@nervekit/orchestrator 0.1.0 → 0.3.0
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/{server.d.ts → app/orchestrator-state.d.ts} +11 -17
- package/dist/app/orchestrator-state.d.ts.map +1 -0
- package/dist/app/orchestrator-state.js +105 -0
- package/dist/app/orchestrator-state.js.map +1 -0
- package/dist/app/server.d.ts +5 -0
- package/dist/app/server.d.ts.map +1 -0
- package/dist/{server.js → app/server.js} +6 -112
- package/dist/app/server.js.map +1 -0
- package/dist/app/version.d.ts.map +1 -0
- package/dist/app/version.js.map +1 -0
- package/dist/domains/agents/agent-lifecycle.service.d.ts +1 -1
- package/dist/domains/agents/agent-lifecycle.service.d.ts.map +1 -1
- package/dist/domains/agents/prompting/index.d.ts +4 -0
- package/dist/domains/agents/prompting/index.d.ts.map +1 -0
- package/dist/domains/agents/prompting/index.js +4 -0
- package/dist/domains/agents/prompting/index.js.map +1 -0
- package/dist/domains/agents/prompting/nerve-system-prompt.d.ts.map +1 -0
- package/dist/{nerve-system-prompt.js → domains/agents/prompting/nerve-system-prompt.js} +4 -2
- package/dist/domains/agents/prompting/nerve-system-prompt.js.map +1 -0
- package/dist/domains/agents/prompting/prompt-text.d.ts.map +1 -0
- package/dist/domains/agents/prompting/prompt-text.js.map +1 -0
- package/dist/domains/agents/prompting/resource-loader.d.ts.map +1 -0
- package/dist/{resource-loader.js → domains/agents/prompting/resource-loader.js} +1 -1
- package/dist/domains/agents/prompting/resource-loader.js.map +1 -0
- package/dist/domains/agents/run/agent-run-session.d.ts.map +1 -1
- package/dist/domains/agents/run/agent-run-session.js +28 -3
- package/dist/domains/agents/run/agent-run-session.js.map +1 -1
- package/dist/domains/agents/run/agent-runner.d.ts +18 -7
- package/dist/domains/agents/run/agent-runner.d.ts.map +1 -1
- package/dist/domains/agents/run/agent-runner.js +30 -83
- package/dist/domains/agents/run/agent-runner.js.map +1 -1
- package/dist/domains/agents/run/auto-compaction-runner.d.ts +19 -0
- package/dist/domains/agents/run/auto-compaction-runner.d.ts.map +1 -0
- package/dist/domains/agents/run/auto-compaction-runner.js +105 -0
- package/dist/domains/agents/run/auto-compaction-runner.js.map +1 -0
- package/dist/domains/agents/run/explore-helpers.d.ts.map +1 -1
- package/dist/domains/agents/run/explore-helpers.js +73 -16
- package/dist/domains/agents/run/explore-helpers.js.map +1 -1
- package/dist/domains/agents/run/inline-command-results.d.ts +8 -0
- package/dist/domains/agents/run/inline-command-results.d.ts.map +1 -0
- package/dist/domains/agents/run/inline-command-results.js +108 -0
- package/dist/domains/agents/run/inline-command-results.js.map +1 -0
- package/dist/domains/agents/run/inline-command-runner.d.ts +19 -0
- package/dist/domains/agents/run/inline-command-runner.d.ts.map +1 -0
- package/dist/domains/agents/run/inline-command-runner.js +168 -0
- package/dist/domains/agents/run/inline-command-runner.js.map +1 -0
- package/dist/domains/agents/run/interrupted-run-recovery.d.ts +1 -1
- package/dist/domains/agents/run/interrupted-run-recovery.d.ts.map +1 -1
- package/dist/domains/agents/run/subagent-runner.d.ts +4 -2
- package/dist/domains/agents/run/subagent-runner.d.ts.map +1 -1
- package/dist/domains/agents/run/subagent-runner.js +13 -7
- package/dist/domains/agents/run/subagent-runner.js.map +1 -1
- package/dist/domains/agents/run/system-prompt-builder.d.ts +1 -1
- package/dist/domains/agents/run/system-prompt-builder.d.ts.map +1 -1
- package/dist/domains/agents/run/system-prompt-builder.js +2 -2
- package/dist/domains/agents/run/system-prompt-builder.js.map +1 -1
- package/dist/domains/agents/run/tool-draft-progress.d.ts +4 -0
- package/dist/domains/agents/run/tool-draft-progress.d.ts.map +1 -1
- package/dist/domains/agents/run/tool-draft-progress.js +114 -2
- package/dist/domains/agents/run/tool-draft-progress.js.map +1 -1
- package/dist/{auth.d.ts → domains/auth/auth-manager.d.ts} +2 -2
- package/dist/domains/auth/auth-manager.d.ts.map +1 -0
- package/dist/{auth.js → domains/auth/auth-manager.js} +1 -1
- package/dist/domains/auth/auth-manager.js.map +1 -0
- package/dist/{credential-crypto.d.ts → domains/auth/credential-key.service.d.ts} +1 -1
- package/dist/domains/auth/credential-key.service.d.ts.map +1 -0
- package/dist/{credential-crypto.js → domains/auth/credential-key.service.js} +2 -2
- package/dist/domains/auth/credential-key.service.js.map +1 -0
- package/dist/domains/auth/index.d.ts +4 -0
- package/dist/domains/auth/index.d.ts.map +1 -0
- package/dist/domains/auth/index.js +4 -0
- package/dist/domains/auth/index.js.map +1 -0
- package/dist/{oauth-flow.d.ts → domains/auth/oauth-flow-manager.d.ts} +3 -3
- package/dist/domains/auth/oauth-flow-manager.d.ts.map +1 -0
- package/dist/{oauth-flow.js → domains/auth/oauth-flow-manager.js} +2 -2
- package/dist/domains/auth/oauth-flow-manager.js.map +1 -0
- package/dist/domains/conversations/conversation-lifecycle.service.d.ts +1 -1
- package/dist/domains/conversations/conversation-lifecycle.service.d.ts.map +1 -1
- package/dist/domains/conversations/conversation-lifecycle.service.js +21 -4
- package/dist/domains/conversations/conversation-lifecycle.service.js.map +1 -1
- package/dist/domains/conversations/conversation-query.service.d.ts +2 -2
- package/dist/domains/conversations/conversation-query.service.d.ts.map +1 -1
- package/dist/domains/conversations/conversation-query.service.js +6 -2
- package/dist/domains/conversations/conversation-query.service.js.map +1 -1
- package/dist/domains/conversations/conversation-runtime.d.ts +2 -0
- package/dist/domains/conversations/conversation-runtime.d.ts.map +1 -1
- package/dist/domains/conversations/conversation-runtime.js +36 -2
- package/dist/domains/conversations/conversation-runtime.js.map +1 -1
- package/dist/domains/conversations/operations/import-service.d.ts.map +1 -1
- package/dist/domains/conversations/operations/import-service.js +1 -0
- package/dist/domains/conversations/operations/import-service.js.map +1 -1
- package/dist/domains/git/git-service.d.ts +1 -0
- package/dist/domains/git/git-service.d.ts.map +1 -1
- package/dist/domains/git/git-service.js +53 -0
- package/dist/domains/git/git-service.js.map +1 -1
- package/dist/domains/human-input/human-input-resolution.service.d.ts +1 -1
- package/dist/domains/human-input/human-input-resolution.service.d.ts.map +1 -1
- package/dist/domains/pinned-commands/pinned-command.service.d.ts +3 -1
- package/dist/domains/pinned-commands/pinned-command.service.d.ts.map +1 -1
- package/dist/domains/pinned-commands/pinned-command.service.js +26 -3
- package/dist/domains/pinned-commands/pinned-command.service.js.map +1 -1
- package/dist/domains/plans/plan-service.d.ts +2 -0
- package/dist/domains/plans/plan-service.d.ts.map +1 -1
- package/dist/domains/plans/plan-service.js +31 -6
- package/dist/domains/plans/plan-service.js.map +1 -1
- package/dist/domains/projects/prune-conversations.service.d.ts +1 -1
- package/dist/domains/projects/prune-conversations.service.d.ts.map +1 -1
- package/dist/domains/tasks/index.d.ts +1 -0
- package/dist/domains/tasks/index.d.ts.map +1 -1
- package/dist/domains/tasks/index.js +1 -0
- package/dist/domains/tasks/index.js.map +1 -1
- package/dist/domains/tasks/task-launch-config.store.d.ts +1 -1
- package/dist/domains/tasks/task-launch-config.store.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-foreground.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-foreground.js +4 -1
- package/dist/domains/tasks/task-manager-foreground.js.map +1 -1
- package/dist/domains/tasks/task-manager-orphan.d.ts +4 -1
- package/dist/domains/tasks/task-manager-orphan.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-orphan.js +100 -1
- package/dist/domains/tasks/task-manager-orphan.js.map +1 -1
- package/dist/domains/tasks/task-manager-start.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-start.js +46 -0
- package/dist/domains/tasks/task-manager-start.js.map +1 -1
- package/dist/domains/tasks/task-manager.d.ts +26 -4
- package/dist/domains/tasks/task-manager.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager.js +10 -1
- package/dist/domains/tasks/task-manager.js.map +1 -1
- package/dist/domains/tasks/task-notification.service.d.ts +2 -2
- package/dist/domains/tasks/task-notification.service.d.ts.map +1 -1
- package/dist/domains/tasks/task-port-inspector.d.ts +7 -0
- package/dist/domains/tasks/task-port-inspector.d.ts.map +1 -0
- package/dist/domains/tasks/task-port-inspector.js +286 -0
- package/dist/domains/tasks/task-port-inspector.js.map +1 -0
- package/dist/domains/tasks/task-summary-format.d.ts +1 -0
- package/dist/domains/tasks/task-summary-format.d.ts.map +1 -1
- package/dist/domains/tasks/task-summary-format.js +14 -0
- package/dist/domains/tasks/task-summary-format.js.map +1 -1
- package/dist/domains/tasks/task-supervisor.d.ts +3 -1
- package/dist/domains/tasks/task-supervisor.d.ts.map +1 -1
- package/dist/domains/tasks/task-supervisor.js +15 -1
- package/dist/domains/tasks/task-supervisor.js.map +1 -1
- package/dist/domains/tools/agent-tool-adapter.d.ts.map +1 -1
- package/dist/domains/tools/agent-tool-adapter.js +1 -2
- package/dist/domains/tools/agent-tool-adapter.js.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher-handlers.d.ts.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher-handlers.js +24 -4
- package/dist/domains/tools/orchestration-tool-dispatcher-handlers.js.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher.d.ts.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher.js +3 -1
- package/dist/domains/tools/orchestration-tool-dispatcher.js.map +1 -1
- package/dist/domains/tools/tool-call-transcript-preview.d.ts +3 -0
- package/dist/domains/tools/tool-call-transcript-preview.d.ts.map +1 -0
- package/dist/domains/tools/tool-call-transcript-preview.js +442 -0
- package/dist/domains/tools/tool-call-transcript-preview.js.map +1 -0
- package/dist/domains/tools/tool-call.repository.d.ts.map +1 -1
- package/dist/domains/tools/tool-call.repository.js +6 -9
- package/dist/domains/tools/tool-call.repository.js.map +1 -1
- package/dist/domains/tools/tool-executor.service.d.ts +1 -1
- package/dist/domains/tools/tool-executor.service.d.ts.map +1 -1
- package/dist/domains/tools/tool-executor.service.js +3 -2
- package/dist/domains/tools/tool-executor.service.js.map +1 -1
- package/dist/domains/tools/tool-result-bounds.d.ts.map +1 -1
- package/dist/domains/tools/tool-result-bounds.js +23 -9
- package/dist/domains/tools/tool-result-bounds.js.map +1 -1
- package/dist/domains/tools/tool-result-model-limits.d.ts +2 -0
- package/dist/domains/tools/tool-result-model-limits.d.ts.map +1 -0
- package/dist/domains/tools/tool-result-model-limits.js +84 -0
- package/dist/domains/tools/tool-result-model-limits.js.map +1 -0
- package/dist/domains/tools/tool-service.d.ts +6 -2
- package/dist/domains/tools/tool-service.d.ts.map +1 -1
- package/dist/domains/tools/tool-service.js +2 -1
- package/dist/domains/tools/tool-service.js.map +1 -1
- package/dist/domains/transcription/transcription.service.d.ts +1 -1
- package/dist/domains/transcription/transcription.service.d.ts.map +1 -1
- package/dist/domains/transcription/transcription.service.js.map +1 -1
- package/dist/domains/usage/subscription-usage-service.d.ts +1 -1
- package/dist/domains/usage/subscription-usage-service.d.ts.map +1 -1
- package/dist/http/request-context.d.ts +1 -1
- package/dist/http/request-context.d.ts.map +1 -1
- package/dist/http/static-files.d.ts +1 -1
- package/dist/http/static-files.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/diagnostics/crash-reports.d.ts +14 -0
- package/dist/infrastructure/diagnostics/crash-reports.d.ts.map +1 -0
- package/dist/infrastructure/diagnostics/crash-reports.js +199 -0
- package/dist/infrastructure/diagnostics/crash-reports.js.map +1 -0
- package/dist/infrastructure/diagnostics/index.d.ts +3 -0
- package/dist/infrastructure/diagnostics/index.d.ts.map +1 -0
- package/dist/infrastructure/diagnostics/index.js +3 -0
- package/dist/infrastructure/diagnostics/index.js.map +1 -0
- package/dist/infrastructure/diagnostics/logging.d.ts.map +1 -0
- package/dist/{logging.js → infrastructure/diagnostics/logging.js} +1 -1
- package/dist/infrastructure/diagnostics/logging.js.map +1 -0
- package/dist/{secrets.d.ts → infrastructure/secrets/index.d.ts} +1 -1
- package/dist/infrastructure/secrets/index.d.ts.map +1 -0
- package/dist/{secrets.js → infrastructure/secrets/index.js} +2 -2
- package/dist/infrastructure/secrets/index.js.map +1 -0
- package/dist/main.js +43 -7
- package/dist/main.js.map +1 -1
- package/dist/routes/agent-routes.d.ts +1 -1
- package/dist/routes/agent-routes.d.ts.map +1 -1
- package/dist/routes/agent-routes.js.map +1 -1
- package/dist/routes/auth-routes.d.ts +1 -1
- package/dist/routes/auth-routes.d.ts.map +1 -1
- package/dist/routes/auth-routes.js.map +1 -1
- package/dist/routes/completion-routes.d.ts +1 -1
- package/dist/routes/completion-routes.d.ts.map +1 -1
- package/dist/routes/completion-routes.js.map +1 -1
- package/dist/routes/conversation-routes.d.ts +1 -1
- package/dist/routes/conversation-routes.d.ts.map +1 -1
- package/dist/routes/conversation-routes.js.map +1 -1
- package/dist/routes/filesystem-routes.d.ts +1 -1
- package/dist/routes/filesystem-routes.d.ts.map +1 -1
- package/dist/routes/filesystem-routes.js.map +1 -1
- package/dist/routes/git-routes.d.ts +1 -1
- package/dist/routes/git-routes.d.ts.map +1 -1
- package/dist/routes/git-routes.js +4 -0
- package/dist/routes/git-routes.js.map +1 -1
- package/dist/routes/index.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/log-routes.d.ts +1 -1
- package/dist/routes/log-routes.d.ts.map +1 -1
- package/dist/routes/log-routes.js.map +1 -1
- package/dist/routes/model-routes.d.ts +1 -1
- package/dist/routes/model-routes.d.ts.map +1 -1
- package/dist/routes/project-routes.d.ts +1 -1
- package/dist/routes/project-routes.d.ts.map +1 -1
- package/dist/routes/project-routes.js +7 -1
- package/dist/routes/project-routes.js.map +1 -1
- package/dist/routes/provider-catalog-routes.d.ts +1 -1
- package/dist/routes/provider-catalog-routes.d.ts.map +1 -1
- package/dist/routes/provider-catalog-routes.js +1 -1
- package/dist/routes/provider-catalog-routes.js.map +1 -1
- package/dist/routes/settings-routes.d.ts +1 -1
- package/dist/routes/settings-routes.d.ts.map +1 -1
- package/dist/routes/settings-routes.js.map +1 -1
- package/dist/routes/status-routes.d.ts +1 -1
- package/dist/routes/status-routes.d.ts.map +1 -1
- package/dist/routes/status-routes.js +1 -1
- package/dist/routes/status-routes.js.map +1 -1
- package/dist/routes/storage-routes.d.ts +1 -1
- package/dist/routes/storage-routes.d.ts.map +1 -1
- package/dist/routes/storage-routes.js.map +1 -1
- package/dist/routes/task-routes.d.ts +1 -1
- package/dist/routes/task-routes.d.ts.map +1 -1
- package/dist/routes/task-routes.js.map +1 -1
- package/dist/routes/tool-routes.d.ts +1 -1
- package/dist/routes/tool-routes.d.ts.map +1 -1
- package/dist/routes/tool-routes.js +47 -19
- package/dist/routes/tool-routes.js.map +1 -1
- package/dist/routes/transcription-routes.d.ts +1 -1
- package/dist/routes/transcription-routes.d.ts.map +1 -1
- package/dist/routes/transcription-routes.js.map +1 -1
- package/dist/routes/worker-routes.d.ts +1 -1
- package/dist/routes/worker-routes.d.ts.map +1 -1
- package/dist/routes/worker-routes.js.map +1 -1
- package/dist/runtime/runtime-composition.d.ts +3 -3
- package/dist/runtime/runtime-composition.d.ts.map +1 -1
- package/dist/runtime/runtime-composition.js.map +1 -1
- package/dist/{registry.d.ts → runtime/runtime-registry.d.ts} +159 -44
- package/dist/runtime/runtime-registry.d.ts.map +1 -0
- package/dist/{registry.js → runtime/runtime-registry.js} +7 -12
- package/dist/runtime/runtime-registry.js.map +1 -0
- package/dist/runtime/runtime-state.d.ts +3 -2
- package/dist/runtime/runtime-state.d.ts.map +1 -1
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/{registry → runtime}/types.js.map +1 -1
- package/dist/web/assets/{dist-DVpGQCt0.js → dist-DuVh-9Yy.js} +1 -1
- package/dist/web/assets/index-bmeeVJYV.css +2 -0
- package/dist/web/assets/index-hdM6dgBG.js +192 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +4 -4
- package/dist/agent-process.d.ts +0 -32
- package/dist/agent-process.d.ts.map +0 -1
- package/dist/agent-process.js +0 -129
- package/dist/agent-process.js.map +0 -1
- package/dist/agent-runner/agent-runner.d.ts +0 -65
- package/dist/agent-runner/agent-runner.d.ts.map +0 -1
- package/dist/agent-runner/agent-runner.js +0 -802
- package/dist/agent-runner/agent-runner.js.map +0 -1
- package/dist/agent-runner/index.d.ts +0 -6
- package/dist/agent-runner/index.d.ts.map +0 -1
- package/dist/agent-runner/index.js +0 -4
- package/dist/agent-runner/index.js.map +0 -1
- package/dist/agent-runner/message-mirror.d.ts +0 -44
- package/dist/agent-runner/message-mirror.d.ts.map +0 -1
- package/dist/agent-runner/message-mirror.js +0 -154
- package/dist/agent-runner/message-mirror.js.map +0 -1
- package/dist/agent-runner/run-state.d.ts +0 -12
- package/dist/agent-runner/run-state.d.ts.map +0 -1
- package/dist/agent-runner/run-state.js +0 -2
- package/dist/agent-runner/run-state.js.map +0 -1
- package/dist/agent-runner/subagent-runner.d.ts +0 -29
- package/dist/agent-runner/subagent-runner.d.ts.map +0 -1
- package/dist/agent-runner/subagent-runner.js +0 -84
- package/dist/agent-runner/subagent-runner.js.map +0 -1
- package/dist/agent-runner/system-prompt-builder.d.ts +0 -19
- package/dist/agent-runner/system-prompt-builder.d.ts.map +0 -1
- package/dist/agent-runner/system-prompt-builder.js +0 -35
- package/dist/agent-runner/system-prompt-builder.js.map +0 -1
- package/dist/agent-runner/tool-draft-streaming.d.ts +0 -2
- package/dist/agent-runner/tool-draft-streaming.d.ts.map +0 -1
- package/dist/agent-runner/tool-draft-streaming.js +0 -5
- package/dist/agent-runner/tool-draft-streaming.js.map +0 -1
- package/dist/agent-suspension-service.d.ts +0 -44
- package/dist/agent-suspension-service.d.ts.map +0 -1
- package/dist/agent-suspension-service.js +0 -96
- package/dist/agent-suspension-service.js.map +0 -1
- package/dist/agent-tool-adapter.d.ts +0 -20
- package/dist/agent-tool-adapter.d.ts.map +0 -1
- package/dist/agent-tool-adapter.js +0 -215
- package/dist/agent-tool-adapter.js.map +0 -1
- package/dist/agents/agent-authority.d.ts +0 -5
- package/dist/agents/agent-authority.d.ts.map +0 -1
- package/dist/agents/agent-authority.js +0 -28
- package/dist/agents/agent-authority.js.map +0 -1
- package/dist/agents/agent-budget.d.ts +0 -3
- package/dist/agents/agent-budget.d.ts.map +0 -1
- package/dist/agents/agent-budget.js +0 -17
- package/dist/agents/agent-budget.js.map +0 -1
- package/dist/agents/agent-status.d.ts +0 -4
- package/dist/agents/agent-status.d.ts.map +0 -1
- package/dist/agents/agent-status.js +0 -10
- package/dist/agents/agent-status.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/conversation-operations/compaction-service.d.ts +0 -37
- package/dist/conversation-operations/compaction-service.d.ts.map +0 -1
- package/dist/conversation-operations/compaction-service.js +0 -102
- package/dist/conversation-operations/compaction-service.js.map +0 -1
- package/dist/conversation-operations/export-service.d.ts +0 -22
- package/dist/conversation-operations/export-service.d.ts.map +0 -1
- package/dist/conversation-operations/export-service.js +0 -79
- package/dist/conversation-operations/export-service.js.map +0 -1
- package/dist/conversation-operations/import-service.d.ts +0 -20
- package/dist/conversation-operations/import-service.d.ts.map +0 -1
- package/dist/conversation-operations/import-service.js +0 -97
- package/dist/conversation-operations/import-service.js.map +0 -1
- package/dist/conversation-operations/index.d.ts +0 -8
- package/dist/conversation-operations/index.d.ts.map +0 -1
- package/dist/conversation-operations/index.js +0 -6
- package/dist/conversation-operations/index.js.map +0 -1
- package/dist/conversation-operations/navigation-service.d.ts +0 -18
- package/dist/conversation-operations/navigation-service.d.ts.map +0 -1
- package/dist/conversation-operations/navigation-service.js +0 -102
- package/dist/conversation-operations/navigation-service.js.map +0 -1
- package/dist/conversation-operations/summary.d.ts +0 -11
- package/dist/conversation-operations/summary.d.ts.map +0 -1
- package/dist/conversation-operations/summary.js +0 -29
- package/dist/conversation-operations/summary.js.map +0 -1
- package/dist/conversation-runtime.d.ts +0 -96
- package/dist/conversation-runtime.d.ts.map +0 -1
- package/dist/conversation-runtime.js +0 -363
- package/dist/conversation-runtime.js.map +0 -1
- package/dist/conversation-service.d.ts +0 -17
- package/dist/conversation-service.d.ts.map +0 -1
- package/dist/conversation-service.js +0 -56
- package/dist/conversation-service.js.map +0 -1
- package/dist/credential-crypto.d.ts.map +0 -1
- package/dist/credential-crypto.js.map +0 -1
- package/dist/domains/processes/index.d.ts +0 -10
- package/dist/domains/processes/index.d.ts.map +0 -1
- package/dist/domains/processes/index.js +0 -7
- package/dist/domains/processes/index.js.map +0 -1
- package/dist/domains/processes/process-launch-config.store.d.ts +0 -21
- package/dist/domains/processes/process-launch-config.store.d.ts.map +0 -1
- package/dist/domains/processes/process-launch-config.store.js +0 -49
- package/dist/domains/processes/process-launch-config.store.js.map +0 -1
- package/dist/domains/processes/process-log.service.d.ts +0 -25
- package/dist/domains/processes/process-log.service.d.ts.map +0 -1
- package/dist/domains/processes/process-log.service.js +0 -155
- package/dist/domains/processes/process-log.service.js.map +0 -1
- package/dist/domains/processes/process-manager.d.ts +0 -107
- package/dist/domains/processes/process-manager.d.ts.map +0 -1
- package/dist/domains/processes/process-manager.js +0 -814
- package/dist/domains/processes/process-manager.js.map +0 -1
- package/dist/domains/processes/process-readiness.service.d.ts +0 -7
- package/dist/domains/processes/process-readiness.service.d.ts.map +0 -1
- package/dist/domains/processes/process-readiness.service.js +0 -26
- package/dist/domains/processes/process-readiness.service.js.map +0 -1
- package/dist/domains/processes/process-status.d.ts +0 -5
- package/dist/domains/processes/process-status.d.ts.map +0 -1
- package/dist/domains/processes/process-status.js +0 -13
- package/dist/domains/processes/process-status.js.map +0 -1
- package/dist/domains/processes/process-supervisor.d.ts +0 -34
- package/dist/domains/processes/process-supervisor.d.ts.map +0 -1
- package/dist/domains/processes/process-supervisor.js +0 -211
- package/dist/domains/processes/process-supervisor.js.map +0 -1
- package/dist/domains/processes/process.repository.d.ts +0 -11
- package/dist/domains/processes/process.repository.d.ts.map +0 -1
- package/dist/domains/processes/process.repository.js +0 -31
- package/dist/domains/processes/process.repository.js.map +0 -1
- package/dist/domains/tasks/task-completion.service.d.ts +0 -31
- package/dist/domains/tasks/task-completion.service.d.ts.map +0 -1
- package/dist/domains/tasks/task-completion.service.js +0 -147
- package/dist/domains/tasks/task-completion.service.js.map +0 -1
- package/dist/domains/tasks/task-legacy-migration.d.ts +0 -15
- package/dist/domains/tasks/task-legacy-migration.d.ts.map +0 -1
- package/dist/domains/tasks/task-legacy-migration.js +0 -191
- package/dist/domains/tasks/task-legacy-migration.js.map +0 -1
- package/dist/events.d.ts +0 -2
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -2
- package/dist/events.js.map +0 -1
- package/dist/git/git-service.d.ts +0 -51
- package/dist/git/git-service.d.ts.map +0 -1
- package/dist/git/git-service.js +0 -716
- package/dist/git/git-service.js.map +0 -1
- package/dist/git/git-status.d.ts +0 -24
- package/dist/git/git-status.d.ts.map +0 -1
- package/dist/git/git-status.js +0 -133
- package/dist/git/git-status.js.map +0 -1
- package/dist/harness-manager.d.ts +0 -21
- package/dist/harness-manager.d.ts.map +0 -1
- package/dist/harness-manager.js +0 -105
- package/dist/harness-manager.js.map +0 -1
- package/dist/index-store.d.ts +0 -2
- package/dist/index-store.d.ts.map +0 -1
- package/dist/index-store.js +0 -2
- package/dist/index-store.js.map +0 -1
- package/dist/logging.d.ts.map +0 -1
- package/dist/logging.js.map +0 -1
- package/dist/nerve-system-prompt.d.ts.map +0 -1
- package/dist/nerve-system-prompt.js.map +0 -1
- package/dist/oauth-flow.d.ts.map +0 -1
- package/dist/oauth-flow.js.map +0 -1
- package/dist/plan-paths.d.ts +0 -6
- package/dist/plan-paths.d.ts.map +0 -1
- package/dist/plan-paths.js +0 -30
- package/dist/plan-paths.js.map +0 -1
- package/dist/plan-service.d.ts +0 -61
- package/dist/plan-service.d.ts.map +0 -1
- package/dist/plan-service.js +0 -255
- package/dist/plan-service.js.map +0 -1
- package/dist/policy.d.ts +0 -14
- package/dist/policy.d.ts.map +0 -1
- package/dist/policy.js +0 -247
- package/dist/policy.js.map +0 -1
- package/dist/process-manager.d.ts +0 -72
- package/dist/process-manager.d.ts.map +0 -1
- package/dist/process-manager.js +0 -376
- package/dist/process-manager.js.map +0 -1
- package/dist/prompt-text.d.ts.map +0 -1
- package/dist/prompt-text.js.map +0 -1
- package/dist/registry/agent-lifecycle-service.d.ts +0 -38
- package/dist/registry/agent-lifecycle-service.d.ts.map +0 -1
- package/dist/registry/agent-lifecycle-service.js +0 -199
- package/dist/registry/agent-lifecycle-service.js.map +0 -1
- package/dist/registry/conversation-lifecycle-service.d.ts +0 -35
- package/dist/registry/conversation-lifecycle-service.d.ts.map +0 -1
- package/dist/registry/conversation-lifecycle-service.js +0 -136
- package/dist/registry/conversation-lifecycle-service.js.map +0 -1
- package/dist/registry/pinned-command-service.d.ts +0 -11
- package/dist/registry/pinned-command-service.d.ts.map +0 -1
- package/dist/registry/pinned-command-service.js +0 -40
- package/dist/registry/pinned-command-service.js.map +0 -1
- package/dist/registry/project-lifecycle-service.d.ts +0 -22
- package/dist/registry/project-lifecycle-service.d.ts.map +0 -1
- package/dist/registry/project-lifecycle-service.js +0 -87
- package/dist/registry/project-lifecycle-service.js.map +0 -1
- package/dist/registry/types.d.ts.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/repositories/agent-repository.d.ts +0 -12
- package/dist/repositories/agent-repository.d.ts.map +0 -1
- package/dist/repositories/agent-repository.js +0 -33
- package/dist/repositories/agent-repository.js.map +0 -1
- package/dist/repositories/conversation-repository.d.ts +0 -13
- package/dist/repositories/conversation-repository.d.ts.map +0 -1
- package/dist/repositories/conversation-repository.js +0 -39
- package/dist/repositories/conversation-repository.js.map +0 -1
- package/dist/repositories/entry-repository.d.ts +0 -15
- package/dist/repositories/entry-repository.d.ts.map +0 -1
- package/dist/repositories/entry-repository.js +0 -81
- package/dist/repositories/entry-repository.js.map +0 -1
- package/dist/repositories/index.d.ts +0 -7
- package/dist/repositories/index.d.ts.map +0 -1
- package/dist/repositories/index.js +0 -7
- package/dist/repositories/index.js.map +0 -1
- package/dist/repositories/pinned-command-repository.d.ts +0 -10
- package/dist/repositories/pinned-command-repository.d.ts.map +0 -1
- package/dist/repositories/pinned-command-repository.js +0 -28
- package/dist/repositories/pinned-command-repository.js.map +0 -1
- package/dist/repositories/project-repository.d.ts +0 -12
- package/dist/repositories/project-repository.d.ts.map +0 -1
- package/dist/repositories/project-repository.js +0 -33
- package/dist/repositories/project-repository.js.map +0 -1
- package/dist/repositories/prompt-queue-repository.d.ts +0 -28
- package/dist/repositories/prompt-queue-repository.d.ts.map +0 -1
- package/dist/repositories/prompt-queue-repository.js +0 -88
- package/dist/repositories/prompt-queue-repository.js.map +0 -1
- package/dist/resource-loader.d.ts.map +0 -1
- package/dist/resource-loader.js.map +0 -1
- package/dist/routes/process-routes.d.ts +0 -4
- package/dist/routes/process-routes.d.ts.map +0 -1
- package/dist/routes/process-routes.js +0 -43
- package/dist/routes/process-routes.js.map +0 -1
- package/dist/secrets.d.ts.map +0 -1
- package/dist/secrets.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/storage.d.ts +0 -2
- package/dist/storage.d.ts.map +0 -1
- package/dist/storage.js +0 -2
- package/dist/storage.js.map +0 -1
- package/dist/tool-service.d.ts +0 -82
- package/dist/tool-service.d.ts.map +0 -1
- package/dist/tool-service.js +0 -409
- package/dist/tool-service.js.map +0 -1
- package/dist/transcription-service.d.ts +0 -15
- package/dist/transcription-service.d.ts.map +0 -1
- package/dist/transcription-service.js +0 -128
- package/dist/transcription-service.js.map +0 -1
- package/dist/usage/anthropic-client.d.ts +0 -9
- package/dist/usage/anthropic-client.d.ts.map +0 -1
- package/dist/usage/anthropic-client.js +0 -207
- package/dist/usage/anthropic-client.js.map +0 -1
- package/dist/usage/codex-client.d.ts +0 -18
- package/dist/usage/codex-client.d.ts.map +0 -1
- package/dist/usage/codex-client.js +0 -316
- package/dist/usage/codex-client.js.map +0 -1
- package/dist/usage/subscription-usage-service.d.ts +0 -42
- package/dist/usage/subscription-usage-service.d.ts.map +0 -1
- package/dist/usage/subscription-usage-service.js +0 -131
- package/dist/usage/subscription-usage-service.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/web/assets/index-DFKLdj_D.css +0 -2
- package/dist/web/assets/index-DP6SGqvJ.js +0 -165
- package/dist/worker-manager.d.ts +0 -51
- package/dist/worker-manager.d.ts.map +0 -1
- package/dist/worker-manager.js +0 -116
- package/dist/worker-manager.js.map +0 -1
- /package/dist/{version.d.ts → app/version.d.ts} +0 -0
- /package/dist/{version.js → app/version.js} +0 -0
- /package/dist/{nerve-system-prompt.d.ts → domains/agents/prompting/nerve-system-prompt.d.ts} +0 -0
- /package/dist/{prompt-text.d.ts → domains/agents/prompting/prompt-text.d.ts} +0 -0
- /package/dist/{prompt-text.js → domains/agents/prompting/prompt-text.js} +0 -0
- /package/dist/{resource-loader.d.ts → domains/agents/prompting/resource-loader.d.ts} +0 -0
- /package/dist/{logging.d.ts → infrastructure/diagnostics/logging.d.ts} +0 -0
- /package/dist/{registry → runtime}/types.d.ts +0 -0
- /package/dist/{registry → runtime}/types.js +0 -0
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bash-B7CDPTg5.js","assets/shellscript-CLZ0U2zV.js","assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/svelte-Uaf2W_lJ.js","assets/typescript-bsJCZSQ-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=`modulepreload`,d=function(e){return`/`+e},f={},p=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=d(t,n),t in f)return;f[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:u,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},m=`true`,h=`false`,g=m===`true`,_=h===`true`;function v(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,g||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await p(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!_)if(g)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}var y=Array.isArray,b=Array.prototype.indexOf,x=Array.prototype.includes,S=Array.from,ee=Object.defineProperty,C=Object.getOwnPropertyDescriptor,te=Object.getOwnPropertyDescriptors,ne=Object.prototype,re=Array.prototype,ie=Object.getPrototypeOf,ae=Object.isExtensible;function oe(e){return typeof e==`function`}var w=()=>{};function se(e){return e()}function ce(e){for(var t=0;t<e.length;t++)e[t]()}function le(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function ue(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var de=1<<24,fe=1024,pe=2048,me=4096,he=8192,ge=16384,_e=32768,ve=1<<25,ye=65536,be=1<<18,xe=1<<19,Se=1<<20,Ce=1<<25,we=65536,Te=1<<21,Ee=1<<22,De=1<<23,Oe=Symbol(`$state`),ke=Symbol(`legacy props`),Ae=Symbol(``),je=Symbol(`attributes`),Me=Symbol(`class`),Ne=Symbol(`style`),Pe=Symbol(`text`),Fe=Symbol(`form reset`),Ie=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Le=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function Re(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ze(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Be(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ve(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function He(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ue(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function We(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ge(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ke(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function qe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Je(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ye(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Xe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ze={},Qe=Symbol(`uninitialized`),eee=`http://www.w3.org/1999/xhtml`,$e=`http://www.w3.org/2000/svg`,tee=`http://www.w3.org/1998/Math/MathML`,nee=`@attach`;function et(){console.warn(`https://svelte.dev/e/derived_inert`)}function tt(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ree(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function iee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var nt=!1;function rt(e){nt=e}var it;function at(e){if(e===null)throw tt(),Ze;return it=e}function ot(){return at(Un(it))}function T(e){if(nt){if(Un(it)!==null)throw tt(),Ze;it=e}}function E(e=1){if(nt){for(var t=e,n=it;t--;)n=Un(n);it=n}}function st(e=!0){for(var t=0,n=it;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Un(n);e&&n.remove(),n=i}}function ct(e){if(!e||e.nodeType!==8)throw tt(),Ze;return e.data}function lt(e){return e===this.v}function ut(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function dt(e){return!ut(e,this.v)}var ft=!1,pt=!1;function mt(){pt=!0}var ht=[];function gt(e,t=!1,n=!1){return _t(e,new Map,``,ht,null,n)}function _t(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(y(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=_t(l,t,n,r,null,a))}return s}if(ie(e)===ne){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=_t(e[u],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON==`function`&&!a)return _t(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var vt=null;function yt(e){vt=e}function bt(e){return Tt(`getContext`).get(e)}function xt(e,t){let n=Tt(`setContext`);if(ft){var r=Ar.f;!Dr&&r&32&&!vt.i||Ke()}return n.set(e,t),t}function St(e){return Tt(`hasContext`).has(e)}function Ct(){return Tt(`getAllContexts`)}function D(e,t=!1,n){vt={p:vt,i:!1,c:null,e:null,s:e,x:null,r:Ar,l:pt&&!t?{s:null,u:null,$:[]}:null}}function O(e){var t=vt,n=t.e;if(n!==null){t.e=null;for(var r of n)ir(r)}return e!==void 0&&(t.x=e),t.i=!0,vt=t.p,e??{}}function wt(){return!pt||vt!==null&&vt.l===null}function Tt(e){return vt===null&&Re(e),vt.c??=new Map(aee(vt)||void 0)}function aee(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var Et=[];function Dt(){var e=Et;Et=[],ce(e)}function Ot(e){if(Et.length===0&&!ln){var t=Et;queueMicrotask(()=>{t===Et&&Dt()})}Et.push(e)}function kt(){for(;Et.length>0;)Dt()}function At(e){var t=Ar;if(t===null)return Dr.f|=De,e;if(!(t.f&32768)&&!(t.f&4))throw e;jt(e,t)}function jt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var Mt=~(pe|me|fe);function Nt(e,t){e.f=e.f&Mt|t}function Pt(e){e.f&512||e.deps===null?Nt(e,fe):Nt(e,me)}function Ft(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=we,Ft(t.deps))}function It(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Ft(e.deps),Nt(e,fe)}function Lt(e,t,n){if(e==null)return t(void 0),n&&n(void 0),w;let r=Zr(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}var Rt=[];function oee(e,t){return{subscribe:zt(e,t).subscribe}}function zt(e,t=w){let n=null,r=new Set;function i(t){if(ut(e,t)&&(e=t,n)){let t=!Rt.length;for(let t of r)t[1](),Rt.push(t,e);if(t){for(let e=0;e<Rt.length;e+=2)Rt[e][0](Rt[e+1]);Rt.length=0}}}function a(t){i(t(e))}function o(o,s=w){let c=[o,s];return r.add(c),r.size===1&&(n=t(i,a)||w),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function see(e,t,n){let r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw Error(`derived() expects stores as input, got a falsy value`);let a=t.length<2;return oee(n,(e,n)=>{let o=!1,s=[],c=0,l=w,u=()=>{if(c)return;l();let i=t(r?s[0]:s,e,n);a?e(i):l=typeof i==`function`?i:w},d=i.map((e,t)=>Lt(e,e=>{s[t]=e,c&=~(1<<t),o&&u()},()=>{c|=1<<t}));return o=!0,u(),function(){ce(d),l(),o=!1}})}function cee(e){let t;return Lt(e,e=>t=e)(),t}var lee=!1,Bt=!1;function uee(e){var t=Bt;try{return Bt=!1,[e(),Bt]}finally{Bt=t}}function Vt(e){let t=0,n=On(0),r;return()=>{tr()&&(I(n),cr(()=>(t===0&&(r=Zr(()=>e(()=>An(n)))),t+=1,()=>{Ot(()=>{--t,t===0&&(r?.(),r=void 0,An(n))})})))}}var Ht=ye|xe;function Ut(e,t,n,r){new Wt(e,t,n,r)}var Wt=class{parent;is_pending=!1;transform_error;#e;#t=nt?it:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Vt(()=>(this.#m=On(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Ar;t.b=this,t.f|=128,n(e)},this.parent=Ar.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=lr(()=>{if(nt){let e=this.#t;ot();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},Ht),nt&&(this.#e=it)}#g(){try{this.#a=dr(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=dr(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=dr(()=>e(this.#e)),Ot(()=>{var e=this.#c=document.createDocumentFragment(),t=Vn();e.append(t),this.#a=this.#x(()=>dr(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,vr(this.#o,()=>{this.#o=null}),this.#b(an))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=dr(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Sr(this.#a,e);let t=this.#n.pending;this.#o=dr(()=>t(this.#e))}else this.#b(an)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){It(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=Ar,n=Dr,r=vt;jr(this.#i),kr(this.#i),yt(this.#i.ctx);try{return hn.ensure(),e()}catch(e){return At(e),null}finally{jr(t),kr(n),yt(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&vr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ot(()=>{this.#d=!1,this.#m&&kn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),I(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;an?.is_fork?(this.#a&&an.skip_effect(this.#a),this.#o&&an.skip_effect(this.#o),this.#s&&an.skip_effect(this.#s),an.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(hr(this.#a),null),this.#o&&=(hr(this.#o),null),this.#s&&=(hr(this.#s),null),nt&&(at(this.#t),E(),at(st()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){iee();return}r=!0,i&&Xe(),this.#s!==null&&vr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){jt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return dr(()=>{var t=Ar;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return jt(e,this.#i.parent),null}}))};Ot(()=>{var t;try{t=this.transform_error(e)}catch(e){jt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>jt(e,this.#i&&this.#i.parent)):o(t)})}};function Gt(e,t,n,r){let i=wt()?Yt:Qt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Ar,c=Kt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){jt(e,s)}qt()}}var d=Jt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Zt(e))).then(u).catch(e=>jt(e,s)).finally(d)}l?l.then(()=>{c(),f(),qt()}):f()}function Kt(){var e=Ar,t=Dr,n=vt,r=an;return function(i=!0){jr(e),kr(t),yt(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function qt(e=!0){jr(null),kr(null),yt(null),e&&an?.deactivate()}function Jt(){var e=Ar,t=e.b,n=an,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Yt(e){var t=2|pe;return Ar!==null&&(Ar.f|=xe),{ctx:vt,deps:null,effects:null,equals:lt,f:t,fn:e,reactions:null,rv:0,v:Qe,wv:0,parent:Ar,ac:null}}var Xt=Symbol(`obsolete`);function Zt(e,t,n){let r=Ar;r===null&&ze();var i=void 0,a=On(Qe),o=!Dr,s=new Set;return vee(()=>{var t=Ar,n=le();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ie&&n.reject(e)}).finally(qt)}catch(e){n.reject(e),qt()}var c=an;if(o){if(t.f&32768)var l=Jt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Xt);else for(let e of s.values())e.reject(Xt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Xt&&(c.activate(),t?(a.f|=De,kn(a,t)):(a.f&8388608&&(a.f^=De),kn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),nr(()=>{for(let e of s)e.reject(Xt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function k(e){let t=Yt(e);return ft||Nr(t),t}function Qt(e){let t=Yt(e);return t.equals=dt,t}function dee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)hr(t[n])}}function $t(e){var t,n=Ar,r=e.parent;if(!Tr&&r!==null&&e.v!==Qe&&r.f&24576)return et(),e.v;jr(r);try{e.f&=~we,dee(e),t=Wr(e)}finally{jr(n)}return t}function en(e){var t=$t(e);if(!e.equals(t)&&(e.wv=Vr(),(!an?.is_fork||e.deps===null)&&(an===null?e.v=t:(an.capture(e,t,!0),on?.capture(e,t,!0)),e.deps===null))){Nt(e,fe);return}Tr||(sn===null?Pt(e):(tr()||an?.is_fork)&&sn.set(e,t))}function fee(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(Ie),t.fn!==null&&(t.teardown=w),t.ac=null,Kr(t,0),pr(t))}function tn(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&qr(t)}var nn=null,rn=null,an=null,on=null,sn=null,cn=null,ln=!1,un=!1,dn=null,fn=null,pn=0,mn=1,hn=class e{id=mn++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){rn===null?nn=rn=this:(rn.#n=this,this.#t=rn),rn=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)Nt(r,pe),t(r);for(r of n.m)Nt(r,me),t(r)}this.#p.add(e)}#g(){this.#e=!0,pn++>1e3&&(this.#S(),_n());for(let e of this.#u)this.#d.delete(e),Nt(e,pe),this.schedule(e);for(let e of this.#d)Nt(e,me),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=dn=[],r=[],i=fn=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw wn(e),this.#h()||this.discard(),t}if(an=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(dn=null,fn=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Cn(e,t);i.length>0&&an.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),on=this,yn(r),yn(n),on=null,this.#s?.resolve();var s=an;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),ft&&(this.#x(),an=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=fe;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=fe:i&4?t.push(r):ft&&i&16777224?n.push(r):Hr(r)&&(i&16&&this.#d.add(r),qr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),Nt(i,pe),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),an=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)It(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==Qe&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),sn?.set(e,t)),this.is_fork||(e.v=t)}activate(){an=this}deactivate(){an=null,sn=null}flush(){try{un=!0,an=this,this.#g()}finally{pn=0,cn=null,dn=null,fn=null,un=!1,an=null,sn=null,En.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(Xt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=nn;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)bn(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&xn(e,c,o)&&(e.f&4194320?(Nt(e,pe),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,Ot(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=le()).promise}static ensure(){if(an===null){let t=an=new e;!un&&!ln&&Ot(()=>{t.#e||t.flush()})}return an}apply(){if(!ft||!this.is_fork&&this.#t===null&&this.#n===null){sn=null;return}sn=new Map;for(let[e,[t]]of this.current)sn.set(e,t);for(let t=nn;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)sn.has(e)||sn.set(e,n)}}schedule(e){if(cn=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(dn!==null&&t===Ar&&(ft||(Dr===null||!(Dr.f&2))&&!lee))return;if(n&96){if(!(n&1024))return;t.f^=fe}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?nn=t:e.#n=t,t===null?rn=e:t.#t=e,this.linked=!1}}};function gn(e){var t=ln;ln=!0;try{var n;for(e&&(an!==null&&!an.is_fork&&an.flush(),n=e());;){if(kt(),an===null)return n;an.flush()}}finally{ln=t}}function _n(){try{We()}catch(e){jt(e,cn)}}var vn=null;function yn(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Hr(r)&&(vn=new Set,qr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&_r(r),vn?.size>0)){En.clear();for(let e of vn){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)vn.has(n)&&(vn.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||qr(n)}}vn.clear()}}vn=null}}function bn(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?bn(i,t,n,r):e&4194320&&!(e&2048)&&xn(i,t,r)&&(Nt(i,pe),Sn(i))}}function xn(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(x.call(t,r))return!0;if(r.f&2&&xn(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function Sn(e){an.schedule(e)}function Cn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),Nt(e,fe);for(var n=e.first;n!==null;)Cn(n,t),n=n.next}}function wn(e){Nt(e,fe);for(var t=e.first;t!==null;)wn(t),t=t.next}var Tn=new Set,En=new Map,Dn=!1;function On(e,t){return{f:0,v:e,reactions:null,equals:lt,rv:0,wv:0}}function A(e,t){let n=On(e,t);return Nr(n),n}function pee(e,t=!1,n=!0){let r=On(e);return t||(r.equals=dt),pt&&n&&vt!==null&&vt.l!==null&&(vt.l.s??=[]).push(r),r}function j(e,t,n=!1){return Dr!==null&&(!Or||Dr.f&131072)&&wt()&&Dr.f&4325394&&(Mr===null||!Mr.has(e))&&Ye(),kn(e,n?Mn(t):t,fn)}function kn(e,t,n=null){if(!e.equals(t)){En.set(e,Tr?t:e.v);var r=hn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&$t(t),sn===null&&Pt(t)}e.wv=Vr(),jn(e,pe,n),wt()&&Ar!==null&&Ar.f&1024&&!(Ar.f&96)&&(Ir===null?yee([e]):Ir.push(e)),!r.is_fork&&Tn.size>0&&!Dn&&mee()}return t}function mee(){Dn=!1;for(let e of Tn){e.f&1024&&Nt(e,me);let t;try{t=Hr(e)}catch{t=!0}t&&qr(e)}Tn.clear()}function An(e){j(e,e.v+1)}function jn(e,t,n){var r=e.reactions;if(r!==null)for(var i=wt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===Ar)){var l=(c&pe)===0;if(l&&Nt(s,t),c&131072)Tn.add(s);else if(c&2){var u=s;sn?.delete(u),c&65536||(c&512&&(Ar===null||!(Ar.f&2097152))&&(s.f|=we),jn(u,me,n))}else if(l){var d=s;c&16&&vn!==null&&vn.add(d),n===null?Sn(d):n.push(d)}}}}function Mn(e){if(typeof e!=`object`||!e||Oe in e)return e;let t=ie(e);if(t!==ne&&t!==re)return e;var n=new Map,r=y(e),i=A(0),a=null,o=zr,s=e=>{if(zr===o)return e();var t=Dr,n=zr;kr(null),Br(o);var r=e();return kr(t),Br(n),r};return r&&n.set(`length`,A(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&qe();var i=n.get(t);return i===void 0?s(()=>{var e=A(r.value,a);return n.set(t,e),e}):j(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>A(Qe,a));n.set(t,e),An(i)}}else j(r,Qe),An(i);return!0},get(t,r,i){if(r===Oe)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||C(t,r)?.writable)&&(o=s(()=>A(Mn(c?t[r]:Qe),a)),n.set(r,o)),o!==void 0){var l=I(o);return l===Qe?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=I(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Qe)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===Oe)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Qe||Reflect.has(e,t);return(r!==void 0||Ar!==null&&(!i||C(e,t)?.writable))&&(r===void 0&&(r=s(()=>A(i?Mn(e[t]):Qe,a)),n.set(t,r)),I(r)===Qe)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>A(Qe,a)),n.set(d+``,f)):j(f,Qe)}if(l===void 0)(!u||C(e,t)?.writable)&&(l=s(()=>A(void 0,a)),j(l,Mn(o)),n.set(t,l));else{u=l.v!==Qe;var p=s(()=>Mn(o));j(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&j(h,g+1)}An(i)}return!0},ownKeys(e){I(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Qe});for(var[r,a]of n)a.v!==Qe&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Je()}})}function Nn(e){try{if(typeof e==`object`&&e&&Oe in e)return e[Oe]}catch{}return e}function Pn(e,t){return Object.is(Nn(e),Nn(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var Fn,In,Ln,Rn,zn;function Bn(){if(Fn===void 0){Fn=window,In=document,Ln=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Rn=C(t,`firstChild`).get,zn=C(t,`nextSibling`).get,ae(e)&&(e[Me]=void 0,e[je]=null,e[Ne]=void 0,e.__e=void 0),ae(n)&&(n[Pe]=void 0)}}function Vn(e=``){return document.createTextNode(e)}function Hn(e){return Rn.call(e)}function Un(e){return zn.call(e)}function M(e,t){if(!nt)return Hn(e);var n=Hn(it);if(n===null)n=it.appendChild(Vn());else if(t&&n.nodeType!==3){var r=Vn();return n?.before(r),at(r),r}return t&&qn(n),at(n),n}function N(e,t=!1){if(!nt){var n=Hn(e);return n instanceof Comment&&n.data===``?Un(n):n}if(t){if(it?.nodeType!==3){var r=Vn();return it?.before(r),at(r),r}qn(it)}return it}function P(e,t=1,n=!1){let r=nt?it:e;for(var i;t--;)i=r,r=Un(r);if(!nt)return r;if(n){if(r?.nodeType!==3){var a=Vn();return r===null?i?.after(a):r.before(a),at(a),a}qn(r)}return at(r),r}function Wn(e){e.textContent=``}function Gn(){return!ft||vn!==null?!1:(Ar.f&_e)!==0}function Kn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function qn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function hee(e,t){if(t){let t=document.body;e.autofocus=!0,Ot(()=>{document.activeElement===t&&e.focus()})}}function Jn(e){nt&&Hn(e)!==null&&Wn(e)}var Yn=!1;function Xn(){Yn||(Yn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Fe]?.()})},{capture:!0}))}function Zn(e){var t=Dr,n=Ar;kr(null),jr(null);try{return e()}finally{kr(t),jr(n)}}function Qn(e,t,n,r=n){e.addEventListener(t,()=>Zn(n));let i=e[Fe];i?e[Fe]=()=>{i(),r(!0)}:e[Fe]=()=>r(!0),Xn()}function $n(e){Ar===null&&(Dr===null&&Ue(e),He()),Tr&&Ve(e)}function gee(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function er(e,t){var n=Ar;n!==null&&n.f&8192&&(e|=he);var r={ctx:vt,deps:null,nodes:null,f:e|pe|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};an?.register_created_effect(r);var i=r;if(e&4)dn===null?hn.ensure().schedule(r):dn.push(r);else if(t!==null){try{qr(r)}catch(e){throw hr(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ye))}if(i!==null&&(i.parent=n,n!==null&&gee(i,n),Dr!==null&&Dr.f&2&&!(e&64))){var a=Dr;(a.effects??=[]).push(i)}return r}function tr(){return Dr!==null&&!Or}function nr(e){let t=er(8,null);return Nt(t,fe),t.teardown=e,t}function rr(e){$n(`$effect`);var t=Ar.f;if(!Dr&&t&32&&vt!==null&&!vt.i){var n=vt;(n.e??=[]).push(e)}else return ir(e)}function ir(e){return er(4|Se,e)}function ar(e){return $n(`$effect.pre`),er(8|Se,e)}function or(e){hn.ensure();let t=er(64|xe,e);return()=>{hr(t)}}function _ee(e){hn.ensure();let t=er(64|xe,e);return(e={})=>new Promise(n=>{e.outro?vr(t,()=>{hr(t),n(void 0)}):(hr(t),n(void 0))})}function sr(e){return er(4,e)}function vee(e){return er(Ee|xe,e)}function cr(e,t=0){return er(8|t,e)}function F(e,t=[],n=[],r=[]){Gt(r,t,n,t=>{er(8,()=>{e(...t.map(I))})})}function lr(e,t=0){return er(16|t,e)}function ur(e,t=0){return er(de|t,e)}function dr(e){return er(32|xe,e)}function fr(e){var t=e.teardown;if(t!==null){let e=Tr,n=Dr;Er(!0),kr(null);try{t.call(null)}finally{Er(e),kr(n)}}}function pr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Zn(()=>{e.abort(Ie)});var r=n.next;n.f&64?n.parent=null:hr(n,t),n=r}}function mr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||hr(t),t=n}}function hr(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(gr(e.nodes.start,e.nodes.end),n=!0),e.f|=ve,pr(e,t&&!n),Kr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();fr(e),e.f^=ve,e.f|=ge;var i=e.parent;i!==null&&i.first!==null&&_r(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function gr(e,t){for(;e!==null;){var n=e===t?null:Un(e);e.remove(),e=n}}function _r(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function vr(e,t,n=!0){var r=[];yr(e,r,!0);var i=()=>{n&&hr(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function yr(e,t,n){if(!(e.f&8192)){e.f^=he;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;yr(i,t,o?n:!1)}i=a}}}function br(e){xr(e,!0)}function xr(e,t){if(e.f&8192){e.f^=he,e.f&1024||(Nt(e,pe),hn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;xr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Sr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Un(n);t.append(n),n=i}}var Cr=null,wr=!1,Tr=!1;function Er(e){Tr=e}var Dr=null,Or=!1;function kr(e){Dr=e}var Ar=null;function jr(e){Ar=e}var Mr=null;function Nr(e){Dr!==null&&(!ft||Dr.f&2)&&(Mr??=new Set).add(e)}var Pr=null,Fr=0,Ir=null;function yee(e){Ir=e}var Lr=1,Rr=0,zr=Rr;function Br(e){zr=e}function Vr(){return++Lr}function Hr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~we),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Hr(a)&&en(a),a.wv>e.wv)return!0}t&512&&sn===null&&Nt(e,fe)}return!1}function Ur(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!ft&&Mr!==null&&Mr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Ur(a,t,!1):t===a&&(n?Nt(a,pe):a.f&1024&&Nt(a,me),Sn(a))}}function Wr(e){var t=Pr,n=Fr,r=Ir,i=Dr,a=Mr,o=vt,s=Or,c=zr,l=e.f;Pr=null,Fr=0,Ir=null,Dr=l&96?null:e,Mr=null,yt(e.ctx),Or=!1,zr=++Rr,e.ac!==null&&(Zn(()=>{e.ac.abort(Ie)}),e.ac=null);try{e.f|=Te;var u=e.fn,d=u();e.f|=_e;var f=e.deps,p=an?.is_fork;if(Pr!==null){var m;if(p||Kr(e,Fr),f!==null&&Fr>0)for(f.length=Fr+Pr.length,m=0;m<Pr.length;m++)f[Fr+m]=Pr[m];else e.deps=f=Pr;if(tr()&&e.f&512)for(m=Fr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Fr<f.length&&(Kr(e,Fr),f.length=Fr);if(wt()&&Ir!==null&&!Or&&f!==null&&!(e.f&6146))for(m=0;m<Ir.length;m++)Ur(Ir[m],e);if(i!==null&&i!==e){if(Rr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Rr;if(t!==null)for(let e of t)e.rv=Rr;Ir!==null&&(r===null?r=Ir:r.push(...Ir))}return e.f&8388608&&(e.f^=De),d}catch(e){return At(e)}finally{e.f^=Te,Pr=t,Fr=n,Ir=r,Dr=i,Mr=a,yt(o),Or=s,zr=c}}function Gr(e,t){let n=t.reactions;if(n!==null){var r=b.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Pr===null||!x.call(Pr,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~we),a.v!==Qe&&Pt(a),fee(a),Kr(a,0)}}function Kr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Gr(e,n[r])}function qr(e){var t=e.f;if(!(t&16384)){Nt(e,fe);var n=Ar,r=wr;Ar=e,wr=!0;try{t&16777232?mr(e):pr(e),fr(e);var i=Wr(e);e.teardown=typeof i==`function`?i:null,e.wv=Lr}finally{wr=r,Ar=n}}}async function Jr(){if(ft)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),gn()}function I(e){var t=(e.f&2)!=0;if(Cr?.add(e),Dr!==null&&!Or&&!(Ar!==null&&Ar.f&16384)&&(Mr===null||!Mr.has(e))){var n=Dr.deps;if(Dr.f&2097152)e.rv<Rr&&(e.rv=Rr,Pr===null&&n!==null&&n[Fr]===e?Fr++:Pr===null?Pr=[e]:Pr.push(e));else{Dr.deps??=[],x.call(Dr.deps,e)||Dr.deps.push(e);var r=e.reactions;r===null?e.reactions=[Dr]:x.call(r,Dr)||r.push(Dr)}}if(Tr&&En.has(e))return En.get(e);if(t){var i=e;if(Tr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Xr(i))&&(a=$t(i)),En.set(i,a),a}var o=(i.f&512)==0&&!Or&&Dr!==null&&(wr||(Dr.f&512)!=0),s=(i.f&_e)===0;Hr(i)&&(o&&(i.f|=512),en(i)),o&&!s&&(tn(i),Yr(i))}if(sn?.has(e))return sn.get(e);if(e.f&8388608)throw e.v;return e.v}function Yr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(tn(t),Yr(t))}function Xr(e){if(e.v===Qe)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(En.has(t)||t.f&2&&Xr(t))return!0;return!1}function Zr(e){var t=Or;try{return Or=!0,e()}finally{Or=t}}function Qr(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(Oe in e)$r(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&Oe in n&&$r(n)}}}function $r(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{$r(e[n],t)}catch{}let n=ie(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=te(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}function ei(){return Symbol(nee)}function ti(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var ni=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function ri(e){return ni.includes(e)}var ii=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),ai={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function oi(e){return e=e.toLowerCase(),ai[e]??e}[...ii];var si=[`touchstart`,`touchmove`];function ci(e){return si.includes(e)}var li=[`textarea`,`script`,`style`,`title`];function ui(e){return li.includes(e)}var di=Symbol(`events`),fi=new Set,pi=new Set;function mi(e,t,n,r={}){function i(e){if(r.capture||bi.call(t,e),!e.cancelBubble)return Zn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?Ot(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function hi(e,t,n,r={}){var i=mi(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function gi(e,t,n,r,i){var a={capture:r,passive:i},o=mi(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&nr(()=>{t.removeEventListener(e,o,a)})}function _i(e,t,n){(t[di]??={})[e]=n}function vi(e){for(var t=0;t<e.length;t++)fi.add(e[t]);for(var n of pi)n(e)}var yi=null;function bi(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;yi=e;var o=0,s=yi===e&&e[di];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[di]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){ee(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Dr,d=Ar;kr(null),jr(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[di]?.[r];m!=null&&(!a.disabled||e.target===a)&&m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[di]=t,delete e.currentTarget,kr(u),jr(d)}}}var bee=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function xee(e){return bee?.createHTML(e)??e}function xi(e){var t=Kn(`template`);return t.innerHTML=xee(e.replaceAll(`<!>`,`<!---->`)),t.content}function Si(e,t){var n=Ar;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function L(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(nt)return Si(it,null),it;i===void 0&&(i=xi(a?e:`<!>`+e),n||(i=Hn(i)));var t=r||Ln?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Hn(t),s=t.lastChild;Si(o,s)}else Si(t,t);return t}}function See(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(nt)return Si(it,null),it;if(!o){var e=Hn(xi(a));if(i)for(o=document.createDocumentFragment();Hn(e);)o.appendChild(Hn(e));else o=Hn(e)}var t=o.cloneNode(!0);if(i){var n=Hn(t),r=t.lastChild;Si(n,r)}else Si(t,t);return t}}function Ci(e,t){return See(e,t,`svg`)}function wi(e=``){if(!nt){var t=Vn(e+``);return Si(t,t),t}var n=it;return n.nodeType===3?qn(n):(n.before(n=Vn()),at(n)),Si(n,n),n}function R(){if(nt)return Si(it,null),it;var e=document.createDocumentFragment(),t=document.createComment(``),n=Vn();return e.append(t,n),Si(t,n),e}function z(e,t){if(nt){var n=Ar;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=it),ot();return}e!==null&&e.before(t)}function Ti(){if(nt&&it&&it.nodeType===8&&it.textContent?.startsWith(`$`)){let e=it.textContent.substring(1);return ot(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function B(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Pe]??=e.nodeValue)&&(e[Pe]=n,e.nodeValue=`${n}`)}function Ei(e,t){return Cee(e,t)}var Di=new Map;function Cee(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Bn();var c=void 0,l=_ee(()=>{var o=n??t.appendChild(Vn());Ut(o,{pending:()=>{}},t=>{D({});var n=vt;if(a&&(n.c=a),i&&(r.$$events=i),nt&&Si(t,null),c=e(t,r)||{},nt&&(Ar.nodes.end=it,it===null||it.nodeType!==8||it.data!==`]`))throw tt(),Ze;O()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=ci(r);for(let e of[t,document]){var a=Di.get(e);a===void 0&&(a=new Map,Di.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,bi,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(S(fi)),pi.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=Di.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,bi),r.delete(e),r.size===0&&Di.delete(n)):r.set(e,i)}pi.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Oi.set(c,l),c}var Oi=new WeakMap;function wee(e,t){let n=Oi.get(e);return n?(Oi.delete(e),n(t)):Promise.resolve()}var ki=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)br(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(br(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(hr(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Sr(r,t),t.append(Vn()),this.#n.set(e,{effect:r,fragment:t})}else hr(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),vr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(hr(n.effect),this.#n.delete(e))};ensure(e,t){var n=an,r=Gn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Vn();i.append(a),this.#n.set(e,{effect:dr(()=>t(a)),fragment:i})}else this.#t.set(e,dr(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else nt&&(this.anchor=it),this.#a(n)}};function V(e,t,n=!1){var r;nt&&(r=it,ot());var i=new ki(e),a=n?ye:0;function o(e,t){if(nt){var n=ct(r);if(e!==parseInt(n.substring(1))){var a=st();at(a),i.anchor=a,rt(!1),i.ensure(e,t),rt(!0);return}}i.ensure(e,t)}lr(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Tee=Symbol(`NaN`);function Eee(e,t,n){nt&&ot();var r=new ki(e),i=!wt();lr(()=>{var e=t();e!==e&&(e=Tee),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Ai(e,t){return t}function Dee(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];vr(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;ji(e,S(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;Wn(u),u.append(l),e.items.clear()}ji(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function ji(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=Ce,Sr(a,document.createDocumentFragment())):hr(t[i],n)}}var Mi;function Ni(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=nt?at(Hn(c)):c.appendChild(Vn())}nt&&ot();var l=null,u=Qt(()=>{var e=n();return y(e)?e:e==null?[]:S(e)}),d,f=new Map,p=!0;function m(e){g.effect.f&16384||(g.pending.delete(e),g.fallback=l,Fi(g,d,o,t,r),l!==null&&(d.length===0?l.f&33554432?(l.f^=Ce,Li(l,null,o)):br(l):vr(l,()=>{l=null})))}function h(e){g.pending.delete(e)}var g={effect:lr(()=>{d=I(u);var e=d.length;let c=!1;nt&&ct(o)===`[!`!=(e===0)&&(o=st(),at(o),rt(!1),c=!0);for(var g=new Set,_=an,v=Gn(),y=0;y<e;y+=1){nt&&it.nodeType===8&&it.data===`]`&&(o=it,c=!0,rt(!1));var b=d[y],x=r(b,y),S=p?null:s.get(x);S?(S.v&&kn(S.v,b),S.i&&kn(S.i,y),v&&_.unskip_effect(S.e)):(S=Ii(s,p?o:Mi??=Vn(),b,x,y,i,t,n),p||(S.e.f|=Ce),s.set(x,S)),g.add(x)}if(e===0&&a&&!l&&(p?l=dr(()=>a(o)):(l=dr(()=>a(Mi??=Vn())),l.f|=Ce)),e>g.size&&Be(``,``,``),nt&&e>0&&at(st()),!p)if(f.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(m),_.ondiscard(h)}else m(_);c&&rt(!0),I(u)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};p=!1,nt&&(o=it)}function Pi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Fi(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Pi(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(br(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432)if(g.f^=Ce,g===c)Li(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Ri(e,u,g),Ri(e,g,v),Li(g,v,n),u=g,f=[],p=[],c=Pi(u.next);continue}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],ee=f[f.length-1];for(b=0;b<f.length;b+=1)Li(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Ri(e,x.prev,ee.next),Ri(e,u,x),Ri(e,ee,y),c=y,u=ee,--_,f=[],p=[]}else l.delete(g),Li(g,c,n),Ri(e,g.prev,g.next),Ri(e,g,u===null?e.effect.first:u.next),Ri(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=Pi(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=Pi(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(ji(e,S(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=Pi(c.next);var te=C.length;if(te>0){var ne=r&4&&o===0?n:null;if(a){for(_=0;_<te;_+=1)C[_].nodes?.a?.measure();for(_=0;_<te;_+=1)C[_].nodes?.a?.fix()}Dee(e,C,ne)}}a&&Ot(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Ii(e,t,n,r,i,a,o,s){var c=o&1?o&16?On(n):pee(n,!1,!1):null,l=o&2?On(i):null;return{v:c,i:l,e:dr(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Li(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Un(r);if(a.before(r),r===i)return;r=o}}function Ri(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function zi(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;nt&&(o=at(Hn(c)))}F(()=>{var e=Ar;if(s===(s=t()??``)){nt&&ot();return}if(n&&!nt){e.nodes=null,c.innerHTML=s,s!==``&&Si(Hn(c),c.lastChild);return}if(e.nodes!==null&&(gr(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(nt){for(var a=it.data,l=ot(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=Un(l);if(l===null)throw tt(),Ze;Si(it,u),o=at(l);return}var d=Kn(r?`svg`:i?`math`:`template`,r?$e:i?tee:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(Si(Hn(f),f.lastChild),r||i)for(;Hn(f);)o.before(Hn(f));else o.before(f)}})}function H(e,t,...n){var r=new ki(e);lr(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ye)}function U(e,t,n){var r;nt&&(r=it,ot());var i=new ki(e);lr(()=>{var e=t()??null;if(nt&&ct(r)===`[`!=(e!==null)){var a=st();at(a),i.anchor=a,rt(!1),i.ensure(e,e&&(t=>n(t,e))),rt(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ye)}function Bi(e,t,n,r,i,a){let o=nt;nt&&ot();var s=null;nt&&it.nodeType===1&&(s=it,ot());var c=nt?it:e,l=new ki(c,!1);lr(()=>{let e=t()||null;var a=i?i():n||e===`svg`?$e:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=nt?s:Kn(e,a),Si(s,s),r){var n=null;nt&&ui(e)&&s.append(n=document.createComment(``));var i=nt?Hn(s):s.appendChild(Vn());nt&&(i===null?rt(!1):at(i)),r(s,i),n?.remove()}Ar.nodes.end=s,t.before(s)}nt&&at(t)}),()=>{}},ye),nr(()=>{}),o&&(rt(!0),at(c))}function Vi(e,t){let n=null,r=nt;var i;if(nt){n=it;for(var a=Hn(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=Un(a);if(a===null)rt(!1);else{var o=Un(a);a.remove(),at(o)}}nt||(i=document.head.appendChild(Vn()));try{lr(()=>{var e=dr(()=>t(i));e.f|=be})}finally{r&&(rt(!0),at(n))}}function Hi(e,t,n){sr(()=>{var r=Zr(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};cr(()=>{var e=n();Qr(e),i&&ut(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Ui(e,t){var n=void 0,r;ur(()=>{n!==(n=t())&&(r&&=(hr(r),null),n&&(r=dr(()=>{sr(()=>n(e))})))})}function Wi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Wi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Gi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wi(e))&&(r&&(r+=` `),r+=t);return r}function Ki(e){return typeof e==`object`?Gi(e):e??``}var qi=[...`
|
|
3
|
-
\r\f\xA0\v`];function Ji(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||qi.includes(r[o-1]))&&(s===r.length||qi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Yi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Xi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Zi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Xi)),i&&c.push(...Object.keys(i).map(Xi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Xi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Yi(r)),i&&(n+=Yi(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Qi(e,t,n,r,i,a){var o=e[Me];if(nt||o!==n||o===void 0){var s=Ji(n,r,a);(!nt||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[Me]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function $i(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ea(e,t,n,r){var i=e[Ne];if(nt||i!==t){var a=Zi(t,r);(!nt||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[Ne]=t}else r&&(Array.isArray(r)?($i(e,n?.[0],r[0]),$i(e,n?.[1],r[1],`important`)):$i(e,n,r));return r}function ta(e,t,n=!1){if(e.multiple){if(t==null)return;if(!y(t))return ree();for(var r of e.options)r.selected=t.includes(ra(r));return}for(r of e.options)if(Pn(ra(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function na(e){var t=new MutationObserver(()=>{ta(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),nr(()=>{t.disconnect()})}function ra(e){return`__value`in e?e.__value:e.value}var ia=Symbol(`class`),aa=Symbol(`style`),oa=Symbol(`is custom element`),sa=Symbol(`is html`),ca=Le?`link`:`LINK`,la=Le?`input`:`INPUT`,ua=Le?`option`:`OPTION`,da=Le?`select`:`SELECT`,fa=Le?`progress`:`PROGRESS`;function pa(e){if(nt){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;W(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;W(e,`checked`,null),e.checked=r}}};e[Fe]=n,Ot(n),Xn()}}function ma(e,t){var n=va(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==fa)||(e.value=t??``)}function ha(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function W(e,t,n,r){var i=va(e);nt&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ca)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[Ae]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ba(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ga(e,t,n,r,i=!1,a=!1){if(nt&&i&&e.nodeName===la){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||pa(o)}var s=va(e),c=s[oa],l=!s[sa];let u=nt&&c;u&&rt(!1);var d=t||{},f=e.nodeName===ua;for(var p in t)p in n||(n[p]=null);n.class?n.class=Ki(n.class):(r||n[ia])&&(n.class=null),n[aa]&&(n.style??=null);var m=ba(e);if(e.nodeName===la&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,W(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){Qi(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[ia],n[ia]),d[i]=o,d[ia]=n[ia];continue}if(i===`style`){ea(e,o,t?.[aa],n[aa]),d[i]=o,d[aa]=n[aa];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=ri(r);if(ti(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)_i(r,e,o),vi([r]);else if(o!=null){function a(e){d[i].call(this,e)}d[n]=mi(r,e,a,t)}}else if(i===`style`)W(e,i,o);else if(i===`autofocus`)hee(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)ha(e,o);else{var y=i;l||(y=oi(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||m.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=Qe)):typeof o!=`function`&&W(e,y,o,a)}}}return u&&rt(!0),d}function _a(e,t,n=[],r=[],i=[],a,o=!1,s=!1){Gt(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===da,l=!1;if(ur(()=>{var u=t(...n.map(I)),d=ga(e,r,u,a,o,s);l&&c&&`value`in u&&ta(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||hr(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&hr(i[t]),i[t]=dr(()=>Ui(e,()=>f))),d[t]=f}r=d}),c){var u=e;sr(()=>{ta(u,r.value,!0),na(u)})}l=!0})}function va(e){return e[je]??={[oa]:e.nodeName.includes(`-`),[sa]:e.namespaceURI===eee}}var ya=new Map;function ba(e){var t=e.getAttribute(`is`)||e.nodeName,n=ya.get(t);if(n)return n;ya.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=te(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=ie(i)}return n}function xa(e,t,n=t){var r=new WeakSet;Qn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Sa(e)?Ca(a):a,n(a),an!==null&&r.add(an),await Jr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(nt&&e.defaultValue!==e.value||Zr(t)==null&&e.value)&&(n(Sa(e)?Ca(e.value):e.value),an!==null&&r.add(an)),cr(()=>{var n=t();if(e===document.activeElement){var i=ft?on:an;if(r.has(i))return}Sa(e)&&n===Ca(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Sa(e){var t=e.type;return t===`number`||t===`range`}function Ca(e){return e===``?null:+e}function Oee(e,t,n=t){Qn(e,`change`,()=>{n(e.files)}),nt&&e.files&&n(e.files),cr(()=>{e.files=t()})}function wa(e,t){return e===t||e?.[Oe]===t}function Ta(e={},t,n,r){var i=vt.r,a=Ar;return sr(()=>{var o,s;return cr(()=>{o=s,s=r?.()||[],Zr(()=>{wa(n(...s),e)||(t(e,...s),o&&wa(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&wa(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Ea(e=!1){let t=vt,n=t.l.u;if(!n)return;let r=()=>Qr(t.s);if(e){let e=0,n={},i=Yt(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>I(i)}n.b.length&&ar(()=>{Da(t,r),ce(n.b)}),rr(()=>{let e=Zr(()=>n.m.map(se));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&rr(()=>{Da(t,r),ce(n.a)})}function Da(e,t){if(e.l.s)for(let t of e.l.s)I(t);t()}var kee={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function G(e,t,n){return new Proxy({props:e,exclude:t},kee)}var Aee={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(oe(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];oe(i)&&(i=i());let a=C(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(oe(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=C(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Oe||t===ke)return!1;for(let n of e.props)if(oe(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(oe(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function K(...e){return new Proxy({props:e},Aee)}function q(e,t,n,r){var i=!pt||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=void 0,u=()=>o&&i?(l??=Yt(r),I(l)):(c&&(c=!1,s=o?Zr(r):r),s);let d;if(a){var f=Oe in e||ke in e;d=C(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=uee(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Ge(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?Yt:Qt)(()=>(_=!1,h()));a&&I(v);var y=Ar;return(function(e,t){if(arguments.length>0){let n=t?I(v):i&&a?Mn(e):e;return j(v,n),_=!0,s!==void 0&&(s=n),e}return Tr&&_||y.f&16384?v.v:I(v)})}function Oa(e){vt===null&&Re(`onMount`),pt&&vt.l!==null?jee(vt).m.push(e):rr(()=>{let t=Zr(e);if(typeof t==`function`)return t})}function ka(e){vt===null&&Re(`onDestroy`),Oa(()=>()=>Zr(e))}function jee(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`),mt();var Aa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Mee={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ja=new class{#e=Mee;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Nee(e){setTimeout(e,0)}var Ma=typeof window>`u`||`Deno`in globalThis;function Na(){}function Pee(e,t){return typeof e==`function`?e(t):e}function Fee(e){return typeof e==`number`&&e>=0&&e!==1/0}function Iee(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pa(e,t){return typeof e==`function`?e(t):e}function Lee(e,t){return typeof e==`function`?e(t):e}function Fa(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==La(o,t.options))return!1}else if(!za(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ia(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ra(t.options.mutationKey)!==Ra(a))return!1}else if(!za(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function La(e,t){return(t?.queryKeyHashFn||Ra)(e)}function Ra(e){return JSON.stringify(e,(e,t)=>Ha(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function za(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>za(e[n],t[n])):!1}var Ree=Object.prototype.hasOwnProperty;function Ba(e,t){if(e===t)return e;let n=Va(e)&&Va(t);if(!n&&!(Ha(e)&&Ha(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:Ree.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=Ba(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function Va(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ha(e){if(!Ua(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ua(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ua(e){return Object.prototype.toString.call(e)===`[object Object]`}function Wa(e){return new Promise(t=>{ja.setTimeout(t,e)})}function Ga(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ba(e,t)}function Ka(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function qa(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ja=Symbol();function Ya(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ja?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Xa=new class extends Aa{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ma&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function Za(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Qa=Nee;function $a(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Qa,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var eo=$a(),to=new class extends Aa{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ma&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function no(e){return Math.min(1e3*2**e,3e4)}function ro(e){return(e??`online`)===`online`?to.isOnline():!0}var io=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ao(e){let t=!1,n=0,r,i=Za(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new io(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Xa.isFocused()&&(e.networkMode===`always`||to.isOnline())&&e.canRun(),u=()=>ro(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ma?0:3),o=e.retryDelay??no,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Wa(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var oo=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fee(this.gcTime)&&(this.#e=ja.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ma?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(ja.clearTimeout(this.#e),void 0)}},so=class extends oo{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=lo(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=lo(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Ga(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Na).catch(Na):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Lee(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ja||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Pa(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Iee(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Ya(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=ao({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof io&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof io){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...co(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:`success`,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),eo.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function co(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ro(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function lo(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function uo(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=Ya(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?qa:Ka;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?po:fo,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:fo(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function fo(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function po(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var mo=class extends oo{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ho(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ao({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error:t})}}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),eo.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ho(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var go=class extends Aa{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new mo({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=_o(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=_o(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=_o(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=_o(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){eo.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ia(t,e))}findAll(e={}){return this.getAll().filter(t=>Ia(e,t))}notify(e){eo.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return eo.batch(()=>Promise.all(e.map(e=>e.continue().catch(Na))))}};function _o(e){return e.options.scope?.id}var vo=class extends Aa{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??La(r,t),a=this.get(i);return a||(a=new so({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){eo.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Fa(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Fa(e,t)):t}notify(e){eo.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){eo.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){eo.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yo=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new vo,this.#t=e.mutationCache||new go,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Xa.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=to.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Pa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Pee(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return eo.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;eo.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return eo.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=eo.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Na).catch(Na)}invalidateQueries(e,t={}){return eo.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=eo.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Na)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Na)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Pa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Na).catch(Na)}fetchInfiniteQuery(e){return e.behavior=uo(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Na).catch(Na)}ensureInfiniteQueryData(e){return e.behavior=uo(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return to.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ra(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{za(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ra(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{za(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=La(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Ja&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},bo=Symbol(`QueryClient`),xo=e=>{xt(bo,e)},So=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],Co=[`difference`,`intersection`,`symmetricDifference`,`union`],wo=!1,To=class e extends Set{#e=new Map;#t=A(0);#n=A(0);#r=zr||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}wo||this.#a()}#i(e){return zr===this.#r?A(e):On(e)}#a(){wo=!0;var t=e.prototype,n=Set.prototype;for(let e of So)t[e]=function(...t){return I(this.#t),n[e].apply(this,t)};for(let r of Co)t[r]=function(...t){return I(this.#t),new e(n[r].apply(this,t))}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return I(this.#t),!1;r=this.#i(!0),n.set(e,r)}return I(r),t}add(e){return super.has(e)||(super.add(e),j(this.#n,super.size),An(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),j(r,!1)),t&&(j(this.#n,super.size),An(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())j(t,!1);e.clear(),j(this.#n,0),An(this.#t)}}keys(){return this.values()}values(){return I(this.#t),super.values()}entries(){return I(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return I(this.#n)}},Eo=class extends Map{#e=new Map;#t=A(0);#n=A(0);#r=zr||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return zr===this.#r?A(e):On(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return I(this.#t),!1;return I(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{I(this.#t);return}return I(n),super.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),j(this.#n,super.size),An(o);else if(i!==t){An(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&An(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),j(n,-1)),r&&(j(this.#n,super.size),An(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;j(this.#n,0);for(var t of e.values())j(t,-1);An(this.#t),e.clear()}}#a(){I(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)I(n)}keys(){return I(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return I(this.#n),super.size}},Do=class{#e;#t;constructor(e,t){this.#e=e,this.#t=Vt(t)}get current(){return this.#t(),this.#e()}},Oo=/\(.+\)/,ko=new Set([`all`,`print`,`screen`,`and`,`or`,`not`,`only`]),Ao=class extends Do{constructor(e,t){let n=Oo.test(e)||e.split(/[\s,]+/).some(e=>ko.has(e.trim()))?e:`(${e})`,r=window.matchMedia(n);super(()=>r.matches,e=>hi(r,`change`,e))}};function jo(e,t){D(t,!0);let n=q(t,`client`,19,()=>new yo);Oa(()=>{n().mount()}),xo(n()),ka(()=>{n().unmount()});var r=R();H(N(r),()=>t.children),z(e,r),O()}var Mo=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function No(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=Mo,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Vt(e=>{let n=hi(t,`focusin`,e),r=hi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?No(this.#e):null}};function Po(e,t){switch(e){case`post`:rr(t);break;case`pre`:ar(t);break}}function Fo(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Po(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Zr(()=>n(t,o));return o=t,r})}function Io(e,t,n){let r=or(()=>{let i=!1;Fo(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});rr(()=>r)}function Lo(e,t,n){Fo(e,`post`,t,n)}function Ro(e,t,n){Fo(e,`pre`,t,n)}Lo.pre=Ro;function zo(e,t){Io(e,`post`,t)}function Bo(e,t){Io(e,`pre`,t)}zo.pre=Bo;function Vo(e,t){switch(e){case`local`:return t.localStorage;case`session`:return t.sessionStorage}}var Ho=class{#e;#t;#n;#r;#i;#a=A(0);constructor(e,t,n={}){let{storage:r=`local`,serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:o=Mo}=n;if(this.#e=t,this.#t=e,this.#n=i,o===void 0)return;let s=Vo(r,o);this.#r=s;let c=s.getItem(e);c===null?this.#c(t):this.#e=this.#s(c),a&&r===`local`&&(this.#i=Vt(()=>hi(o,`storage`,this.#o)))}get current(){this.#i?.(),I(this.#a);let e=this.#s(this.#r?.getItem(this.#t))??this.#e,t=new WeakMap,n=r=>{if(r===null||r?.constructor.name===`Date`||typeof r!=`object`)return r;let i=t.get(r);return i||(i=new Proxy(r,{get:(e,t)=>(I(this.#a),n(Reflect.get(e,t))),set:(t,n,r)=>(j(this.#a,I(this.#a)+1),Reflect.set(t,n,r),this.#c(e),!0)}),t.set(r,i)),i};return n(e)}set current(e){this.#c(e),j(this.#a,I(this.#a)+1)}#o=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#s(e.newValue),j(this.#a,I(this.#a)+1))};#s(e){try{return this.#n.deserialize(e)}catch(t){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,t);return}}#c(e){try{e!=null&&this.#r?.setItem(this.#t,this.#n.serialize(e))}catch(e){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#r}`,e)}}};function Uo(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function Wo(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function Go(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(Mn(o)),u=A(!1),d=A(void 0),f=A(Mn([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?Uo(h,s):c?Wo(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||v&&JSON.stringify(t)===JSON.stringify(v)||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function Ko(e,t,n){return Go(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Lo(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function qo(e,t,n){return Go(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Lo.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}Ko.pre=qo;function Jo(e){return e.filter(e=>e.length>0)}var Yo={getItem:e=>null,setItem:(e,t)=>{}},Xo=typeof document<`u`;function Zo(e){return typeof e==`function`}function Qo(e){return typeof e==`object`&&!!e}var $o=Symbol(`box`),es=Symbol(`is-writable`);function ts(e){return Qo(e)&&$o in e}function ns(e){return rs.isBox(e)&&es in e}function rs(e){let t=A(Mn(e));return{[$o]:!0,[es]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}function is(e,t){let n=k(e);return t?{[$o]:!0,[es]:!0,get current(){return I(n)},set current(e){t(e)}}:{[$o]:!0,get current(){return e()}}}function as(e){return rs.isBox(e)?e:Zo(e)?rs.with(e):rs(e)}function os(e){return Object.entries(e).reduce((e,[t,n])=>rs.isBox(n)?(rs.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function ss(e){return rs.isWritableBox(e)?{[$o]:!0,get current(){return e.current}}:e}rs.from=as,rs.with=is,rs.flatten=os,rs.readonly=ss,rs.isBox=ts,rs.isWritableBox=ns;var cs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ls=/\n/g,us=/^\s*/,ds=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fs=/^:\s*/,ps=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ms=/^[;\s]*/,hs=/^\s+|\s+$/g,gs=`
|
|
4
|
-
`,_s=`/`,vs=`*`,ys=``,bs=`comment`,xs=`declaration`;function Ss(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(ls);t&&(n+=t.length);var i=e.lastIndexOf(gs);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(us)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(!(_s!=e.charAt(0)||vs!=e.charAt(1))){for(var n=2;ys!=e.charAt(n)&&(vs!=e.charAt(n)||_s!=e.charAt(n+1));)++n;if(n+=2,ys===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:bs,comment:o})}}function f(){var e=a(),t=c(ds);if(t){if(d(),!c(fs))return s(`property missing ':'`);var n=c(ps),r=e({type:xs,property:Cs(t[0].replace(cs,ys)),value:n?Cs(n[0].replace(cs,ys)):ys});return c(ms),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Cs(e){return e?e.replace(hs,ys):ys}function ws(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Ss(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}function Ts(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Es=Ts(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ds(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Es(t)}: ${e[t]};`).join(`
|
|
5
|
-
`)}function Os(e={}){return Ds(e).replace(`
|
|
6
|
-
`,` `)}Os({position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`});var ks=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function As(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=ks,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Vt(e=>{let n=hi(t,`focusin`,e),r=hi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?As(this.#e):null}};function js(e,t){switch(e){case`post`:rr(t);break;case`pre`:ar(t);break}}function Ms(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;js(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Zr(()=>n(t,o));return o=t,r})}function Ns(e,t,n){let r=or(()=>{let i=!1;Ms(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});rr(()=>r)}function Ps(e,t,n){Ms(e,`post`,t,n)}function Fs(e,t,n){Ms(e,`pre`,t,n)}Ps.pre=Fs;function Is(e,t){Ns(e,`post`,t)}function Ls(e,t){Ns(e,`pre`,t)}Is.pre=Ls;var Rs=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return St(this.#t)}get(){let e=bt(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=bt(this.#t);return t===void 0?e:t}set(e){return xt(this.#t,e)}},zs=rs(`mode-watcher-mode`),Bs=rs(`mode-watcher-theme`),Vs=[`dark`,`light`,`system`];function Hs(e){return typeof e==`string`?Vs.includes(e):!1}var zee=class{#e=`system`;#t=Xo?localStorage:Yo;#n=this.#t.getItem(zs.current);#r=Hs(this.#n)?this.#n:this.#e;#i=A(Mn(this.#a()));#a(e=this.#r){return new Ho(zs.current,e,{serializer:{serialize:e=>e,deserialize:e=>Hs(e)?e:this.#e}})}constructor(){or(()=>Lo.pre(()=>zs.current,(e,t)=>{let n=I(this.#i).current;j(this.#i,this.#a(n),!0),t&&localStorage.removeItem(t)}))}get current(){return I(this.#i).current}set current(e){I(this.#i).current=e}},Bee=class{#e=void 0;#t=!0;#n=A(Mn(this.#e));#r=typeof window<`u`&&typeof window.matchMedia==`function`?new Ao(`prefers-color-scheme: light`):{current:!1};query(){Xo&&j(this.#n,this.#r.current?`light`:`dark`,!0)}tracking(e){this.#t=e}constructor(){or(()=>{ar(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return I(this.#n)}},Us=new zee,Ws=new Bee,Gs=new class{#e=Xo?localStorage:Yo;#t=this.#e.getItem(Bs.current);#n=this.#t===null||this.#t===void 0?``:this.#t;#r=A(Mn(this.#i()));#i(e=this.#n){return new Ho(Bs.current,e,{serializer:{serialize:e=>typeof e==`string`?e:``,deserialize:e=>e}})}constructor(){or(()=>Lo.pre(()=>Bs.current,(e,t)=>{let n=I(this.#r).current;j(this.#r,this.#i(n),!0),t&&localStorage.removeItem(t)}))}get current(){return I(this.#r).current}set current(e){I(this.#r).current=e}},Ks,qs,Js=!1,Ys=null;function Vee(){return Ys||(Ys=document.createElement(`style`),Ys.appendChild(document.createTextNode(`* {
|
|
7
|
-
-webkit-transition: none !important;
|
|
8
|
-
-moz-transition: none !important;
|
|
9
|
-
-o-transition: none !important;
|
|
10
|
-
-ms-transition: none !important;
|
|
11
|
-
transition: none !important;
|
|
12
|
-
}`)),Ys)}function Xs(e,t=!1){if(typeof document>`u`)return;if(!Js){Js=!0,e();return}if(typeof window<`u`&&window.__vitest_worker__){e();return}clearTimeout(Ks),clearTimeout(qs);let n=Vee(),r=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function a(){e(),window.requestAnimationFrame(i)}if(window.requestAnimationFrame!==void 0){r(),t?a():window.requestAnimationFrame(()=>{a()});return}r(),Ks=window.setTimeout(()=>{e(),qs=window.setTimeout(i,16)},16)}var Zs=rs(void 0),Qs=rs(!0),$s=rs(!1),ec=rs([]),tc=rs([]);function Hee(){let e=k(()=>{if(!Xo)return;let e=Us.current===`system`?Ws.current:Us.current,t=Jo(ec.current),n=Jo(tc.current);function r(){let r=document.documentElement,i=document.querySelector(`meta[name="theme-color"]`);e===`light`?(t.length&&r.classList.remove(...t),n.length&&r.classList.add(...n),r.style.colorScheme=`light`,i&&Zs.current&&i.setAttribute(`content`,Zs.current.light)):(n.length&&r.classList.remove(...n),t.length&&r.classList.add(...t),r.style.colorScheme=`dark`,i&&Zs.current&&i.setAttribute(`content`,Zs.current.dark))}return Qs.current?Xs(r,$s.current):r(),e});return{get current(){return I(e)}}}function Uee(){let e=k(()=>{if(Gs.current,!Xo)return;function e(){document.documentElement.setAttribute(`data-theme`,Gs.current)}return Qs.current?Xs(e,Zr(()=>$s.current)):e(),Gs.current});return{get current(){return I(e)}}}var nc=Hee(),Wee=Uee();function rc(e){Us.current=e}function Gee(e){Gs.current=e}function Kee(e){return e}function qee({defaultMode:e=`system`,themeColors:t,darkClassNames:n=[`dark`],lightClassNames:r=[],defaultTheme:i=``,modeStorageKey:a=`mode-watcher-mode`,themeStorageKey:o=`mode-watcher-theme`}){let s=document.documentElement,c=localStorage.getItem(a)??e,l=localStorage.getItem(o)??i,u=c===`light`||c===`system`&&window.matchMedia(`(prefers-color-scheme: light)`).matches;if(u?(n.length&&s.classList.remove(...n.filter(Boolean)),r.length&&s.classList.add(...r.filter(Boolean))):(r.length&&s.classList.remove(...r.filter(Boolean)),n.length&&s.classList.add(...n.filter(Boolean))),s.style.colorScheme=u?`light`:`dark`,t){let e=document.querySelector(`meta[name="theme-color"]`);e&&e.setAttribute(`content`,c===`light`?t.light:t.dark)}l&&(s.setAttribute(`data-theme`,l),localStorage.setItem(o,l)),localStorage.setItem(a,c)}var Jee=L(`<meta name="theme-color"/>`);function Yee(e,t){D(t,!0);var n=R(),r=N(n),i=e=>{var n=Jee();F(()=>W(n,`content`,t.themeColors.dark)),z(e,n)};V(r,e=>{t.themeColors&&e(i)}),z(e,n),O()}var Xee=L(`<meta name="theme-color"/>`),Zee=L(`<!> <!>`,1);function Qee(e,t){D(t,!0);let n=q(t,`trueNonce`,3,``);Vi(`10dpm82`,e=>{var r=Zee(),i=N(r),a=e=>{var n=Xee();F(()=>W(n,`content`,t.themeColors.dark)),z(e,n)};V(i,e=>{t.themeColors&&e(a)}),zi(P(i,2),()=>`<script${n()?` nonce=${n()}`:``}>(`+qee.toString()+`)(`+JSON.stringify(t.initConfig)+`);<\/script>`),z(e,r)}),O()}function $ee(e,t){D(t,!0);let n=q(t,`track`,3,!0),r=q(t,`defaultMode`,3,`system`),i=q(t,`disableTransitions`,3,!0),a=q(t,`darkClassNames`,19,()=>[`dark`]),o=q(t,`lightClassNames`,19,()=>[]),s=q(t,`defaultTheme`,3,``),c=q(t,`nonce`,3,``),l=q(t,`themeStorageKey`,3,`mode-watcher-theme`),u=q(t,`modeStorageKey`,3,`mode-watcher-mode`),d=q(t,`disableHeadScriptInjection`,3,!1),f=q(t,`synchronousModeChanges`,3,!1);zs.current=u(),Bs.current=l(),ec.current=a(),tc.current=o(),Qs.current=i(),Zs.current=t.themeColors,$s.current=f(),ar(()=>{$s.current=f()}),ar(()=>{Qs.current=i()}),ar(()=>{Zs.current=t.themeColors}),ar(()=>{ec.current=a()}),ar(()=>{tc.current=o()}),ar(()=>{zs.current=u()}),ar(()=>{Bs.current=l()}),ar(()=>{nc.current,zs.current,Bs.current,Wee.current}),Oa(()=>{Ws.tracking(n()),Ws.query();let e=localStorage.getItem(zs.current);rc(Hs(e)?e:r()),Gee(localStorage.getItem(Bs.current)||s())});let p=Kee({defaultMode:r(),themeColors:t.themeColors,darkClassNames:a(),lightClassNames:o(),defaultTheme:s(),modeStorageKey:u(),themeStorageKey:l()}),m=k(()=>typeof window>`u`?c():``);var h=R(),g=N(h),_=e=>{Yee(e,{get themeColors(){return Zs.current}})},v=e=>{Qee(e,{get trueNonce(){return I(m)},get initConfig(){return p},get themeColors(){return Zs.current}})};V(g,e=>{d()?e(_):e(v,-1)}),z(e,h),O()}var ete={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},tte=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},nte=Symbol(`lucide-context`),rte=()=>bt(nte),ite=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),ate=Ci(`<svg><!><!></svg>`);function ic(e,t){D(t,!0);let n=rte()??{},r=q(t,`color`,19,()=>n.color??`currentColor`),i=q(t,`size`,19,()=>n.size??24),a=q(t,`strokeWidth`,19,()=>n.strokeWidth??2),o=q(t,`absoluteStrokeWidth`,19,()=>n.absoluteStrokeWidth??!1),s=q(t,`iconNode`,19,()=>[]),c=G(t,ite),l=k(()=>o()?Number(a())*24/Number(i()):a());var u=ate();_a(u,e=>({...ete,...e,...c,width:i(),height:i(),stroke:r(),"stroke-width":I(l),class:[`lucide-icon lucide`,n.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!tte(c)&&{"aria-hidden":`true`}]);var d=M(u);Ni(d,17,s,Ai,(e,t)=>{var n=k(()=>ue(I(t),2));let r=()=>I(n)[0],i=()=>I(n)[1];var a=R();Bi(N(a),r,!0,(e,t)=>{_a(e,()=>({...i()}))}),z(e,a)}),H(P(d),()=>t.children??w),T(u),z(e,u),O()}var ote=new Set([`$$slots`,`$$events`,`$$legacy`]);function ste(e,t){let n=G(t,ote),r=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`}]];ic(e,K({name:`bell`},()=>n,{get iconNode(){return r}}))}var cte=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},lte=(e,t)=>({classGroupId:e,validator:t}),ac=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),oc=`-`,sc=[],ute=`arbitrary..`,dte=e=>{let t=pte(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return fte(e);let n=e.split(oc);return cc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?cte(i,t):t:i||sc}return n[e]||sc}}},cc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=cc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(oc):e.slice(t).join(oc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},fte=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ute+r:void 0})(),pte=e=>{let{theme:t,classGroups:n}=e;return mte(n,t)},mte=(e,t)=>{let n=ac();for(let r in e){let i=e[r];lc(i,n,r,t)}return n},lc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];hte(i,t,n,r)}},hte=(e,t,n,r)=>{if(typeof e==`string`){gte(e,t,n);return}if(typeof e==`function`){_te(e,t,n,r);return}vte(e,t,n,r)},gte=(e,t,n)=>{let r=e===``?t:uc(t,e);r.classGroupId=n},_te=(e,t,n,r)=>{if(yte(e)){lc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(lte(n,e))},vte=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];lc(o,uc(t,a),n,r)}},uc=(e,t)=>{let n=e,r=t.split(oc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ac(),n.nextPart.set(t,i)),n=i}return n},yte=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,bte=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},dc=`!`,fc=`:`,xte=[],pc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ste=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===fc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(dc)?(c=s.slice(0,-1),l=!0):s.startsWith(dc)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return pc(t,l,c,u)};if(t){let e=t+fc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):pc(xte,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Cte=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},wte=e=>({cache:bte(e.cacheSize),parseClassName:Ste(e),sortModifiers:Cte(e),postfixLookupClassGroupIds:Tte(e),...dte(e)}),Tte=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ete=/\s+/,Dte=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ete),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+dc:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ote=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=mc(n))&&(i&&(i+=` `),i+=r);return i},mc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=mc(e[r]))&&(n&&(n+=` `),n+=t);return n},hc=(e,...t)=>{let n,r,i,a,o=o=>(n=wte(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Dte(e,n);return i(e,a),a};return a=o,(...e)=>a(Ote(...e))},kte=[],gc=e=>{let t=t=>t[e]||kte;return t.isThemeGetter=!0,t},_c=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ate=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mte=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Nte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pte=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yc=e=>Ate.test(e),bc=e=>!!e&&!Number.isNaN(Number(e)),xc=e=>!!e&&Number.isInteger(Number(e)),Sc=e=>e.endsWith(`%`)&&bc(e.slice(0,-1)),Cc=e=>jte.test(e),wc=()=>!0,Ite=e=>Mte.test(e)&&!Nte.test(e),Tc=()=>!1,Lte=e=>Pte.test(e),Rte=e=>Fte.test(e),zte=e=>!Ec(e)&&!Pc(e),Bte=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Vte=e=>Hc(e,Kc,Tc),Ec=e=>_c.test(e),Dc=e=>Hc(e,qc,Ite),Oc=e=>Hc(e,Jc,bc),kc=e=>Hc(e,Xc,wc),Ac=e=>Hc(e,Yc,Tc),jc=e=>Hc(e,Wc,Tc),Mc=e=>Hc(e,Gc,Rte),Nc=e=>Hc(e,Zc,Lte),Pc=e=>vc.test(e),Fc=e=>Uc(e,qc),Ic=e=>Uc(e,Yc),Lc=e=>Uc(e,Wc),Rc=e=>Uc(e,Kc),zc=e=>Uc(e,Gc),Bc=e=>Uc(e,Zc,!0),Vc=e=>Uc(e,Xc,!0),Hc=(e,t,n)=>{let r=_c.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Uc=(e,t,n=!1)=>{let r=vc.exec(e);return r?r[1]?t(r[1]):n:!1},Wc=e=>e===`position`||e===`percentage`,Gc=e=>e===`image`||e===`url`,Kc=e=>e===`length`||e===`size`||e===`bg-size`,qc=e=>e===`length`,Jc=e=>e===`number`,Yc=e=>e===`family-name`,Xc=e=>e===`number`||e===`weight`,Zc=e=>e===`shadow`,Qc=()=>{let e=gc(`color`),t=gc(`font`),n=gc(`text`),r=gc(`font-weight`),i=gc(`tracking`),a=gc(`leading`),o=gc(`breakpoint`),s=gc(`container`),c=gc(`spacing`),l=gc(`radius`),u=gc(`shadow`),d=gc(`inset-shadow`),f=gc(`text-shadow`),p=gc(`drop-shadow`),m=gc(`blur`),h=gc(`perspective`),g=gc(`aspect`),_=gc(`ease`),v=gc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Pc,Ec],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],ee=()=>[`auto`,`contain`,`none`],C=()=>[Pc,Ec,c],te=()=>[yc,`full`,`auto`,...C()],ne=()=>[xc,`none`,`subgrid`,Pc,Ec],re=()=>[`auto`,{span:[`full`,xc,Pc,Ec]},xc,Pc,Ec],ie=()=>[xc,`auto`,Pc,Ec],ae=()=>[`auto`,`min`,`max`,`fr`,Pc,Ec],oe=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],w=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],se=()=>[`auto`,...C()],ce=()=>[yc,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],le=()=>[yc,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],ue=()=>[yc,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],de=()=>[e,Pc,Ec],fe=()=>[...b(),Lc,jc,{position:[Pc,Ec]}],pe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],me=()=>[`auto`,`cover`,`contain`,Rc,Vte,{size:[Pc,Ec]}],he=()=>[Sc,Fc,Dc],ge=()=>[``,`none`,`full`,l,Pc,Ec],_e=()=>[``,bc,Fc,Dc],ve=()=>[`solid`,`dashed`,`dotted`,`double`],ye=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],be=()=>[bc,Sc,Lc,jc],xe=()=>[``,`none`,m,Pc,Ec],Se=()=>[`none`,bc,Pc,Ec],Ce=()=>[`none`,bc,Pc,Ec],we=()=>[bc,Pc,Ec],Te=()=>[yc,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Cc],breakpoint:[Cc],color:[wc],container:[Cc],"drop-shadow":[Cc],ease:[`in`,`out`,`in-out`],font:[zte],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Cc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Cc],shadow:[Cc],spacing:[`px`,bc],text:[Cc],"text-shadow":[Cc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,yc,Ec,Pc,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Pc,Ec]}],"container-named":[Bte],columns:[{columns:[bc,Ec,Pc,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[xc,`auto`,Pc,Ec]}],basis:[{basis:[yc,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[bc,yc,`auto`,`initial`,`none`,Ec]}],grow:[{grow:[``,bc,Pc,Ec]}],shrink:[{shrink:[``,bc,Pc,Ec]}],order:[{order:[xc,`first`,`last`,`none`,Pc,Ec]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...oe(),`normal`]}],"justify-items":[{"justify-items":[...w(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...w()]}],"align-content":[{content:[`normal`,...oe()]}],"align-items":[{items:[...w(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...w(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...w(),`baseline`]}],"place-self":[{"place-self":[`auto`,...w()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:se()}],mx:[{mx:se()}],my:[{my:se()}],ms:[{ms:se()}],me:[{me:se()}],mbs:[{mbs:se()}],mbe:[{mbe:se()}],mt:[{mt:se()}],mr:[{mr:se()}],mb:[{mb:se()}],ml:[{ml:se()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ce()}],"inline-size":[{inline:[`auto`,...le()]}],"min-inline-size":[{"min-inline":[`auto`,...le()]}],"max-inline-size":[{"max-inline":[`none`,...le()]}],"block-size":[{block:[`auto`,...ue()]}],"min-block-size":[{"min-block":[`auto`,...ue()]}],"max-block-size":[{"max-block":[`none`,...ue()]}],w:[{w:[s,`screen`,...ce()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ce()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ce()]}],h:[{h:[`screen`,`lh`,...ce()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ce()]}],"max-h":[{"max-h":[`screen`,`lh`,...ce()]}],"font-size":[{text:[`base`,n,Fc,Dc]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Vc,kc]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Sc,Ec]}],"font-family":[{font:[Ic,Ac,t]}],"font-features":[{"font-features":[Ec]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Pc,Ec]}],"line-clamp":[{"line-clamp":[bc,`none`,Pc,Oc]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,Pc,Ec]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Pc,Ec]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:de()}],"text-color":[{text:de()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ve(),`wavy`]}],"text-decoration-thickness":[{decoration:[bc,`from-font`,`auto`,Pc,Dc]}],"text-decoration-color":[{decoration:de()}],"underline-offset":[{"underline-offset":[bc,`auto`,Pc,Ec]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[xc,Pc,Ec]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Pc,Ec]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Pc,Ec]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:fe()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:me()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},xc,Pc,Ec],radial:[``,Pc,Ec],conic:[xc,Pc,Ec]},zc,Mc]}],"bg-color":[{bg:de()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:de()}],"gradient-via":[{via:de()}],"gradient-to":[{to:de()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ve(),`hidden`,`none`]}],"divide-style":[{divide:[...ve(),`hidden`,`none`]}],"border-color":[{border:de()}],"border-color-x":[{"border-x":de()}],"border-color-y":[{"border-y":de()}],"border-color-s":[{"border-s":de()}],"border-color-e":[{"border-e":de()}],"border-color-bs":[{"border-bs":de()}],"border-color-be":[{"border-be":de()}],"border-color-t":[{"border-t":de()}],"border-color-r":[{"border-r":de()}],"border-color-b":[{"border-b":de()}],"border-color-l":[{"border-l":de()}],"divide-color":[{divide:de()}],"outline-style":[{outline:[...ve(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[bc,Pc,Ec]}],"outline-w":[{outline:[``,bc,Fc,Dc]}],"outline-color":[{outline:de()}],shadow:[{shadow:[``,`none`,u,Bc,Nc]}],"shadow-color":[{shadow:de()}],"inset-shadow":[{"inset-shadow":[`none`,d,Bc,Nc]}],"inset-shadow-color":[{"inset-shadow":de()}],"ring-w":[{ring:_e()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:de()}],"ring-offset-w":[{"ring-offset":[bc,Dc]}],"ring-offset-color":[{"ring-offset":de()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":de()}],"text-shadow":[{"text-shadow":[`none`,f,Bc,Nc]}],"text-shadow-color":[{"text-shadow":de()}],opacity:[{opacity:[bc,Pc,Ec]}],"mix-blend":[{"mix-blend":[...ye(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[bc]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":de()}],"mask-image-linear-to-color":[{"mask-linear-to":de()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":de()}],"mask-image-t-to-color":[{"mask-t-to":de()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":de()}],"mask-image-r-to-color":[{"mask-r-to":de()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":de()}],"mask-image-b-to-color":[{"mask-b-to":de()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":de()}],"mask-image-l-to-color":[{"mask-l-to":de()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":de()}],"mask-image-x-to-color":[{"mask-x-to":de()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":de()}],"mask-image-y-to-color":[{"mask-y-to":de()}],"mask-image-radial":[{"mask-radial":[Pc,Ec]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":de()}],"mask-image-radial-to-color":[{"mask-radial-to":de()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[bc]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":de()}],"mask-image-conic-to-color":[{"mask-conic-to":de()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:fe()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Pc,Ec]}],filter:[{filter:[``,`none`,Pc,Ec]}],blur:[{blur:xe()}],brightness:[{brightness:[bc,Pc,Ec]}],contrast:[{contrast:[bc,Pc,Ec]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Bc,Nc]}],"drop-shadow-color":[{"drop-shadow":de()}],grayscale:[{grayscale:[``,bc,Pc,Ec]}],"hue-rotate":[{"hue-rotate":[bc,Pc,Ec]}],invert:[{invert:[``,bc,Pc,Ec]}],saturate:[{saturate:[bc,Pc,Ec]}],sepia:[{sepia:[``,bc,Pc,Ec]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Pc,Ec]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[bc,Pc,Ec]}],"backdrop-contrast":[{"backdrop-contrast":[bc,Pc,Ec]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,bc,Pc,Ec]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bc,Pc,Ec]}],"backdrop-invert":[{"backdrop-invert":[``,bc,Pc,Ec]}],"backdrop-opacity":[{"backdrop-opacity":[bc,Pc,Ec]}],"backdrop-saturate":[{"backdrop-saturate":[bc,Pc,Ec]}],"backdrop-sepia":[{"backdrop-sepia":[``,bc,Pc,Ec]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Pc,Ec]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[bc,`initial`,Pc,Ec]}],ease:[{ease:[`linear`,`initial`,_,Pc,Ec]}],delay:[{delay:[bc,Pc,Ec]}],animate:[{animate:[`none`,v,Pc,Ec]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Pc,Ec]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":[`scale-3d`],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[Pc,Ec,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":[`translate-none`],zoom:[{zoom:[xc,Pc,Ec]}],accent:[{accent:de()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:de()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Pc,Ec]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":de()}],"scrollbar-track-color":[{"scrollbar-track":de()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Pc,Ec]}],fill:[{fill:[`none`,...de()]}],"stroke-w":[{stroke:[bc,Fc,Dc,Oc]}],stroke:[{stroke:[`none`,...de()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},$c=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(el(e,`cacheSize`,t),el(e,`prefix`,n),el(e,`experimentalParseClassName`,r),tl(e.theme,a.theme),tl(e.classGroups,a.classGroups),tl(e.conflictingClassGroups,a.conflictingClassGroups),tl(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),el(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),el(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),nl(e.theme,i.theme),nl(e.classGroups,i.classGroups),nl(e.conflictingClassGroups,i.conflictingClassGroups),nl(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),rl(e,i,`postfixLookupClassGroups`),rl(e,i,`orderSensitiveModifiers`),e),el=(e,t,n)=>{n!==void 0&&(e[t]=n)},tl=(e,t)=>{if(t)for(let n in t)el(e,n,t[n])},nl=(e,t)=>{if(t)for(let n in t)rl(e,t,n)},rl=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},il=(e,...t)=>typeof e==`function`?hc(Qc,e,...t):hc(()=>$c(Qc(),e),...t),al=hc(Qc);function ol(...e){return al(Gi(e))}var sl=/\s+/g,cl=e=>typeof e!=`string`||!e?e:e.replace(sl,` `).trim(),ll=(...e)=>{let t=[],n=e=>{if(!e&&e!==0&&e!==0n)return;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)n(e[t]);return}let r=typeof e;if(r===`string`||r===`number`||r===`bigint`){if(r===`number`&&e!==e)return;t.push(String(e))}else if(r===`object`){let n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r];e[i]&&t.push(i)}}};for(let t=0,r=e.length;t<r;t++){let r=e[t];r!=null&&n(r)}return t.length>0?cl(t.join(` `)):void 0},ul=e=>e===!1?`false`:e===!0?`true`:e===0?`0`:e,dl=e=>{if(!e||typeof e!=`object`)return!0;for(let t in e)return!1;return!0},fl=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){let a=n[i];if(!r.includes(a)||e[a]!==t[a])return!1}return!0},pl=(e,t)=>{for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];n in e?e[n]=ll(e[n],r):e[n]=r}return e},ml=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?ml(r,t):r&&t.push(r)}},hl=(...e)=>{let t=[];ml(e,t);let n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(t[e]);return n},gl=(e,t)=>{let n={};for(let r in e){let i=e[r];if(r in t){let e=t[r];Array.isArray(i)||Array.isArray(e)?n[r]=hl(e,i):typeof i==`object`&&typeof e==`object`&&i&&e?n[r]=gl(i,e):n[r]=e+` `+i}else n[r]=i}for(let r in t)r in e||(n[r]=t[r]);return n},_l={twMerge:!0,twMergeConfig:{}};function vl(){let e=null,t={},n=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(t){e=t},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(e){t=e},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(e){n=e},reset(){e=null,t={},n=!1}}}var yl=vl(),bl=e=>{let t=(t,n)=>{let{extend:r=null,slots:i={},variants:a={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:c={}}=t,l={..._l,...n},u=r?.base?ll(r.base,t?.base):t?.base,d=r?.variants&&!dl(r.variants)?gl(a,r.variants):a,f=r?.defaultVariants&&!dl(r.defaultVariants)?{...r.defaultVariants,...c}:c;!dl(l.twMergeConfig)&&!fl(l.twMergeConfig,yl.cachedTwMergeConfig)&&(yl.didTwMergeConfigChange=!0,yl.cachedTwMergeConfig=l.twMergeConfig);let p=dl(r?.slots),m=dl(i)?{}:{base:ll(t?.base,p&&r?.base),...i},h=p?m:pl({...r?.slots},dl(m)?{base:t?.base}:m),g=dl(r?.compoundVariants)?o:hl(r?.compoundVariants,o),_=t=>{if(dl(d)&&dl(i)&&p)return e(u,t?.class,t?.className)(l);if(g&&!Array.isArray(g))throw TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof g}`);if(s&&!Array.isArray(s))throw TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let n=(e,n=d,r=null,i=null)=>{let a=n[e];if(!a||dl(a))return null;let o=i?.[e]??t?.[e];if(o===null)return null;let s=ul(o);if(typeof s==`object`)return null;let c=f?.[e];return a[(s??ul(c))||`false`]},r=()=>{if(!d)return null;let e=Object.keys(d),t=[];for(let r=0;r<e.length;r++){let i=n(e[r],d);i&&t.push(i)}return t},a=(e,t)=>{if(!d||typeof d!=`object`)return null;let r=[];for(let i in d){let a=n(i,d,e,t),o=e===`base`&&typeof a==`string`?a:a&&a[e];o&&r.push(o)}return r},o={};for(let e in t){let n=t[e];n!==void 0&&(o[e]=n)}let c=(e,n)=>{let r=typeof t?.[e]==`object`?{[e]:t[e]?.initial}:{};return{...f,...o,...r,...n}},m=(e=[],t)=>{let n=[],r=e.length;for(let i=0;i<r;i++){let{class:r,className:a,...o}=e[i],s=!0,l=c(null,t);for(let e in o){let t=o[e],n=l[e];if(Array.isArray(t)){if(!t.includes(n)){s=!1;break}}else{if((t==null||t===!1)&&(n==null||n===!1))continue;if(n!==t){s=!1;break}}}s&&(r&&n.push(r),a&&n.push(a))}return n},_=t=>{let n=m(g,t);if(!Array.isArray(n))return n;let r={},i=e;for(let e=0;e<n.length;e++){let t=n[e];if(typeof t==`string`)r.base=i(r.base,t)(l);else if(typeof t==`object`)for(let e in t)r[e]=i(r[e],t[e])(l)}return r},v=e=>{if(s.length<1)return null;let t={},n=c(null,e);for(let e=0;e<s.length;e++){let{slots:r=[],class:i,className:a,...o}=s[e];if(!dl(o)){let e=!0;for(let t in o){let r=n[t],i=o[t];if(r===void 0||(Array.isArray(i)?!i.includes(r):i!==r)){e=!1;break}}if(!e)continue}for(let e=0;e<r.length;e++){let n=r[e];t[n]||(t[n]=[]),t[n].push([i,a])}}return t};if(!dl(i)||!p){let t={};if(typeof h==`object`&&!dl(h)){let n=e;for(let e in h)t[e]=t=>{let r=_(t),i=v(t);return n(h[e],a(e,t),r?r[e]:void 0,i?i[e]:void 0,t?.class,t?.className)(l)}}return t}return e(u,r(),m(g),t?.class,t?.className)(l)};return _.variantKeys=(()=>{if(!(!d||typeof d!=`object`))return Object.keys(d)})(),_.extend=r,_.base=u,_.slots=h,_.variants=d,_.defaultVariants=f,_.compoundSlots=s,_.compoundVariants=g,_};return{tv:t,createTV:e=>(n,r)=>t(n,r?gl(e,r):e)}},xl=e=>dl(e)?al:il({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),Sl=(e,t)=>{let n=ll(e);return!n||!(t?.twMerge??!0)?n:((!yl.cachedTwMerge||yl.didTwMergeConfigChange)&&(yl.didTwMergeConfigChange=!1,yl.cachedTwMerge=xl(yl.cachedTwMergeConfig)),yl.cachedTwMerge(n)||void 0)},{createTV:Hte,tv:Cl}=bl((...e)=>t=>Sl(e,t)),wl=Cl({base:`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 data-[active]:bg-muted data-[active]:text-foreground [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,success:`bg-success text-success-foreground hover:bg-success/80 focus-visible:ring-success/30 focus-visible:border-success/40`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),Tl=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`variant`,`size`,`ref`,`href`,`type`,`disabled`,`active`,`pressed`,`ariaLabel`,`children`]),El=L(`<a><!></a>`),Dl=L(`<button><!></button>`);function Ol(e,t){D(t,!0);let n=q(t,`variant`,3,`default`),r=q(t,`size`,3,`default`),i=q(t,`ref`,15,null),a=q(t,`href`,3,void 0),o=q(t,`type`,3,`button`),s=q(t,`active`,3,!1),c=G(t,Tl);var l=R(),u=N(l),d=e=>{var o=El();_a(o,e=>({"data-slot":`button`,class:e,href:t.disabled?void 0:a(),"aria-disabled":t.disabled,"aria-label":t.ariaLabel,"aria-pressed":t.pressed,"data-active":s()?``:void 0,role:t.disabled?`link`:void 0,tabindex:t.disabled?-1:void 0,...c}),[()=>ol(wl({variant:n(),size:r()}),t.class)]),H(M(o),()=>t.children??w),T(o),Ta(o,e=>i(e),()=>i()),z(e,o)},f=e=>{var a=Dl();_a(a,e=>({"data-slot":`button`,class:e,type:o(),disabled:t.disabled,"aria-label":t.ariaLabel,"aria-pressed":t.pressed,"data-active":s()?``:void 0,...c}),[()=>ol(wl({variant:n(),size:r()}),t.class)]),H(M(a),()=>t.children??w),T(a),Ta(a,e=>i(e),()=>i()),z(e,a)};V(u,e=>{a()?e(d):e(f,-1)}),z(e,l),O()}var kl=Array(12).fill(0),Al=L(`<div class="sonner-loading-bar"></div>`),jl=L(`<div><div class="sonner-spinner"></div></div>`);function Ml(e,t){D(t,!0);var n=jl(),r=M(n);Ni(r,23,()=>kl,(e,t)=>`spinner-bar-${t}`,(e,t)=>{z(e,Al())}),T(r),T(n),F(e=>{Qi(n,1,e),W(n,`data-visible`,t.visible)},[()=>Ki([`sonner-loading-wrapper`,t.class].filter(Boolean).join(` `))]),z(e,n),O()}function Nl(...e){return e.filter(Boolean).join(` `)}var Pl=typeof document<`u`,Fl=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Il(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=Fl,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Vt(e=>{let n=hi(t,`focusin`,e),r=hi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Il(this.#e):null}};var Ll=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return St(this.#t)}get(){let e=bt(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=bt(this.#t);return t===void 0?e:t}set(e){return xt(this.#t,e)}};function Rl(e,t){switch(e){case`post`:rr(t);break;case`pre`:ar(t);break}}function zl(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Rl(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Zr(()=>n(t,o));return o=t,r})}function Bl(e,t,n){let r=or(()=>{let i=!1;zl(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});rr(()=>r)}function Vl(e,t,n){zl(e,`post`,t,n)}function Hl(e,t,n){zl(e,`pre`,t,n)}Vl.pre=Hl;function Ul(e,t){Bl(e,`post`,t)}function Wl(e,t){Bl(e,`pre`,t)}Ul.pre=Wl;function Gl(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function Kl(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function ql(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(Mn(o)),u=A(!1),d=A(void 0),f=A(Mn([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?Gl(h,s):c?Kl(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function Jl(e,t,n){return ql(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Vl(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function Yl(e,t,n){return ql(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Vl.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}Jl.pre=Yl,new Ll(`richColorsContext`);var Xl=new Ll(`<Toaster/>`),Zl=0,Ql=class{#e=A(Mn([]));get toasts(){return I(this.#e)}set toasts(e){j(this.#e,e,!0)}#t=A(Mn([]));get heights(){return I(this.#t)}set heights(e){j(this.#t,e,!0)}#n=e=>{let t=this.toasts.findIndex(t=>t.id===e);return t===-1?null:t};addToast=e=>{Pl&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:n,message:r})=>{let i=this.toasts.findIndex(t=>t.id===e),a=this.toasts[i];this.toasts[i]={...a,...t,id:e,title:r,type:n,updated:!0}};create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id&&e.id?.length>0?e.id:Zl++,i=e.dismissible===void 0?e.dismissable===void 0?!0:e.dismissable:e.dismissible,a=e.type===void 0?`default`:e.type;return Zr(()=>{this.toasts.find(e=>e.id===r)?this.updateToast({id:r,data:e,type:a,message:t,dismissible:i}):this.addToast({...n,id:r,title:t,dismissible:i,type:a})}),r};dismiss=e=>(Zr(()=>{if(e===void 0){this.toasts=this.toasts.map(e=>({...e,dismiss:!0}));return}let t=this.toasts.findIndex(t=>t.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}let t=this.#n(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:`default`,message:e});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:typeof t.loading==`string`?t.loading:t.loading()}));let r=e instanceof Promise?e:e(),i=n!==void 0;return r.then(e=>{if(typeof e==`object`&&e&&`ok`in e&&typeof e.ok==`boolean`&&!e.ok){i=!1;let t=$l(e);this.create({id:n,type:`error`,message:t})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?t.success(e):t.success;this.create({id:n,type:`success`,message:r})}}).catch(e=>{if(t.error!==void 0){i=!1;let r=typeof t.error==`function`?t.error(e):t.error;this.create({id:n,type:`error`,message:r})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),n};custom=(e,t)=>{let n=t?.id||Zl++;return this.create({component:e,id:n,...t}),n};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{let t=this.#n(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}};function $l(e){return e&&typeof e==`object`&&`status`in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}var eu=new Ql;function tu(e,t){return eu.create({message:e,...t})}var nu=class{#e=k(()=>eu.toasts.filter(e=>!e.dismiss));get toasts(){return I(this.#e)}},ru=Object.assign(tu,{success:eu.success,info:eu.info,warning:eu.warning,error:eu.error,custom:eu.custom,message:eu.message,promise:eu.promise,dismiss:eu.dismiss,loading:eu.loading,getActiveToasts:()=>eu.toasts.filter(e=>!e.dismiss)});function iu(e){return e.label!==void 0}function au(){let e=A(Mn(typeof document<`u`?document.hidden:!1));return rr(()=>hi(document,`visibilitychange`,()=>{j(e,document.hidden,!0)})),{get current(){return I(e)}}}var ou=4e3,su=14,cu=45,lu=200,uu=.05,du={toast:``,title:``,description:``,loader:``,closeButton:``,cancelButton:``,actionButton:``,action:``,warning:``,error:``,success:``,default:``,info:``,loading:``};function fu(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function pu(e){return 1/(1.5+Math.abs(e)/20)}new Set(`$$slots.$$events.$$legacy.toast.index.expanded.invert.position.visibleToasts.expandByDefault.closeButton.interacting.cancelButtonStyle.actionButtonStyle.duration.descriptionClass.classes.unstyled.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.defaultRichColors.swipeDirections.closeButtonAriaLabel.pauseWhenPageIsHidden`.split(`.`));var mu=L(`<div><!></div>`),hu=L(`<button data-close-button=""><!></button>`),gu=L(`<div data-icon=""><!> <!></div>`),_u=L(`<div data-description=""><!></div>`),vu=L(`<button data-button="" data-cancel=""> </button>`),yu=L(`<button data-button=""> </button>`),bu=L(`<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>`,1),xu=L(`<li aria-atomic="true" data-sonner-toast=""><!> <!></li>`);function Su(e,t){D(t,!0);let n=e=>{var n=R(),r=N(n),i=e=>{var n=mu();H(M(n),()=>t.loadingIcon),T(n),F(e=>{Qi(n,1,e),W(n,`data-visible`,I(S)===`loading`)},[()=>Ki(Nl(I(de)?.loader,t.toast?.classes?.loader,`sonner-loader`))]),z(e,n)},a=e=>{{let n=k(()=>Nl(I(de)?.loader,t.toast.classes?.loader)),r=k(()=>I(S)===`loading`);Ml(e,{get class(){return I(n)},get visible(){return I(r)}})}};V(r,e=>{t.loadingIcon?e(i):e(a,-1)}),z(e,n)},r=q(t,`cancelButtonStyle`,3,``),i=q(t,`actionButtonStyle`,3,``),a=q(t,`descriptionClass`,3,``),o=q(t,`unstyled`,3,!1),s=q(t,`defaultRichColors`,3,!1),c={...du},l=A(!1),u=A(!1),d=A(!1),f=A(!1),p=A(!1),m=A(0),h=A(0),g=t.toast.duration||t.duration||ou,_=A(void 0),v=A(null),y=A(null),b=k(()=>t.index===0),x=k(()=>t.index+1<=t.visibleToasts),S=k(()=>t.toast.type),ee=k(()=>t.toast.dismissible===void 0?t.toast.dismissable!==!1:t.toast.dismissible!==!1),C=k(()=>t.toast.class||``),te=k(()=>t.toast.descriptionClass||``),ne=k(()=>eu.heights.findIndex(e=>e.toastId===t.toast.id)||0),re=k(()=>t.toast.closeButton??t.closeButton),ie=k(()=>t.toast.duration??t.duration??ou),ae=null,oe=k(()=>t.position.split(`-`)),se=k(()=>eu.heights.reduce((e,t,n)=>n>=I(ne)?e:e+t.height,0)),ce=au(),le=k(()=>t.toast.invert||t.invert),ue=k(()=>I(S)===`loading`),de=k(()=>({...c,...t.classes})),fe=k(()=>t.toast.title),pe=k(()=>t.toast.description),me=A(0),he=A(0),ge=k(()=>Math.round(I(ne)*su+I(se)));rr(()=>{I(fe),I(pe);let e;e=t.expanded||t.expandByDefault?1:1-t.index*uu;let n=Zr(()=>I(_));if(n===void 0)return;n.style.setProperty(`height`,`auto`);let r=n.offsetHeight,i=n.getBoundingClientRect().height,a=Math.round(i/e+2**-52&100)/100;n.style.removeProperty(`height`);let o;o=Math.abs(a-r)<1?a:r,j(h,o,!0),eu.setHeight({toastId:t.toast.id,height:o})});function _e(){j(u,!0),j(m,I(ge),!0),eu.removeHeight(t.toast.id),setTimeout(()=>{eu.remove(t.toast.id)},lu)}let ve,ye=k(()=>t.toast.promise&&I(S)===`loading`||t.toast.duration===1/0);function be(){j(me,new Date().getTime(),!0),ve=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),_e()},g)}function xe(){if(I(he)<I(me)){let e=new Date().getTime()-I(me);g-=e}j(he,new Date().getTime(),!0)}rr(()=>{t.toast.updated&&(clearTimeout(ve),g=I(ie),I(ye)||be())}),rr(()=>(I(ye)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&ce.current?xe():be()),()=>clearTimeout(ve))),Oa(()=>{j(l,!0);let e=I(_)?.getBoundingClientRect().height;return j(h,e,!0),eu.setHeight({toastId:t.toast.id,height:e}),()=>{eu.removeHeight(t.toast.id)}}),rr(()=>{t.toast.delete&&Zr(()=>{_e(),t.toast.onDismiss?.(t.toast)})});let Se=e=>{if(I(ue))return;j(m,I(ge),!0);let t=e.target;t.setPointerCapture(e.pointerId),t.tagName!==`BUTTON`&&(j(d,!0),ae={x:e.clientX,y:e.clientY})},Ce=()=>{if(I(f)||!I(ee))return;ae=null;let e=Number(I(_)?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),n=Number(I(_)?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-0,i=I(v)===`x`?e:n,a=Math.abs(i)/r;if(Math.abs(i)>=cu||a>.11){j(m,I(ge),!0),t.toast.onDismiss?.(t.toast),I(v)===`x`?j(y,e>0?`right`:`left`,!0):j(y,n>0?`down`:`up`,!0),_e(),j(f,!0);return}else I(_)?.style.setProperty(`--swipe-amount-x`,`0px`),I(_)?.style.setProperty(`--swipe-amount-y`,`0px`);j(p,!1),j(d,!1),j(v,null)},we=e=>{if(!ae||!I(ee)||(window.getSelection()?.toString().length??-1)>0)return;let n=e.clientY-ae.y,r=e.clientX-ae.x,i=t.swipeDirections??fu(t.position);!I(v)&&(Math.abs(r)>1||Math.abs(n)>1)&&j(v,Math.abs(r)>Math.abs(n)?`x`:`y`,!0);let a={x:0,y:0};if(I(v)===`y`){if(i.includes(`top`)||i.includes(`bottom`))if(i.includes(`top`)&&n<0||i.includes(`bottom`)&&n>0)a.y=n;else{let e=n*pu(n);a.y=Math.abs(e)<Math.abs(n)?e:n}}else if(I(v)===`x`&&(i.includes(`left`)||i.includes(`right`)))if(i.includes(`left`)&&r<0||i.includes(`right`)&&r>0)a.x=r;else{let e=r*pu(r);a.x=Math.abs(e)<Math.abs(r)?e:r}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&j(p,!0),I(_)?.style.setProperty(`--swipe-amount-x`,`${a.x}px`),I(_)?.style.setProperty(`--swipe-amount-y`,`${a.y}px`)},Te=()=>{j(d,!1),j(v,null),ae=null},Ee=k(()=>t.toast.icon?t.toast.icon:I(S)===`success`?t.successIcon:I(S)===`error`?t.errorIcon:I(S)===`warning`?t.warningIcon:I(S)===`info`?t.infoIcon:I(S)===`loading`?t.loadingIcon:null);var De=xu();W(De,`tabindex`,0);let Oe;var ke=M(De),Ae=e=>{var n=hu();H(M(n),()=>t.closeIcon??w),T(n),F(e=>{W(n,`aria-label`,t.closeButtonAriaLabel),W(n,`data-disabled`,I(ue)),Qi(n,1,e)},[()=>Ki(Nl(I(de)?.closeButton,t.toast?.classes?.closeButton))]),_i(`click`,n,()=>{I(ue)||!I(ee)||(_e(),t.toast.onDismiss?.(t.toast))}),z(e,n)};V(ke,e=>{I(re)&&!t.toast.component&&I(S)!==`loading`&&t.closeIcon!==null&&e(Ae)});var je=P(ke,2),Me=e=>{let n=k(()=>t.toast.component);var r=R();U(N(r),()=>I(n),(e,n)=>{n(e,K(()=>t.toast.componentProps,{closeToast:_e}))}),z(e,r)},Ne=e=>{var o=bu(),s=N(o),c=e=>{var r=gu(),i=M(r),a=e=>{var r=R(),i=N(r),a=e=>{var n=R();U(N(n),()=>t.toast.icon,(e,t)=>{t(e,{})}),z(e,n)},o=e=>{n(e)};V(i,e=>{t.toast.icon?e(a):e(o,-1)}),z(e,r)};V(i,e=>{(t.toast.promise||I(S)===`loading`)&&e(a)});var o=P(i,2),s=e=>{var n=R(),r=N(n),i=e=>{var n=R();U(N(n),()=>t.toast.icon,(e,t)=>{t(e,{})}),z(e,n)},a=e=>{var n=R();H(N(n),()=>t.successIcon??w),z(e,n)},o=e=>{var n=R();H(N(n),()=>t.errorIcon??w),z(e,n)},s=e=>{var n=R();H(N(n),()=>t.warningIcon??w),z(e,n)},c=e=>{var n=R();H(N(n),()=>t.infoIcon??w),z(e,n)};V(r,e=>{t.toast.icon?e(i):I(S)===`success`?e(a,1):I(S)===`error`?e(o,2):I(S)===`warning`?e(s,3):I(S)===`info`&&e(c,4)}),z(e,n)};V(o,e=>{t.toast.type!==`loading`&&e(s)}),T(r),F(e=>Qi(r,1,e),[()=>Ki(Nl(I(de)?.icon,t.toast?.classes?.icon))]),z(e,r)};V(s,e=>{(I(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(I(Ee)!==null||t.toast.icon)&&e(c)});var l=P(s,2),u=M(l),d=M(u),f=e=>{var n=R(),r=N(n),i=e=>{let n=k(()=>t.toast.title);var r=R();U(N(r),()=>I(n),(e,n)=>{n(e,K(()=>t.toast.componentProps))}),z(e,r)},a=e=>{var n=wi();F(()=>B(n,t.toast.title)),z(e,n)};V(r,e=>{typeof t.toast.title==`string`?e(a,-1):e(i)}),z(e,n)};V(d,e=>{t.toast.title&&e(f)}),T(u);var p=P(u,2),m=e=>{var n=_u(),r=M(n),i=e=>{let n=k(()=>t.toast.description);var r=R();U(N(r),()=>I(n),(e,n)=>{n(e,K(()=>t.toast.componentProps))}),z(e,r)},o=e=>{var n=wi();F(()=>B(n,t.toast.description)),z(e,n)};V(r,e=>{typeof t.toast.description==`string`?e(o,-1):e(i)}),T(n),F(e=>Qi(n,1,e),[()=>Ki(Nl(a(),I(te),I(de)?.description,t.toast.classes?.description))]),z(e,n)};V(p,e=>{t.toast.description&&e(m)}),T(l);var h=P(l,2),g=e=>{var n=R(),i=N(n),a=e=>{var n=R();U(N(n),()=>t.toast.cancel,(e,t)=>{t(e,{})}),z(e,n)},o=e=>{var n=vu(),i=M(n,!0);T(n),F(e=>{ea(n,t.toast.cancelButtonStyle??r()),Qi(n,1,e),B(i,t.toast.cancel.label)},[()=>Ki(Nl(I(de)?.cancelButton,t.toast?.classes?.cancelButton))]),_i(`click`,n,e=>{iu(t.toast.cancel)&&I(ee)&&(t.toast.cancel?.onClick?.(e),_e())}),z(e,n)},s=k(()=>iu(t.toast.cancel));V(i,e=>{typeof t.toast.cancel==`function`?e(a):I(s)&&e(o,1)}),z(e,n)};V(h,e=>{t.toast.cancel&&e(g)});var _=P(h,2),v=e=>{var n=R(),r=N(n),a=e=>{var n=R();U(N(n),()=>t.toast.action,(e,t)=>{t(e,{})}),z(e,n)},o=e=>{var n=yu(),r=M(n,!0);T(n),F(e=>{ea(n,t.toast.actionButtonStyle??i()),Qi(n,1,e),B(r,t.toast.action.label)},[()=>Ki(Nl(I(de)?.actionButton,t.toast?.classes?.actionButton))]),_i(`click`,n,e=>{iu(t.toast.action)&&(t.toast.action?.onClick(e),!e.defaultPrevented&&_e())}),z(e,n)},s=k(()=>iu(t.toast.action));V(r,e=>{typeof t.toast.action==`function`?e(a):I(s)&&e(o,1)}),z(e,n)};V(_,e=>{t.toast.action&&e(v)}),F((e,t)=>{Qi(l,1,e),Qi(u,1,t)},[()=>Ki(Nl(I(de)?.content,t.toast?.classes?.content)),()=>Ki(Nl(I(de)?.title,t.toast?.classes?.title))]),z(e,o)};V(je,e=>{t.toast.component?e(Me):e(Ne,-1)}),T(De),Ta(De,e=>j(_,e),()=>I(_)),F((e,n,r)=>{Qi(De,1,e),W(De,`aria-live`,t.toast.important?`assertive`:`polite`),W(De,`data-rich-colors`,t.toast.richColors??s()),W(De,`data-styled`,!(t.toast.component||t.toast.unstyled||o())),W(De,`data-mounted`,I(l)),W(De,`data-promise`,n),W(De,`data-swiped`,I(p)),W(De,`data-removed`,I(u)),W(De,`data-visible`,I(x)),W(De,`data-y-position`,I(oe)[0]),W(De,`data-x-position`,I(oe)[1]),W(De,`data-index`,t.index),W(De,`data-front`,I(b)),W(De,`data-swiping`,I(d)),W(De,`data-dismissible`,I(ee)),W(De,`data-type`,I(S)),W(De,`data-invert`,I(le)),W(De,`data-swipe-out`,I(f)),W(De,`data-swipe-direction`,I(y)),W(De,`data-expanded`,r),Oe=ea(De,`${t.style} ${t.toast.style}`,Oe,{"--index":t.index,"--toasts-before":t.index,"--z-index":eu.toasts.length-t.index,"--offset":`${I(u)?I(m):I(ge)}px`,"--initial-height":t.expandByDefault?`auto`:`${I(h)}px`})},[()=>Ki(Nl(t.class,I(C),I(de)?.toast,t.toast?.classes?.toast,I(de)?.[I(S)],t.toast?.classes?.[I(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&I(l))]),_i(`pointermove`,De,we),_i(`pointerup`,De,Ce),_i(`pointerdown`,De,Se),gi(`dragend`,De,Te),z(e,De),O()}vi([`pointermove`,`pointerup`,`pointerdown`,`click`]);var Cu=Ci(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>`);function wu(e){z(e,Cu())}var Tu=Ci(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`);function Eu(e){z(e,Tu())}var Du=Ci(`<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>`);function Ou(e){z(e,Du())}var ku=Ci(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>`);function Au(e){z(e,ku())}var ju=Ci(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`);function Mu(e){z(e,ju())}var Nu=3,Pu=`24px`,Fu=`16px`,Iu=4e3,Lu=356,Ru=14,zu=`dark`,Bu=`light`;function Vu(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Fu:Pu;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{let r=e[t];r===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof r==`number`?`${r}px`:r}):o(a)}),n}var Hu=new Set(`$$slots.$$events.$$legacy.invert.position.hotkey.expand.closeButton.offset.mobileOffset.theme.richColors.duration.visibleToasts.toastOptions.dir.gap.pauseWhenPageIsHidden.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.containerAriaLabel.class.closeButtonAriaLabel.onblur.onfocus.onmouseenter.onmousemove.onmouseleave.ondragend.onpointerdown.onpointerup`.split(`.`)),Uu=L(`<ol></ol>`),Wu=L(`<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-1bt1jes"><!></section>`);function Gu(e,t){D(t,!0);function n(e){return e===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?zu:Bu:e}let r=q(t,`invert`,3,!1),i=q(t,`position`,3,`bottom-right`),a=q(t,`hotkey`,19,()=>[`altKey`,`KeyT`]),o=q(t,`expand`,3,!1),s=q(t,`closeButton`,3,!1),c=q(t,`offset`,3,Pu),l=q(t,`mobileOffset`,3,Fu),u=q(t,`theme`,3,`light`),d=q(t,`richColors`,3,!1),f=q(t,`duration`,3,Iu),p=q(t,`visibleToasts`,3,Nu),m=q(t,`toastOptions`,19,()=>({})),h=q(t,`dir`,7,`auto`),g=q(t,`gap`,3,Ru),_=q(t,`pauseWhenPageIsHidden`,3,!1),v=q(t,`containerAriaLabel`,3,`Notifications`),y=q(t,`closeButtonAriaLabel`,3,`Close toast`),b=G(t,Hu);function x(){if(h()!==`auto`)return h();if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?(Zr(()=>h(window.getComputedStyle(document.documentElement).direction??`ltr`)),h()):(Zr(()=>h(e)),e)}let S=k(()=>Array.from(new Set([i(),...eu.toasts.filter(e=>e.position).map(e=>e.position)].filter(Boolean)))),ee=A(!1),C=A(!1),te=A(Mn(n(u()))),ne=A(void 0),re=A(null),ie=A(!1),ae=k(()=>a().join(`+`).replace(/Key/g,``).replace(/Digit/g,``));rr(()=>{eu.toasts.length<=1&&j(ee,!1)}),rr(()=>{let e=eu.toasts.filter(e=>e.dismiss&&!e.delete);e.length>0&&(eu.toasts=eu.toasts.map(t=>e.find(e=>e.id===t.id)?{...t,delete:!0}:t))}),rr(()=>()=>{I(ne)&&I(re)&&(I(re).focus({preventScroll:!0}),j(re,null),j(ie,!1))}),Oa(()=>(eu.reset(),hi(document,`keydown`,e=>{a().every(t=>e[t]||e.code===t)&&(j(ee,!0),I(ne)?.focus()),e.code===`Escape`&&(document.activeElement===I(ne)||I(ne)?.contains(document.activeElement))&&j(ee,!1)}))),rr(()=>{if(u()!==`system`&&j(te,u()),typeof window<`u`){u()===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(te,zu):j(te,Bu));let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=({matches:e})=>{u()===`system`&&j(te,e?zu:Bu,!0)};`addEventListener`in e?e.addEventListener(`change`,t):e.addListener(t)}});let oe=e=>{t.onblur?.(e),I(ie)&&!e.currentTarget.contains(e.relatedTarget)&&(j(ie,!1),I(re)&&(I(re).focus({preventScroll:!0}),j(re,null)))},se=e=>{t.onfocus?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&(I(ie)||(j(ie,!0),j(re,e.relatedTarget,!0)))},ce=e=>{t.onpointerdown?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&j(C,!0)},le=e=>{t.onmouseenter?.(e),j(ee,!0)},ue=e=>{t.onmouseleave?.(e),I(C)||j(ee,!1)},de=e=>{t.onmousemove?.(e),j(ee,!0)},fe=e=>{t.ondragend?.(e),j(ee,!1)},pe=e=>{t.onpointerup?.(e),j(C,!1)};Xl.set(new nu);var me=Wu();W(me,`tabindex`,-1);var he=M(me),ge=e=>{var n=R();Ni(N(n),18,()=>I(S),e=>e,(e,n,i,a)=>{let u=k(()=>{let[e,t]=n.split(`-`);return{y:e,x:t}}),h=k(()=>Vu(c(),l()));var v=Uu();_a(v,e=>({tabindex:-1,dir:e,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":I(te),"data-y-position":I(u).y,"data-x-position":I(u).x,style:t.style,onblur:oe,onfocus:se,onmouseenter:le,onmousemove:de,onmouseleave:ue,ondragend:fe,onpointerdown:ce,onpointerup:pe,...b,[aa]:{"--front-toast-height":`${eu.heights[0]?.height}px`,"--width":`${Lu}px`,"--gap":`${g()}px`,"--offset-top":I(h)[`--offset-top`],"--offset-right":I(h)[`--offset-right`],"--offset-bottom":I(h)[`--offset-bottom`],"--offset-left":I(h)[`--offset-left`],"--mobile-offset-top":I(h)[`--mobile-offset-top`],"--mobile-offset-right":I(h)[`--mobile-offset-right`],"--mobile-offset-bottom":I(h)[`--mobile-offset-bottom`],"--mobile-offset-left":I(h)[`--mobile-offset-left`]}}),[()=>x()],void 0,void 0,`svelte-1bt1jes`),Ni(v,23,()=>eu.toasts.filter(e=>!e.position&&I(i)===0||e.position===n),e=>e.id,(e,i,a,c)=>{{let c=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.successIcon??w),z(e,n)},a=e=>{wu(e,{})};V(r,e=>{t.successIcon?e(i):t.successIcon!==null&&e(a,1)}),z(e,n)},l=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.errorIcon??w),z(e,n)},a=e=>{Eu(e,{})};V(r,e=>{t.errorIcon?e(i):t.errorIcon!==null&&e(a,1)}),z(e,n)},u=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.warningIcon??w),z(e,n)},a=e=>{Ou(e,{})};V(r,e=>{t.warningIcon?e(i):t.warningIcon!==null&&e(a,1)}),z(e,n)},h=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.infoIcon??w),z(e,n)},a=e=>{Au(e,{})};V(r,e=>{t.infoIcon?e(i):t.infoIcon!==null&&e(a,1)}),z(e,n)},g=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.closeIcon??w),z(e,n)},a=e=>{Mu(e,{})};V(r,e=>{t.closeIcon?e(i):t.closeIcon!==null&&e(a,1)}),z(e,n)},v=k(()=>m()?.duration??f()),b=k(()=>m()?.class??``),x=k(()=>m()?.descriptionClass||``),S=k(()=>m()?.style??``),te=k(()=>m().classes||{}),ne=k(()=>m().unstyled??!1),re=k(()=>m()?.cancelButtonStyle??``),ie=k(()=>m()?.actionButtonStyle??``),ae=k(()=>m()?.closeButtonAriaLabel??y());Su(e,{get index(){return I(a)},get toast(){return I(i)},get defaultRichColors(){return d()},get duration(){return I(v)},get class(){return I(b)},get descriptionClass(){return I(x)},get invert(){return r()},get visibleToasts(){return p()},get closeButton(){return s()},get interacting(){return I(C)},get position(){return n},get style(){return I(S)},get classes(){return I(te)},get unstyled(){return I(ne)},get cancelButtonStyle(){return I(re)},get actionButtonStyle(){return I(ie)},get closeButtonAriaLabel(){return I(ae)},get expandByDefault(){return o()},get expanded(){return I(ee)},get pauseWhenPageIsHidden(){return _()},get loadingIcon(){return t.loadingIcon},successIcon:c,errorIcon:l,warningIcon:u,infoIcon:h,closeIcon:g,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),T(v),Ta(v,e=>j(ne,e),()=>I(ne)),F(()=>v.dir=v.dir),z(e,v)}),z(e,n)};V(he,e=>{eu.toasts.length>0&&e(ge)}),T(me),F(()=>W(me,`aria-label`,`${v()??``} ${I(ae)??``}`)),z(e,me),O()}var Ku=Ju(),qu=Mn({isDesktop:Ku!==void 0,platform:Ku?.platform,quitting:!1,windowState:{maximized:!1,focused:!0}});function Ju(){if(!(typeof window>`u`))return window.nerveDesktop?.kind===`electron`?window.nerveDesktop:void 0}function Yu(){return Ju()!==void 0}function Xu(){let e=Ju();if(qu.isDesktop=e!==void 0,qu.platform=e?.platform,!e)return()=>void 0;let t=()=>void 0,n=()=>void 0;return e.window.getState().then(e=>{qu.windowState=e}).catch(()=>void 0),t=e.window.onStateChange(e=>{qu.windowState=e}),n=e.app.onQuitStarted(()=>{qu.quitting=!0}),()=>{t(),n()}}async function Zu(){await Ju()?.window.minimize()}async function Qu(){await Ju()?.window.toggleMaximize()}async function $u(e){await Ju()?.window.close(e)}async function ed(e){await Ju()?.settings.setCloseToTray(e)}async function td(e){let t=Ju();return t?t.notifications.show(e).catch(()=>({shown:!1})):{shown:!1}}var nd=Mn({initialized:!1,browserSupported:!1,permission:`unsupported`,promptVisible:!1,promptDismissed:!1,lastRequestResult:void 0}),rd=!1,id={success(e,t={}){dd(`success`,e,t.description)},error(e,t={}){dd(`error`,e,t.description)},message(e,t={}){dd(`message`,e,t.description)}};function ad(e,t=`code block`){e?id.success(`Copied ${t}`):id.error(`Could not copy ${t}`)}function od(){pd(),nd.initialized=!0,!(rd||typeof window>`u`)&&(rd=!0,window.addEventListener(`focus`,pd),document.addEventListener(`visibilitychange`,pd))}async function sd(){if(!(Yu()||!hd()))try{nd.lastRequestResult=await Notification.requestPermission(),nd.promptDismissed=!0}finally{pd()}}function cd(){nd.promptDismissed=!0,pd()}function ld(e,t={}){ud(e,t.kind??(e.urgency===`attention`?`error`:`message`),t)}function ud(e,t,n){if(!(n.backgroundOnly&&vd())){if(pd(),Yu()){td(e);return}if(gd()){fd(e,n);return}dd(t,e.title,e.body)}}function dd(e,t,n){let r=n?{description:n}:void 0;e===`success`?ru.success(t,r):e===`error`?ru.error(t,r):ru.message(t,r)}function fd(e,t){try{let n=new Notification(e.title,{body:e.body,tag:t.tag});n.onclick=()=>{window.focus(),n.close()}}catch{}}function pd(){nd.browserSupported=hd(),nd.permission=_d(),nd.promptVisible=md()}function md(){return!Yu()&&nd.browserSupported&&nd.permission==="default"&&!nd.promptDismissed}function hd(){return typeof window<`u`&&`Notification`in window}function gd(){return hd()&&Notification.permission===`granted`}function _d(){return hd()?Notification.permission:`unsupported`}function vd(){return typeof document>`u`?!1:document.visibilityState===`visible`&&document.hasFocus()}var yd=L(`<aside class="fixed right-4 bottom-4 z-50 w-[min(24rem,calc(100vw-2rem))] rounded-lg border border-border bg-card p-4 text-card-foreground shadow-lg" aria-live="polite" aria-label="Notification permission"><div class="flex gap-3"><div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground"><!></div> <div class="min-w-0 flex-1 space-y-3"><div class="space-y-1"><h2 class="text-sm font-medium">Enable desktop notifications</h2> <p class="text-sm text-muted-foreground">Let Nerve alert you when an agent needs approval, asks a question, or finishes in the background.</p></div> <div class="flex flex-wrap justify-end gap-2"><!> <!></div></div></div></aside>`);function bd(e,t){D(t,!1),Ea();var n=R(),r=N(n),i=e=>{var t=yd(),n=M(t),r=M(n);ste(M(r),{class:`size-4`,strokeWidth:2}),T(r);var i=P(r,2),a=P(M(i),2),o=M(a);Ol(o,{variant:`ghost`,size:`sm`,get onclick(){return cd},children:(e,t)=>{E(),z(e,wi(`Not now`))},$$slots:{default:!0}}),Ol(P(o,2),{size:`sm`,onclick:()=>void sd(),children:(e,t)=>{E(),z(e,wi(`Enable notifications`))},$$slots:{default:!0}}),T(a),T(i),T(n),T(t),z(e,t)};V(r,e=>{nd.promptVisible&&e(i)}),z(e,n),O()}var xd=Mn({quitRequested:!1}),Sd=L(`<div class="shutdown-overlay" role="status" aria-live="polite"><div class="shutdown-card"><div class="shutdown-spinner" aria-hidden="true"></div> <strong>Closing Nerve…</strong> <span>Stopping the local daemon safely.</span></div></div>`);function Cd(e,t){D(t,!0);let n=k(()=>qu.quitting||xd.quitRequested);var r=R(),i=N(r),a=e=>{z(e,Sd())};V(i,e=>{qu.isDesktop&&I(n)&&e(a)}),z(e,r),O()}var wd=new Set([`$$slots`,`$$events`,`$$legacy`]);function Td(e,t){let n=G(t,wd),r=[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}]];ic(e,K({name:`git-branch`},()=>n,{get iconNode(){return r}}))}var Ed=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dd(e,t){let n=G(t,Ed),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];ic(e,K({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var Od=new Set([`$$slots`,`$$events`,`$$legacy`]);function kd(e,t){let n=G(t,Od),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`m16 15-3-3 3-3`}]];ic(e,K({name:`panel-left-close`},()=>n,{get iconNode(){return r}}))}var Ad=new Set([`$$slots`,`$$events`,`$$legacy`]);function jd(e,t){let n=G(t,Ad),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}]];ic(e,K({name:`panel-right`},()=>n,{get iconNode(){return r}}))}var Md=new Set([`$$slots`,`$$events`,`$$legacy`]);function Nd(e,t){let n=G(t,Md),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}],[`path`,{d:`m8 9 3 3-3 3`}]];ic(e,K({name:`panel-right-close`},()=>n,{get iconNode(){return r}}))}var Pd=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fd(e,t){let n=G(t,Pd),r=[[`path`,{d:`M12 19h8`}],[`path`,{d:`m4 17 6-6-6-6`}]];ic(e,K({name:`terminal`},()=>n,{get iconNode(){return r}}))}var Id=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ld(e,t){let n=G(t,Id),r=[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}],[`path`,{d:`M12 9v4`}],[`path`,{d:`M12 17h.01`}]];ic(e,K({name:`triangle-alert`},()=>n,{get iconNode(){return r}}))}function Rd(e,t){if(!e)return``;let n=zd(e),r=``,i=t?zd(t):void 0;i&&(Vd(n,i)||Hd(n,i))?(n=n.slice(i.length),r=`~`):n.startsWith(`/`)&&(r=``);let a=n.split(`/`).filter(Boolean);if(a.length===0)return r||n||`/`;let o=a[a.length-1],s=a.slice(0,-1).map(e=>{let[t]=Array.from(e);return t??``});return[...r?[r,...s]:s,o].join(`/`)}function zd(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)||e}function Bd(e){let t=zd(e);return/^[A-Za-z]:\//.test(t)?t.toLowerCase():t}function Vd(e,t){return Bd(e)===Bd(t)}function Hd(e,t){return Bd(e).startsWith(`${Bd(t)}/`)}function Ud(e,t){if(!e||!t)return!1;let n=zd(e),r=zd(t);return Vd(n,r)||Hd(n,r)}function Wd(e,t){if(!e)return``;let n=zd(e),r=t?zd(t):void 0;return r&&Vd(n,r)?`~`:r&&Hd(n,r)?`~${n.slice(r.length)}`:n||e||`/`}function Gd(e){return Bd(e)}function Kd(e){let t=e.trim();return t?t.startsWith(`/`)||t.startsWith(`~`)||t.startsWith(`\\\\`)||/^[A-Za-z]:[\\/]?/.test(t)||t.includes(`/`)||t.includes(`\\`)||t.toLowerCase().startsWith(`file://`):!1}function qd(e){return(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`))&&e.includes(`\\`)?`\\`:`/`}function Jd(e,t,n){return e.endsWith(n)?`${e}${t}`:`${e}${n}${t}`}function Yd(e,t){let n=e.match(/^([A-Za-z]:)[\\/]/);if(n){let e=n[1]??``;return{label:e,path:`${e}${t}`}}let r=e.match(/^[\\/]{2}([^\\/]+)[\\/]+([^\\/]+)/);if(r){let e=`${t}${t}${r[1]}${t}${r[2]}`;return{label:e,path:e}}if(e.startsWith(`/`))return{label:`/`,path:`/`}}function Xd(e,t){if(!e)return[];let n=e.trim();if(!n)return[];let r=qd(n),i=zd(n),a=[],o,s,c=t?zd(t):void 0;if(c&&(Vd(i,c)||Hd(i,c)))o=t?.replace(/[\\/]+$/,``)||(t??`~`),a.push({label:`~`,path:o}),s=i.slice(c.length);else{let e=Yd(n,r);e?(o=e.path,a.push({label:e.label,path:e.path}),s=i.slice(zd(e.path).length)):(o=``,s=i)}for(let e of s.split(`/`).filter(Boolean))o=o?Jd(o,e,r):e,a.push({label:e,path:o});return a}function Zd(e){return e<1e3?e.toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:e<1e7?`${(e/1e6).toFixed(1)}M`:`${Math.round(e/1e6)}M`}function Qd(e){return e==null?`neutral`:e>90?`error`:e>70?`warning`:`neutral`}function $d(e){if(e==null||!Number.isFinite(e)||e<0)return null;let t=Math.floor(e);if(t===0)return`0m`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60,a=[];return n>0&&a.push(`${n}d`),r>0&&a.push(`${r}h`),i>0&&a.push(`${i}m`),a.join(` `)}function ef(e){if(!e)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:nf(t-Date.now())}function tf(e){return e==null||e<=0?null:nf(e*1e3)}function nf(e){return e<=0?null:$d(Math.floor(e/6e4))}var rf=Cl({base:`h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none`,variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`},tone:{neutral:`border-border bg-secondary text-muted-foreground`,accent:`border-border bg-accent text-foreground`,running:`border-info/40 bg-info/15 text-info`,good:`border-success/40 bg-success/15 text-success`,warn:`border-warning/40 bg-warning/15 text-warning`,danger:`border-destructive/40 bg-destructive/15 text-destructive`},size:{xs:`px-1.5 py-px text-xs`,sm:`px-2 py-0.5 text-xs`}}}),af=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`href`,`class`,`variant`,`tone`,`size`,`children`]);function of(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,af);var i=R();Bi(N(i),()=>t.href?`a`:`span`,!1,(e,i)=>{Ta(e,e=>n(e),()=>n()),_a(e,e=>({"data-slot":`badge`,href:t.href,class:e,...r}),[()=>ol(rf({variant:t.variant,tone:t.tone,size:t.size}),t.class)]);var a=R();H(N(a),()=>t.children??w),z(i,a)}),z(e,i),O()}function sf(e){return typeof e==`function`}function cf(e){return typeof e==`object`&&!!e}var lf=[`string`,`number`,`bigint`,`boolean`];function uf(e){return e==null||lf.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>uf(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var df=Symbol(`box`),ff=Symbol(`is-writable`);function J(e,t){let n=k(e);return t?{[df]:!0,[ff]:!0,get current(){return I(n)},set current(e){t(e)}}:{[df]:!0,get current(){return e()}}}function pf(e){return cf(e)&&df in e}function mf(e){return pf(e)&&ff in e}function hf(e){return pf(e)?e:sf(e)?J(e):vf(e)}function gf(e){return Object.entries(e).reduce((e,[t,n])=>pf(n)?(mf(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function _f(e){return mf(e)?{[df]:!0,get current(){return e.current}}:e}function vf(e){let t=A(Mn(e));return{[df]:!0,[ff]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}function yf(e){let t=A(Mn(e));return{[df]:!0,[ff]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}yf.from=hf,yf.with=J,yf.flatten=gf,yf.readonly=_f,yf.isBox=pf,yf.isWritableBox=mf;function bf(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var xf=/\d/,Sf=[`-`,`_`,`/`,`.`];function Cf(e=``){if(!xf.test(e))return e!==e.toLowerCase()}function wf(e){let t=[],n=``,r,i;for(let a of e){let e=Sf.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Cf(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function Tf(e){return e?wf(e).map(e=>Df(e)).join(``):``}function Ef(e){return Of(Tf(e||``))}function Df(e){return e?e[0].toUpperCase()+e.slice(1):``}function Of(e){return e?e[0].toLowerCase()+e.slice(1):``}function kf(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[Tf(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Ef(e)]=n}return ws(e,n),t}function Af(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function jf(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Mf=jf(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Nf(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Mf(t)}: ${e[t]};`).join(`
|
|
13
|
-
`)}function Pf(e={}){return Nf(e).replace(`
|
|
14
|
-
`,` `)}var Ff=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function If(e){return Ff.has(e)}function Lf(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&If(e))t[e]=bf(n,i);else if(a&&o)t[e]=Af(n,i);else if(e===`class`){let r=uf(n),a=uf(i);r&&a?t[e]=Gi(n,i):r?t[e]=Gi(n):a&&(t[e]=Gi(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=kf(i);t[e]={...n,...r}}else if(o&&a)t[e]={...kf(n),...i};else if(o&&s){let r=kf(n),a=kf(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=Pf(t.style).replaceAll(`
|
|
15
|
-
`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var Rf={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`};Pf(Rf);var zf=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Bf(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=zf,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Vt(e=>{let n=hi(t,`focusin`,e),r=hi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Bf(this.#e):null}};function Vf(e){return typeof e==`function`}function Hf(e,t){if(Vf(e)){let n=e();return n===void 0?t:n}return e===void 0?t:e}var Uf=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return St(this.#t)}get(){let e=bt(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=bt(this.#t);return t===void 0?e:t}set(e){return xt(this.#t,e)}};function Wf(e,t){let n=A(null),r=k(()=>Hf(t,250));function i(...t){if(I(n))I(n).timeout&&clearTimeout(I(n).timeout);else{let e,t;j(n,{timeout:null,runner:null,promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t},!0)}return I(n).runner=async()=>{if(!I(n))return;let r=I(n);j(n,null);try{r.resolve(await e.apply(this,t))}catch(e){r.reject(e)}},I(n).timeout=setTimeout(I(n).runner,I(r)),I(n).promise}return i.cancel=async()=>{(!I(n)||I(n).timeout===null)&&(await new Promise(e=>setTimeout(e,0)),!I(n)||I(n).timeout===null)||(clearTimeout(I(n).timeout),I(n).reject(`Cancelled`),j(n,null))},i.runScheduledNow=async()=>{(!I(n)||!I(n).timeout)&&(await new Promise(e=>setTimeout(e,0)),!I(n)||!I(n).timeout)||(clearTimeout(I(n).timeout),I(n).timeout=null,await I(n).runner?.())},Object.defineProperty(i,"pending",{enumerable:!0,get(){return!!I(n)?.timeout}}),i}function Gf(e,t){switch(e){case`post`:rr(t);break;case`pre`:ar(t);break}}function Kf(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Gf(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Zr(()=>n(t,o));return o=t,r})}function qf(e,t,n){let r=or(()=>{let i=!1;Kf(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});rr(()=>r)}function Jf(e,t,n){Kf(e,`post`,t,n)}function Yf(e,t,n){Kf(e,`pre`,t,n)}Jf.pre=Yf;function Xf(e,t){qf(e,`post`,t)}function Zf(e,t){qf(e,`pre`,t)}Xf.pre=Zf;function Qf(e){return Vf(e)?e():e}var $f=class{#e={width:0,height:0};#t=!1;#n;#r;#i;#a=k(()=>(I(this.#s)?.(),this.getSize().width));#o=k(()=>(I(this.#s)?.(),this.getSize().height));#s=k(()=>{let e=Qf(this.#r);if(e)return Vt(t=>{if(!this.#i)return;let n=new this.#i.ResizeObserver(e=>{this.#t=!0;for(let t of e){let e=this.#n.box===`content-box`?t.contentBoxSize:t.borderBoxSize,n=Array.isArray(e)?e:[e];this.#e.width=n.reduce((e,t)=>Math.max(e,t.inlineSize),0),this.#e.height=n.reduce((e,t)=>Math.max(e,t.blockSize),0)}t()});return n.observe(e),()=>{this.#t=!1,n.disconnect()}})});constructor(e,t={box:`border-box`}){this.#i=t.window??zf,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){let e=Qf(this.#r);if(!e||!this.#i)return;let t=e.offsetWidth,n=e.offsetHeight;if(this.#n.box===`border-box`)return{width:t,height:n};let r=this.#i.getComputedStyle(e),i=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),o=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),s=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth);return{width:t-i-o,height:n-a-s}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return I(this.#s)?.(),this.getSize()}get width(){return I(this.#a)}get height(){return I(this.#o)}},ep=class{#e=A(!1);constructor(){rr(()=>(Zr(()=>j(this.#e,!0)),()=>{j(this.#e,!1)}))}get current(){return I(this.#e)}},tp=class{#e=()=>void 0;#t=k(()=>this.#e());constructor(e,t){let n;t!==void 0&&(n=t),this.#e=()=>{try{return n}finally{n=e()}}}get current(){return I(this.#t)}};function np(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function rp(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function ip(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(Mn(o)),u=A(!1),d=A(void 0),f=A(Mn([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?np(h,s):c?rp(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function ap(e,t,n){return ip(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Jf(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function op(e,t,n){return ip(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Jf.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}ap.pre=op;function sp(e){rr(()=>()=>{e()})}function cp(e){rr(()=>Zr(()=>e()))}function lp(e,t){return setTimeout(t,e)}function up(e){Jr().then(e)}var Ute=1,Wte=9,Gte=11;function dp(e){return cf(e)&&e.nodeType===Ute&&typeof e.nodeName==`string`}function fp(e){return cf(e)&&e.nodeType===Wte}function Kte(e){return cf(e)&&e.constructor?.name===`VisualViewport`}function qte(e){return cf(e)&&e.nodeType!==void 0}function pp(e){return qte(e)&&e.nodeType===Gte&&`host`in e}function Jte(e,t){if(!e||!t||!dp(e)||!dp(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&pp(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function mp(e){return fp(e)?e:Kte(e)?e.document:e?.ownerDocument??document}function hp(e){return pp(e)?hp(e.host):fp(e)?e.defaultView??window:dp(e)?e.ownerDocument?.defaultView??window:window}function Yte(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var gp=class{element;#e=k(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return I(this.#e)}set root(e){j(this.#e,e)}constructor(e){typeof e==`function`?this.element=J(e):this.element=e}getDocument=()=>mp(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Yte(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function _p(e,t){return{[ei()]:n=>pf(e)?(e.current=n,Zr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Zr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function vp(e){return e?`true`:`false`}function Xte(e){return e?`true`:void 0}function yp(e){return e?``:void 0}function bp(e){return e?!0:void 0}function xp(e){return e?`open`:`closed`}function Zte(e){return e?`checked`:`unchecked`}function Sp(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}function Cp(e,t){return t?`mixed`:e?`true`:`false`}var Qte=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function wp(e){let t=new Qte(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Tp=`ArrowDown`,Ep=`ArrowLeft`,Dp=`ArrowRight`,Op=`ArrowUp`,$te=`Enter`,kp=`Home`,Ap=`PageDown`,jp=`PageUp`;function ene(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var tne=[Tp,jp,kp],nne=[Op,Ap,`End`];[...tne,...nne];function rne(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Ep:Dp,vertical:Tp}[t]}function ine(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Dp:Ep,vertical:Op}[t]}function ane(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:rne(e,t),prevKey:ine(e,t)}}var Mp=typeof document<`u`,Np=one();function one(){return Mp&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Pp(e){return e instanceof HTMLElement}function Fp(e){return e instanceof Element}function Ip(e){return e instanceof Element||e instanceof SVGElement}function Lp(e){return e.pointerType===`touch`}function sne(e){return e.matches(`:focus-visible`)}function cne(e){return e!==null}function lne(e){return e instanceof HTMLInputElement&&`select`in e}var Rp=class{#e;#t=yf(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let r=this.#e.rootNode.current;if(!r||!e)return;let i=this.getCandidateNodes();if(!i.length)return;let a=i.indexOf(e),{nextKey:o,prevKey:s}=ane(ene(r),this.#e.orientation.current),c=this.#e.loop.current,l={[o]:a+1,[s]:a-1,[kp]:0,End:i.length-1};if(n){let e=o===`ArrowDown`?Dp:Tp,t=s===`ArrowUp`?Ep:Op;l[e]=a+1,l[t]=a-1}let u=l[t.key];if(u===void 0)return;t.preventDefault(),u<0&&c?u=i.length-1:u===i.length&&c&&(u=0);let d=i[u];if(d)return d.focus(),this.#t.current=d.id,this.#e.onCandidateFocus?.(d),d}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);!t||!Pp(t)||t.focus()}},zp=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,sp(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?up(t):t()}},Bp=class{#e;#t;#n;#r=A(!1);#i=A(void 0);#a=!1;#o=null;constructor(e){this.#e=e,j(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new zp({ref:this.#e.ref,afterTick:this.#e.open}),sp(()=>this.#s()),Jf(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){j(this.#r,!1),j(this.#i,void 0),this.#e.onComplete?.();return}if(e&&j(this.#r,!0),j(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&j(this.#i,void 0)})),!this.#t){e||j(this.#r,!1),j(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||j(this.#r,!1),j(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return I(this.#r)}get transitionStatus(){return I(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function Vp(){}function Hp(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var une=wp({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Up=new Uf(`Dialog.Root | AlertDialog.Root`),Wp=class e{static create(t){let n=Up.getOr(null);return Up.set(new e(t,n))}opts;#e=A(null);get triggerNode(){return I(this.#e)}set triggerNode(e){j(this.#e,e,!0)}#t=A(null);get contentNode(){return I(this.#t)}set contentNode(e){j(this.#t,e,!0)}#n=A(null);get overlayNode(){return I(this.#n)}set overlayNode(e){j(this.#n,e,!0)}#r=A(null);get descriptionNode(){return I(this.#r)}set descriptionNode(e){j(this.#r,e,!0)}#i=A(void 0);get contentId(){return I(this.#i)}set contentId(e){j(this.#i,e,!0)}#a=A(void 0);get titleId(){return I(this.#a)}set titleId(e){j(this.#a,e,!0)}#o=A(void 0);get triggerId(){return I(this.#o)}set triggerId(e){j(this.#o,e,!0)}#s=A(void 0);get descriptionId(){return I(this.#s)}set descriptionId(e){j(this.#s,e,!0)}#c=A(null);get cancelNode(){return I(this.#c)}set cancelNode(e){j(this.#c,e,!0)}#l=A(0);get nestedOpenCount(){return I(this.#l)}set nestedOpenCount(e){j(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Bp({ref:J(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Bp({ref:J(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Jf(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),sp(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>une.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=k(()=>({"data-state":xp(this.opts.open.current)}));get sharedProps(){return I(this.#u)}set sharedProps(e){j(this.#u,e)}},dne=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},fne=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref)}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`action`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},pne=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=_p(this.opts.ref),Jf.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=k(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},mne=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=_p(this.opts.ref,e=>{this.root.descriptionNode=e}),Jf.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},Gp=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":yp(this.root.nestedOpenCount>0),"data-nested":yp(this.root.parent!==null),...Sp(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},hne=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref,e=>this.root.overlayNode=e)}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":yp(this.root.nestedOpenCount>0),"data-nested":yp(this.root.parent!==null),...Sp(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},gne=class e{static create(t){return new e(t,Up.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref,e=>this.root.cancelNode=e),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`cancel`)]:``,onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}};function _ne(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Vp),i=q(t,`onOpenChangeComplete`,3,Vp);Wp.create({variant:J(()=>`alert-dialog`),open:J(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:J(()=>i())});var a=R();H(N(a),()=>t.children??w),z(e,a),O()}var vne=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),yne=L(`<div><!></div>`);function Kp(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`level`,3,2),o=G(t,vne),s=pne.create({id:J(()=>r()),level:J(()=>a()),ref:J(()=>i(),e=>i(e))}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},f=e=>{var n=yne();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}var bne=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`]),xne=L(`<button><!></button>`);function Sne(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=G(t,bne),o=fne.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=xne();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var Cne=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`disabled`]),wne=L(`<button><!></button>`);function Tne(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=G(t,Cne),s=gne.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),disabled:J(()=>!!a())}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},f=e=>{var n=wne();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}function Ene(e,t){var n=R();Eee(N(n),()=>t.children,e=>{var n=R();H(N(n),()=>t.children??w),z(e,n)}),z(e,n)}var Dne=new Uf(`BitsConfig`);function One(){let e=new kne(null,{});return Dne.getOr(e).opts}var kne=class{opts;constructor(e,t){let n=Ane(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function Ane(e,t){return n=>J(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function jne(e,t){return n=>{let r=One();return J(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var Mne=jne(e=>e.defaultPortalTo,`body`);function qp(e,t){D(t,!0);let n=Mne(()=>t.to),r=Ct(),i=k(a);function a(){if(!Mp||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let o;function s(){o&&=(wee(o),null)}Jf([()=>I(i),()=>t.disabled],([e,n])=>{if(!e||n){s();return}return o=Ei(Ene,{target:e,props:{children:t.children},context:r}),()=>{s()}});var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.children??w),z(e,n)};V(l,e=>{t.disabled&&e(u)}),z(e,c),O()}var Nne=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return hi(e,this.eventName,e=>{t(e)},n)}};function Jp(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Yp(e,t){return e===t||e.contains(t)}function Xp(e){return e?.ownerDocument??document}function Pne(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var Zp=[$te,` `],Fne=[Tp,jp,kp],Qp=[Op,Ap,`End`],Ine=[...Fne,...Qp],Lne={ltr:[...Zp,Dp],rtl:[...Zp,Ep]},Rne={ltr:[Ep],rtl:[Dp]};function $p(e){return e.pointerType===`mouse`}function zne(e,{select:t=!1}={}){if(!e||!e.focus)return;let n=mp(e);if(n.activeElement===e)return;let r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&lne(e)&&t&&e.select()}function Bne(e,{select:t=!1}={},n){let r=n();for(let i of e)if(zne(i,{select:t}),n()!==r)return!0}var em=A(!1),Vne=class e{static _refs=0;static _cleanup;constructor(){rr(()=>(e._refs===0&&(e._cleanup=or(()=>{let e=[],t=e=>{j(em,!1)};return e.push(hi(document,`pointerdown`,t,{capture:!0}),hi(document,`pointermove`,t,{capture:!0}),hi(document,`keydown`,e=>{j(em,!0)},{capture:!0})),Af(...e)})),e._refs++,()=>{e._refs--,e._refs===0&&(j(em,!1),e._cleanup?.())}))}get current(){return I(em)}set current(e){j(em,e,!0)}},tm=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],nm=tm.join(`,`),rm=typeof Element>`u`,im=rm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,am=!rm&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},om=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):om(e.parentNode))},Hne=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},sm=function(e,t,n){if(om(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(nm));return t&&im.call(e,nm)&&r.unshift(e),r=r.filter(n),r},cm=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!om(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=cm(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{im.call(a,nm)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!om(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=cm(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},lm=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},um=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Hne(e))&&!lm(e)?0:e.tabIndex},Une=function(e,t){var n=um(e);return n<0&&t&&!lm(e)?0:n},Wne=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},dm=function(e){return e.tagName===`INPUT`},Gne=function(e){return dm(e)&&e.type===`hidden`},Kne=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},qne=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Jne=function(e){if(!e.name)return!0;var t=e.form||am(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=qne(r,e.form);return!i||i===e},Yne=function(e){return dm(e)&&e.type===`radio`},Xne=function(e){return Yne(e)&&!Jne(e)},Zne=function(e){var t=e&&am(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=am(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},fm=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Qne=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=im.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(im.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=am(e);if(o&&!o.shadowRoot&&r(o)===!0)return fm(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Zne(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return fm(e);return!1},$ne=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return im.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},pm=function(e,t){return!(t.disabled||Gne(t)||Qne(t,e)||Kne(t)||$ne(t))},mm=function(e,t){return!(Xne(t)||um(t)<0||!pm(e,t))},ere=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},hm=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Une(a,i),s=i?hm(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Wne).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},gm=function(e,t){return t||={},hm(t.getShadowRoot?cm([e],t.includeContainer,{filter:mm.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ere}):sm(e,t.includeContainer,mm.bind(null,t)))},_m=function(e,t){return t||={},t.getShadowRoot?cm([e],t.includeContainer,{filter:pm.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):sm(e,t.includeContainer,pm.bind(null,t))},vm=function(e,t){if(t||={},!e)throw Error(`No node provided`);return im.call(e,nm)===!1?!1:mm(t,e)},tre=tm.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),ym=function(e,t){if(t||={},!e)throw Error(`No node provided`);return im.call(e,tre)===!1?!1:pm(t,e)};function bm(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`}}function nre(e,t){if(!vm(e,bm()))return rre(e,t);let n=mp(e),r=gm(n.body,bm());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function rre(e,t){let n=mp(e);if(!ym(e,bm()))return n.body;let r=_m(n.body,bm());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(e=>vm(e,bm()))??n.body}function ire(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===e.length-1?n?e[0]:void 0:e[t+1]}function are(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===0?n?e[e.length-1]:void 0:e[t-1]}function ore(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let i=t+n;return i=r?(i%e.length+e.length)%e.length:Math.max(0,Math.min(i,e.length-1)),e[i]}function sre(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let i=t-n;return i=r?(i%e.length+e.length)%e.length:Math.max(0,Math.min(i,e.length-1)),e[i]}function xm(e,t,n){let r=t.toLowerCase();if(r.endsWith(` `)){let i=r.slice(0,-1);if(e.filter(e=>e.toLowerCase().startsWith(i)).length<=1)return xm(e,i,n);let a=n?.toLowerCase();if(a&&a.startsWith(i)&&a.charAt(i.length)===` `&&t.trim()===i)return n;let o=e.filter(e=>e.toLowerCase().startsWith(r));if(o.length>0){let t=n?e.indexOf(n):-1;return Sm(o,Math.max(t,0)).find(e=>e!==n)||n}}let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=i.toLowerCase(),o=n?e.indexOf(n):-1,s=Sm(e,Math.max(o,0));i.length===1&&(s=s.filter(e=>e!==n));let c=s.find(e=>e?.toLowerCase().startsWith(a));return c===n?void 0:c}function Sm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cre={afterMs:1e4,onChange:Vp};function Cm(e,t){let{afterMs:n,onChange:r,getWindow:i}={...cre,...t},a=null,o=A(Mn(e));function s(){return i().setTimeout(()=>{j(o,e,!0),r?.(e)},n)}return rr(()=>()=>{a&&i().clearTimeout(a)}),J(()=>I(o),e=>{j(o,e,!0),r?.(e),a&&i().clearTimeout(a),a=s()})}var wm=class{#e;#t;#n=k(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=k(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=Cm(``,{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;let n=I(this.#r)(),r=t.find(e=>e===n)?.textContent?.trim()??``,i=xm(t.map(e=>e.textContent?.trim()??``),this.#t.current,r),a=t.find(e=>e.textContent?.trim()===i);return a&&I(this.#n)(a),a}resetTypeahead(){this.#t.current=``}get search(){return this.#t.current}},Tm=`data-context-menu-trigger`,lre=`data-context-menu-content`,Em=new Uf(`Menu.Root`),Dm=new Uf(`Menu.Root | Menu.Sub`),Om=new Uf(`Menu.Content`),km=new Uf(`Menu.Group | Menu.RadioGroup`),ure=new Uf(`Menu.RadioGroup`),dre=new Uf(`Menu.CheckboxGroup`),Am=new Nne(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),fre=wp({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),pre=class{#e;#t=null;#n=null;#r=!1;#i=null;#a=null;#o=null;#s=null;constructor(e){this.#e=e,Jf([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(this.#_(),!e||!t||!n)return;let r=e=>{$p(e)&&(this.#s={x:e.clientX,y:e.clientY},this.#r||this.#d(e,`content`))},i=e=>{$p(e)&&this.#f(e,`content`)},a=e=>{$p(e)&&(this.#r||this.#d(e,`trigger`))},o=e=>{if($p(e)){if(Fp(e.relatedTarget)){let n=this.#e.subContentSelector(),r=e.relatedTarget.closest(n);if(r&&r!==t&&r.id&&t.querySelector(`[aria-controls="${r.id}"]`))return}this.#f(e,`trigger`)}},s=e=>{$p(e)&&this.#m()},c=e=>{$p(e)&&this.#m()};return e.addEventListener(`pointermove`,r),e.addEventListener(`pointerleave`,i),e.addEventListener(`pointerenter`,s),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerleave`,o),t.addEventListener(`pointerenter`,c),()=>{e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerleave`,i),e.removeEventListener(`pointerenter`,s),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerleave`,o),t.removeEventListener(`pointerenter`,c),this.#_()}}),sp(()=>{this.#_()})}#c(){let e=this.#e.parentContentNode();return e?e.getBoundingClientRect():this.#e.triggerNode()?.getBoundingClientRect()??null}#l(e,t){let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return null;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=hre(i,a),s,c,l;return t===`content`?(s=this.#r?this.#a??e:e,c=a):(s=this.#s??e,c=this.#c()??i,l=a),this.#a=s,{corridor:gre(i,a,o),intent:_re(s,c,o,t,l),targetRect:c,side:o}}#u(e,t,n){return jm(e,t)||jm(e,n)}#d(e,t){let n={x:e.clientX,y:e.clientY};this.#l(n,t)&&(this.#i=t,this.#o=n)}#f(e,t){if(!this.#e.enabled())return;let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return;let i=e.relatedTarget;if(Fp(i)&&(t===`content`&&r.contains(i)||t===`trigger`&&n.contains(i)))return;let a={x:e.clientX,y:e.clientY},o=this.#l(a,t);if(o){if(!Mm(a,o.targetRect)&&!this.#u(a,o.corridor,o.intent)){this.#w();return}this.#r=!0,this.#i=t,this.#o=a,this.#e.setIsPointerInTransit(!0),this.#b(),this.#S()}}#p=null;#m(){if(!this.#r)return;let e=this.#i===`trigger`;this.#x(),this.#C(),this.#r=!1,this.#w(),e?(this.#h(),this.#p=setTimeout(()=>{this.#p=null,this.#e.setIsPointerInTransit(!1)},100)):this.#e.setIsPointerInTransit(!1)}#h(){this.#p!==null&&(clearTimeout(this.#p),this.#p=null)}#g(){let e=this.#o;this.#x(),this.#C(),this.#h(),this.#r=!1,this.#e.setIsPointerInTransit(!1),this.#w(),this.#e.onIntentExit(e)}#_(){this.#x(),this.#C(),this.#h(),this.#r&&this.#e.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#a=null,this.#o=null,this.#s=null}#v(e){let t=this.#e.contentNode();if(!t)return!1;let n=t.ownerDocument.elementFromPoint(e.x,e.y);if(!n)return!1;let r=this.#e.subContentSelector(),i=n.closest(r);return!i||i===t?!1:i.id?!!t.querySelector(`[aria-controls="${i.id}"]`):!1}#y=e=>{if(!this.#r||!this.#i||!$p(e))return;let t=this.#e.triggerNode(),n=this.#e.contentNode();if(!t||!n){this.#g();return}this.#C();let r={x:e.clientX,y:e.clientY};this.#o=r;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(this.#i===`content`&&Mm(r,a)){this.#m();return}if(this.#i===`trigger`&&mre(r,i,4)){this.#m();return}if(this.#v(r)){this.#S();return}let o=this.#l(r,this.#i);if(!o){this.#g();return}if(this.#u(r,o.corridor,o.intent)){this.#S();return}this.#g()};#b(){if(this.#t)return;let e=mp(this.#e.triggerNode()??this.#e.contentNode());e&&(e.addEventListener(`pointermove`,this.#y,!0),this.#t=()=>{e.removeEventListener(`pointermove`,this.#y,!0),this.#t=null})}#x(){this.#t?.()}#S(){this.#C(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#g()},500)}#C(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#w(){this.#i=null,this.#a=null,this.#o=null}};function jm(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Mm(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function mre(e,t,n){return e.x>=t.left+n&&e.x<=t.right-n&&e.y>=t.top+n&&e.y<=t.bottom-n}function hre(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}function gre(e,t,n){switch(n){case`top`:return[{x:Math.min(e.left,t.left)-2,y:e.top},{x:Math.min(e.left,t.left)-2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:e.top}];case`bottom`:return[{x:Math.min(e.left,t.left)-2,y:e.bottom},{x:Math.min(e.left,t.left)-2,y:t.top},{x:Math.max(e.right,t.right)+2,y:t.top},{x:Math.max(e.right,t.right)+2,y:e.bottom}];case`left`:return[{x:e.left,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.max(e.bottom,t.bottom)+2},{x:e.left,y:Math.max(e.bottom,t.bottom)+2}];case`right`:return[{x:e.right,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.max(e.bottom,t.bottom)+2},{x:e.right,y:Math.max(e.bottom,t.bottom)+2}]}}function _re(e,t,n,r,i){let a=r===`trigger`?vre(n):n,o=i?Math.min(t.top,i.top)-8:t.top-8,s=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,c=i?Math.min(t.left,i.left)-8:t.left-8,l=i?Math.max(t.right,i.right)+8:t.right+8;switch(a){case`right`:return[e,{x:t.left,y:o},{x:t.left,y:s}];case`left`:return[e,{x:t.right,y:o},{x:t.right,y:s}];case`bottom`:return[e,{x:c,y:t.top},{x:l,y:t.top}];case`top`:return[e,{x:c,y:t.bottom},{x:l,y:t.bottom}]}}function vre(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}var Nm=class e{static create(t){let n=new e(t);return Em.set(n)}opts;isUsingKeyboard=new Vne;#e=A(!1);get ignoreCloseAutoFocus(){return I(this.#e)}set ignoreCloseAutoFocus(e){j(this.#e,e,!0)}#t=A(!1);get isPointerInTransit(){return I(this.#t)}set isPointerInTransit(e){j(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>fre.getAttr(e,this.opts.variant.current)},Pm=class e{static create(t,n){return Dm.set(new e(t,n,null))}opts;root;parentMenu;contentId=J(()=>``);#e=A(null);get contentNode(){return I(this.#e)}set contentNode(e){j(this.#e,e,!0)}contentPresence;#t=A(null);get triggerNode(){return I(this.#t)}set triggerNode(e){j(this.#t,e,!0)}constructor(e,t,n){this.opts=e,this.root=t,this.parentMenu=n,this.contentPresence=new Bp({ref:J(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!==`menubar`||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),n&&Jf(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}},Fm=class e{static create(t){return Om.set(new e(t,Dm.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=A(``);get search(){return I(this.#e)}set search(e){j(this.#e,e,!0)}#t=0;#n;#r=A(!1);get mounted(){return I(this.#r)}set mounted(e){j(this.#r,e,!0)}#i;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new gp(e.ref),this.attachment=_p(this.opts.ref,e=>{this.parentMenu.contentNode!==e&&(this.parentMenu.contentNode=e)}),t.contentId=e.id,this.#i=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new pre({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr(`sub-content`)}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`)),onIntentExit:e=>{this.parentMenu.opts.open.current=!1,this.#s(e)},setIsPointerInTransit:e=>{this.parentMenu.root.isPointerInTransit=e}}),this.#n=new wm({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new Rp({rootNode:J(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr(`item`),loop:this.opts.loop,orientation:J(()=>`vertical`)}),Jf(()=>this.parentMenu.contentNode,e=>e?Am.listen(e,()=>{up(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})}):void 0),rr(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#a(){let e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#s(e){if(!e)return;let t=this.parentMenu.parentMenu?.contentNode;if(!t)return;let n=this.domContext.getDocument().elementFromPoint(e.x,e.y);if(!Fp(n))return;let r=n.closest(`[${this.parentMenu.root.getBitsAttr(`sub-trigger`)}]`);!r||!t.contains(r)||r!==this.parentMenu.triggerNode&&r.dispatchEvent(new PointerEvent(`pointermove`,{bubbles:!0,cancelable:!0,pointerType:`mouse`,clientX:e.x,clientY:e.y}))}onCloseAutoFocus=e=>{if(this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){e.preventDefault();return}this.parentMenu.triggerNode&&vm(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();let n=nre(t.triggerNode,e.shiftKey?`prev`:`next`);n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),up(()=>{n.focus(),up(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===`Tab`){this.handleTabKeyDown(e);return}let t=e.target,n=e.currentTarget;if(!Pp(t)||!Pp(n))return;let r=t.closest(`[${this.parentMenu.root.getBitsAttr(`content`)}]`)?.id===this.parentMenu.contentId.current,i=e.ctrlKey||e.altKey||e.metaKey,a=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code===`Space`)return;let o=this.#a();r&&!i&&a&&this.#n(e.key,o),e.target?.id===this.parentMenu.contentId.current&&Ine.includes(e.key)&&(e.preventDefault(),Qp.includes(e.key)&&o.reverse(),Bne(o,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){Fp(e.currentTarget)&&Fp(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=``))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&up(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(e){e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`))||this.#o()||this.parentMenu.root.isUsingKeyboard.current||(this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId(``))}onTriggerLeave(){return!!this.#o()}handleInteractOutside(e){if(!Ip(e.target))return;let t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}if(e.target.closest(`#${t}`)){e.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,up(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#c=k(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return I(this.#c)}set snippetProps(e){j(this.#c,e)}#l=k(()=>({id:this.opts.id.current,role:`menu`,"aria-orientation":`vertical`,[this.parentMenu.root.getBitsAttr(`content`)]:``,"data-state":xp(this.parentMenu.opts.open.current),...Sp(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:`auto`,contain:`layout style`},...this.attachment}));get props(){return I(this.#l)}set props(e){j(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}},Im=class{opts;content;attachment;#e=A(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=_p(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&$p(e))if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;let t=e.currentTarget;if(!Pp(t))return;t.focus({preventScroll:!0})}}onpointerleave(e){e.defaultPrevented||$p(e)&&this.content.onItemLeave(e)}onfocus(e){up(()=>{e.defaultPrevented||this.opts.disabled.current||j(this.#e,!0)})}onblur(e){up(()=>{e.defaultPrevented||j(this.#e,!1)})}#t=k(()=>({id:this.opts.id.current,tabindex:-1,role:`menuitem`,"aria-disabled":vp(this.opts.disabled.current),"data-disabled":yp(this.opts.disabled.current),"data-highlighted":I(this.#e)?``:void 0,[this.content.parentMenu.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},yre=class e{static create(t){return new e(t,new Im(t,Om.get()))}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;let e=new CustomEvent(`menuitemselect`,{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){let t=this.item.content.search!==``;if(!(this.item.opts.disabled.current||t&&e.key===` `)&&Zp.includes(e.key)){if(!Pp(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!Pp(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=k(()=>Lf(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},bre=class e{static create(t){let n=Om.get();return new e(t,new Im(t,n),n,Dm.get())}opts;item;content;submenu;attachment;#e=null;constructor(e,t,n,r){this.opts=e,this.item=t,this.content=n,this.submenu=r,this.attachment=_p(this.opts.ref,e=>this.submenu.triggerNode=e),this.onpointerleave=this.onpointerleave.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),sp(()=>{this.#t()})}#t(){this.#e!==null&&(this.content.domContext.getWindow().clearTimeout(this.#e),this.#e=null)}onpointermove(e){if($p(e)){if(this.submenu.root.isPointerInTransit){this.#e!==null&&this.#t();return}if(!this.item.opts.disabled.current&&!this.submenu.opts.open.current&&!this.#e){let e=this.opts.openDelay.current;if(e<=0){this.submenu.onOpen();return}this.#e=this.content.domContext.setTimeout(()=>{if(this.submenu.root.isPointerInTransit){this.#t();return}this.submenu.onOpen(),this.#t()},e)}}}onpointerleave(e){$p(e)&&this.#t()}onkeydown(e){let t=this.content.search!==``;this.item.opts.disabled.current||t&&e.key===` `||Lne[this.submenu.root.opts.dir.current].includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}onclick(e){if(this.item.opts.disabled.current||!Pp(e.currentTarget))return;e.currentTarget.focus();let t=new CustomEvent(`menusubtriggerselect`,{bubbles:!0,cancelable:!0});this.opts.onSelect.current(t),this.submenu.opts.open.current||(this.submenu.onOpen(),up(()=>{let e=this.submenu.contentNode;e&&Am.dispatch(e)}))}#n=k(()=>Lf({"aria-haspopup":`menu`,"aria-expanded":vp(this.submenu.opts.open.current),"data-state":xp(this.submenu.opts.open.current),"aria-controls":this.submenu.opts.open.current?this.submenu.contentId.current:void 0,[this.submenu.root.getBitsAttr(`sub-trigger`)]:``,onclick:this.onclick,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onkeydown:this.onkeydown,...this.attachment},this.item.props));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},xre=class e{static create(t){return km.set(new e(t,Em.get()))}opts;root;attachment;#e=A(void 0);get groupHeadingId(){return I(this.#e)}set groupHeadingId(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref)}#t=k(()=>({id:this.opts.id.current,role:`group`,"aria-labelledby":this.groupHeadingId,[this.root.getBitsAttr(`group`)]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Sre=class e{static create(t){let n=dre.getOr(null);if(n)return new e(t,n);let r=ure.getOr(null);return r?new e(t,r):new e(t,km.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=_p(this.opts.ref,e=>this.group.groupHeadingId=e?.id)}#e=k(()=>({id:this.opts.id.current,role:`group`,[this.group.root.getBitsAttr(`group-heading`)]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},Cre=class e{static create(t){return new e(t,Em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref)}#e=k(()=>({id:this.opts.id.current,role:`group`,[this.root.getBitsAttr(`separator`)]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},wre=class e{static create(t){return new e(t,Dm.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=_p(this.opts.ref,e=>this.parentMenu.triggerNode=e)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType===`touch`)return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType===`touch`&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===` `||e.key===`Enter`){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===`ArrowDown`&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=k(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=k(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":`menu`,"aria-expanded":vp(this.parentMenu.opts.open.current),"aria-controls":I(this.#e),"data-disabled":yp(this.opts.disabled.current),"data-state":xp(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr(`trigger`)]:``,onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Tre=class e{static create(t){return new e(t,Dm.get())}opts;parentMenu;attachment;#e=A(Mn({x:0,y:0}));virtualElement=vf({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...I(this.#e)})});#t=null;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=_p(this.opts.ref,e=>this.parentMenu.triggerNode=e),this.oncontextmenu=this.oncontextmenu.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointercancel=this.onpointercancel.bind(this),this.onpointerup=this.onpointerup.bind(this),Jf(()=>I(this.#e),e=>{this.virtualElement.current={getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...e})}}),Jf(()=>this.opts.disabled.current,e=>{e&&this.#n()}),sp(()=>this.#n())}#n(){this.#t!==null&&hp(this.opts.ref.current).clearTimeout(this.#t)}#r(e){j(this.#e,{x:e.clientX,y:e.clientY},!0),this.parentMenu.onOpen()}oncontextmenu(e){e.defaultPrevented||this.opts.disabled.current||(this.#n(),this.#r(e),e.preventDefault(),this.parentMenu.contentNode?.focus())}onpointerdown(e){this.opts.disabled.current||$p(e)||(this.#n(),this.#t=hp(this.opts.ref.current).setTimeout(()=>this.#r(e),700))}onpointermove(e){this.opts.disabled.current||$p(e)||this.#n()}onpointercancel(e){this.opts.disabled.current||$p(e)||this.#n()}onpointerup(e){this.opts.disabled.current||$p(e)||this.#n()}#i=k(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"data-disabled":yp(this.opts.disabled.current),"data-state":xp(this.parentMenu.opts.open.current),[Tm]:``,tabindex:-1,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointercancel:this.onpointercancel,onpointerup:this.onpointerup,oncontextmenu:this.oncontextmenu,...this.attachment}));get props(){return I(this.#i)}set props(e){j(this.#i,e)}},Ere=class{static create(e){let t=Dm.get();return Dm.set(new Pm(e,t.root,t))}};globalThis.bitsDismissableLayers??=new Map;var Dre=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=Vp;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,rr(()=>{this.#a=Xp(this.opts.ref.current)});let t=Vp,n=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};Jf([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return lp(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),n}),sp(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&up(()=>{!this.opts.ref.current||this.#h(e.target)||e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return Af(hi(this.#a,`pointerdown`,Af(this.#f,this.#m),{capture:!0}),hi(this.#a,`pointerdown`,Af(this.#p,this.#d)),hi(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Lm(e)),this.#e.current(e)};#d=Jp(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||Are(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Lm(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=hi(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=kre(this.opts.ref.current))};#h=e=>this.opts.ref.current?Yp(this.opts.ref.current,e):!1;#g=Jp(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function Ore(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function kre(e){let t=[...globalThis.bitsDismissableLayers],n=Ore(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function Are(e,t){let n=e.target;if(!Ip(n))return!1;let r=!!n.closest(`[${Tm}]`),i=!!t.closest(`[${lre}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:Xp(n).documentElement.contains(n)&&!Yp(t,n)&&Pne(e,t)}function Lm(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function Rm(e,t){D(t,!0);let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`onInteractOutside`,3,Vp),i=q(t,`onFocusOutside`,3,Vp),a=q(t,`isValidEvent`,3,()=>!1),o=Dre.create({id:J(()=>t.id),interactOutsideBehavior:J(()=>n()),onInteractOutside:J(()=>r()),enabled:J(()=>t.enabled),onFocusOutside:J(()=>i()),isValidEvent:J(()=>a()),ref:t.ref});var s=R();H(N(s),()=>t.children??w,()=>({props:o.props})),z(e,s),O()}globalThis.bitsEscapeLayers??=new Map;var jre=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new gp(this.opts.ref);let t=Vp;Jf(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>hi(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!Mre(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;n!==`close`&&n!==`defer-otherwise-close`||this.opts.onEscapeKeydown.current(t)}};function Mre(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function zm(e,t){D(t,!0);let n=q(t,`escapeKeydownBehavior`,3,`close`),r=q(t,`onEscapeKeydown`,3,Vp);jre.create({escapeKeydownBehavior:J(()=>n()),onEscapeKeydown:J(()=>r()),enabled:J(()=>t.enabled),ref:t.ref});var i=R();H(N(i),()=>t.children??w),z(e,i),O()}var Nre=class e{static instance;#e=vf([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},Pre=class e{#e=!1;#t=null;#n=Nre.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(hi(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n)if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&ym(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}},{capture:!0}),hi(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?gm(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?_m(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return Jf([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),sp(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function Bm(e,t){D(t,!0);let n=q(t,`enabled`,3,!1),r=q(t,`trapFocus`,3,!1),i=q(t,`loop`,3,!1),a=q(t,`onCloseAutoFocus`,3,Vp),o=q(t,`onOpenAutoFocus`,3,Vp),s=Pre.use({enabled:J(()=>n()),trap:J(()=>r()),loop:i(),onCloseAutoFocus:J(()=>a()),onOpenAutoFocus:J(()=>o()),ref:t.ref});var c=R();H(N(c),()=>t.focusScope??w,()=>({props:s.props})),z(e,c),O()}var Vm=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var Fre=class e{static create(t){return new e(t)}opts;domContext;#e=Vp;#t=!1;#n=Vm;#r=Vm;constructor(e){this.opts=e,this.domContext=new gp(e.ref);let t=Vp;Jf(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return Af(hi(this.domContext.getDocument(),`pointerdown`,this.#o),hi(this.domContext.getDocument(),`pointerup`,bf(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;!Pp(t)||!Pp(n)||!this.#t||!Lre(this)||!Jte(t,n)||(this.#n(e),!e.defaultPrevented&&(this.#e=Ire(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=Vp}},Hm=e=>e.style.userSelect||e.style.webkitUserSelect;function Ire(e,t){let n=Hm(t),r=Hm(e);return Um(t,`none`),Um(e,`text`),()=>{Um(t,n),Um(e,r)}}function Um(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function Lre(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function Wm(e,t){D(t,!0);let n=q(t,`preventOverflowTextSelection`,3,!0),r=q(t,`onPointerDown`,3,Vp),i=q(t,`onPointerUp`,3,Vp);Fre.create({id:J(()=>t.id),onPointerDown:J(()=>r()),onPointerUp:J(()=>i()),enabled:J(()=>t.enabled&&n()),ref:t.ref});var a=R();H(N(a),()=>t.children??w),z(e,a),O()}globalThis.bitsIdCounter??={current:0};function Gm(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var Rre=class{#e;#t=0;#n=A();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),j(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,I(this.#n)===void 0&&(this.#r=or(()=>{j(this.#n,this.#e(...e),!0)})),rr(()=>()=>{this.#i()}),I(this.#n)}},Km=new Eo,qm=A(null),Jm=null,Ym=null,Xm=!1,Zm=J(()=>{for(let e of Km.values())if(e)return!0;return!1}),Qm=null,zre=new Rre(()=>{function e(){document.body.setAttribute(`style`,I(qm)??``),document.body.style.removeProperty(`--scrollbar-width`),Np&&Jm?.(),j(qm,null)}function t(){Ym!==null&&(window.clearTimeout(Ym),Ym=null)}function n(e,n){t(),Xm=!0,Qm=Date.now();let r=Qm,i=()=>{Ym=null,Qm===r&&(eh(Km)?Xm=!1:(Xm=!1,n()))},a=e===null?24:e;Ym=window.setTimeout(i,a)}function r(){I(qm)===null&&Km.size===0&&!Xm&&j(qm,document.body.getAttribute(`style`),!0)}return Jf(()=>Zm.current,()=>{if(!Zm.current)return;r(),Xm=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Np&&(Jm=hi(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),up(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),sp(()=>()=>{Jm?.()}),{get lockMap(){return Km},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),$m=class{#e=Gm();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=zre.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=J(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),sp(()=>{if(this.#r.lockMap.delete(this.#e),eh(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function eh(e){for(let[t,n]of e)if(n)return!0;return!1}function th(e,t){D(t,!0);let n=q(t,`preventScroll`,3,!0),r=q(t,`restoreScrollDelay`,3,null);n()&&new $m(n(),()=>r()),O()}var nh=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`interactOutsideBehavior`,`onCloseAutoFocus`,`onEscapeKeydown`,`onOpenAutoFocus`,`onInteractOutside`,`preventScroll`,`trapFocus`,`restoreScrollDelay`]),rh=L(`<!> <!>`,1),ih=L(`<!> <div><!></div>`,1);function ah(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=q(t,`interactOutsideBehavior`,3,`ignore`),s=q(t,`onCloseAutoFocus`,3,Vp),c=q(t,`onEscapeKeydown`,3,Vp),l=q(t,`onOpenAutoFocus`,3,Vp),u=q(t,`onInteractOutside`,3,Vp),d=q(t,`preventScroll`,3,!0),f=q(t,`trapFocus`,3,!0),p=q(t,`restoreScrollDelay`,3,null),m=G(t,nh),h=Gp.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),g=k(()=>Lf(m,h.props));var _=R(),v=N(_),y=e=>{Bm(e,{get ref(){return h.opts.ref},loop:!0,get trapFocus(){return f()},get enabled(){return h.root.opts.open.current},get onCloseAutoFocus(){return s()},onOpenAutoFocus:e=>{l()(e),!e.defaultPrevented&&(e.preventDefault(),lp(0,()=>h.opts.ref.current?.focus()))},focusScope:(e,n)=>{let r=()=>n?.().props;zm(e,K(()=>I(g),{get enabled(){return h.root.opts.open.current},get ref(){return h.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{Rm(e,K(()=>I(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},get interactOutsideBehavior(){return o()},onInteractOutside:e=>{u()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{Wm(e,K(()=>I(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},children:(e,n)=>{var i=R(),a=N(i),o=e=>{var n=rh(),i=N(n),a=e=>{th(e,{get preventScroll(){return d()},get restoreScrollDelay(){return p()}})};V(i,e=>{h.root.opts.open.current&&e(a)});var o=P(i,2);{let e=k(()=>({props:Lf(I(g),r()),...h.snippetProps}));H(o,()=>t.child,()=>I(e))}z(e,n)},s=e=>{var n=ih(),i=N(n);th(i,{get preventScroll(){return d()}});var a=P(i,2);_a(a,e=>({...e}),[()=>Lf(I(g),r())]),H(M(a),()=>t.children??w),T(a),z(e,n)};V(a,e=>{t.child?e(o):e(s,-1)}),z(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};V(v,e=>{(h.shouldRender||a())&&e(y)}),z(e,_),O()}var oh=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),sh=L(`<div><!></div>`);function ch(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`forceMount`,3,!1),a=q(t,`ref`,15,null),o=G(t,oh),s=hne.create({id:J(()=>r()),ref:J(()=>a(),e=>a(e))}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R(),r=N(n),i=e=>{var n=R(),r=N(n);{let e=k(()=>({props:Lf(I(c)),...s.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},a=e=>{var n=sh();_a(n,e=>({...e}),[()=>Lf(I(c))]),H(M(n),()=>t.children??w,()=>s.snippetProps),T(n),z(e,n)};V(r,e=>{t.child?e(i):e(a,-1)}),z(e,n)};V(u,e=>{(s.shouldRender||i())&&e(d)}),z(e,l),O()}var lh=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),uh=L(`<div><!></div>`);function dh(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=G(t,lh),o=mne.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=uh();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var fh=wp({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),ph=new Uf(`Checkbox.Group`),mh=new Uf(`Checkbox.Root`),hh=class e{static create(t,n=null){return mh.set(new e(t,n))}opts;group;#e=k(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return I(this.#e)}set trueName(e){j(this.#e,e)}#t=k(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return I(this.#t)}set trueRequired(e){j(this.#t,e)}#n=k(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return I(this.#n)}set trueDisabled(e){j(this.#n,e)}#r=k(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return I(this.#r)}set trueReadonly(e){j(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=_p(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),Jf.pre([()=>gt(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{!e||!t||(this.opts.checked.current=e.includes(t))}),Jf.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===`Enter`){e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),this.#i())}}#i(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current===`submit`){this.#i();return}e.preventDefault(),this.#i()}}#a=k(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return I(this.#a)}set snippetProps(e){j(this.#a,e)}#o=k(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Cp(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":vp(this.trueRequired),"aria-readonly":vp(this.trueReadonly),"data-disabled":yp(this.trueDisabled),"data-readonly":yp(this.trueReadonly),"data-state":_h(this.opts.checked.current,this.opts.indeterminate.current),[fh.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},gh=class e{static create(){return new e(mh.get())}root;#e=k(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return I(this.#e)}set trueChecked(e){j(this.#e,e)}#t=k(()=>!!this.root.trueName);get shouldRender(){return I(this.#t)}set shouldRender(e){j(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Pp(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=k(()=>({type:`checkbox`,checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}};function _h(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}var vh=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]),yh=L(`<input/>`);function bh(e,t){D(t,!0);let n=q(t,`value`,15),r=G(t,vh),i=k(()=>Lf(r,{"aria-hidden":`true`,tabindex:-1,style:{...Rf,position:`absolute`,top:`0`,left:`0`}}));var a=R(),o=N(a),s=e=>{var t=yh();_a(t,()=>({...I(i),value:n()}),void 0,void 0,void 0,void 0,!0),z(e,t)},c=e=>{var t=yh();_a(t,()=>({...I(i)}),void 0,void 0,void 0,void 0,!0),xa(t,n),z(e,t)};V(o,e=>{I(i).type===`checkbox`?e(s):e(c,-1)}),z(e,a),O()}function xh(e,t){D(t,!1);let n=gh.create();Ea();var r=R(),i=N(r),a=e=>{bh(e,K(()=>n.props))};V(i,e=>{n.shouldRender&&e(a)}),z(e,r),O()}var Sh=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),Ch=L(`<button><!></button>`),wh=L(`<!> <!>`,1);function Th(e,t){let n=Ti();D(t,!0);let r=q(t,`checked`,15,!1),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=q(t,`required`,3,!1),s=q(t,`name`,3,void 0),c=q(t,`value`,3,`on`),l=q(t,`id`,19,()=>Hp(n)),u=q(t,`indeterminate`,15,!1),d=q(t,`type`,3,`button`),f=G(t,Sh),p=ph.getOr(null);p&&c()&&(p.opts.value.current.includes(c())?r(!0):r(!1)),Jf.pre(()=>c(),()=>{p&&c()&&(p.opts.value.current.includes(c())?r(!0):r(!1))});let m=hh.create({checked:J(()=>r(),e=>{r(e),t.onCheckedChange?.(e)}),disabled:J(()=>a()??!1),required:J(()=>o()),name:J(()=>s()),value:J(()=>c()),id:J(()=>l()),ref:J(()=>i(),e=>i(e)),indeterminate:J(()=>u(),e=>{u(e),t.onIndeterminateChange?.(e)}),type:J(()=>d()),readonly:J(()=>!!t.readonly)},p),h=k(()=>Lf({...f},m.props));var g=wh(),_=N(g),v=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(h),...m.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},y=e=>{var n=Ch();_a(n,()=>({...I(h)})),H(M(n),()=>t.children??w,()=>m.snippetProps),T(n),z(e,n)};V(_,e=>{t.child?e(v):e(y,-1)}),xh(P(_,2),{}),z(e,g),O()}var Eh=[`top`,`right`,`bottom`,`left`],Dh=Math.min,Oh=Math.max,kh=Math.round,Ah=Math.floor,jh=e=>({x:e,y:e}),Mh={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Nh(e,t,n){return Oh(e,Dh(t,n))}function Ph(e,t){return typeof e==`function`?e(t):e}function Fh(e){return e.split(`-`)[0]}function Ih(e){return e.split(`-`)[1]}function Lh(e){return e===`x`?`y`:`x`}function Rh(e){return e===`y`?`height`:`width`}function zh(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Bh(e){return Lh(zh(e))}function Vh(e,t,n){n===void 0&&(n=!1);let r=Ih(e),i=Bh(e),a=Rh(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Xh(o)),[o,Xh(o)]}function Hh(e){let t=Xh(e);return[Uh(e),t,Uh(t)]}function Uh(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Wh=[`left`,`right`],Gh=[`right`,`left`],Kh=[`top`,`bottom`],qh=[`bottom`,`top`];function Jh(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Gh:Wh:t?Wh:Gh;case`left`:case`right`:return t?Kh:qh;default:return[]}}function Yh(e,t,n,r){let i=Ih(e),a=Jh(Fh(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Uh)))),a}function Xh(e){let t=Fh(e);return Mh[t]+e.slice(t.length)}function Zh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qh(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zh(e)}function $h(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function eg(e,t,n){let{reference:r,floating:i}=e,a=zh(t),o=Bh(t),s=Rh(o),c=Fh(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ih(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function tg(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ph(t,e),p=Qh(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$h(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$h(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ng=50,rg=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:tg},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=eg(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ng&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=eg(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ig=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ph(e,t)||{};if(l==null)return{};let d=Qh(u),f={x:n,y:r},p=Bh(i),m=Rh(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),ee=S?S[y]:0;(!ee||!await(o.isElement==null?void 0:o.isElement(S)))&&(ee=s.floating[y]||a.floating[m]);let C=b/2-x/2,te=ee/2-h[m]/2-1,ne=Dh(d[_],te),re=Dh(d[v],te),ie=ne,ae=ee-h[m]-re,oe=ee/2-h[m]/2+C,w=Nh(ie,oe,ae),se=!c.arrow&&Ih(i)!=null&&oe!==w&&a.reference[m]/2-(oe<ie?ne:re)-h[m]/2<0,ce=se?oe<ie?oe-ie:oe-ae:0;return{[p]:f[p]+ce,data:{[p]:w,centerOffset:oe-w-ce,...se&&{alignmentOffset:ce}},reset:se}}}),ag=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ph(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Fh(r),_=zh(o),v=Fh(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Xh(o)]:Hh(o)),x=p!==`none`;!d&&x&&b.push(...Yh(o,m,p,y));let S=[o,...b],ee=await s.detectOverflow(t,h),C=[],te=i.flip?.overflows||[];if(l&&C.push(ee[g]),u){let e=Vh(r,a,y);C.push(ee[e[0]],ee[e[1]])}if(te=[...te,{placement:r,overflows:C}],!C.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==zh(t))||te.every(e=>zh(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:te},reset:{placement:t}};let n=te.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=te.filter(e=>{if(x){let t=zh(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function og(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sg(e){return Eh.some(t=>e[t]>=0)}var cg=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ph(e,t);switch(i){case`referenceHidden`:{let e=og(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:sg(e)}}}case`escaped`:{let e=og(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:sg(e)}}}default:return{}}}}},lg=new Set([`left`,`top`]);async function ug(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Fh(n),s=Ih(n),c=zh(n)===`y`,l=lg.has(o)?-1:1,u=a&&c?-1:1,d=Ph(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var dg=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ug(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fg=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ph(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=zh(Fh(i)),p=Lh(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Nh(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Nh(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},pg=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ph(e,t),u={x:n,y:r},d=zh(i),f=Lh(d),p=u[f],m=u[d],h=Ph(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=lg.has(Fh(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},mg=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ph(e,t),u=await o.detectOverflow(t,l),d=Fh(i),f=Ih(i),p=zh(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Dh(h-u[g],v),x=Dh(m-u[_],y),S=!t.middlewareData.shift,ee=b,C=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(ee=v),S&&!f){let e=Oh(u.left,0),t=Oh(u.right,0),n=Oh(u.top,0),r=Oh(u.bottom,0);p?C=m-2*(e!==0||t!==0?e+t:Oh(u.left,u.right)):ee=h-2*(n!==0||r!==0?n+r:Oh(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:ee});let te=await o.getDimensions(s.floating);return m!==te.width||h!==te.height?{reset:{rects:!0}}:{}}}};function hg(){return typeof window<`u`}function gg(e){return yg(e)?(e.nodeName||``).toLowerCase():`#document`}function _g(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vg(e){return((yg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function yg(e){return hg()?e instanceof Node||e instanceof _g(e).Node:!1}function bg(e){return hg()?e instanceof Element||e instanceof _g(e).Element:!1}function xg(e){return hg()?e instanceof HTMLElement||e instanceof _g(e).HTMLElement:!1}function Sg(e){return!hg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof _g(e).ShadowRoot}function Cg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Pg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function wg(e){return/^(table|td|th)$/.test(gg(e))}function Tg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Eg=/transform|translate|scale|rotate|perspective|filter/,Dg=/paint|layout|strict|content/,Og=e=>!!e&&e!==`none`,kg;function Ag(e){let t=bg(e)?Pg(e):e;return Og(t.transform)||Og(t.translate)||Og(t.scale)||Og(t.rotate)||Og(t.perspective)||!Mg()&&(Og(t.backdropFilter)||Og(t.filter))||Eg.test(t.willChange||``)||Dg.test(t.contain||``)}function jg(e){let t=Ig(e);for(;xg(t)&&!Ng(t);){if(Ag(t))return t;if(Tg(t))return null;t=Ig(t)}return null}function Mg(){return kg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),kg}function Ng(e){return/^(html|body|#document)$/.test(gg(e))}function Pg(e){return _g(e).getComputedStyle(e)}function Fg(e){return bg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ig(e){if(gg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Sg(e)&&e.host||vg(e);return Sg(t)?t.host:t}function Lg(e){let t=Ig(e);return Ng(t)?e.ownerDocument?e.ownerDocument.body:e.body:xg(t)&&Cg(t)?t:Lg(t)}function Rg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Lg(e),i=r===e.ownerDocument?.body,a=_g(r);if(i){let e=zg(a);return t.concat(a,a.visualViewport||[],Cg(r)?r:[],e&&n?Rg(e):[])}else return t.concat(r,Rg(r,[],n))}function zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bg(e){let t=Pg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=kh(n)!==a||kh(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Vg(e){return bg(e)?e:e.contextElement}function Hg(e){let t=Vg(e);if(!xg(t))return jh(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Bg(t),o=(a?kh(n.width):n.width)/r,s=(a?kh(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ug=jh(0);function Wg(e){let t=_g(e);return!Mg()||!t.visualViewport?Ug:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_g(e)?!1:t}function Kg(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Vg(e),o=jh(1);t&&(r?bg(r)&&(o=Hg(r)):o=Hg(e));let s=Gg(a,n,r)?Wg(a):jh(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=_g(a),t=r&&bg(r)?_g(r):r,n=e,i=zg(n);for(;i&&r&&t!==n;){let e=Hg(i),t=i.getBoundingClientRect(),r=Pg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=_g(i),i=zg(n)}}return $h({width:u,height:d,x:c,y:l})}function qg(e,t){let n=Fg(e).scrollLeft;return t?t.left+n:Kg(vg(e)).left+n}function Jg(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qg(e,n),y:n.top+t.scrollTop}}function Yg(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=vg(r),s=t?Tg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=jh(1),u=jh(0),d=xg(r);if((d||!d&&!a)&&((gg(r)!==`body`||Cg(o))&&(c=Fg(r)),d)){let e=Kg(r);l=Hg(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Jg(o,c):jh(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Xg(e){return Array.from(e.getClientRects())}function Zg(e){let t=vg(e),n=Fg(e),r=e.ownerDocument.body,i=Oh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Oh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+qg(e),s=-n.scrollTop;return Pg(r).direction===`rtl`&&(o+=Oh(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Qg=25;function $g(e,t){let n=_g(e),r=vg(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Mg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=qg(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Qg&&(a-=o)}else l<=Qg&&(a+=l);return{width:a,height:o,x:s,y:c}}function e_(e,t){let n=Kg(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xg(e)?Hg(e):jh(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function t_(e,t,n){let r;if(t===`viewport`)r=$g(e,n);else if(t===`document`)r=Zg(vg(e));else if(bg(t))r=e_(t,n);else{let n=Wg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $h(r)}function n_(e,t){let n=Ig(e);return n===t||!bg(n)||Ng(n)?!1:Pg(n).position===`fixed`||n_(n,t)}function r_(e,t){let n=t.get(e);if(n)return n;let r=Rg(e,[],!1).filter(e=>bg(e)&&gg(e)!==`body`),i=null,a=Pg(e).position===`fixed`,o=a?Ig(e):e;for(;bg(o)&&!Ng(o);){let t=Pg(o),n=Ag(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Cg(o)&&!n&&n_(e,o))?r=r.filter(e=>e!==o):i=t,o=Ig(o)}return t.set(e,r),r}function i_(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Tg(t)?[]:r_(t,this._c):[].concat(n),r],o=t_(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=t_(t,a[e],i);s=Oh(n.top,s),c=Dh(n.right,c),l=Dh(n.bottom,l),u=Oh(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function a_(e){let{width:t,height:n}=Bg(e);return{width:t,height:n}}function o_(e,t,n){let r=xg(t),i=vg(t),a=n===`fixed`,o=Kg(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=jh(0);function l(){c.x=qg(i)}if(r||!r&&!a)if((gg(t)!==`body`||Cg(i))&&(s=Fg(t)),r){let e=Kg(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Jg(i,s):jh(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function s_(e){return Pg(e).position===`static`}function c_(e,t){if(!xg(e)||Pg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return vg(e)===n&&(n=n.ownerDocument.body),n}function l_(e,t){let n=_g(e);if(Tg(e))return n;if(!xg(e)){let t=Ig(e);for(;t&&!Ng(t);){if(bg(t)&&!s_(t))return t;t=Ig(t)}return n}let r=c_(e,t);for(;r&&wg(r)&&s_(r);)r=c_(r,t);return r&&Ng(r)&&s_(r)&&!Ag(r)?n:r||jg(e)||n}var u_=async function(e){let t=this.getOffsetParent||l_,n=this.getDimensions,r=await n(e.floating);return{reference:o_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function d_(e){return Pg(e).direction===`rtl`}var f_={convertOffsetParentRelativeRectToViewportRelativeRect:Yg,getDocumentElement:vg,getClippingRect:i_,getOffsetParent:l_,getElementRects:u_,getClientRects:Xg,getDimensions:a_,getScale:Hg,isElement:bg,isRTL:d_};function p_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function m_(e,t){let n=null,r,i=vg(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Ah(d),h=Ah(i.clientWidth-(u+f)),g=Ah(i.clientHeight-(d+p)),_=Ah(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Oh(0,Dh(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!p_(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function h_(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Vg(e),u=i||a?[...l?Rg(l):[],...t?Rg(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?m_(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Kg(e):null;c&&g();function g(){let t=Kg(e);h&&!p_(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var g_=dg,__=fg,v_=ag,y_=mg,b_=cg,x_=ig,S_=pg,C_=(e,t,n)=>{let r=new Map,i={platform:f_,...n},a={...i.platform,_c:r};return rg(e,t,{...i,platform:a})};function w_(e){return typeof e==`function`?e():e}function T_(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function E_(e,t){let n=T_(e);return Math.round(t*n)/n}function D_(e){return{[`--bits-${e}-content-transform-origin`]:`var(--bits-floating-transform-origin)`,[`--bits-${e}-content-available-width`]:`var(--bits-floating-available-width)`,[`--bits-${e}-content-available-height`]:`var(--bits-floating-available-height)`,[`--bits-${e}-anchor-width`]:`var(--bits-floating-anchor-width)`,[`--bits-${e}-anchor-height`]:`var(--bits-floating-anchor-height)`}}function O_(e){let t=e.whileElementsMounted,n=k(()=>w_(e.open)??!0),r=k(()=>w_(e.middleware)),i=k(()=>w_(e.transform)??!0),a=k(()=>w_(e.placement)??`bottom`),o=k(()=>w_(e.strategy)??`absolute`),s=k(()=>w_(e.sideOffset)??0),c=k(()=>w_(e.alignOffset)??0),l=e.reference,u=A(0),d=A(0),f=vf(null),p=A(Mn(I(o))),m=A(Mn(I(a))),h=A(Mn({})),g=A(!1),_=!1,v=0,y=k(()=>{let e=f.current?E_(f.current,I(u)):I(u),t=f.current?E_(f.current,I(d)):I(d);return I(i)?{position:I(p),left:`0`,top:`0`,transform:`translate(${e}px, ${t}px)`,...f.current&&T_(f.current)>=1.5&&{willChange:`transform`}}:{position:I(p),left:`${e}px`,top:`${t}px`}}),b;function x(){if(l.current===null||f.current===null)return;let e=l.current,t=f.current,i=++v;C_(e,t,{middleware:I(r),placement:I(a),strategy:I(o)}).then(r=>{if(i===v&&!(l.current!==e||f.current!==t)){if(k_(e)){j(h,{...I(h),hide:{...I(h).hide,referenceHidden:!0}},!0);return}if(!I(n)&&I(u)!==0&&I(d)!==0){let e=Math.max(Math.abs(I(s)),Math.abs(I(c)),15);if(r.x<=e&&r.y<=e)return}j(u,r.x,!0),j(d,r.y,!0),j(p,r.strategy,!0),j(m,r.placement,!0),j(h,r.middlewareData,!0),j(g,!0)}})}function S(){typeof b==`function`&&(b(),b=void 0),v++}function ee(){if(S(),t===void 0){x();return}I(n)&&(l.current===null||f.current===null||(b=t(l.current,f.current,x)))}function C(){!I(n)&&f.current===null&&j(g,!1)}function te(){return[I(r),I(a),I(o),I(s),I(c),I(n)]}return rr(()=>{t===void 0&&I(n)&&x()}),rr(ee),rr(()=>{if(t!==void 0){if(te(),!I(n)){_=!1;return}if(!I(g)){_=!1;return}if(!_){_=!0;return}x()}}),rr(C),rr(()=>S),{floating:f,reference:l,get strategy(){return I(p)},get placement(){return I(m)},get middlewareData(){return I(h)},get isPositioned(){return I(g)},get floatingStyles(){return I(y)},get update(){return x}}}function k_(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}var A_={top:`bottom`,right:`left`,bottom:`top`,left:`right`},j_=new Uf(`Floating.Root`),M_=new Uf(`Floating.Content`),N_=new Uf(`Floating.Root`),P_=class e{static create(t=!1){return t?N_.set(new e):j_.set(new e)}anchorNode=vf(null);customAnchorNode=vf(null);triggerNode=vf(null);constructor(){rr(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current==`string`?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}},F_=class e{static create(t,n=!1){return n?M_.set(new e(t,N_.get())):M_.set(new e(t,j_.get()))}opts;root;contentRef=vf(null);wrapperRef=vf(null);arrowRef=vf(null);contentAttachment=_p(this.contentRef);wrapperAttachment=_p(this.wrapperRef);arrowAttachment=_p(this.arrowRef);arrowId=vf(Gm());#e=k(()=>{if(typeof this.opts.style==`string`)return kf(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#n=new $f(()=>this.arrowRef.current??void 0);#r=k(()=>this.#n?.width??0);#i=k(()=>this.#n?.height??0);#a=k(()=>this.opts.side?.current+(this.opts.align.current===`center`?``:`-${this.opts.align.current}`));#o=k(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=k(()=>I(this.#o).length>0);get hasExplicitBoundaries(){return I(this.#s)}set hasExplicitBoundaries(e){j(this.#s,e)}#c=k(()=>({padding:this.opts.collisionPadding.current,boundary:I(this.#o).filter(cne),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return I(this.#c)}set detectOverflowOptions(e){j(this.#c,e)}#l=A(void 0);#u=A(void 0);#d=A(void 0);#f=A(void 0);#p=k(()=>[g_({mainAxis:this.opts.sideOffset.current+I(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&__({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current===`partial`?S_():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&v_({...this.detectOverflowOptions}),y_({...this.detectOverflowOptions,apply:({rects:e,availableWidth:t,availableHeight:n})=>{let{width:r,height:i}=e.reference;j(this.#l,t,!0),j(this.#u,n,!0),j(this.#d,r,!0),j(this.#f,i,!0)}}),this.arrowRef.current&&x_({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),R_({arrowWidth:I(this.#r),arrowHeight:I(this.#i)}),this.opts.hideWhenDetached.current&&b_({strategy:`referenceHidden`,...this.detectOverflowOptions})].filter(Boolean));get middleware(){return I(this.#p)}set middleware(e){j(this.#p,e)}floating;#m=k(()=>B_(this.floating.placement));get placedSide(){return I(this.#m)}set placedSide(e){j(this.#m,e)}#h=k(()=>V_(this.floating.placement));get placedAlign(){return I(this.#h)}set placedAlign(e){j(this.#h,e)}#g=k(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return I(this.#g)}set arrowX(e){j(this.#g,e)}#_=k(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return I(this.#_)}set arrowY(e){j(this.#_,e)}#v=k(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return I(this.#v)}set cannotCenterArrow(e){j(this.#v,e)}#y=A();get contentZIndex(){return I(this.#y)}set contentZIndex(e){j(this.#y,e,!0)}#b=k(()=>A_[this.placedSide]);get arrowBaseSide(){return I(this.#b)}set arrowBaseSide(e){j(this.#b,e)}#x=k(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":``,style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${I(this.#l)}px`,"--bits-floating-available-height":`${I(this.#u)}px`,"--bits-floating-anchor-width":`${I(this.#d)}px`,"--bits-floating-anchor-height":`${I(this.#f)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:`hidden`,"pointer-events":`none`},...I(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return I(this.#x)}set wrapperProps(e){j(this.#x,e)}#S=k(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Pf({...I(this.#e)}),...this.contentAttachment}));get props(){return I(this.#S)}set props(e){j(this.#S,e)}#C=k(()=>({position:`absolute`,left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[this.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[this.placedSide],visibility:this.cannotCenterArrow?`hidden`:void 0}));get arrowStyle(){return I(this.#C)}set arrowStyle(e){j(this.#C,e)}constructor(e,t){this.opts=e,this.root=t,this.#t=e.updatePositionStrategy,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),Jf(()=>e.customAnchor.current,e=>{this.root.customAnchorNode.current=e}),this.floating=O_({strategy:()=>this.opts.strategy.current,placement:()=>I(this.#a),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...e)=>h_(...e,{animationFrame:this.#t?.current===`always`}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),rr(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Jf(()=>this.contentRef.current,e=>{if(!e||!this.opts.enabled.current)return;let t=hp(e),n=t.requestAnimationFrame(()=>{if(this.contentRef.current!==e||!this.opts.enabled.current)return;let n=t.getComputedStyle(e).zIndex;n!==this.contentZIndex&&(this.contentZIndex=n)});return()=>{t.cancelAnimationFrame(n)}}),rr(()=>{this.floating.floating.current=this.wrapperRef.current})}},I_=class e{static create(t){return new e(t,M_.get())}opts;content;constructor(e,t){this.opts=e,this.content=t}#e=k(()=>({id:this.opts.id.current,style:this.content.arrowStyle,"data-side":this.content.placedSide,...this.content.arrowAttachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},L_=class e{static create(t,n=!1){return n?new e(t,N_.get()):new e(t,j_.get())}opts;root;constructor(e,t){this.opts=e,this.root=t,e.virtualEl&&e.virtualEl.current?t.triggerNode=hf(e.virtualEl.current):t.triggerNode=e.ref}};function R_(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=z_(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}}function z_(e){let[t,n=`center`]=e.split(`-`);return[t,n]}function B_(e){return z_(e)[0]}function V_(e){return z_(e)[1]}function H_(e,t){D(t,!0);let n=q(t,`tooltip`,3,!1);P_.create(n());var r=R();H(N(r),()=>t.children??w),z(e,r),O()}var U_=class{#e;#t=k(()=>this.#e.candidateValues());#n;constructor(e){this.#e=e,this.#n=Cm(``,{afterMs:1e3,getWindow:this.#e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e){if(!this.#e.enabled()||!I(this.#t).length)return;this.#n.current=this.#n.current+e;let t=this.#e.getCurrentItem(),n=I(this.#t).find(e=>e===t)??``,r=xm(I(this.#t).map(e=>e??``),this.#n.current,n),i=I(this.#t).find(e=>e===r);return i&&this.#e.onMatch(i),i}resetTypeahead(){this.#n.current=``}},W_=[Tp,jp,kp],G_=[Op,Ap,`End`],K_=[...W_,...G_],q_=wp({component:`select`,parts:[`trigger`,`content`,`item`,`viewport`,`scroll-up-button`,`scroll-down-button`,`group`,`group-label`,`separator`,`arrow`,`input`,`content-wrapper`,`item-text`,`value`]}),J_=new Uf(`Select.Root | Combobox.Root`);new Uf(`Select.Group | Combobox.Group`);var Y_=new Uf(`Select.Content | Combobox.Content`),X_=class{opts;#e=A(!1);get touchedInput(){return I(this.#e)}set touchedInput(e){j(this.#e,e,!0)}#t=A(null);get inputNode(){return I(this.#t)}set inputNode(e){j(this.#t,e,!0)}#n=A(null);get contentNode(){return I(this.#n)}set contentNode(e){j(this.#n,e,!0)}contentPresence;#r=A(null);get viewportNode(){return I(this.#r)}set viewportNode(e){j(this.#r,e,!0)}#i=A(null);get triggerNode(){return I(this.#i)}set triggerNode(e){j(this.#i,e,!0)}#a=A(null);get valueNode(){return I(this.#a)}set valueNode(e){j(this.#a,e,!0)}#o=A(``);get valueId(){return I(this.#o)}set valueId(e){j(this.#o,e,!0)}#s=A(null);get highlightedNode(){return I(this.#s)}set highlightedNode(e){j(this.#s,e,!0)}#c=k(()=>this.highlightedNode?this.highlightedNode.getAttribute(`data-value`):null);get highlightedValue(){return I(this.#c)}set highlightedValue(e){j(this.#c,e)}#l=k(()=>{if(this.highlightedNode)return this.highlightedNode.id});get highlightedId(){return I(this.#l)}set highlightedId(e){j(this.#l,e)}#u=k(()=>this.highlightedNode?this.highlightedNode.getAttribute(`data-label`):null);get highlightedLabel(){return I(this.#u)}set highlightedLabel(e){j(this.#u,e)}#d=A(!1);get contentIsPositioned(){return I(this.#d)}set contentIsPositioned(e){j(this.#d,e,!0)}isUsingKeyboard=!1;isCombobox=!1;domContext=new gp(()=>null);constructor(e){this.opts=e,this.isCombobox=e.isCombobox,this.contentPresence=new Bp({ref:J(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),ar(()=>{this.opts.open.current||this.setHighlightedNode(null)})}setHighlightedNode(e,t=!1){this.highlightedNode=e,e&&(this.isUsingKeyboard||t)&&this.scrollHighlightedNodeIntoView(e)}scrollHighlightedNodeIntoView(e){!this.viewportNode||!this.contentIsPositioned||e.scrollIntoView({block:this.opts.scrollAlignment.current})}getCandidateNodes(){let e=this.contentNode;return e?Array.from(e.querySelectorAll(`[${this.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}setHighlightedToFirstCandidate(e=!1){this.setHighlightedNode(null);let t=this.getCandidateNodes();if(t.length){if(this.viewportNode){let e=this.viewportNode.getBoundingClientRect();t=t.filter(t=>{if(!this.viewportNode)return!1;let n=t.getBoundingClientRect();return n.right<=e.right&&n.left>=e.left&&n.bottom<=e.bottom&&n.top>=e.top})}this.setHighlightedNode(t[0],e)}}getNodeByValue(e){return this.getCandidateNodes().find(t=>t.dataset.value===e)??null}getLabelForValue(e){if(e===``)return``;let t=this.opts.items.current.find(t=>t.value===e)?.label;if(t!==void 0)return t;let n=this.getNodeByValue(e);if(n){let t=n.getAttribute(`data-label`);return t!==null&&t!==``?t:n.textContent?.trim()??e}return e}setOpen(e){this.opts.open.current=e}toggleOpen(){this.opts.open.current=!this.opts.open.current}handleOpen(){this.setOpen(!0)}handleClose(){this.setHighlightedNode(null),this.setOpen(!1)}toggleMenu(){this.toggleOpen()}getBitsAttr=e=>q_.getAttr(e,this.isCombobox?`combobox`:void 0)},Z_=class extends X_{opts;isMulti=!1;#e=k(()=>this.opts.value.current!==``);get hasValue(){return I(this.#e)}set hasValue(e){j(this.#e,e)}#t=k(()=>this.opts.items.current.length?this.opts.items.current.find(e=>e.value===this.opts.value.current)?.label??``:``);get currentLabel(){return I(this.#t)}set currentLabel(e){j(this.#t,e)}#n=k(()=>this.opts.items.current.length?this.opts.items.current.filter(e=>!e.disabled).map(e=>e.label):[]);get candidateLabels(){return I(this.#n)}set candidateLabels(e){j(this.#n,e)}#r=k(()=>!(this.isMulti||this.opts.items.current.length===0));get dataTypeaheadEnabled(){return I(this.#r)}set dataTypeaheadEnabled(e){j(this.#r,e)}constructor(e){super(e),this.opts=e,rr(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),Jf(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current===e}toggleItem(e,t=e){let n=this.includesItem(e)?``:e;this.opts.value.current=n,n!==``&&(this.opts.inputValue.current=t)}setInitialHighlightedNode(){up(()=>{if(!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current!==``){let e=this.getNodeByValue(this.opts.value.current);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}},Q_=class extends X_{opts;isMulti=!0;#e=k(()=>this.opts.value.current.length>0);get hasValue(){return I(this.#e)}set hasValue(e){j(this.#e,e)}constructor(e){super(e),this.opts=e,rr(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),Jf(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t=e){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):this.opts.value.current=[...this.opts.value.current,e],this.opts.inputValue.current=t}setInitialHighlightedNode(){up(()=>{if(this.domContext&&!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current.length&&this.opts.value.current[0]!==``){let e=this.getNodeByValue(this.opts.value.current[0]);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}},$_=class{static create(e){let{type:t,...n}=e,r=t===`single`?new Z_(n):new Q_(n);return J_.set(r)}},ev=class e{static create(t){return new e(t,J_.get())}opts;root;attachment;#e;#t;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref,e=>this.root.triggerNode=e),this.root.domContext=new gp(e.ref),this.#e=new wm({getCurrentItem:()=>this.root.highlightedNode,onMatch:e=>{this.root.setHighlightedNode(e)},getActiveElement:()=>this.root.domContext.getActiveElement(),getWindow:()=>this.root.domContext.getWindow()}),this.#t=new U_({getCurrentItem:()=>this.root.isMulti?``:this.root.currentLabel,onMatch:e=>{if(this.root.isMulti||!this.root.opts.items.current)return;let t=this.root.opts.items.current.find(t=>t.label===e);t&&(this.root.opts.value.current=t.value)},enabled:()=>!this.root.isMulti&&this.root.dataTypeaheadEnabled,candidateValues:()=>this.root.isMulti?[]:this.root.candidateLabels,getWindow:()=>this.root.domContext.getWindow()}),this.onkeydown=this.onkeydown.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onclick=this.onclick.bind(this)}#n(){this.root.opts.open.current=!0,this.#t.resetTypeahead(),this.#e.resetTypeahead()}#r(e){this.#n()}#i(){let e=this.root.highlightedValue===this.root.opts.value.current;return!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti||(this.root.highlightedValue!==null&&this.root.toggleItem(this.root.highlightedValue,this.root.highlightedLabel??void 0),!this.root.isMulti&&!e)?(this.root.handleClose(),!0):!1}onkeydown(e){if(this.root.isUsingKeyboard=!0,(e.key===`ArrowUp`||e.key===`ArrowDown`)&&e.preventDefault(),!this.root.opts.open.current){if(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),this.root.handleOpen();else if(!this.root.isMulti&&this.root.dataTypeaheadEnabled){this.#t.handleTypeaheadSearch(e.key);return}if(this.root.hasValue)return;let t=this.root.getCandidateNodes();if(!t.length)return;if(e.key===`ArrowDown`){let e=t[0];this.root.setHighlightedNode(e)}else if(e.key===`ArrowUp`){let e=t[t.length-1];this.root.setHighlightedNode(e)}return}if(e.key===`Tab`){this.root.handleClose();return}if((e.key===`Enter`||e.key===` `&&this.#e.search===``)&&!e.isComposing&&(e.preventDefault(),this.#i()))return;if(e.key===`ArrowUp`&&e.altKey&&this.root.handleClose(),K_.includes(e.key)){e.preventDefault();let t=this.root.getCandidateNodes(),n=this.root.highlightedNode,r=n?t.indexOf(n):-1,i=this.root.opts.loop.current,a;if(e.key===`ArrowDown`?a=ire(t,r,i):e.key===`ArrowUp`?a=are(t,r,i):e.key===`PageDown`?a=ore(t,r,10,i):e.key===`PageUp`?a=sre(t,r,10,i):e.key===`Home`?a=t[0]:e.key===`End`&&(a=t[t.length-1]),!a)return;this.root.setHighlightedNode(a);return}let t=e.ctrlKey||e.altKey||e.metaKey,n=e.key.length===1,r=e.key===` `,i=this.root.getCandidateNodes();if(e.key!==`Tab`){if(!t&&(n||r)){!this.#e.handleTypeaheadSearch(e.key,i)&&r&&(e.preventDefault(),this.#i());return}this.root.highlightedNode||this.root.setHighlightedToFirstCandidate()}}onclick(e){e.currentTarget.focus()}onpointerdown(e){if(this.root.opts.disabled.current)return;if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t?.hasPointerCapture(e.pointerId)&&t?.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(this.root.opts.open.current===!1?this.#r(e):this.root.handleClose())}onpointerup(e){this.root.opts.disabled.current||(e.preventDefault(),e.pointerType===`touch`&&(this.root.opts.open.current===!1?this.#r(e):this.root.handleClose()))}#a=k(()=>({id:this.opts.id.current,disabled:this.root.opts.disabled.current?!0:void 0,"aria-haspopup":`listbox`,"aria-expanded":vp(this.root.opts.open.current),"aria-activedescendant":this.root.highlightedId,"data-state":xp(this.root.opts.open.current),"data-disabled":yp(this.root.opts.disabled.current),"data-placeholder":this.root.hasValue?void 0:``,[this.root.getBitsAttr(`trigger`)]:``,onpointerdown:this.onpointerdown,onkeydown:this.onkeydown,onclick:this.onclick,onpointerup:this.onpointerup,...this.attachment}));get props(){return I(this.#a)}set props(e){j(this.#a,e)}},tv=class e{static create(t){return Y_.set(new e(t,J_.get()))}opts;root;attachment;#e=A(!1);get isPositioned(){return I(this.#e)}set isPositioned(e){j(this.#e,e,!0)}domContext;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref,e=>this.root.contentNode=e),this.domContext=new gp(this.opts.ref),this.root.domContext===null&&(this.root.domContext=this.domContext),sp(()=>{this.root.contentNode=null,this.root.contentIsPositioned=!1,this.isPositioned=!1}),Jf(()=>this.root.opts.open.current,()=>{this.root.opts.open.current||(this.root.contentIsPositioned=!1,this.isPositioned=!1)}),Jf([()=>this.isPositioned,()=>this.root.highlightedNode],()=>{!this.isPositioned||!this.root.highlightedNode||this.root.scrollHighlightedNodeIntoView(this.root.highlightedNode)}),this.onpointermove=this.onpointermove.bind(this)}onpointermove(e){this.root.isUsingKeyboard=!1}#t=k(()=>D_(this.root.isCombobox?`combobox`:`select`));onInteractOutside=e=>{if(e.target===this.root.triggerNode||e.target===this.root.inputNode){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#n=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#n)}set snippetProps(e){j(this.#n,e)}#r=k(()=>({id:this.opts.id.current,role:`listbox`,"aria-multiselectable":this.root.isMulti?`true`:void 0,"data-state":xp(this.root.opts.open.current),...Sp(this.root.contentPresence.transitionStatus),[this.root.getBitsAttr(`content`)]:``,style:{display:`flex`,flexDirection:`column`,outline:`none`,boxSizing:`border-box`,pointerEvents:`auto`,...I(this.#t)},onpointermove:this.onpointermove,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus,trapFocus:!1,loop:!1,onPlaced:()=>{this.root.opts.open.current&&(this.root.contentIsPositioned=!0,this.isPositioned=!0)}}},nv=class e{static create(t){return new e(t,J_.get())}opts;root;attachment;#e=k(()=>this.root.includesItem(this.opts.value.current));get isSelected(){return I(this.#e)}set isSelected(e){j(this.#e,e)}#t=k(()=>this.root.highlightedValue===this.opts.value.current);get isHighlighted(){return I(this.#t)}set isHighlighted(e){j(this.#t,e)}prevHighlighted=new tp(()=>this.isHighlighted);#n=A(!1);get mounted(){return I(this.#n)}set mounted(e){j(this.#n,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref),Jf([()=>this.isHighlighted,()=>this.prevHighlighted.current],()=>{this.isHighlighted?this.opts.onHighlight.current():this.prevHighlighted.current&&this.opts.onUnhighlight.current()}),Jf(()=>this.mounted,()=>{this.mounted&&this.root.setInitialHighlightedNode()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onpointermove=this.onpointermove.bind(this)}handleSelect(){if(this.opts.disabled.current)return;let e=this.opts.value.current===this.root.opts.value.current;if(!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti){this.root.handleClose();return}this.root.toggleItem(this.opts.value.current,this.opts.label.current),!this.root.isMulti&&!e&&this.root.handleClose()}#r=k(()=>({selected:this.isSelected,highlighted:this.isHighlighted}));get snippetProps(){return I(this.#r)}set snippetProps(e){j(this.#r,e)}onpointerdown(e){e.preventDefault()}onpointerup(e){if(!(e.defaultPrevented||!this.opts.ref.current)){if(e.pointerType===`touch`&&!Np){hi(this.opts.ref.current,`click`,()=>{this.handleSelect(),this.root.setHighlightedNode(this.opts.ref.current)},{once:!0});return}e.preventDefault(),this.handleSelect(),e.pointerType===`touch`&&this.root.setHighlightedNode(this.opts.ref.current)}}onpointermove(e){e.pointerType!==`touch`&&this.root.highlightedNode!==this.opts.ref.current&&this.root.setHighlightedNode(this.opts.ref.current)}#i=k(()=>({id:this.opts.id.current,role:`option`,"aria-selected":this.root.includesItem(this.opts.value.current)?`true`:void 0,"data-value":this.opts.value.current,"data-disabled":yp(this.opts.disabled.current),"data-highlighted":this.root.highlightedValue===this.opts.value.current&&!this.opts.disabled.current?``:void 0,"data-selected":this.root.includesItem(this.opts.value.current)?``:void 0,"data-label":this.opts.label.current,[this.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,...this.attachment}));get props(){return I(this.#i)}set props(e){j(this.#i,e)}},rv=class e{static create(t){return new e(t,J_.get())}opts;root;#e=k(()=>this.root.opts.name.current!==``);get shouldRender(){return I(this.#e)}set shouldRender(e){j(this.#e,e)}constructor(e,t){this.opts=e,this.root=t,this.onfocus=this.onfocus.bind(this)}onfocus(e){e.preventDefault(),this.root.isCombobox?this.root.inputNode?.focus():this.root.triggerNode?.focus()}#t=k(()=>({disabled:bp(this.root.opts.disabled.current),required:bp(this.root.opts.required.current),name:this.root.opts.name.current,value:this.opts.value.current,onfocus:this.onfocus}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},iv=class e{static create(t){return new e(t,Y_.get())}opts;content;root;attachment;#e=A(0);get prevScrollTop(){return I(this.#e)}set prevScrollTop(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.content=t,this.root=t.root,this.attachment=_p(e.ref,e=>{this.root.viewportNode=e})}#t=k(()=>({id:this.opts.id.current,role:`presentation`,[this.root.getBitsAttr(`viewport`)]:``,style:{position:`relative`,flex:1,overflow:`auto`},...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},av=class{opts;content;root;attachment;autoScrollTimer=null;userScrollTimer=-1;isUserScrolling=!1;onAutoScroll=Vp;#e=A(!1);get mounted(){return I(this.#e)}set mounted(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.content=t,this.root=t.root,this.attachment=_p(e.ref),Jf([()=>this.mounted],()=>{if(!this.mounted){this.isUserScrolling=!1;return}this.isUserScrolling}),rr(()=>{this.mounted||this.clearAutoScrollInterval()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}handleUserScroll(){this.content.domContext.clearTimeout(this.userScrollTimer),this.isUserScrolling=!0,this.userScrollTimer=this.content.domContext.setTimeout(()=>{this.isUserScrolling=!1},200)}clearAutoScrollInterval(){this.autoScrollTimer!==null&&(this.content.domContext.clearTimeout(this.autoScrollTimer),this.autoScrollTimer=null)}onpointerdown(e){if(this.autoScrollTimer!==null)return;let t=e=>{this.onAutoScroll(),this.autoScrollTimer=this.content.domContext.setTimeout(()=>t(e+1),this.opts.delay.current(e))};this.autoScrollTimer=this.content.domContext.setTimeout(()=>t(1),this.opts.delay.current(0))}onpointermove(e){this.onpointerdown(e)}onpointerleave(e){this.clearAutoScrollInterval()}#t=k(()=>({id:this.opts.id.current,"aria-hidden":Xte(!0),style:{flexShrink:0},onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},ov=class e{static create(t){return new e(new av(t,Y_.get()))}scrollButtonState;content;root;#e=A(!1);get canScrollDown(){return I(this.#e)}set canScrollDown(e){j(this.#e,e,!0)}scrollIntoViewTimer=null;constructor(e){this.scrollButtonState=e,this.content=e.content,this.root=e.root,this.scrollButtonState.onAutoScroll=this.handleAutoScroll,Jf([()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.root.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),hi(this.root.viewportNode,`scroll`,()=>this.handleScroll())}),Jf([()=>this.root.opts.inputValue.current,()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{!this.root.viewportNode||!this.content.isPositioned||this.handleScroll(!0)}),Jf(()=>this.scrollButtonState.mounted,()=>{this.scrollButtonState.mounted&&(this.scrollIntoViewTimer&&clearTimeout(this.scrollIntoViewTimer),this.scrollIntoViewTimer=lp(5,()=>{let e=this.root.highlightedNode;e&&this.root.scrollHighlightedNodeIntoView(e)}))})}handleScroll=(e=!1)=>{if(e||this.scrollButtonState.handleUserScroll(),!this.root.viewportNode)return;let t=this.root.viewportNode.scrollHeight-this.root.viewportNode.clientHeight,n=Number.parseInt(getComputedStyle(this.root.viewportNode).paddingTop,10);this.canScrollDown=Math.ceil(this.root.viewportNode.scrollTop)<t-n};handleAutoScroll=()=>{let e=this.root.viewportNode,t=this.root.highlightedNode;!e||!t||(e.scrollTop+=t.offsetHeight)};#t=k(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr(`scroll-down-button`)]:``}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},sv=class e{static create(t){return new e(new av(t,Y_.get()))}scrollButtonState;content;root;#e=A(!1);get canScrollUp(){return I(this.#e)}set canScrollUp(e){j(this.#e,e,!0)}constructor(e){this.scrollButtonState=e,this.content=e.content,this.root=e.root,this.scrollButtonState.onAutoScroll=this.handleAutoScroll,Jf([()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.root.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),hi(this.root.viewportNode,`scroll`,()=>this.handleScroll())})}handleScroll=(e=!1)=>{if(e||this.scrollButtonState.handleUserScroll(),!this.root.viewportNode)return;let t=Number.parseInt(getComputedStyle(this.root.viewportNode).paddingTop,10);this.canScrollUp=this.root.viewportNode.scrollTop-t>.1};handleAutoScroll=()=>{!this.root.viewportNode||!this.root.highlightedNode||(this.root.viewportNode.scrollTop=this.root.viewportNode.scrollTop-this.root.highlightedNode.offsetHeight)};#t=k(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr(`scroll-up-button`)]:``}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}};function cv(e,t){D(t,!0);let n=q(t,`value`,15),r=rv.create({value:J(()=>n())});var i=R(),a=N(i),o=e=>{bh(e,K(()=>r.props,{get autocomplete(){return t.autocomplete},get value(){return n()},set value(e){n(e)}}))};V(a,e=>{r.shouldRender&&e(o)}),z(e,i),O()}function lv(e,t){D(t,!0);let n=q(t,`tooltip`,3,!1);L_.create({id:J(()=>t.id),virtualEl:J(()=>t.virtualEl),ref:t.ref},n());var r=R();H(N(r),()=>t.children??w),z(e,r),O()}var uv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`width`,`height`]),dv=Ci(`<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>`),fv=L(`<span><!></span>`);function pv(e,t){D(t,!0);let n=q(t,`id`,19,Gm),r=q(t,`width`,3,10),i=q(t,`height`,3,5),a=G(t,uv),o=k(()=>Lf(a,{id:n()}));var s=R(),c=N(s),l=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(o)})),z(e,n)},u=e=>{var n=fv();_a(n,()=>({...I(o)}));var a=M(n),s=e=>{var n=R();H(N(n),()=>t.children??w),z(e,n)},c=e=>{var t=dv();F(()=>{W(t,`width`,r()),W(t,`height`,i())}),z(e,t)};V(a,e=>{t.children?e(s):e(c,-1)}),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s),O()}var mv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`]);function hv(e,t){D(t,!0);let n=q(t,`id`,19,Gm),r=q(t,`ref`,15,null),i=G(t,mv),a=I_.create({id:J(()=>n()),ref:J(()=>r(),e=>r(e))}),o=k(()=>Lf(i,a.props));pv(e,K(()=>I(o))),O()}function gv(e,t){D(t,!0);let n=q(t,`side`,3,`bottom`),r=q(t,`sideOffset`,3,0),i=q(t,`align`,3,`center`),a=q(t,`alignOffset`,3,0),o=q(t,`arrowPadding`,3,0),s=q(t,`avoidCollisions`,3,!0),c=q(t,`collisionBoundary`,19,()=>[]),l=q(t,`collisionPadding`,3,0),u=q(t,`hideWhenDetached`,3,!1),d=q(t,`onPlaced`,3,()=>{}),f=q(t,`sticky`,3,`partial`),p=q(t,`updatePositionStrategy`,3,`optimized`),m=q(t,`strategy`,3,`fixed`),h=q(t,`dir`,3,`ltr`),g=q(t,`style`,19,()=>({})),_=q(t,`wrapperId`,19,Gm),v=q(t,`customAnchor`,3,null),y=q(t,`tooltip`,3,!1),b=F_.create({side:J(()=>n()),sideOffset:J(()=>r()),align:J(()=>i()),alignOffset:J(()=>a()),id:J(()=>t.id),arrowPadding:J(()=>o()),avoidCollisions:J(()=>s()),collisionBoundary:J(()=>c()),collisionPadding:J(()=>l()),hideWhenDetached:J(()=>u()),onPlaced:J(()=>d()),sticky:J(()=>f()),updatePositionStrategy:J(()=>p()),strategy:J(()=>m()),dir:J(()=>h()),style:J(()=>g()),enabled:J(()=>t.enabled),wrapperId:J(()=>_()),customAnchor:J(()=>v())},y()),x=k(()=>Lf(b.wrapperProps,{style:{pointerEvents:`auto`}}));var S=R();H(N(S),()=>t.content??w,()=>({props:b.props,wrapperProps:I(x)})),z(e,S),O()}function _v(e,t){D(t,!0),Oa(()=>{t.onPlaced?.()});var n=R();H(N(n),()=>t.content??w,()=>({props:{},wrapperProps:{}})),z(e,n),O()}var vv=new Set([`$$slots`,`$$events`,`$$legacy`,`content`,`isStatic`,`onPlaced`]);function yv(e,t){let n=q(t,`isStatic`,3,!1),r=G(t,vv);var i=R(),a=N(i),o=e=>{_v(e,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},s=e=>{gv(e,K({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};V(a,e=>{n()?e(o):e(s,-1)}),z(e,i)}var bv=new Set(`$$slots.$$events.$$legacy.popper.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.enabled.ref.tooltip.contentPointerEvents`.split(`.`)),xv=L(`<!> <!>`,1);function Sv(e,t){D(t,!0);let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`trapFocus`,3,!0),i=q(t,`isValidEvent`,3,()=>!1),a=q(t,`customAnchor`,3,null),o=q(t,`isStatic`,3,!1),s=q(t,`tooltip`,3,!1),c=q(t,`contentPointerEvents`,3,`auto`),l=G(t,bv),u=k(()=>t.preventScroll??!0),d=k(()=>t.strategy??(I(u)?`fixed`:`absolute`));yv(e,{get isStatic(){return o()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return I(d)},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get enabled(){return t.enabled},get tooltip(){return s()},content:(e,a)=>{let o=()=>a?.().props,s=()=>a?.().wrapperProps;var d=xv(),f=N(d),p=e=>{th(e,{get preventScroll(){return I(u)}})},m=e=>{th(e,{get preventScroll(){return I(u)}})};V(f,e=>{t.forceMount&&t.enabled?e(p):t.forceMount||e(m,1)}),Bm(P(f,2),{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(e,r)=>{let a=()=>r?.().props;zm(e,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,r)=>{Rm(e,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,n)=>{let r=()=>n?.().props;Wm(e,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,n)=>{var i=R(),u=N(i);{let e=k(()=>({props:Lf(l,o(),r(),a(),{style:{pointerEvents:c()}}),wrapperProps:s()}));H(u,()=>t.popper??w,()=>I(e))}z(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),z(e,d)},$$slots:{content:!0}}),O()}var Cv=new Set(`$$slots.$$events.$$legacy.popper.open.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.ref.shouldRender`.split(`.`));function wv(e,t){let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`trapFocus`,3,!0),i=q(t,`isValidEvent`,3,()=>!1),a=q(t,`customAnchor`,3,null),o=q(t,`isStatic`,3,!1),s=G(t,Cv);var c=R(),l=N(c),u=e=>{Sv(e,K({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>s))};V(l,e=>{t.shouldRender&&e(u)}),z(e,c)}var Tv=new Set(`$$slots.$$events.$$legacy.popper.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.enabled`.split(`.`));function Ev(e,t){let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`trapFocus`,3,!0),i=q(t,`isValidEvent`,3,()=>!1),a=q(t,`customAnchor`,3,null),o=q(t,`isStatic`,3,!1),s=G(t,Tv);Sv(e,K({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>s,{forceMount:!0}))}var Dv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`,`side`,`onInteractOutside`,`onEscapeKeydown`,`children`,`child`,`preventScroll`,`style`]),Ov=L(`<div><div><!></div></div>`);function kv(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=q(t,`side`,3,`bottom`),s=q(t,`onInteractOutside`,3,Vp),c=q(t,`onEscapeKeydown`,3,Vp),l=q(t,`preventScroll`,3,!1),u=G(t,Dv),d=tv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),onInteractOutside:J(()=>s()),onEscapeKeydown:J(()=>c())}),f=k(()=>Lf(u,d.props));var p=R(),m=N(p),h=e=>{Ev(e,K(()=>I(f),()=>d.popperProps,{get ref(){return d.opts.ref},get side(){return o()},get enabled(){return d.root.opts.open.current},get id(){return r()},get preventScroll(){return l()},forceMount:!0,get shouldRender(){return d.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:d.props.style},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...d.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Ov();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},g=e=>{wv(e,K(()=>I(f),()=>d.popperProps,{get ref(){return d.opts.ref},get side(){return o()},get open(){return d.root.opts.open.current},get id(){return r()},get preventScroll(){return l()},forceMount:!1,get shouldRender(){return d.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:d.props.style},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...d.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Ov();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(m,e=>{a()?e(h):a()||e(g,1)}),z(e,p),O()}function Av(e,t){D(t,!0);let n=q(t,`mounted`,15,!1),r=q(t,`onMountedChange`,3,Vp);cp(()=>(n(!0),r()(!0),()=>{n(!1),r()(!1)})),O()}var jv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`label`,`disabled`,`children`,`child`,`onHighlight`,`onUnhighlight`]),Mv=L(`<div><!></div>`),Nv=L(`<!> <!>`,1);function Pv(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`label`,19,()=>t.value),o=q(t,`disabled`,3,!1),s=q(t,`onHighlight`,3,Vp),c=q(t,`onUnhighlight`,3,Vp),l=G(t,jv),u=nv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),value:J(()=>t.value),disabled:J(()=>o()),label:J(()=>a()),onHighlight:J(()=>s()),onUnhighlight:J(()=>c())}),d=k(()=>Lf(l,u.props));var f=Nv(),p=N(f),m=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(d),...u.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},h=e=>{var n=Mv();_a(n,()=>({...I(d)})),H(M(n),()=>t.children??w,()=>u.snippetProps),T(n),z(e,n)};V(p,e=>{t.child?e(m):e(h,-1)}),Av(P(p,2),{get mounted(){return u.mounted},set mounted(e){u.mounted=e}}),z(e,f),O()}var Fv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`]),Iv=L(`<div><!></div>`);function Lv(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=G(t,Fv),o=iv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=Iv();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var Rv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`delay`,`child`,`children`]),zv=L(`<div><!></div>`),Bv=L(`<!> <!>`,1);function Vv(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`delay`,3,()=>50),o=G(t,Rv),s=ov.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),delay:J(()=>a())}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=Bv(),r=N(n);Av(r,{get mounted(){return s.scrollButtonState.mounted},set mounted(e){s.scrollButtonState.mounted=e}});var i=P(r,2),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:o})),z(e,n)},l=e=>{var n=zv();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(l,-1)}),z(e,n)};V(u,e=>{s.canScrollDown&&e(d)}),z(e,l),O()}var Hv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`delay`,`child`,`children`]),Uv=L(`<div><!></div>`),Wv=L(`<!> <!>`,1);function Gv(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`delay`,3,()=>50),o=G(t,Hv),s=sv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),delay:J(()=>a())}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=Wv(),r=N(n);Av(r,{get mounted(){return s.scrollButtonState.mounted},set mounted(e){s.scrollButtonState.mounted=e}});var i=P(r,2),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:o})),z(e,n)},l=e=>{var n=Uv();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(l,-1)}),z(e,n)};V(u,e=>{s.canScrollUp&&e(d)}),z(e,l),O()}function Kv(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`dir`,3,`ltr`),i=q(t,`onOpenChange`,3,Vp),a=q(t,`onOpenChangeComplete`,3,Vp),o=Nm.create({variant:J(()=>`context-menu`),dir:J(()=>r()),onClose:()=>{n(!1),i()?.(!1)}});Pm.create({open:J(()=>n(),e=>{n(e),i()(e)}),onOpenChangeComplete:J(()=>a())},o),H_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}function qv(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Vp),i=q(t,`onOpenChangeComplete`,3,Vp);Ere.create({open:J(()=>n(),e=>{n(e),r()?.(e)}),onOpenChangeComplete:J(()=>i())}),H_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}var Jv=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),Yv=L(`<div><!></div>`);function Xv(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=q(t,`disabled`,3,!1),o=q(t,`onSelect`,3,Vp),s=q(t,`closeOnSelect`,3,!0),c=G(t,Jv),l=yre.create({id:J(()=>i()),disabled:J(()=>a()),onSelect:J(()=>o()),ref:J(()=>r(),e=>r(e)),closeOnSelect:J(()=>s())}),u=k(()=>Lf(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=Yv();_a(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var Zv=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),Qv=L(`<div><!></div>`);function $v(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,Zv),o=xre.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=Qv();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var ey=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),ty=L(`<div><!></div>`);function ny(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,ey),o=Sre.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=ty();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var ry=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onCloseAutoFocus`,`onOpenAutoFocus`,`preventScroll`,`side`,`sideOffset`,`align`,`onEscapeKeydown`,`forceMount`,`trapFocus`,`style`]),iy=L(`<div><div><!></div></div>`);function ay(e,t){D(t,!0);let n=q(t,`id`,19,Gm),r=q(t,`ref`,15,null),i=q(t,`loop`,3,!0),a=q(t,`onInteractOutside`,3,Vp),o=q(t,`onCloseAutoFocus`,3,Vp),s=q(t,`onOpenAutoFocus`,3,Vp),c=q(t,`preventScroll`,3,!0),l=q(t,`side`,3,`right`),u=q(t,`sideOffset`,3,2),d=q(t,`align`,3,`start`),f=q(t,`onEscapeKeydown`,3,Vp),p=q(t,`forceMount`,3,!1),m=q(t,`trapFocus`,3,!1),h=G(t,ry),g=Fm.create({id:J(()=>n()),loop:J(()=>i()),ref:J(()=>r(),e=>r(e)),onCloseAutoFocus:J(()=>o())}),_=k(()=>Lf(h,g.props,{side:l(),sideOffset:u(),align:d(),onOpenAutoFocus:s(),isValidEvent:b,trapFocus:m(),loop:i(),id:n(),ref:g.opts.ref,preventScroll:c(),onInteractOutside:v,onEscapeKeydown:y,shouldRender:g.shouldRender}));function v(e){if(a()(e),!e.defaultPrevented){if(e.target&&e.target instanceof Element){let t=`[${g.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}g.parentMenu.onClose()}}function y(e){f()(e),!e.defaultPrevented&&g.parentMenu.onClose()}function b(e){if(`button`in e&&e.button===2){let t=e.target;return t?t.closest(`[${Tm}]`)!==g.parentMenu.triggerNode:!1}return!1}var x=R(),S=N(x),ee=e=>{Ev(e,K(()=>I(_),()=>g.popperProps,{get enabled(){return g.parentMenu.opts.open.current},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:D_(`context-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...g.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=iy();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},C=e=>{wv(e,K(()=>I(_),()=>g.popperProps,{get open(){return g.parentMenu.opts.open.current},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:D_(`context-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...g.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=iy();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(S,e=>{p()?e(ee):p()||e(C,1)}),z(e,x),O()}var oy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`]),sy=L(`<div><!></div>`);function cy(e,t){D(t,!0);let n=q(t,`id`,19,Gm),r=q(t,`ref`,15,null),i=q(t,`disabled`,3,!1),a=G(t,oy),o=Tre.create({id:J(()=>n()),disabled:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Lf(a,o.props,{style:{pointerEvents:`auto`}},{style:t.style,tabindex:t.tabindex}));var c=R();U(N(c),()=>lv,(e,r)=>{r(e,{get id(){return n()},get virtualEl(){return o.virtualElement},get ref(){return o.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},o=e=>{var n=sy();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}),z(e,c),O()}var ly=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),uy=L(`<div><!></div>`);function dy(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,ly),o=Cre.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=uy();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var fy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`loop`,`onInteractOutside`,`forceMount`,`onEscapeKeydown`,`interactOutsideBehavior`,`escapeKeydownBehavior`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onFocusOutside`,`side`,`trapFocus`,`style`]),py=L(`<div><div><!></div></div>`);function my(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`loop`,3,!0),o=q(t,`onInteractOutside`,3,Vp),s=q(t,`forceMount`,3,!1),c=q(t,`onEscapeKeydown`,3,Vp),l=q(t,`interactOutsideBehavior`,3,`defer-otherwise-close`),u=q(t,`escapeKeydownBehavior`,3,`defer-otherwise-close`),d=q(t,`onOpenAutoFocus`,3,Vp),f=q(t,`onCloseAutoFocus`,3,Vp),p=q(t,`onFocusOutside`,3,Vp),m=q(t,`side`,3,`right`),h=q(t,`trapFocus`,3,!1),g=G(t,fy),_=Fm.create({id:J(()=>r()),loop:J(()=>a()),ref:J(()=>i(),e=>i(e)),isSub:!0,onCloseAutoFocus:J(()=>S)});function v(e){let t=e.currentTarget.contains(e.target),n=Rne[_.parentMenu.root.opts.dir.current].includes(e.key);t&&n&&(_.parentMenu.onClose(),_.parentMenu.triggerNode?.focus(),e.preventDefault())}let y=k(()=>_.parentMenu.root.getBitsAttr(`sub-content`)),b=k(()=>Lf(g,_.props,{side:m(),onkeydown:v,[I(y)]:``}));function x(e){d()(e),!e.defaultPrevented&&(e.preventDefault(),_.parentMenu.root.isUsingKeyboard&&_.parentMenu.contentNode&&Am.dispatch(_.parentMenu.contentNode))}function S(e){f()(e),!e.defaultPrevented&&e.preventDefault()}function ee(e){o()(e),!e.defaultPrevented&&_.parentMenu.onClose()}function C(e){c()(e),!e.defaultPrevented&&_.parentMenu.onClose()}function te(e){if(p()(e),e.defaultPrevented||!Pp(e.target)||e.target.id===_.parentMenu.triggerNode?.id)return;if((_.parentMenu.parentMenu?.contentNode)?.contains(e.target)){_.parentMenu.onClose(),e.preventDefault();return}let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t)){e.preventDefault();return}_.parentMenu.onClose()}var ne=R(),re=N(ne),ie=e=>{Ev(e,K(()=>I(b),{get ref(){return _.opts.ref},get interactOutsideBehavior(){return l()},get escapeKeydownBehavior(){return u()},onOpenAutoFocus:x,get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:C,onFocusOutside:te,preventScroll:!1,get loop(){return a()},get trapFocus(){return h()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),I(b),{style:D_(`menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=py();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},ae=e=>{wv(e,K(()=>I(b),{get ref(){return _.opts.ref},get interactOutsideBehavior(){return l()},get escapeKeydownBehavior(){return u()},onCloseAutoFocus:S,onOpenAutoFocus:x,get open(){return _.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:C,onFocusOutside:te,preventScroll:!1,get loop(){return a()},get trapFocus(){return h()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),I(b),{style:D_(`menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=py();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(re,e=>{s()?e(ie):s()||e(ae,1)}),z(e,ne),O()}var hy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`disabled`,`ref`,`children`,`child`,`onSelect`,`openDelay`]),gy=L(`<div><!></div>`);function _y(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`disabled`,3,!1),a=q(t,`ref`,15,null),o=q(t,`onSelect`,3,Vp),s=q(t,`openDelay`,3,0),c=G(t,hy),l=bre.create({disabled:J(()=>i()),onSelect:J(()=>o()),id:J(()=>r()),ref:J(()=>a(),e=>a(e)),openDelay:J(()=>s())}),u=k(()=>Lf(c,l.props));lv(e,{get id(){return r()},get ref(){return l.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},o=e=>{var n=gy();_a(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}}),O()}function vy(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]??[0,0],[c,l]=t[o]??[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function yy(e,t){return e[0]>=t.left&&e[0]<=t.right&&e[1]>=t.top&&e[1]<=t.bottom}function by(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}var xy=class{#e;#t;#n;#r=null;#i=null;#a=[];#o=null;#s=null;#c=null;#l(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#u(){this.#l(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())})}#d(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null)}#f(){this.#n!==null&&(this.#d(),this.#c=window.setTimeout(()=>{this.#c=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())},this.#n))}constructor(e){this.#e=e,this.#t=e.buffer??1;let t=e.transitIntentTimeout;this.#n=typeof t==`number`&&t>0?t:null,Jf([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(!e||!t||!n){this.#o=null,this.#m();return}return this.#o&&this.#o!==e&&this.#m(),this.#o=e,[hi(mp(e),`pointermove`,n=>{this.#p([n.clientX,n.clientY],e,t)}),hi(e,`pointerleave`,e=>{let n=e.relatedTarget;if(Fp(n)&&t.contains(n))return;let r=this.#e.ignoredTargets?.()??[];Fp(n)&&r.some(e=>e===n||e.contains(n))||(this.#a=Fp(n)&&r.length>0?r.filter(e=>n.contains(e)):[],this.#r=[e.clientX,e.clientY],this.#i=`content`,this.#u())}),hi(e,`pointerenter`,()=>{this.#m()}),hi(t,`pointerenter`,()=>{this.#m()}),hi(t,`pointerleave`,t=>{let n=t.relatedTarget;Fp(n)&&e.contains(n)||(this.#r=[t.clientX,t.clientY],this.#i=`trigger`,this.#u())})].reduce((e,t)=>()=>{e(),t()},()=>{})})}#p(e,t,n){if(!this.#r||!this.#i)return;this.#l(),this.#f();let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();if(this.#i===`content`&&yy(e,i)){this.#m();return}if(this.#i===`trigger`&&yy(e,r)){this.#m();return}if(this.#i===`content`&&this.#a.length>0)for(let t of this.#a){let n=t.getBoundingClientRect();if(yy(e,n))return;let i=by(r,n),a=this.#h(r,n,i);if(a&&vy(e,a))return}let a=by(r,i),o=this.#h(r,i,a);if(o&&vy(e,o))return;let s=this.#i===`content`?i:r;vy(e,this.#g(this.#r,s,a,this.#i))||(this.#m(),this.#e.onPointerExit())}#m(){this.#r=null,this.#i=null,this.#a=[],this.#l(),this.#d()}#h(e,t,n){let r=this.#t;switch(n){case`top`:return[[Math.min(e.left,t.left)-r,e.top],[Math.min(e.left,t.left)-r,t.bottom],[Math.max(e.right,t.right)+r,t.bottom],[Math.max(e.right,t.right)+r,e.top]];case`bottom`:return[[Math.min(e.left,t.left)-r,e.bottom],[Math.min(e.left,t.left)-r,t.top],[Math.max(e.right,t.right)+r,t.top],[Math.max(e.right,t.right)+r,e.bottom]];case`left`:return[[e.left,Math.min(e.top,t.top)-r],[t.right,Math.min(e.top,t.top)-r],[t.right,Math.max(e.bottom,t.bottom)+r],[e.left,Math.max(e.bottom,t.bottom)+r]];case`right`:return[[e.right,Math.min(e.top,t.top)-r],[t.left,Math.min(e.top,t.top)-r],[t.left,Math.max(e.bottom,t.bottom)+r],[e.right,Math.max(e.bottom,t.bottom)+r]]}}#g(e,t,n,r){let i=this.#t*4,[a,o]=e;switch(r===`trigger`?this.#_(n):n){case`top`:return[[a-i,o+i],[a+i,o+i],[t.right+i,t.bottom],[t.right+i,t.top],[t.left-i,t.top],[t.left-i,t.bottom]];case`bottom`:return[[a-i,o-i],[a+i,o-i],[t.right+i,t.top],[t.right+i,t.bottom],[t.left-i,t.bottom],[t.left-i,t.top]];case`left`:return[[a+i,o-i],[a+i,o+i],[t.right,t.bottom+i],[t.left,t.bottom+i],[t.left,t.top-i],[t.right,t.top-i]];case`right`:return[[a-i,o-i],[a-i,o+i],[t.left,t.bottom+i],[t.right,t.bottom+i],[t.right,t.top-i],[t.left,t.top-i]]}}#_(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}},Sy=wp({component:`popover`,parts:[`root`,`trigger`,`content`,`close`,`overlay`]}),Cy=new Uf(`Popover.Root`),wy=class e{static create(t){return Cy.set(new e(t))}opts;#e=A(null);get contentNode(){return I(this.#e)}set contentNode(e){j(this.#e,e,!0)}contentPresence;#t=A(null);get triggerNode(){return I(this.#t)}set triggerNode(e){j(this.#t,e,!0)}#n=A(null);get overlayNode(){return I(this.#n)}set overlayNode(e){j(this.#n,e,!0)}overlayPresence;#r=A(!1);get openedViaHover(){return I(this.#r)}set openedViaHover(e){j(this.#r,e,!0)}#i=A(!1);get hasInteractedWithContent(){return I(this.#i)}set hasInteractedWithContent(e){j(this.#i,e,!0)}#a=A(!1);get hoverCooldown(){return I(this.#a)}set hoverCooldown(e){j(this.#a,e,!0)}#o=A(0);get closeDelay(){return I(this.#o)}set closeDelay(e){j(this.#o,e,!0)}#s=null;#c=null;constructor(e){this.opts=e,this.contentPresence=new Bp({ref:J(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Bp({ref:J(()=>this.overlayNode),open:this.opts.open}),Jf(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(e){this.#c=e}#l(){this.#s!==null&&this.#c&&(this.#c.clearTimeout(this.#s),this.#s=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#c&&(this.#s=this.#c.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#s=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}},Ty=class e{static create(t){return new e(t,Cy.get())}opts;root;attachment;domContext;#e=null;#t=null;#n=A(!1);constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref,e=>this.root.triggerNode=e),this.domContext=new gp(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Jf(()=>this.opts.closeDelay.current,e=>{this.root.closeDelay=e})}#r(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#i(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#a(){this.#r(),this.#i()}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||Lp(e)||(j(this.#n,!0),this.#i(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;let t=this.opts.openDelay.current;t<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},t)}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(Lp(e)||(j(this.#n,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(this.#a(),I(this.#n)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}I(this.#n)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#a(),this.root.toggleOpen())}#o(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#s=k(()=>({id:this.opts.id.current,"aria-haspopup":`dialog`,"aria-expanded":vp(this.root.opts.open.current),"data-state":xp(this.root.opts.open.current),"aria-controls":this.#o(),[Sy.trigger]:``,disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return I(this.#s)}set props(e){j(this.#s,e)}},Ey=class e{static create(t){return new e(t,Cy.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref,e=>this.root.contentNode=e),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new xy({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(e){this.root.markInteraction()}onfocusin(e){let t=e.target;Fp(t)&&vm(t)&&this.root.markInteraction()}onpointerenter(e){Lp(e)||this.root.cancelDelayedClose()}onpointerleave(e){Lp(e)}onInteractOutside=e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!Fp(e.target))return;let t=e.target.closest(Sy.selector(`trigger`));if(!(t&&t===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Fp(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current==`string`){let t=document.querySelector(this.opts.customAnchor.current);if(t&&t.contains(e.target))return}}this.root.handleClose()}};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,tabindex:-1,"data-state":xp(this.root.opts.open.current),...Sp(this.root.contentPresence.transitionStatus),[Sy.content]:``,style:{pointerEvents:`auto`,contain:`layout style`},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}},Dy=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`forceMount`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`customAnchor`,`style`]),Oy=L(`<div><div><!></div></div>`);function ky(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=q(t,`forceMount`,3,!1),o=q(t,`onOpenAutoFocus`,3,Vp),s=q(t,`onCloseAutoFocus`,3,Vp),c=q(t,`onEscapeKeydown`,3,Vp),l=q(t,`onInteractOutside`,3,Vp),u=q(t,`trapFocus`,3,!0),d=q(t,`preventScroll`,3,!1),f=q(t,`customAnchor`,3,null),p=G(t,Dy),m=Ey.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e)),onInteractOutside:J(()=>l()),onEscapeKeydown:J(()=>c()),customAnchor:J(()=>f())}),h=k(()=>Lf(p,m.props)),g=k(()=>u()&&m.shouldTrapFocus);function _(e){m.shouldTrapFocus||e.preventDefault(),o()(e)}var v=R(),y=N(v),b=e=>{Ev(e,K(()=>I(h),()=>m.popperProps,{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},get id(){return i()},get trapFocus(){return I(g)},get preventScroll(){return d()},loop:!0,forceMount:!0,get customAnchor(){return f()},onOpenAutoFocus:_,get onCloseAutoFocus(){return s()},get shouldRender(){return m.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:D_(`popover`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...m.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Oy();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},x=e=>{wv(e,K(()=>I(h),()=>m.popperProps,{get ref(){return m.opts.ref},get open(){return m.root.opts.open.current},get id(){return i()},get trapFocus(){return I(g)},get preventScroll(){return d()},loop:!0,forceMount:!1,get customAnchor(){return f()},onOpenAutoFocus:_,get onCloseAutoFocus(){return s()},get shouldRender(){return m.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:D_(`popover`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...m.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Oy();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(y,e=>{a()?e(b):a()||e(x,1)}),z(e,v),O()}var Ay=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`type`,`disabled`,`openOnHover`,`openDelay`,`closeDelay`]),jy=L(`<button><!></button>`);function My(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`type`,3,`button`),o=q(t,`disabled`,3,!1),s=q(t,`openOnHover`,3,!1),c=q(t,`openDelay`,3,700),l=q(t,`closeDelay`,3,300),u=G(t,Ay),d=Ty.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),disabled:J(()=>!!o()),openOnHover:J(()=>s()),openDelay:J(()=>c()),closeDelay:J(()=>l())}),f=k(()=>Lf(u,d.props,{type:a()}));lv(e,{get id(){return r()},get ref(){return d.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(f)})),z(e,n)},o=e=>{var n=jy();_a(n,()=>({...I(f)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}}),O()}var Ny=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function Py(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Ny);hv(e,K(()=>r,{"data-popover-arrow":``,get ref(){return n()},set ref(e){n(e)}})),O()}function Fy(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Vp),i=q(t,`onOpenChangeComplete`,3,Vp);Wp.create({variant:J(()=>`dialog`),open:J(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:J(()=>i())});var a=R();H(N(a),()=>t.children??w),z(e,a),O()}var Iy=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Ly=L(`<button><!></button>`);function Ry(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=G(t,Iy),s=dne.create({variant:J(()=>`close`),id:J(()=>r()),ref:J(()=>i(),e=>i(e)),disabled:J(()=>!!a())}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},f=e=>{var n=Ly();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}var zy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),By=L(`<!> <!>`,1),Vy=L(`<!> <div><!></div>`,1);function Hy(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=q(t,`onCloseAutoFocus`,3,Vp),s=q(t,`onOpenAutoFocus`,3,Vp),c=q(t,`onEscapeKeydown`,3,Vp),l=q(t,`onInteractOutside`,3,Vp),u=q(t,`trapFocus`,3,!0),d=q(t,`preventScroll`,3,!0),f=q(t,`restoreScrollDelay`,3,null),p=G(t,zy),m=Gp.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),h=k(()=>Lf(p,m.props));var g=R(),_=N(g),v=e=>{Bm(e,{get ref(){return m.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return m.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;zm(e,K(()=>I(h),{get enabled(){return m.root.opts.open.current},get ref(){return m.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&m.root.handleClose()},children:(e,n)=>{Rm(e,K(()=>I(h),{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},onInteractOutside:e=>{l()(e),!e.defaultPrevented&&m.root.handleClose()},children:(e,n)=>{Wm(e,K(()=>I(h),{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},children:(e,n)=>{var i=R(),a=N(i),o=e=>{var n=By(),i=N(n),a=e=>{th(e,{get preventScroll(){return d()},get restoreScrollDelay(){return f()}})};V(i,e=>{m.root.opts.open.current&&e(a)});var o=P(i,2);{let e=k(()=>({props:Lf(I(h),r()),...m.snippetProps}));H(o,()=>t.child,()=>I(e))}z(e,n)},s=e=>{var n=Vy(),i=N(n);th(i,{get preventScroll(){return d()}});var a=P(i,2);_a(a,e=>({...e}),[()=>Lf(I(h),r())]),H(M(a),()=>t.children??w),T(a),z(e,n)};V(a,e=>{t.child?e(o):e(s,-1)}),z(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};V(_,e=>{(m.shouldRender||a())&&e(v)}),z(e,g),O()}function Uy(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`dir`,3,`ltr`),i=q(t,`onOpenChange`,3,Vp),a=q(t,`onOpenChangeComplete`,3,Vp),o=q(t,`_internal_variant`,3,`dropdown-menu`),s=q(t,`_internal_should_skip_exit_animation`,3,void 0),c=Nm.create({variant:J(()=>o()),dir:J(()=>r()),onClose:()=>{n(!1),i()(!1)},shouldSkipExitAnimation:()=>s()?.()??!1});Pm.create({open:J(()=>n(),e=>{n(e),i()(e)}),onOpenChangeComplete:J(()=>a())},c),H_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}var Wy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),Gy=L(`<div><div><!></div></div>`);function Ky(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`loop`,3,!0),o=q(t,`onInteractOutside`,3,Vp),s=q(t,`onEscapeKeydown`,3,Vp),c=q(t,`onCloseAutoFocus`,3,Vp),l=q(t,`forceMount`,3,!1),u=q(t,`trapFocus`,3,!1),d=G(t,Wy),f=Fm.create({id:J(()=>r()),loop:J(()=>a()),ref:J(()=>i(),e=>i(e)),onCloseAutoFocus:J(()=>c())}),p=k(()=>Lf(d,f.props));function m(e){if(f.handleInteractOutside(e),!e.defaultPrevented&&(o()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${f.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}f.parentMenu.onClose()}}function h(e){s()(e),!e.defaultPrevented&&f.parentMenu.onClose()}var g=R(),_=N(g),v=e=>{Ev(e,K(()=>I(p),()=>f.popperProps,{get ref(){return f.opts.ref},get enabled(){return f.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:h,get trapFocus(){return u()},get loop(){return a()},forceMount:!0,get id(){return r()},get shouldRender(){return f.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:D_(`dropdown-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...f.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Gy();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},y=e=>{wv(e,K(()=>I(p),()=>f.popperProps,{get ref(){return f.opts.ref},get open(){return f.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:h,get trapFocus(){return u()},get loop(){return a()},forceMount:!1,get id(){return r()},get shouldRender(){return f.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(r(),{style:D_(`dropdown-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...f.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Gy();_a(n,()=>({...i()}));var r=M(n);_a(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(_,e=>{l()?e(v):l()||e(y,1)}),z(e,g),O()}var qy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),Jy=L(`<button><!></button>`);function Yy(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=q(t,`type`,3,`button`),s=G(t,qy),c=wre.create({id:J(()=>r()),disabled:J(()=>a()??!1),ref:J(()=>i(),e=>i(e))}),l=k(()=>Lf(s,c.props,{type:o()}));lv(e,{get id(){return r()},get ref(){return c.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(l)})),z(e,n)},o=e=>{var n=Jy();_a(n,()=>({...I(l)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}}),O()}var Xy=wp({component:`label`,parts:[`root`]}),Zy=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=_p(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}onmousedown(e){e.detail>1&&e.preventDefault()}#e=k(()=>({id:this.opts.id.current,[Xy.root]:``,onmousedown:this.onmousedown,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},Qy=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`for`]),$y=L(`<label><!></label>`);function eb(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=G(t,Qy),o=Zy.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Lf(a,o.props,{for:t.for}));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=$y();_a(n,()=>({...I(s),for:t.for})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var tb=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),rr(this.handler)}handler(){let e=0,t=this.#e();if(!t)return;let n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}},nb=class{opts;present;#e;#t=A(!1);#n=!1;#r=A(void 0);#i=null;constructor(e){this.opts=e,this.present=this.opts.open,j(this.#t,e.open.current,!0),this.#e=new zp({ref:this.opts.ref,afterTick:this.opts.open}),sp(()=>this.#o()),Jf(()=>this.present.current,e=>{if(!this.#n){this.#n=!0;return}this.#o(),e&&j(this.#t,!0),j(this.#r,e?`starting`:`ending`,!0),e&&(this.#i=window.requestAnimationFrame(()=>{this.#i=null,this.present.current&&j(this.#r,void 0)})),this.#e.run(()=>{e===this.present.current&&(e||j(this.#t,!1),j(this.#r,void 0))})})}#a=k(()=>I(this.#t));get isPresent(){return I(this.#a)}set isPresent(e){j(this.#a,e)}get transitionStatus(){return I(this.#r)}#o(){this.#i!==null&&(window.cancelAnimationFrame(this.#i),this.#i=null)}};function rb(e,t){D(t,!0);let n=new nb({open:J(()=>t.open),ref:t.ref});var r=R(),i=N(r),a=e=>{var r=R();H(N(r),()=>t.presence??w,()=>({present:n.isPresent,transitionStatus:n.transitionStatus})),z(e,r)};V(i,e=>{(t.forceMount||t.open||n.isPresent)&&e(a)}),z(e,r),O()}function ib(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Vp),i=q(t,`onOpenChangeComplete`,3,Vp);wy.create({open:J(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:J(()=>i())}),H_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}var ab=wp({component:`progress`,parts:[`root`]}),ob=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=_p(this.opts.ref)}#e=k(()=>({role:`progressbar`,value:this.opts.value.current,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":this.opts.value.current===null?void 0:this.opts.value.current,"data-value":this.opts.value.current===null?void 0:this.opts.value.current,"data-state":sb(this.opts.value.current,this.opts.max.current),"data-max":this.opts.max.current,"data-min":this.opts.min.current,"data-indeterminate":this.opts.value.current===null?``:void 0,[ab.root]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}};function sb(e,t){return e===null?`indeterminate`:e===t?`loaded`:`loading`}var cb=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`value`,`max`,`min`,`id`,`ref`]),lb=L(`<div><!></div>`);function ub(e,t){let n=Ti();D(t,!0);let r=q(t,`value`,3,0),i=q(t,`max`,3,100),a=q(t,`min`,3,0),o=q(t,`id`,19,()=>Hp(n)),s=q(t,`ref`,15,null),c=G(t,cb),l=ob.create({value:J(()=>r()),max:J(()=>i()),min:J(()=>a()),id:J(()=>o()),ref:J(()=>s(),e=>s(e))}),u=k(()=>Lf(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=lb();_a(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var db=wp({component:`radio-group`,parts:[`root`,`item`]}),fb=new Uf(`RadioGroup.Root`),pb=class e{static create(t){return fb.set(new e(t))}opts;#e=k(()=>this.opts.value.current!==``);get hasValue(){return I(this.#e)}set hasValue(e){j(this.#e,e)}rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=_p(this.opts.ref),this.rovingFocusGroup=new Rp({rootNode:this.opts.ref,candidateAttr:db.item,loop:this.opts.loop,orientation:this.opts.orientation})}isChecked(e){return this.opts.value.current===e}setValue(e){this.opts.value.current=e}#t=k(()=>({id:this.opts.id.current,role:`radiogroup`,"aria-required":vp(this.opts.required.current),"aria-disabled":vp(this.opts.disabled.current),"aria-readonly":this.opts.readonly.current?`true`:void 0,"data-disabled":yp(this.opts.disabled.current),"data-readonly":yp(this.opts.readonly.current),"data-orientation":this.opts.orientation.current,[db.root]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},mb=class e{static create(t){return new e(t,fb.get())}opts;root;attachment;#e=k(()=>this.root.opts.value.current===this.opts.value.current);get checked(){return I(this.#e)}set checked(e){j(this.#e,e)}#t=k(()=>this.opts.disabled.current||this.root.opts.disabled.current);#n=k(()=>this.root.opts.readonly.current);#r=k(()=>this.root.isChecked(this.opts.value.current));#i=A(-1);constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref),this.opts.value.current===this.root.opts.value.current?(this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current),j(this.#i,0)):this.root.opts.value.current||j(this.#i,0),rr(()=>{j(this.#i,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0)}),Jf([()=>this.opts.value.current,()=>this.root.opts.value.current],()=>{this.opts.value.current===this.root.opts.value.current&&(this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current),j(this.#i,0))}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onfocus=this.onfocus.bind(this)}onclick(e){this.opts.disabled.current||I(this.#n)||this.root.setValue(this.opts.value.current)}onfocus(e){!this.root.hasValue||I(this.#n)||this.root.setValue(this.opts.value.current)}onkeydown(e){if(!I(this.#t)){if(e.key===` `){e.preventDefault(),I(this.#n)||this.root.setValue(this.opts.value.current);return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e,!0)}}#a=k(()=>({checked:I(this.#r)}));get snippetProps(){return I(this.#a)}set snippetProps(e){j(this.#a,e)}#o=k(()=>({id:this.opts.id.current,disabled:I(this.#t)?!0:void 0,"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":yp(I(this.#t)),"data-readonly":yp(I(this.#n)),"data-state":I(this.#r)?`checked`:`unchecked`,"aria-checked":Cp(I(this.#r),!1),[db.item]:``,type:`button`,role:`radio`,tabindex:I(this.#i),onkeydown:this.onkeydown,onfocus:this.onfocus,onclick:this.onclick,...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},hb=class e{static create(){return new e(fb.get())}root;#e=k(()=>this.root.opts.name.current!==void 0);get shouldRender(){return I(this.#e)}set shouldRender(e){j(this.#e,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){this.root.rovingFocusGroup.focusCurrentTabStop()}#t=k(()=>({name:this.root.opts.name.current,value:this.root.opts.value.current,required:this.root.opts.required.current,disabled:this.root.opts.disabled.current,onfocus:this.onfocus}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}};function gb(e,t){D(t,!1);let n=hb.create();Ea();var r=R(),i=N(r),a=e=>{bh(e,K(()=>n.props))};V(i,e=>{n.shouldRender&&e(a)}),z(e,r),O()}var _b=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`,`child`,`value`,`ref`,`orientation`,`loop`,`name`,`required`,`readonly`,`id`,`onValueChange`]),vb=L(`<div><!></div>`),yb=L(`<!> <!>`,1);function bb(e,t){let n=Ti();D(t,!0);let r=q(t,`disabled`,3,!1),i=q(t,`value`,15,``),a=q(t,`ref`,15,null),o=q(t,`orientation`,3,`vertical`),s=q(t,`loop`,3,!0),c=q(t,`name`,3,void 0),l=q(t,`required`,3,!1),u=q(t,`readonly`,3,!1),d=q(t,`id`,19,()=>Hp(n)),f=q(t,`onValueChange`,3,Vp),p=G(t,_b),m=pb.create({orientation:J(()=>o()),disabled:J(()=>r()),loop:J(()=>s()),name:J(()=>c()),required:J(()=>l()),readonly:J(()=>u()),id:J(()=>d()),value:J(()=>i(),e=>{e!==i()&&(i(e),f()?.(e))}),ref:J(()=>a(),e=>a(e))}),h=k(()=>Lf(p,m.props));var g=yb(),_=N(g),v=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(h)})),z(e,n)},y=e=>{var n=vb();_a(n,()=>({...I(h)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(_,e=>{t.child?e(v):e(y,-1)}),gb(P(_,2),{}),z(e,g),O()}var xb=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`value`,`disabled`,`ref`]),Sb=L(`<button><!></button>`);function Cb(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`disabled`,3,!1),a=q(t,`ref`,15,null),o=G(t,xb),s=mb.create({value:J(()=>t.value),disabled:J(()=>i()??!1),id:J(()=>r()),ref:J(()=>a(),e=>a(e))}),c=k(()=>Lf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(c),...s.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},f=e=>{var n=Sb();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w,()=>s.snippetProps),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}function wb(e,t,n){return Math.min(n,Math.max(t,e))}var Tb=class{state;#e;constructor(e,t){this.state=vf(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}},Eb=wp({component:`scroll-area`,parts:[`root`,`viewport`,`corner`,`thumb`,`scrollbar`]}),Db=new Uf(`ScrollArea.Root`),Ob=new Uf(`ScrollArea.Scrollbar`),kb=new Uf(`ScrollArea.ScrollbarVisible`),Ab=new Uf(`ScrollArea.ScrollbarAxis`),jb=new Uf(`ScrollArea.ScrollbarShared`),Mb=class e{static create(t){return Db.set(new e(t))}opts;attachment;#e=A(null);get scrollAreaNode(){return I(this.#e)}set scrollAreaNode(e){j(this.#e,e,!0)}#t=A(null);get viewportNode(){return I(this.#t)}set viewportNode(e){j(this.#t,e,!0)}#n=A(null);get contentNode(){return I(this.#n)}set contentNode(e){j(this.#n,e,!0)}#r=A(null);get scrollbarXNode(){return I(this.#r)}set scrollbarXNode(e){j(this.#r,e,!0)}#i=A(null);get scrollbarYNode(){return I(this.#i)}set scrollbarYNode(e){j(this.#i,e,!0)}#a=A(0);get cornerWidth(){return I(this.#a)}set cornerWidth(e){j(this.#a,e,!0)}#o=A(0);get cornerHeight(){return I(this.#o)}set cornerHeight(e){j(this.#o,e,!0)}#s=A(!1);get scrollbarXEnabled(){return I(this.#s)}set scrollbarXEnabled(e){j(this.#s,e,!0)}#c=A(!1);get scrollbarYEnabled(){return I(this.#c)}set scrollbarYEnabled(e){j(this.#c,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=_p(e.ref,e=>this.scrollAreaNode=e),this.domContext=new gp(e.ref)}#l=k(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:`relative`,"--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[Eb.root]:``,...this.attachment}));get props(){return I(this.#l)}set props(e){j(this.#l,e)}},Nb=class e{static create(t){return new e(t,Db.get())}opts;root;attachment;#e=vf(Gm());#t=vf(null);contentAttachment=_p(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref,e=>this.root.viewportNode=e)}#n=k(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?`scroll`:`hidden`,overflowY:this.root.scrollbarYEnabled?`scroll`:`hidden`},[Eb.viewport]:``,...this.attachment}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}#r=k(()=>({id:this.#e.current,"data-scroll-area-content":``,style:{minWidth:this.root.scrollbarXEnabled?`fit-content`:void 0},...this.contentAttachment}));get contentProps(){return I(this.#r)}set contentProps(e){j(this.#r,e)}},Pb=class e{static create(t){return Ob.set(new e(t,Db.get()))}opts;root;#e=k(()=>this.opts.orientation.current===`horizontal`);get isHorizontal(){return I(this.#e)}set isHorizontal(e){j(this.#e,e)}#t=A(!1);get hasThumb(){return I(this.#t)}set hasThumb(e){j(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,Jf(()=>this.isHorizontal,e=>e?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}},Fb=class e{static create(){return new e(Ob.get())}scrollbar;root;#e=A(!1);get isVisible(){return I(this.#e)}set isVisible(e){j(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,rr(()=>{let e=this.root.scrollAreaNode,t=this.root.opts.scrollHideDelay.current,n=0;if(!e)return;let r=Af(hi(e,`pointerenter`,()=>{this.root.domContext.clearTimeout(n),Zr(()=>this.isVisible=!0)}),hi(e,`pointerleave`,()=>{n&&this.root.domContext.clearTimeout(n),n=this.root.domContext.setTimeout(()=>{Zr(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},t)}));return()=>{this.root.domContext.getWindow().clearTimeout(n),r()}})}#t=k(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Ib=class e{static create(){return new e(Ob.get())}scrollbar;root;machine=new Tb(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});#e=k(()=>this.machine.state.current===`hidden`);get isHidden(){return I(this.#e)}set isHidden(e){j(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;let t=Wf(()=>this.machine.dispatch(`SCROLL_END`),100);rr(()=>{let e=this.machine.state.current,t=this.root.opts.scrollHideDelay.current;if(e===`idle`){let e=this.root.domContext.setTimeout(()=>this.machine.dispatch(`HIDE`),t);return()=>this.root.domContext.clearTimeout(e)}}),rr(()=>{let e=this.root.viewportNode;if(!e)return;let n=this.scrollbar.isHorizontal?`scrollLeft`:`scrollTop`,r=e[n];return hi(e,`scroll`,()=>{let i=e[n];r!==i&&(this.machine.dispatch(`SCROLL`),t()),r=i})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch(`POINTER_ENTER`)}onpointerleave(e){this.machine.dispatch(`POINTER_LEAVE`)}#t=k(()=>({"data-state":this.machine.state.current===`hidden`?`hidden`:`visible`,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Lb=class e{static create(){return new e(Ob.get())}scrollbar;root;#e=A(!1);get isVisible(){return I(this.#e)}set isVisible(e){j(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;let t=Wf(()=>{let e=this.root.viewportNode;if(!e)return;let t=e.offsetWidth<e.scrollWidth,n=e.offsetHeight<e.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?t:n},10);new tb(()=>this.root.viewportNode,t),new tb(()=>this.root.contentNode,t)}#t=k(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Rb=class e{static create(){return kb.set(new e(Ob.get()))}scrollbar;root;#e=A(null);get thumbNode(){return I(this.#e)}set thumbNode(e){j(this.#e,e,!0)}#t=A(0);get pointerOffset(){return I(this.#t)}set pointerOffset(e){j(this.#t,e,!0)}#n=A({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return I(this.#n)}set sizes(e){j(this.#n,e)}#r=k(()=>Gb(this.sizes.viewport,this.sizes.content));get thumbRatio(){return I(this.#r)}set thumbRatio(e){j(this.#r,e)}#i=k(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return I(this.#i)}set hasThumb(e){j(this.#i,e)}#a=A(``);get prevTransformStyle(){return I(this.#a)}set prevTransformStyle(e){j(this.#a,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,rr(()=>{this.scrollbar.hasThumb=this.hasThumb}),rr(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return qb({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollLeft,t=`translate3d(${Jb({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollTop,t=`translate3d(0, ${Jb({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}},zb=class e{static create(t){return Ab.set(new e(t,kb.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=A();get computedStyle(){return I(this.#e)}set computedStyle(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=_p(this.scrollbar.opts.ref,e=>this.root.scrollbarXNode=e),rr(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),rr(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),Xb(n,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:Wb(this.computedStyle.paddingLeft),paddingEnd:Wb(this.computedStyle.paddingRight)}})};#t=k(()=>Kb(this.scrollbarVis.sizes));get thumbSize(){return I(this.#t)}set thumbSize(e){j(this.#t,e)}#n=k(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`horizontal`,style:{bottom:0,left:this.root.opts.dir.current===`rtl`?`var(--bits-scroll-area-corner-width)`:0,right:this.root.opts.dir.current===`ltr`?`var(--bits-scroll-area-corner-width)`:0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},Bb=class e{static create(t){return Ab.set(new e(t,kb.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=A();get computedStyle(){return I(this.#e)}set computedStyle(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=_p(this.scrollbar.opts.ref,e=>this.root.scrollbarYNode=e),rr(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),rr(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),Xb(n,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:Wb(this.computedStyle.paddingTop),paddingEnd:Wb(this.computedStyle.paddingBottom)}})}#t=k(()=>Kb(this.scrollbarVis.sizes));get thumbSize(){return I(this.#t)}set thumbSize(e){j(this.#t,e)}#n=k(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`vertical`,style:{top:0,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:`var(--bits-scroll-area-corner-height)`,"--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},Vb=class e{static create(){return jb.set(new e(Ab.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=A(null);get rect(){return I(this.#e)}set rect(e){j(this.#e,e)}#t=A(``);get prevWebkitUserSelect(){return I(this.#t)}set prevWebkitUserSelect(e){j(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=k(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return I(this.#n)}set maxScrollPos(e){j(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=Wf(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,rr(()=>{let e=this.maxScrollPos,t=this.scrollbar.opts.ref.current;return this.root.viewportNode,hi(this.root.domContext.getDocument(),`wheel`,n=>{let r=n.target;t?.contains(r)&&this.handleWheelScroll(n,e)},{passive:!1})}),ar(()=>{this.scrollbarVis.sizes,Zr(()=>this.handleThumbPositionChange())}),new tb(()=>this.scrollbar.opts.ref.current,this.handleResize),new tb(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;let t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}#r(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=``),this.rect=null)}onpointerdown(e){e.button===0&&(e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect=`none`,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=`auto`),this.handleDragScroll(e))}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#r()}onlostpointercapture(e){this.#r()}#i=k(()=>Lf({...this.scrollbarState.props,style:{position:`absolute`,...this.scrollbarState.props.style},[Eb.scrollbar]:``,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return I(this.#i)}set props(e){j(this.#i,e)}},Hb=class e{static create(t){return new e(t,jb.get())}opts;scrollbarState;attachment;#e;#t=A();#n=Wf(()=>{I(this.#t)&&(I(this.#t)(),j(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=_p(this.opts.ref,e=>this.scrollbarState.scrollbarVis.thumbNode=e),rr(()=>{let e=this.#e.viewportNode;return e?(Zr(()=>this.scrollbarState.handleThumbPositionChange()),hi(e,`scroll`,()=>{if(this.#n(),!I(this.#t)){let t=Zb(e,this.scrollbarState.handleThumbPositionChange);j(this.#t,t,!0),this.scrollbarState.handleThumbPositionChange()}})):void 0}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){let t=e.target;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:r,y:i})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#r=k(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?`visible`:`hidden`,style:{width:`var(--bits-scroll-area-thumb-width)`,height:`var(--bits-scroll-area-thumb-height)`,transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[Eb.thumb]:``,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}},Ub=class e{static create(t){return new e(t,Db.get())}opts;root;attachment;#e=A(0);#t=A(0);#n=k(()=>!!(I(this.#e)&&I(this.#t)));get hasSize(){return I(this.#n)}set hasSize(e){j(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref),new tb(()=>this.root.scrollbarXNode,()=>{let e=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=e,j(this.#t,e,!0)}),new tb(()=>this.root.scrollbarYNode,()=>{let e=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=e,j(this.#e,e,!0)})}#r=k(()=>({id:this.opts.id.current,style:{width:I(this.#e),height:I(this.#t),position:`absolute`,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:0},[Eb.corner]:``,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}};function Wb(e){return e?Number.parseInt(e,10):0}function Gb(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Kb(e){let t=Gb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function qb({pointerPos:e,pointerOffset:t,sizes:n,dir:r=`ltr`}){let i=Kb(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Yb([c,l],d)(e)}function Jb({scrollPos:e,sizes:t,dir:n=`ltr`}){let r=Kb(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=wb(e,c[0],c[1]);return Yb([0,o],[0,s])(l)}function Yb(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Xb(e,t){return e>0&&e<t}function Zb(e,t){let n={left:e.scrollLeft,top:e.scrollTop},r=0,i=hp(e);return(function a(){let o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=i.requestAnimationFrame(a)})(),()=>i.cancelAnimationFrame(r)}var Qb=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`type`,`dir`,`scrollHideDelay`,`children`,`child`]),$b=L(`<div><!></div>`);function ex(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=q(t,`type`,3,`hover`),o=q(t,`dir`,3,`ltr`),s=q(t,`scrollHideDelay`,3,600),c=G(t,Qb),l=Mb.create({type:J(()=>a()),dir:J(()=>o()),scrollHideDelay:J(()=>s()),id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),u=k(()=>Lf(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=$b();_a(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var tx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`]),nx=L(`<div><div><!></div></div>`);function rx(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,tx),o=Nb.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Lf(a,o.props)),c=k(()=>Lf({},o.contentProps));var l=nx();_a(l,()=>({...I(s)}));var u=M(l);_a(u,()=>({...I(c)})),H(M(u),()=>t.children??w),T(u),T(l),z(e,l),O()}var ix=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`]),ax=L(`<div><!></div>`);function ox(e,t){D(t,!0);let n=G(t,ix),r=Vb.create(),i=k(()=>Lf(n,r.props));var a=R(),o=N(a),s=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(i)})),z(e,n)},c=e=>{var n=ax();_a(n,()=>({...I(i)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(o,e=>{t.child?e(s):e(c,-1)}),z(e,a),O()}var sx=new Set([`$$slots`,`$$events`,`$$legacy`]);function cx(e,t){D(t,!0);let n=G(t,sx),r=new ep,i=zb.create({mounted:J(()=>r.current)}),a=k(()=>Lf(n,i.props));ox(e,K(()=>I(a))),O()}var lx=new Set([`$$slots`,`$$events`,`$$legacy`]);function ux(e,t){D(t,!0);let n=G(t,lx),r=new ep,i=Bb.create({mounted:J(()=>r.current)}),a=k(()=>Lf(n,i.props));ox(e,K(()=>I(a))),O()}var dx=new Set([`$$slots`,`$$events`,`$$legacy`]);function fx(e,t){D(t,!0);let n=G(t,dx),r=Rb.create();var i=R(),a=N(i),o=e=>{cx(e,K(()=>n))},s=e=>{ux(e,K(()=>n))};V(a,e=>{r.scrollbar.opts.orientation.current===`horizontal`?e(o):e(s,-1)}),z(e,i),O()}var px=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function mx(e,t){D(t,!0);let n=q(t,`forceMount`,3,!1),r=G(t,px),i=Lb.create(),a=k(()=>Lf(r,i.props));{let t=e=>{fx(e,K(()=>I(a)))},r=k(()=>n()||i.isVisible);rb(e,{get open(){return I(r)},get ref(){return i.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}O()}var hx=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function gx(e,t){D(t,!0);let n=q(t,`forceMount`,3,!1),r=G(t,hx),i=Ib.create(),a=k(()=>Lf(r,i.props));{let t=e=>{fx(e,K(()=>I(a)))},r=k(()=>n()||!i.isHidden);rb(e,K(()=>I(a),{get open(){return I(r)},get ref(){return i.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}}))}O()}var _x=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function vx(e,t){D(t,!0);let n=q(t,`forceMount`,3,!1),r=G(t,_x),i=Fb.create(),a=Lb.create(),o=k(()=>Lf(r,i.props,a.props,{"data-state":i.isVisible?`visible`:`hidden`})),s=k(()=>n()||i.isVisible&&a.isVisible);rb(e,{get open(){return I(s)},get ref(){return a.scrollbar.opts.ref},presence:e=>{fx(e,K(()=>I(o)))},$$slots:{presence:!0}}),O()}var yx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`]);function bx(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,yx),o=Pb.create({orientation:J(()=>t.orientation),id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>o.root.opts.type.current);var c=R(),l=N(c),u=e=>{vx(e,K(()=>a,{get id(){return i()}}))},d=e=>{gx(e,K(()=>a,{get id(){return i()}}))},f=e=>{mx(e,K(()=>a,{get id(){return i()}}))},p=e=>{fx(e,K(()=>a,{get id(){return i()}}))};V(l,e=>{I(s)===`hover`?e(u):I(s)===`scroll`?e(d,1):I(s)===`auto`?e(f,2):I(s)===`always`&&e(p,3)}),z(e,c),O()}var xx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`,`present`]),Sx=L(`<div><!></div>`);function Cx(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,xx),i=new ep,a=Hb.create({id:J(()=>t.id),ref:J(()=>n(),e=>n(e)),mounted:J(()=>i.current)}),o=k(()=>Lf(r,a.props,{style:{hidden:!t.present}}));var s=R(),c=N(s),l=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(o)})),z(e,n)},u=e=>{var n=Sx();_a(n,()=>({...I(o)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s),O()}var wx=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`]);function Tx(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=G(t,wx),s=kb.get();{let t=(e,t)=>{let n=()=>t?.().present;Cx(e,K(()=>o,{get id(){return r()},get present(){return n()},get ref(){return i()},set ref(e){i(e)}}))},n=k(()=>a()||s.hasThumb);rb(e,{get open(){return I(n)},get ref(){return s.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}O()}var Ex=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`,`child`]),Dx=L(`<div><!></div>`);function Ox(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Ex),i=Ub.create({id:J(()=>t.id),ref:J(()=>n(),e=>n(e))}),a=k(()=>Lf(r,i.props));var o=R(),s=N(o),c=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(a)})),z(e,n)},l=e=>{var n=Dx();_a(n,()=>({...I(a)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o),O()}var kx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`]);function Ax(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,kx),o=Db.get(),s=k(()=>!!(o.scrollbarXNode&&o.scrollbarYNode)),c=k(()=>o.opts.type.current!==`scroll`&&I(s));var l=R(),u=N(l),d=e=>{Ox(e,K(()=>a,{get id(){return i()},get ref(){return r()},set ref(e){r(e)}}))};V(u,e=>{I(c)&&e(d)}),z(e,l),O()}var jx=L(`<!> <!>`,1);function Mx(e,t){D(t,!0);let n=q(t,`value`,15),r=q(t,`onValueChange`,3,Vp),i=q(t,`name`,3,``),a=q(t,`disabled`,3,!1),o=q(t,`open`,15,!1),s=q(t,`onOpenChange`,3,Vp),c=q(t,`onOpenChangeComplete`,3,Vp),l=q(t,`loop`,3,!1),u=q(t,`scrollAlignment`,3,`nearest`),d=q(t,`required`,3,!1),f=q(t,`items`,19,()=>[]),p=q(t,`allowDeselect`,3,!1);function m(){n()===void 0&&n(t.type===`single`?``:[])}m(),Jf.pre(()=>n(),()=>{m()});let h=A(``),g=$_.create({type:t.type,value:J(()=>n(),e=>{n(e),r()(e)}),disabled:J(()=>a()),required:J(()=>d()),open:J(()=>o(),e=>{o(e),s()(e)}),loop:J(()=>l()),scrollAlignment:J(()=>u()),name:J(()=>i()),isCombobox:!1,items:J(()=>f()),allowDeselect:J(()=>p()),inputValue:J(()=>I(h),e=>j(h,e,!0)),onOpenChangeComplete:J(()=>c())});var _=jx(),v=N(_);H_(v,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}});var y=P(v,2),b=e=>{var n=R(),r=N(n),i=e=>{cv(e,{get autocomplete(){return t.autocomplete}})},a=e=>{var n=R();Ni(N(n),16,()=>g.opts.value.current,e=>e,(e,n)=>{cv(e,{get value(){return n},get autocomplete(){return t.autocomplete}})}),z(e,n)};V(r,e=>{g.opts.value.current.length===0?e(i):e(a,-1)}),z(e,n)},x=k(()=>Array.isArray(g.opts.value.current)),S=e=>{cv(e,{get autocomplete(){return t.autocomplete},get value(){return g.opts.value.current},set value(e){g.opts.value.current=e}})};V(y,e=>{I(x)?e(b):e(S,-1)}),z(e,_),O()}var Nx=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`type`]),Px=L(`<button><!></button>`);function Fx(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`type`,3,`button`),o=G(t,Nx),s=ev.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),c=k(()=>Lf(o,s.props,{type:a()}));var l=R();U(N(l),()=>lv,(e,n)=>{n(e,{get id(){return r()},get ref(){return s.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},o=e=>{var n=Px();_a(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}),z(e,l),O()}var Ix=wp({component:`switch`,parts:[`root`,`thumb`]}),Lx=new Uf(`Switch.Root`),Rx=class e{static create(t){return Lx.set(new e(t))}opts;attachment;constructor(e){this.opts=e,this.attachment=_p(e.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#e(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){!(e.key===`Enter`||e.key===` `)||this.opts.disabled.current||(e.preventDefault(),this.#e())}onclick(e){this.opts.disabled.current||this.#e()}#t=k(()=>({"data-disabled":yp(this.opts.disabled.current),"data-state":Zte(this.opts.checked.current),"data-required":yp(this.opts.required.current)}));get sharedProps(){return I(this.#t)}set sharedProps(e){j(this.#t,e)}#n=k(()=>({checked:this.opts.checked.current}));get snippetProps(){return I(this.#n)}set snippetProps(e){j(this.#n,e)}#r=k(()=>({...this.sharedProps,id:this.opts.id.current,role:`switch`,disabled:bp(this.opts.disabled.current),"aria-checked":Cp(this.opts.checked.current,!1),"aria-required":vp(this.opts.required.current),[Ix.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}},zx=class e{static create(){return new e(Lx.get())}root;#e=k(()=>this.root.opts.name.current!==void 0);get shouldRender(){return I(this.#e)}set shouldRender(e){j(this.#e,e)}constructor(e){this.root=e}#t=k(()=>({type:`checkbox`,name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Bx=class e{static create(t){return new e(t,Lx.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref)}#e=k(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({...this.root.sharedProps,id:this.opts.id.current,[Ix.thumb]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}};function Vx(e,t){D(t,!1);let n=zx.create();Ea();var r=R(),i=N(r),a=e=>{bh(e,K(()=>n.props))};V(i,e=>{n.shouldRender&&e(a)}),z(e,r),O()}var Hx=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`required`,`checked`,`value`,`name`,`type`,`onCheckedChange`]),Ux=L(`<button><!></button>`),Wx=L(`<!> <!>`,1);function Gx(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=q(t,`disabled`,3,!1),o=q(t,`required`,3,!1),s=q(t,`checked`,15,!1),c=q(t,`value`,3,`on`),l=q(t,`name`,3,void 0),u=q(t,`type`,3,`button`),d=q(t,`onCheckedChange`,3,Vp),f=G(t,Hx),p=Rx.create({checked:J(()=>s(),e=>{s(e),d()?.(e)}),disabled:J(()=>a()??!1),required:J(()=>o()),value:J(()=>c()),name:J(()=>l()),id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),m=k(()=>Lf(f,p.props,{type:u()}));var h=Wx(),g=N(h),_=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(m),...p.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},v=e=>{var n=Ux();_a(n,()=>({...I(m)})),H(M(n),()=>t.children??w,()=>p.snippetProps),T(n),z(e,n)};V(g,e=>{t.child?e(_):e(v,-1)}),Vx(P(g,2),{}),z(e,h),O()}var Kx=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`]),qx=L(`<span><!></span>`);function Jx(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=G(t,Kx),o=Bx.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(s),...o.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},d=e=>{var n=qx();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w,()=>o.snippetProps),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var Yx=wp({component:`tabs`,parts:[`root`,`list`,`trigger`,`content`]}),Xx=new Uf(`Tabs.Root`),Zx=class e{static create(t){return Xx.set(new e(t))}opts;attachment;rovingFocusGroup;#e=A(Mn([]));get triggerIds(){return I(this.#e)}set triggerIds(e){j(this.#e,e,!0)}valueToTriggerId=new Eo;valueToContentId=new Eo;constructor(e){this.opts=e,this.attachment=_p(e.ref),this.rovingFocusGroup=new Rp({candidateAttr:Yx.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,t){return this.triggerIds.push(e),this.valueToTriggerId.set(t,e),()=>{this.triggerIds=this.triggerIds.filter(t=>t!==e),this.valueToTriggerId.delete(t)}}registerContent(e,t){return this.valueToContentId.set(t,e),()=>{this.valueToContentId.delete(t)}}setValue(e){this.opts.value.current=e}#t=k(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[Yx.root]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Qx=class e{static create(t){return new e(t,Xx.get())}opts;root;attachment;#e=k(()=>this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref)}#t=k(()=>({id:this.opts.id.current,role:`tablist`,"aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[Yx.list]:``,"data-disabled":yp(I(this.#e)),...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},$x=class e{static create(t){return new e(t,Xx.get())}opts;root;attachment;#e=A(0);#t=k(()=>this.root.opts.value.current===this.opts.value.current);#n=k(()=>this.opts.disabled.current||this.root.opts.disabled.current);#r=k(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(e.ref),Jf([()=>this.opts.id.current,()=>this.opts.value.current],([e,t])=>this.root.registerTrigger(e,t)),rr(()=>{this.root.triggerIds.length,I(this.#t)||!this.root.opts.value.current?j(this.#e,0):j(this.#e,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!==`automatic`||I(this.#n)||this.#i()}onclick(e){I(this.#n)||this.#i()}onkeydown(e){if(!I(this.#n)){if(e.key===` `||e.key===`Enter`){e.preventDefault(),this.#i();return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=k(()=>({id:this.opts.id.current,role:`tab`,"data-state":eS(I(this.#t)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":yp(I(this.#n)),"aria-selected":vp(I(this.#t)),"aria-controls":I(this.#r),[Yx.trigger]:``,disabled:bp(I(this.#n)),tabindex:I(this.#e),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#a)}set props(e){j(this.#a,e)}};function eS(e){return e?`active`:`inactive`}var tS=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`orientation`,`loop`,`activationMode`,`disabled`,`children`,`child`]),nS=L(`<div><!></div>`);function rS(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`value`,15,``),o=q(t,`onValueChange`,3,Vp),s=q(t,`orientation`,3,`horizontal`),c=q(t,`loop`,3,!0),l=q(t,`activationMode`,3,`automatic`),u=q(t,`disabled`,3,!1),d=G(t,tS),f=Zx.create({id:J(()=>r()),value:J(()=>a(),e=>{a(e),o()(e)}),orientation:J(()=>s()),loop:J(()=>c()),activationMode:J(()=>l()),disabled:J(()=>u()),ref:J(()=>i(),e=>i(e))}),p=k(()=>Lf(d,f.props));var m=R(),h=N(m),g=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(p)})),z(e,n)},_=e=>{var n=nS();_a(n,()=>({...I(p)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(h,e=>{t.child?e(g):e(_,-1)}),z(e,m),O()}var iS=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`id`,`ref`]),aS=L(`<div><!></div>`);function oS(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=G(t,iS),o=Qx.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Lf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=aS();_a(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var sS=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`disabled`,`id`,`type`,`value`,`ref`]),cS=L(`<button><!></button>`);function lS(e,t){let n=Ti();D(t,!0);let r=q(t,`disabled`,3,!1),i=q(t,`id`,19,()=>Hp(n)),a=q(t,`type`,3,`button`),o=q(t,`ref`,15,null),s=G(t,sS),c=$x.create({id:J(()=>i()),disabled:J(()=>r()??!1),value:J(()=>t.value),ref:J(()=>o(),e=>o(e))}),l=k(()=>Lf(s,c.props,{type:a()}));var u=R(),d=N(u),f=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(l)})),z(e,n)},p=e=>{var n=cS();_a(n,()=>({...I(l)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(d,e=>{t.child?e(f):e(p,-1)}),z(e,u),O()}var uS=wp({component:`toggle-group`,parts:[`root`,`item`]}),dS=new Uf(`ToggleGroup.Root`),fS=class{opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=_p(this.opts.ref),this.rovingFocusGroup=new Rp({candidateAttr:uS.item,rootNode:e.ref,loop:e.loop,orientation:e.orientation})}#e=k(()=>({id:this.opts.id.current,[uS.root]:``,role:`group`,"data-orientation":this.opts.orientation.current,"data-disabled":yp(this.opts.disabled.current),...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},pS=class extends fS{opts;isMulti=!1;#e=k(()=>this.opts.value.current!==``);get anyPressed(){return I(this.#e)}set anyPressed(e){j(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current===e}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=``:(this.opts.value.current=e,this.rovingFocusGroup.setCurrentTabStopId(t))}},mS=class extends fS{opts;isMulti=!0;#e=k(()=>this.opts.value.current.length>0);get anyPressed(){return I(this.#e)}set anyPressed(e){j(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):(this.opts.value.current=[...this.opts.value.current,e],this.rovingFocusGroup.setCurrentTabStopId(t))}},hS=class{static create(e){let{type:t,...n}=e,r=t===`single`?new pS(n):new mS(n);return dS.set(r)}},gS=class e{static create(t){return new e(t,dS.get())}opts;root;attachment;#e=k(()=>this.opts.disabled.current||this.root.opts.disabled.current);#t=k(()=>this.root.includesItem(this.opts.value.current));get isPressed(){return I(this.#t)}set isPressed(e){j(this.#t,e)}#n=k(()=>this.root.isMulti?void 0:Cp(this.isPressed,!1));#r=k(()=>this.root.isMulti?vp(this.isPressed):void 0);constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref),rr(()=>{this.root.opts.rovingFocus.current?j(this.#a,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0):j(this.#a,0)}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){I(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onclick(e){I(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onkeydown(e){if(!I(this.#e)){if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.#i();return}this.root.opts.rovingFocus.current&&this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=A(0);#o=k(()=>({pressed:this.isPressed}));get snippetProps(){return I(this.#o)}set snippetProps(e){j(this.#o,e)}#s=k(()=>({id:this.opts.id.current,role:this.root.isMulti?void 0:`radio`,tabindex:I(this.#a),"data-orientation":this.root.opts.orientation.current,"data-disabled":yp(I(this.#e)),"data-state":_S(this.isPressed),"data-value":this.opts.value.current,"aria-pressed":I(this.#r),"aria-checked":I(this.#n),disabled:bp(I(this.#e)),[uS.item]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#s)}set props(e){j(this.#s,e)}};function _S(e){return e?`on`:`off`}var vS=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`type`,`disabled`,`loop`,`orientation`,`rovingFocus`,`child`,`children`]),yS=L(`<div><!></div>`);function bS(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`value`,15),o=q(t,`onValueChange`,3,Vp),s=q(t,`disabled`,3,!1),c=q(t,`loop`,3,!0),l=q(t,`orientation`,3,`horizontal`),u=q(t,`rovingFocus`,3,!0),d=G(t,vS);function f(){a()===void 0&&a(t.type===`single`?``:[])}f(),Jf.pre(()=>a(),()=>{f()});let p=hS.create({id:J(()=>r()),value:J(()=>a(),e=>{a(e),o()(e)}),disabled:J(()=>s()),loop:J(()=>c()),orientation:J(()=>l()),rovingFocus:J(()=>u()),type:t.type,ref:J(()=>i(),e=>i(e))}),m=k(()=>Lf(d,p.props));var h=R(),g=N(h),_=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(m)})),z(e,n)},v=e=>{var n=yS();_a(n,()=>({...I(m)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(g,e=>{t.child?e(_):e(v,-1)}),z(e,h),O()}var xS=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`value`,`disabled`,`id`,`type`]),SS=L(`<button><!></button>`);function CS(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`disabled`,3,!1),a=q(t,`id`,19,()=>Hp(n)),o=q(t,`type`,3,`button`),s=G(t,xS),c=gS.create({id:J(()=>a()),value:J(()=>t.value),disabled:J(()=>i()??!1),ref:J(()=>r(),e=>r(e))}),l=k(()=>Lf(s,c.props,{type:o()}));var u=R(),d=N(u),f=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(l),...c.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},p=e=>{var n=SS();_a(n,()=>({...I(l)})),H(M(n),()=>t.children??w,()=>c.snippetProps),T(n),z(e,n)};V(d,e=>{t.child?e(f):e(p,-1)}),z(e,u),O()}var wS=wp({component:`toolbar`,parts:[`root`,`item`,`group`,`group-item`,`link`,`button`]}),TS=new Uf(`Toolbar.Root`);new Uf(`Toolbar.Group`);var ES=class e{static create(t){return TS.set(new e(t))}opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=_p(this.opts.ref),this.rovingFocusGroup=new Rp({orientation:this.opts.orientation,loop:this.opts.loop,rootNode:this.opts.ref,candidateAttr:wS.item})}#e=k(()=>({id:this.opts.id.current,role:`toolbar`,"data-orientation":this.opts.orientation.current,[wS.root]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},DS=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`,`loop`,`child`,`children`]),OS=L(`<div><!></div>`);function kS(e,t){let n=Ti();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>Hp(n)),a=q(t,`orientation`,3,`horizontal`),o=q(t,`loop`,3,!0),s=G(t,DS),c=ES.create({id:J(()=>i()),orientation:J(()=>a()),loop:J(()=>o()),ref:J(()=>r(),e=>r(e))}),l=k(()=>Lf(s,c.props));var u=R(),d=N(u),f=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(l)})),z(e,n)},p=e=>{var n=OS();_a(n,()=>({...I(l)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(d,e=>{t.child?e(f):e(p,-1)}),z(e,u),O()}var AS=class{#e;#t;#n=null;constructor(e,t){this.#t=e,this.#e=t,this.stop=this.stop.bind(this),this.start=this.start.bind(this),sp(this.stop)}#r(){this.#n!==null&&(window.clearTimeout(this.#n),this.#n=null)}stop(){this.#r()}start(...e){this.#r(),this.#n=window.setTimeout(()=>{this.#n=null,this.#t(...e)},this.#e)}},jS=wp({component:`tooltip`,parts:[`content`,`trigger`]}),MS=new Uf(`Tooltip.Provider`),NS=new Uf(`Tooltip.Root`),PS=class{#e=A(Mn(new Map));get triggers(){return I(this.#e)}set triggers(e){j(this.#e,e,!0)}#t=A(null);get activeTriggerId(){return I(this.#t)}set activeTriggerId(e){j(this.#t,e,!0)}#n=k(()=>{let e=this.activeTriggerId;return e===null?null:this.triggers.get(e)?.node??null});get activeTriggerNode(){return I(this.#n)}set activeTriggerNode(e){j(this.#n,e)}#r=k(()=>{let e=this.activeTriggerId;return e===null?null:this.triggers.get(e)?.payload??null});get activePayload(){return I(this.#r)}set activePayload(e){j(this.#r,e)}register=e=>{let t=new Map(this.triggers);t.set(e.id,e),this.triggers=t,this.#i()};update=e=>{let t=new Map(this.triggers);t.set(e.id,e),this.triggers=t,this.#i()};unregister=e=>{if(!this.triggers.has(e))return;let t=new Map(this.triggers);t.delete(e),this.triggers=t,this.activeTriggerId===e&&(this.activeTriggerId=null)};setActiveTrigger=e=>{if(e===null){this.activeTriggerId=null;return}if(!this.triggers.has(e)){this.activeTriggerId=null;return}this.activeTriggerId=e};get=e=>this.triggers.get(e);has=e=>this.triggers.has(e);getFirstTriggerId=()=>{let e=this.triggers.entries().next();return e.done?null:e.value[0]};#i=()=>{let e=this.activeTriggerId;e!==null&&(this.triggers.has(e)||(this.activeTriggerId=null))}},FS=class e{static create(t){return MS.set(new e(t))}opts;#e=A(!0);get isOpenDelayed(){return I(this.#e)}set isOpenDelayed(e){j(this.#e,e,!0)}isPointerInTransit=vf(!1);#t;#n=A(null);constructor(e){this.opts=e,this.#t=new AS(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current),cp(()=>hi(window,`scroll`,e=>{let t=I(this.#n);if(!t)return;let n=t.triggerNode;if(!n)return;let r=e.target;(r instanceof Element||r instanceof Document)&&r.contains(n)&&t.handleClose()}))}#r=()=>{if(this.opts.skipDelayDuration.current===0){this.isOpenDelayed=!0;return}else this.#t.start()};#i=()=>{this.#t.stop()};onOpen=e=>{I(this.#n)&&I(this.#n)!==e&&I(this.#n).handleClose(),this.#i(),this.isOpenDelayed=!1,j(this.#n,e,!0)};onClose=e=>{I(this.#n)===e&&(j(this.#n,null),this.#r())};isTooltipOpen=e=>I(this.#n)===e},IS=class e{static create(t){return NS.set(new e(t,MS.get()))}opts;provider;#e=k(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return I(this.#e)}set delayDuration(e){j(this.#e,e)}#t=k(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return I(this.#t)}set disableHoverableContent(e){j(this.#t,e)}#n=k(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return I(this.#n)}set disableCloseOnTriggerClick(e){j(this.#n,e)}#r=k(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return I(this.#r)}set disabled(e){j(this.#r,e)}#i=k(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return I(this.#i)}set ignoreNonKeyboardFocus(e){j(this.#i,e)}registry;tether;#a=A(null);get contentNode(){return I(this.#a)}set contentNode(e){j(this.#a,e,!0)}contentPresence;#o=A(!1);#s;#c=k(()=>this.opts.open.current?I(this.#o)?`delayed-open`:`instant-open`:`closed`);get stateAttr(){return I(this.#c)}set stateAttr(e){j(this.#c,e)}constructor(e,t){this.opts=e,this.provider=t,this.tether=e.tether.current?.state??null,this.registry=this.tether?.registry??new PS,this.#s=new AS(()=>{j(this.#o,!0),this.opts.open.current=!0},this.delayDuration??0),this.tether&&(this.tether.root=this,cp(()=>()=>{this.tether?.root===this&&(this.tether.root=null)})),this.contentPresence=new Bp({open:this.opts.open,ref:J(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Jf(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#s=new AS(()=>{j(this.#o,!0),this.opts.open.current=!0},this.delayDuration))}),Jf(()=>this.opts.open.current,e=>{e?(this.ensureActiveTrigger(),this.provider.onOpen(this)):this.provider.onClose(this)},{lazy:!0}),Jf(()=>this.opts.triggerId.current,e=>{e!==this.registry.activeTriggerId&&this.registry.setActiveTrigger(e)}),Jf(()=>this.registry.activeTriggerId,e=>{this.opts.triggerId.current!==e&&(this.opts.triggerId.current=e)})}handleOpen=()=>{this.#s.stop(),j(this.#o,!1),this.ensureActiveTrigger(),this.opts.open.current=!0};handleClose=()=>{this.#s.stop(),this.opts.open.current=!1};#l=()=>{this.#s.stop();let e=!this.provider.isOpenDelayed,t=this.delayDuration??0;e||t===0?(j(this.#o,!1),this.opts.open.current=!0):this.#s.start()};onTriggerEnter=e=>{this.setActiveTrigger(e),this.#l()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#s.stop()};ensureActiveTrigger=()=>{if(this.registry.activeTriggerId!==null&&this.registry.has(this.registry.activeTriggerId))return;if(this.opts.triggerId.current!==null&&this.registry.has(this.opts.triggerId.current)){this.registry.setActiveTrigger(this.opts.triggerId.current);return}let e=this.registry.getFirstTriggerId();this.registry.setActiveTrigger(e)};setActiveTrigger=e=>{this.registry.setActiveTrigger(e)};registerTrigger=e=>{this.registry.register(e),e.disabled&&this.registry.activeTriggerId===e.id&&this.opts.open.current&&this.handleClose()};updateTrigger=e=>{this.registry.update(e),e.disabled&&this.registry.activeTriggerId===e.id&&this.opts.open.current&&this.handleClose()};unregisterTrigger=e=>{let t=this.registry.activeTriggerId===e;this.registry.unregister(e),t&&this.opts.open.current&&this.handleClose()};isActiveTrigger=e=>this.registry.activeTriggerId===e;get triggerNode(){return this.registry.activeTriggerNode}get activePayload(){return this.registry.activePayload}get activeTriggerId(){return this.registry.activeTriggerId}},LS=class e{static create(t){return t.tether.current?new e(t,null,t.tether.current.state):new e(t,NS.get(),null)}opts;root;tether;attachment;#e=vf(!1);#t=A(!1);domContext;#n=null;#r=!1;#i=null;constructor(e,t,n){this.opts=e,this.root=t,this.tether=n,this.domContext=new gp(e.ref),this.attachment=_p(this.opts.ref,e=>this.#s(e)),Jf(()=>this.opts.id.current,()=>{this.#s(this.opts.ref.current)}),Jf(()=>this.opts.payload.current,()=>{this.#s(this.opts.ref.current)}),Jf(()=>this.opts.disabled.current,()=>{this.#s(this.opts.ref.current)}),cp(()=>(this.#r=!0,this.#s(this.opts.ref.current),()=>{let e=this.#a(),t=this.#i;t&&(this.tether?this.tether.registry.unregister(t):e?.unregisterTrigger(t)),this.#i=null,this.#r=!1}))}#a=()=>this.tether?.root??this.root;#o=()=>{let e=this.#a();return this.opts.disabled.current||!!e?.disabled};#s=e=>{if(!this.#r)return;let t=this.opts.id.current,n=this.opts.payload.current,r=this.opts.disabled.current;if(this.#i&&this.#i!==t){let e=this.#a();this.tether?this.tether.registry.unregister(this.#i):e?.unregisterTrigger(this.#i)}let i={id:t,node:e,payload:n,disabled:r},a=this.#a();this.tether?(this.tether.registry.has(t)?this.tether.registry.update(i):this.tether.registry.register(i),r&&this.tether.registry.activeTriggerId===t&&a?.opts.open.current&&a.handleClose()):a?.registry.has(t)?a.updateTrigger(i):a?.registerTrigger(i),this.#i=t};#c=()=>{this.#n!==null&&(clearTimeout(this.#n),this.#n=null)};handlePointerUp=()=>{this.#e.current=!1};#l=()=>{this.#o()||(this.#e.current=!1)};#u=()=>{this.#o()||(this.#e.current=!0,this.domContext.getDocument().addEventListener(`pointerup`,()=>{this.handlePointerUp()},{once:!0}))};#d=e=>{let t=this.#a();if(t){if(this.#o()){t.opts.open.current&&t.handleClose();return}if(e.pointerType!==`touch`){if(t.provider.isPointerInTransit.current){this.#c(),this.#n=window.setTimeout(()=>{t.provider.isPointerInTransit.current&&(t.provider.isPointerInTransit.current=!1,t.onTriggerEnter(this.opts.id.current),j(this.#t,!0))},250);return}t.onTriggerEnter(this.opts.id.current),j(this.#t,!0)}}};#f=e=>{let t=this.#a();if(t){if(this.#o()){t.opts.open.current&&t.handleClose();return}e.pointerType!==`touch`&&(I(this.#t)||(this.#c(),t.provider.isPointerInTransit.current=!1,t.onTriggerEnter(this.opts.id.current),j(this.#t,!0)))}};#p=e=>{let t=this.#a();if(!t||this.#o())return;if(this.#c(),!t.isActiveTrigger(this.opts.id.current)){j(this.#t,!1);return}let n=e.relatedTarget;if(Fp(n)){for(let e of t.registry.triggers.values())if(e.node===n){if(t.provider.opts.skipDelayDuration.current>0){j(this.#t,!1);return}t.handleClose(),j(this.#t,!1);return}}t.onTriggerLeave(),j(this.#t,!1)};#m=e=>{let t=this.#a();if(t&&!this.#e.current){if(this.#o()){t.opts.open.current&&t.handleClose();return}t.ignoreNonKeyboardFocus&&!sne(e.currentTarget)||(t.setActiveTrigger(this.opts.id.current),t.handleOpen())}};#h=()=>{let e=this.#a();!e||this.#o()||e.handleClose()};#g=()=>{let e=this.#a();!e||e.disableCloseOnTriggerClick||this.#o()||e.handleClose()};#_=k(()=>{let e=this.#a(),t=!!(e?.opts.open.current&&e.isActiveTrigger(this.opts.id.current)),n=this.#o();return{id:this.opts.id.current,"aria-describedby":t?e?.contentNode?.id:void 0,"data-state":t?e?.stateAttr:`closed`,"data-disabled":yp(n),"data-delay-duration":`${e?.delayDuration??0}`,[jS.trigger]:``,tabindex:n?void 0:this.opts.tabindex.current,disabled:this.opts.disabled.current,onpointerup:this.#l,onpointerdown:this.#u,onpointerenter:this.#d,onpointermove:this.#f,onpointerleave:this.#p,onfocus:this.#m,onblur:this.#h,onclick:this.#g,...this.attachment}});get props(){return I(this.#_)}set props(e){j(this.#_,e)}},RS=class e{static create(t){return new e(t,NS.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=_p(this.opts.ref,e=>this.root.contentNode=e),new xy({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,transitIntentTimeout:180,ignoredTargets:()=>{if(this.root.provider.opts.skipDelayDuration.current===0)return[];let e=[],t=this.root.triggerNode;for(let n of this.root.registry.triggers.values())n.node&&n.node!==t&&e.push(n.node);return e},onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()}})}onInteractOutside=e=>{if(Fp(e.target)&&this.root.triggerNode?.contains(e.target)&&this.root.disableCloseOnTriggerClick){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current?.(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":yp(this.root.disabled),...Sp(this.root.contentPresence.transitionStatus),style:{outline:`none`},[jS.content]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}};function zS(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`triggerId`,15,null),i=q(t,`onOpenChange`,3,Vp),a=q(t,`onOpenChangeComplete`,3,Vp),o=IS.create({open:J(()=>n(),e=>{n(e),i()(e)}),triggerId:J(()=>r(),e=>{r(e)}),delayDuration:J(()=>t.delayDuration),disableCloseOnTriggerClick:J(()=>t.disableCloseOnTriggerClick),disableHoverableContent:J(()=>t.disableHoverableContent),ignoreNonKeyboardFocus:J(()=>t.ignoreNonKeyboardFocus),disabled:J(()=>t.disabled),onOpenChangeComplete:J(()=>a()),tether:J(()=>t.tether)});H_(e,{tooltip:!0,children:(e,n)=>{var r=R();H(N(r),()=>t.children??w,()=>({open:o.opts.open.current,triggerId:o.activeTriggerId,payload:o.activePayload})),z(e,r)},$$slots:{default:!0}}),O()}var BS=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`side`,`sideOffset`,`align`,`avoidCollisions`,`arrowPadding`,`sticky`,`strategy`,`hideWhenDetached`,`customAnchor`,`collisionPadding`,`onInteractOutside`,`onEscapeKeydown`,`forceMount`,`style`]),VS=L(`<div><div><!></div></div>`);function HS(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`ref`,15,null),a=q(t,`side`,3,`top`),o=q(t,`sideOffset`,3,0),s=q(t,`align`,3,`center`),c=q(t,`avoidCollisions`,3,!0),l=q(t,`arrowPadding`,3,0),u=q(t,`sticky`,3,`partial`),d=q(t,`hideWhenDetached`,3,!1),f=q(t,`collisionPadding`,3,0),p=q(t,`onInteractOutside`,3,Vp),m=q(t,`onEscapeKeydown`,3,Vp),h=q(t,`forceMount`,3,!1),g=G(t,BS),_=RS.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),onInteractOutside:J(()=>p()),onEscapeKeydown:J(()=>m())}),v=k(()=>({side:a(),sideOffset:o(),align:s(),avoidCollisions:c(),arrowPadding:l(),sticky:u(),hideWhenDetached:d(),collisionPadding:f(),strategy:t.strategy,customAnchor:t.customAnchor??_.root.triggerNode})),y=k(()=>Lf(g,I(v),_.props));var b=R(),x=N(b),S=e=>{{let n=(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(i(),{style:{pointerEvents:_.root.disableHoverableContent?`none`:void 0}})),o=k(()=>Lf(r(),{style:D_(`tooltip`)},{style:t.style}));var s=R(),c=N(s),l=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(o),wrapperProps:I(a),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},u=e=>{var n=VS();_a(n,()=>({...I(a)}));var r=M(n);_a(r,()=>({...I(o)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s)},i=k(()=>_.root.disableHoverableContent?`none`:`auto`);Ev(e,K(()=>I(y),()=>_.popperProps,{get enabled(){return _.root.opts.open.current},get id(){return r()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return _.opts.ref},tooltip:!0,get shouldRender(){return _.shouldRender},get contentPointerEvents(){return I(i)},popper:n,$$slots:{popper:!0}}))}},ee=e=>{{let n=(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Lf(i(),{style:{pointerEvents:_.root.disableHoverableContent?`none`:void 0}})),o=k(()=>Lf(r(),{style:D_(`tooltip`)},{style:t.style}));var s=R(),c=N(s),l=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(o),wrapperProps:I(a),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},u=e=>{var n=VS();_a(n,()=>({...I(a)}));var r=M(n);_a(r,()=>({...I(o)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s)},i=k(()=>_.root.disableHoverableContent?`none`:`auto`);wv(e,K(()=>I(y),()=>_.popperProps,{get open(){return _.root.opts.open.current},get id(){return r()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return _.opts.ref},tooltip:!0,get shouldRender(){return _.shouldRender},get contentPointerEvents(){return I(i)},popper:n,$$slots:{popper:!0}}))}};V(x,e=>{h()?e(S):h()||e(ee,1)}),z(e,b),O()}var US=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`disabled`,`payload`,`tether`,`type`,`tabindex`,`ref`]),WS=L(`<button><!></button>`);function GS(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,19,()=>Hp(n)),i=q(t,`disabled`,3,!1),a=q(t,`type`,3,`button`),o=q(t,`tabindex`,3,0),s=q(t,`ref`,15,null),c=G(t,US),l=LS.create({id:J(()=>r()),disabled:J(()=>i()??!1),tabindex:J(()=>o()??0),payload:J(()=>t.payload),tether:J(()=>t.tether),ref:J(()=>s(),e=>s(e))}),u=k(()=>Lf(c,l.props,{type:a()}));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=WS();_a(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var KS=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function qS(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,KS);hv(e,K(()=>r,{get ref(){return n()},set ref(e){n(e)}})),O()}function JS(e,t){D(t,!0);let n=q(t,`delayDuration`,3,700),r=q(t,`disableCloseOnTriggerClick`,3,!1),i=q(t,`disableHoverableContent`,3,!1),a=q(t,`disabled`,3,!1),o=q(t,`ignoreNonKeyboardFocus`,3,!1),s=q(t,`skipDelayDuration`,3,300);FS.create({delayDuration:J(()=>n()),disableCloseOnTriggerClick:J(()=>r()),disableHoverableContent:J(()=>i()),disabled:J(()=>a()),ignoreNonKeyboardFocus:J(()=>o()),skipDelayDuration:J(()=>s())});var c=R();H(N(c),()=>t.children??w),z(e,c),O()}var YS=L(`<!> <!>`,1);function XS(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`class`,3,``),i=q(t,`triggerClass`,3,``),a=q(t,`side`,3,`bottom`),o=q(t,`align`,3,`end`),s=q(t,`sideOffset`,3,7),c=q(t,`collisionPadding`,3,8),l=q(t,`trapFocus`,3,!0);function u(e){n(e),t.onOpenChange?.(e)}var d=R();U(N(d),()=>ib,(e,d)=>{d(e,{onOpenChange:u,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var u=YS(),d=N(u);{let e=k(()=>ol(`popover-trigger`,i()));U(d,()=>My,(n,r)=>{r(n,{get class(){return I(e)},get"aria-label"(){return t.ariaLabel},get title(){return t.triggerTitle},get"aria-keyshortcuts"(){return t.triggerAriaKeyShortcuts},children:(e,n)=>{var r=R();H(N(r),()=>t.trigger??w),z(e,r)},$$slots:{default:!0}})})}U(P(d,2),()=>qp,(e,n)=>{n(e,{children:(e,n)=>{var i=R(),u=N(i);{let e=k(()=>ol(`popover-content`,r()));U(u,()=>ky,(n,r)=>{r(n,{get class(){return I(e)},get side(){return a()},get align(){return o()},get sideOffset(){return s()},get collisionPadding(){return c()},get trapFocus(){return l()},children:(e,n)=>{var r=YS(),i=N(r);H(i,()=>t.children??w),U(P(i,2),()=>Py,(e,t)=>{t(e,{class:`popover-arrow`,width:9,height:5})}),z(e,r)},$$slots:{default:!0}})})}z(e,i)},$$slots:{default:!0}})}),z(e,u)},$$slots:{default:!0}})}),z(e,d),O()}var ZS=Cl({base:`inline-block flex-none rounded-full`,variants:{tone:{neutral:`bg-muted-foreground border-muted-foreground`,accent:`bg-foreground border-foreground`,running:`bg-info border-info`,good:`bg-success border-success`,warn:`bg-warning border-warning`,danger:`bg-destructive border-destructive`},size:{xs:`size-[0.42rem]`,sm:`size-2`,md:`size-2.5`},variant:{solid:``,outline:`border-[1.5px] bg-transparent!`}},defaultVariants:{tone:`neutral`,size:`sm`,variant:`solid`}}),QS=L(`<span></span>`);function $S(e,t){D(t,!0);let n=q(t,`tone`,3,`neutral`),r=q(t,`size`,3,`sm`),i=q(t,`variant`,3,`solid`),a=q(t,`pulse`,3,!1);var o=QS();F(e=>{Qi(o,1,e),W(o,`aria-label`,t.label),W(o,`aria-hidden`,t.label?void 0:`true`)},[()=>Ki(ol(ZS({tone:n(),size:r(),variant:i()}),a()&&`status-pulse`,t.class))]),z(e,o),O()}var eC=L(`<span class="status-trigger svelte-19t05xp" title="Open daemon status"><!> <span> </span></span>`),tC=L(`<div class="flex flex-col gap-3 p-3"><header class="flex items-center justify-between gap-2 border-b border-border/60 pb-2.5"><strong class="text-sm font-semibold">Nerve daemon</strong> <!></header> <dl class="flex flex-col gap-2 text-xs"><div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Connection</dt> <dd class="flex items-center gap-1.5 font-medium"><!> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Version</dt> <dd class="font-mono"> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Uptime</dt> <dd class="font-medium"> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Index</dt> <dd> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Home</dt> <dd class="min-w-0 truncate font-mono"> </dd></div></dl></div>`);function nC(e,t){D(t,!0);let n=q(t,`connection`,3,`connecting`),r=q(t,`live`,3,!1),i=q(t,`side`,3,`top`),a=k(()=>r()?`good`:n()===`error`?`danger`:n()===`closed`?`warn`:`running`),o=k(()=>r()?`Connected`:n()),s=k(()=>{if(!t.status?.startedAt)return null;let e=new Date(t.status.startedAt).getTime();return Number.isNaN(e)?null:$d((Date.now()-e)/6e4)});XS(e,{class:`status-popover`,triggerClass:`status-trigger-wrap`,ariaLabel:`Open daemon status`,get side(){return i()},align:`end`,trigger:e=>{var t=eC(),n=M(t);$S(n,{get tone(){return I(a)},get pulse(){return r()}});var i=P(n,2),s=M(i,!0);T(i),T(t),F(()=>B(s,I(o))),z(e,t)},children:(e,r)=>{var i=tC(),c=M(i);of(P(M(c),2),{size:`xs`,get tone(){return I(a)},children:(e,t)=>{E();var n=wi();F(()=>B(n,I(o))),z(e,n)},$$slots:{default:!0}}),T(c);var l=P(c,2),u=M(l),d=P(M(u),2),f=M(d);$S(f,{get tone(){return I(a)},size:`xs`});var p=P(f,1,!0);T(d),T(u);var m=P(u,2),h=P(M(m),2),g=M(h,!0);T(h),T(m);var _=P(m,2),v=P(M(_),2),y=M(v,!0);T(v),T(_);var b=P(_,2),x=P(M(b),2),S=M(x,!0);T(x),T(b);var ee=P(b,2),C=P(M(ee),2),te=M(C,!0);T(C),T(ee),T(l),T(i),F(()=>{B(p,n()),B(g,t.status?.version??`—`),B(y,I(s)??`—`),Qi(x,1,Ki(t.status?.storage.indexHealthy?`text-success`:`text-warning`)),B(S,t.status==null?`—`:t.status.storage.indexHealthy?`healthy`:`rebuilding`),W(C,`title`,t.status?.storage.home),B(te,t.status?.storage.home??`—`)}),z(e,i)},$$slots:{trigger:!0,default:!0}}),O()}var rC=L(`<span class="text-xs text-muted-foreground"> </span>`),iC=L(`<div class="flex flex-col gap-1"><div class="flex items-center justify-between gap-2 text-xs"><span class="text-muted-foreground"> </span> <span> </span></div> <div class="h-1 overflow-hidden rounded-full bg-muted"><div></div></div> <!></div>`),aC=L(`<span class="trigger-muted svelte-fvy830"> </span>`),oC=L(`<span class="trigger-muted svelte-fvy830">/</span> <span> </span>`,1),sC=L(`<span class="subscription-trigger svelte-fvy830"><!> <span> <!></span> <!></span>`),cC=L(`<span class="font-normal text-muted-foreground"> </span>`),lC=L(`<!> <!>`,1),uC=L(`<span class="text-xs text-muted-foreground">No data</span>`),dC=L(`<section><div class="flex items-center justify-between gap-2"><span class="flex items-baseline gap-1.5 text-xs font-semibold"> <!></span> <!></div> <!></section>`),fC=L(`<div class="flex flex-col gap-3 p-3"><header class="flex items-center justify-between gap-2 border-b border-border/60 pb-2.5"><strong class="text-sm font-semibold">Subscription usage</strong> <!></header> <div class="flex flex-col gap-2.5"></div></div>`);function pC(e,t){D(t,!0);let n=(e,t=w,n=w)=>{let r=k(()=>n()?.usedPercent??null),s=k(()=>i(n()));var u=iC(),d=M(u),f=M(d),p=M(f,!0);T(f);var m=P(f,2),h=M(m,!0);T(m),T(d);var g=P(d,2),_=M(g);T(g);var v=P(g,2),y=e=>{var t=rC(),n=M(t);T(t),F(()=>B(n,`resets in ${I(s)??``}`)),z(e,t)};V(v,e=>{I(s)&&e(y)}),T(u),F((e,n,r,i)=>{B(p,t()),Qi(m,1,e,`svelte-fvy830`),B(h,n),Qi(_,1,r,`svelte-fvy830`),ea(_,`width: ${i??``}%`)},[()=>Ki(ol(`font-medium tabular-nums`,c(I(r)))),()=>a(I(r)),()=>Ki(ol(`h-full rounded-full`,l(I(r)))),()=>o(I(r))]),z(e,u)},r=q(t,`usages`,19,()=>[]);function i(e){return e?ef(e.resetsAt)??tf(e.resetAfterSeconds):null}function a(e){return e==null?`—`:`${Math.round(e)}%`}function o(e){return e==null?0:Math.min(100,Math.max(0,e))}function s(e){return e===`openai-codex`?`Codex`:e===`anthropic`?`Anthropic`:e}function c(e){let t=Qd(e);return t===`error`?`text-destructive`:t===`warning`?`text-warning`:``}function l(e){let t=Qd(e);return t===`error`?`bg-destructive`:t===`warning`?`bg-warning`:`bg-success`}function u(e){let t=Qd(e);return t===`error`?`danger`:t===`warning`?`warn`:`good`}function d(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}let f=k(r),p=k(()=>I(f).some(e=>e.usage)),m=k(()=>I(f).find(e=>e.active&&e.usage)??I(f).find(e=>e.usage)),h=k(()=>I(m)?.usage?.session?.usedPercent??null),g=k(()=>i(I(m)?.usage?.session)),_=k(()=>I(m)?.usage?.weekly?.usedPercent??null),v=k(()=>u(Math.max(I(h)??0,I(_)??0))),y=k(()=>d(I(f).map(e=>e.usage?.updatedAt).filter(e=>!!e).sort().at(-1))),b=k(()=>{let e=[];for(let t of I(f)){if(!t.usage)continue;let n=a(t.usage.session?.usedPercent),r=a(t.usage.weekly?.usedPercent);e.push(`${s(t.provider)} — session ${n} / weekly ${r}`)}return e.join(`
|
|
16
|
-
`)});var x=R(),S=N(x),ee=e=>{XS(e,{class:`subscription-popover`,triggerClass:`subscription-trigger-wrap`,ariaLabel:`Open subscription usage details`,side:`top`,align:`end`,trigger:e=>{var t=sC(),n=M(t);{let e=k(()=>I(v)!==`good`);$S(n,{get tone(){return I(v)},get pulse(){return I(e)},size:`xs`})}var r=P(n,2),i=M(r),o=P(i),s=e=>{var t=aC(),n=M(t);T(t),F(()=>B(n,`(${I(g)??``})`)),z(e,t)};V(o,e=>{I(g)!=null&&e(s)}),T(r);var l=P(r,2),u=e=>{var t=oC(),n=P(N(t),2),r=M(n);T(n),F((e,t)=>{Qi(n,1,e,`svelte-fvy830`),B(r,`W:${t??``}`)},[()=>Ki(ol(`trigger-part`,c(I(_)))),()=>a(I(_))]),z(e,t)};V(l,e=>{I(_)!=null&&e(u)}),T(t),F((e,n)=>{W(t,`title`,I(b)),Qi(r,1,e,`svelte-fvy830`),B(i,`S:${n??``}`)},[()=>Ki(ol(`trigger-part`,c(I(h)))),()=>a(I(h))]),z(e,t)},children:(e,t)=>{var r=fC(),i=M(r),a=P(M(i),2),o=e=>{var t=rC(),n=M(t);T(t),F(()=>B(n,`Updated ${I(y)??``}`)),z(e,t)};V(a,e=>{I(y)&&e(o)}),T(i);var c=P(i,2);Ni(c,21,()=>I(f),e=>e.provider,(e,t)=>{var r=dC(),i=M(r),a=M(i),o=M(a),c=P(o),l=e=>{var n=cC(),r=M(n);T(n),F(()=>B(r,`· ${I(t).usage.planType??``}`)),z(e,n)};V(c,e=>{I(t).usage?.planType&&e(l)}),T(a);var u=P(a,2),d=e=>{of(e,{size:`xs`,tone:`neutral`,children:(e,t)=>{E(),z(e,wi(`Active`))},$$slots:{default:!0}})};V(u,e=>{I(t).active&&e(d)}),T(i);var f=P(i,2),p=e=>{var r=lC(),i=N(r);n(i,()=>`Session`,()=>I(t).usage.session),n(P(i,2),()=>`Weekly`,()=>I(t).usage.weekly),z(e,r)},m=e=>{z(e,uC())};V(f,e=>{I(t).usage?e(p):e(m,-1)}),T(r),F((e,t)=>{Qi(r,1,e,`svelte-fvy830`),B(o,`${t??``} `)},[()=>Ki(ol(`flex flex-col gap-2 rounded-md border border-border/60 p-2.5`,I(t).active&&`bg-muted/40`)),()=>s(I(t).provider)]),z(e,r)}),T(c),T(r),z(e,r)},$$slots:{trigger:!0,default:!0}})};V(S,e=>{I(p)&&e(ee)}),z(e,x),O()}var mC=new Set([`$$slots`,`$$events`,`$$legacy`]);function hC(e,t){let n=G(t,mC),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]];ic(e,K({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var gC=new Set([`$$slots`,`$$events`,`$$legacy`]);function _C(e,t){let n=G(t,gC),r=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];ic(e,K({name:`zoom-in`},()=>n,{get iconNode(){return r}}))}var vC=new Set([`$$slots`,`$$events`,`$$legacy`]);function yC(e,t){let n=G(t,vC),r=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];ic(e,K({name:`zoom-out`},()=>n,{get iconNode(){return r}}))}var bC=Mn({utilityTab:`git`,sidebarCollapsed:!1,utilityCollapsed:!1,navDrawerOpen:!1,utilityDrawerOpen:!1}),xC=1.1,SC=Mn({preference:`system`}),CC=Mn({level:0});function wC(e=SC.preference){SC.preference=e,rc(e)}function TC(e){return Number.isFinite(e)?Math.min(8,Math.max(-8,Math.round(e))):0}function EC(e){return xC**TC(e)}function DC(e){return Math.round(EC(e)*100)}function OC(e){let t=TC(e);CC.level=t,!(typeof document>`u`)&&document.documentElement.style.setProperty(`--nerve-zoom-scale`,EC(t).toFixed(4))}function kC(){return typeof localStorage>`u`?!1:localStorage.getItem(`nerve.sidebarCollapsed`)===`1`}function AC(e){bC.sidebarCollapsed=e,typeof localStorage<`u`&&localStorage.setItem(`nerve.sidebarCollapsed`,e?`1`:`0`)}function jC(){return typeof localStorage>`u`?!1:localStorage.getItem(`nerve.utilityCollapsed`)===`1`}function MC(e){bC.utilityCollapsed=e,typeof localStorage<`u`&&localStorage.setItem(`nerve.utilityCollapsed`,e?`1`:`0`)}function NC(e){bC.navDrawerOpen=e}function PC(e){bC.utilityDrawerOpen=e}function FC(){bC.navDrawerOpen=!0,bC.utilityDrawerOpen=!1}function IC(){bC.utilityDrawerOpen=!0,bC.navDrawerOpen=!1}function LC(){bC.navDrawerOpen=!1,bC.utilityDrawerOpen=!1}function RC(){return Us.current??`system`}var zC=L(`<span class="zoom-trigger svelte-ru0gry"><span> </span></span>`),BC=L(`<div class="zoom-card svelte-ru0gry"><header class="svelte-ru0gry"><div class="svelte-ru0gry"><strong class="svelte-ru0gry">Zoom</strong> <span class="svelte-ru0gry"> </span></div> <span class="zoom-percent svelte-ru0gry"> </span></header> <div class="zoom-actions svelte-ru0gry" aria-label="Zoom controls"><!> <!> <!></div> <label class="zoom-slider svelte-ru0gry"><span class="svelte-ru0gry">Level</span> <input type="range" step="1" aria-label="Zoom level" class="svelte-ru0gry"/> <span class="zoom-range-labels svelte-ru0gry" aria-hidden="true"><span> </span> <span>0</span> <span> </span></span></label></div>`);function VC(e,t){D(t,!0);let n=q(t,`zoomLevel`,3,0),r=k(()=>TC(n())),i=k(()=>DC(I(r))),a=k(()=>I(r)>0?`+${I(r)}`:String(I(r)));function o(e){t.onZoomLevelChange?.(TC(e))}function s(e){o(I(r)+e)}function c(e){let t=e.currentTarget;o(Number(t.value))}XS(e,{class:`zoom-popover`,triggerClass:`zoom-trigger-wrap`,ariaLabel:`Open zoom controls`,side:`top`,align:`end`,trigger:e=>{var t=zC(),n=M(t),r=M(n);T(n),T(t),F(()=>{W(t,`title`,`Zoom: ${I(i)}%`),B(r,`${I(i)??``}%`)}),z(e,t)},children:(e,t)=>{var n=BC(),l=M(n),u=M(l),d=P(M(u),2),f=M(d);T(d),T(u);var p=P(u,2),m=M(p);T(p),T(l);var h=P(l,2),g=M(h);{let e=k(()=>I(r)<=-8);Ol(g,{variant:`outline`,size:`icon-sm`,ariaLabel:`Zoom out`,title:`Zoom out`,get disabled(){return I(e)},onclick:()=>s(-1),children:(e,t)=>{yC(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})},$$slots:{default:!0}})}var _=P(g,2);{let e=k(()=>I(r)===0);Ol(_,{variant:`outline`,size:`icon-sm`,ariaLabel:`Reset zoom`,title:`Reset zoom`,get disabled(){return I(e)},onclick:()=>o(0),children:(e,t)=>{hC(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})},$$slots:{default:!0}})}var v=P(_,2);{let e=k(()=>I(r)>=8);Ol(v,{variant:`outline`,size:`icon-sm`,ariaLabel:`Zoom in`,title:`Zoom in`,get disabled(){return I(e)},onclick:()=>s(1),children:(e,t)=>{_C(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})},$$slots:{default:!0}})}T(h);var y=P(h,2),b=P(M(y),2);pa(b);var x=P(b,2),S=M(x),ee=M(S,!0);T(S);var C=P(S,4),te=M(C);T(C),T(x),T(y),T(n),F(()=>{B(f,`Zoom level ${I(a)??``}`),B(m,`${I(i)??``}%`),W(b,`min`,-8),W(b,`max`,8),ma(b,I(r)),B(ee,-8),B(te,`+8`)}),_i(`input`,b,c),z(e,n)},$$slots:{trigger:!0,default:!0}}),O()}vi([`input`]);var HC=L(`<span class="footer-chip svelte-1lcv47q" title="Git branch"><!> <span> </span></span>`),UC=L(`<span class="footer-chip svelte-1lcv47q" title="Running tasks"><!> <span> </span></span>`),WC=L(`<span class="footer-chip warn svelte-1lcv47q" title="Pending approvals"><!> <span> </span></span>`),GC=L(`<!> <!> <!> <!> <!>`,1),KC=L(`<footer class="footerbar svelte-1lcv47q"><div class="footer-group svelte-1lcv47q"><!> <span class="footer-path svelte-1lcv47q"> </span></div> <div class="footer-group footer-right svelte-1lcv47q"><!> <!> <!></div></footer>`);function qC(e,t){D(t,!0);let n=q(t,`connection`,3,`connecting`),r=q(t,`live`,3,!1),i=q(t,`pendingApprovals`,3,0),a=q(t,`tasks`,19,()=>[]),o=q(t,`subscriptionUsages`,19,()=>[]),s=q(t,`zoomLevel`,3,0),c=q(t,`sidebarCollapsed`,3,!1),l=q(t,`utilityCollapsed`,3,!1),u=q(t,`phone`,3,!1),d=k(()=>a().filter(e=>[`starting`,`running`,`ready`,`stopping`].includes(e.status)).length),f=k(()=>t.activeProject?Rd(t.activeProject.dir,t.homeDir):`No project`);var p=KC(),m=M(p),h=M(m);{let e=k(()=>c()?`Show agents panel`:`Hide agents panel`),n=k(()=>!c());Ol(h,{variant:`ghost`,size:`icon-sm`,class:`footer-toggle`,ariaLabel:`Toggle agents panel`,get title(){return I(e)},get pressed(){return I(n)},onclick:()=>t.onToggleSidebar?.(),children:(e,t)=>{var n=R(),r=N(n),i=e=>{Dd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})},a=e=>{kd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})};V(r,e=>{c()?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}var g=P(h,2),_=M(g,!0);T(g),T(m);var v=P(m,2),y=M(v),b=e=>{var n=GC(),r=N(n),a=e=>{var n=HC(),r=M(n);Td(r,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=P(r,2),a=M(i);T(i),T(n),F(()=>B(a,`${t.gitStatus.branch??``}${t.gitStatus.dirty?`*`:``}`)),z(e,n)};V(r,e=>{t.gitStatus&&e(a)});var c=P(r,2),l=e=>{var t=UC(),n=M(t);Fd(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=P(n,2),i=M(r,!0);T(r),T(t),F(()=>B(i,I(d))),z(e,t)};V(c,e=>{I(d)>0&&e(l)});var u=P(c,2),f=e=>{var t=WC(),n=M(t);Ld(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=P(n,2),a=M(r,!0);T(r),T(t),F(()=>B(a,i())),z(e,t)};V(u,e=>{i()>0&&e(f)});var p=P(u,2);pC(p,{get usages(){return o()}}),VC(P(p,2),{get zoomLevel(){return s()},get onZoomLevelChange(){return t.onZoomLevelChange}}),z(e,n)};V(y,e=>{u()||e(b)});var x=P(y,2);nC(x,{get connection(){return n()},get live(){return r()},get status(){return t.status},side:`top`});var S=P(x,2);{let e=k(()=>l()?`Show utility panel`:`Hide utility panel`),n=k(()=>!l());Ol(S,{variant:`ghost`,size:`icon-sm`,class:`footer-toggle`,ariaLabel:`Toggle utility panel`,get title(){return I(e)},get pressed(){return I(n)},onclick:()=>t.onToggleUtility?.(),children:(e,t)=>{var n=R(),r=N(n),i=e=>{jd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})},a=e=>{Nd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})};V(r,e=>{l()?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}T(v),T(p),F(()=>{W(g,`title`,t.activeProject?.dir),B(_,I(f))}),z(e,p),O()}var JC=`max-width: 1023px`,YC=`max-width: 639px`,XC,ZC;typeof window<`u`&&typeof window.matchMedia==`function`&&(XC=new Ao(JC),ZC=new Ao(YC));var QC={get isCompact(){return XC?.current??!1},get isPhone(){return ZC?.current??!1}},$C=[],ew,tw=!1,nw=!1,rw=1e3,iw=500,aw=1e4,ow=[/ResizeObserver loop completed with undelivered notifications\./i,/ResizeObserver loop limit exceeded/i];function sw(e){return typeof e==`string`&&ow.some(t=>t.test(e))}function cw(){tw||typeof window>`u`||(tw=!0,window.addEventListener(`error`,e=>{sw((e.error instanceof Error?e.error.message:void 0)??e.message)||lw(`error`,`web-runtime`,`Unhandled browser error`,{context:{filename:e.filename,lineno:e.lineno,colno:e.colno},error:e.error??e.message})}),window.addEventListener(`unhandledrejection`,e=>{lw(`error`,`web-runtime`,`Unhandled promise rejection`,{error:e.reason})}))}function lw(e,t,n,r={}){$C.push({level:e,component:t,message:n,ts:new Date().toISOString(),durationMs:r.durationMs,context:r.context,error:r.error?pw(r.error):void 0}),$C.length>200&&$C.splice(0,$C.length-200),dw()}function uw(e,t,n,r,i){lw(n&&n<500?`warn`:`error`,`api`,`API request failed`,{durationMs:r,context:{method:e,path:t,status:n},error:i})}function dw(e=iw){ew===void 0&&(ew=setTimeout(()=>{ew=void 0,fw()},e))}async function fw(){if(nw||$C.length===0)return;nw=!0;let e=$C.splice(0,50),t=iw;try{let t=await fetch(`/api/logs/client`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({logs:e})});if(!t.ok)throw Error(`${t.status} ${t.statusText}`);rw=1e3}catch(n){$C.unshift(...e),$C.length>200&&$C.splice(0,$C.length-200),t=rw,rw=Math.min(rw*2,aw),console.warn(`Failed to submit Nerve client logs`,n)}finally{nw=!1,$C.length>0&&dw(t)}}function pw(e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(typeof e==`string`)return{message:e};if(e&&typeof e==`object`){let t=mw(e);return{message:typeof e.message==`string`?e.message:t.split(`
|
|
17
|
-
`,1)[0],stack:t}}return{message:String(e)}}function mw(e){try{let t=new WeakSet;return JSON.stringify(e,(e,n)=>{if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)}catch{return String(e)}}var hw=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t,this.name=`ApiRequestError`}};function gw(){return typeof window<`u`?window.location.origin:`http://localhost`}function _w(e){if(typeof e==`number`&&!Number.isFinite(e))throw Error(`API path segment must be a finite number.`);return encodeURIComponent(String(e))}function vw(e){if(!(e===`/api`||e.startsWith(`/api/`)||e.startsWith(`/api?`))||e.startsWith(`//`))throw Error(`API requests must use a same-origin /api path.`);let t=new URL(e,gw());if(t.origin!==gw())throw Error(`API requests must stay on the current origin.`);if(!(t.pathname===`/api`||t.pathname.startsWith(`/api/`)))throw Error(`API requests must stay under /api.`);return`${t.pathname}${t.search}`}async function yw(e){let t=e.headers.get(`content-type`)??``;if(!e.ok)throw Error(await e.text());if(!t.includes(`application/json`)){let n=await e.text();throw Error(`Expected JSON response from ${e.url||`API`}, received ${t||`unknown content type`}. ${n.slice(0,80)}`)}return await e.json()}async function bw(e,t={}){let n=performance.now(),r=t.method??`GET`,i=vw(e),a;try{return a=await fetch(i,{credentials:`same-origin`,...t}),await yw(a)}catch(e){throw uw(r,i,a?.status,Math.round(performance.now()-n),e),e}}async function xw(e){return bw(e)}async function Sw(e,t){return bw(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Cw(e,t){return bw(e,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function ww(e,t){return bw(e,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Tw(e){return bw(e,{method:`DELETE`})}async function Ew(e){let t=vw(e),n=await fetch(t,{method:`DELETE`,credentials:`same-origin`});if(!n.ok)throw Error(await n.text())}function Dw(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`Failed to read file.`)),r.onload=()=>{let e=String(r.result??``);t(e.includes(`,`)?e.slice(e.indexOf(`,`)+1):e)},r.readAsDataURL(e)})}function Ow(e){try{let t=JSON.parse(e);return{code:typeof t.error?.code==`string`?t.error.code:void 0,message:typeof t.error?.message==`string`?t.error.message:void 0}}catch{return{}}}async function kw(e){return(await xw(`/api/conversations/${_w(e)}/snapshot`)).snapshot}async function Aw(e){return(await xw(`/api/conversations/${_w(e)}/context-usage`)).contextUsage}async function jw(e){return Sw(`/api/conversations/${_w(e)}/compact`,{})}async function Mw(e){await Ew(`/api/conversations/${_w(e)}`)}var Nw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pw(e,t){let n=G(t,Nw),r=[[`path`,{d:`M12 8V4H8`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}],[`path`,{d:`M2 14h2`}],[`path`,{d:`M20 14h2`}],[`path`,{d:`M15 13v2`}],[`path`,{d:`M9 13v2`}]];ic(e,K({name:`bot`},()=>n,{get iconNode(){return r}}))}var Fw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Iw(e,t){let n=G(t,Fw),r=[[`path`,{d:`m6 9 6 6 6-6`}]];ic(e,K({name:`chevron-down`},()=>n,{get iconNode(){return r}}))}var Lw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Rw(e,t){let n=G(t,Lw),r=[[`path`,{d:`m9 18 6-6-6-6`}]];ic(e,K({name:`chevron-right`},()=>n,{get iconNode(){return r}}))}var zw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Bw(e,t){let n=G(t,zw),r=[[`path`,{d:`M12 15V3`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}],[`path`,{d:`m7 10 5 5 5-5`}]];ic(e,K({name:`download`},()=>n,{get iconNode(){return r}}))}var Vw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Hw(e,t){let n=G(t,Vw),r=[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`}]];ic(e,K({name:`layers`},()=>n,{get iconNode(){return r}}))}var Uw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ww(e,t){let n=G(t,Uw),r=[[`path`,{d:`M15 12h-5`}],[`path`,{d:`M15 8h-5`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`}]];ic(e,K({name:`scroll-text`},()=>n,{get iconNode(){return r}}))}function Gw(e){return e===`planning`?`good`:`running`}function Kw(e,t=!1,n){return e===`awaiting_user`?`warn`:e===`running`||t?Gw(n):`neutral`}function qw(e,t=!1){return e===`awaiting_user`?!1:e===`running`||t}function Jw(e){return e===`running`||e===`ready`?`good`:e===`starting`||e===`stopping`?`warn`:e===`failed`||e===`timed_out`||e===`orphaned`?`danger`:`neutral`}function Yw(e){return e===`running`||e===`ready`||e===`starting`||e===`stopping`}function Xw(e){return e===`error`?`danger`:e===`warn`?`warn`:`neutral`}var Zw=L(`<div class="flex shrink-0 items-center gap-1 text-xs text-muted-foreground"><!></div>`),Qw=L(`<div class="flex shrink-0 items-center gap-0.5"><!></div>`),$w=L(`<div><!></div>`),eT=L(`<section class="overflow-hidden rounded-lg border bg-card"><div><button type="button" class="flex min-w-0 flex-1 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left text-xs font-semibold text-foreground transition-colors hover:text-foreground/90 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50"><!> <!> <span class="truncate"> </span></button> <!> <!></div> <!></section>`);function tT(e,t){D(t,!0);let n=q(t,`open`,15,!0);function r(){n(!n()),t.onOpenChange?.(n())}var i=eT(),a=M(i),o=M(a),s=M(o),c=e=>{Iw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})},l=e=>{Rw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})};V(s,e=>{n()?e(c):e(l,-1)});var u=P(s,2),d=e=>{var n=R();U(N(n),()=>t.icon,(e,t)=>{t(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})}),z(e,n)};V(u,e=>{t.icon&&e(d)});var f=P(u,2),p=M(f,!0);T(f),T(o);var m=P(o,2),h=e=>{var n=Zw();H(M(n),()=>t.meta),T(n),z(e,n)};V(m,e=>{t.meta&&e(h)});var g=P(m,2),_=e=>{var n=Qw();H(M(n),()=>t.actions),T(n),z(e,n)};V(g,e=>{t.actions&&e(_)}),T(a);var v=P(a,2),y=e=>{var n=$w();H(M(n),()=>t.children),T(n),F(e=>Qi(n,1,e),[()=>Ki(ol(`px-3 py-2.5`,t.contentClass))]),z(e,n)};V(v,e=>{n()&&e(y)}),T(i),F(e=>{Qi(a,1,e),W(o,`aria-expanded`,n()),B(p,t.title)},[()=>Ki(ol(`flex items-center gap-1 px-2 py-1.5`,n()&&`border-b`))]),_i(`click`,o,r),z(e,i),O()}vi([`click`]);var nT=L(`<dt class="font-mono text-xs text-muted-foreground"> </dt> <dd class="truncate font-mono text-xs text-foreground"> </dd>`,1),rT=L(`<dl class="grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1.5"></dl>`),iT=L(`<p class="px-3 py-2.5 text-xs text-muted-foreground">No agents in the active conversation.</p>`),aT=L(`<button type="button"><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-1.5 truncate text-xs text-foreground"><span>Main agent</span> <span class="font-mono text-xs text-muted-foreground"> </span></div> <div class="truncate text-xs text-muted-foreground"> </div></div></button>`),oT=L(`<div class="px-3 pt-2.5 pb-1"><h4 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Main agent</h4></div> <!>`,1),sT=L(`<button type="button"><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-1.5 truncate text-xs text-foreground"><span>Subagent</span> <span class="font-mono text-xs text-muted-foreground"> </span></div> <div class="truncate text-xs text-muted-foreground"> </div></div></button>`),cT=L(`<button class="flex w-full items-center gap-1 px-3 pt-2.5 pb-1 text-left" type="button"><!> <h4 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Subagents</h4> <span class="text-xs text-muted-foreground"> </span></button> <!>`,1),lT=L(`<div class="-mx-3 -my-2.5 flex flex-col"><!> <!> <!></div>`),uT=L(`<a class="inline-flex w-fit items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs font-medium text-foreground transition-colors hover:bg-muted/60" download=""><!>Export system prompt</a>`),dT=L(`<span class="text-xs text-muted-foreground">No active agent.</span>`),fT=L(`<div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Conversation</span> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div></div> <div class="flex flex-col gap-1.5"><span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">System prompt</span> <!></div></div>`),pT=L(`<div class="flex flex-col gap-2 p-2"><!> <!> <!></div>`);function mT(e,t){D(t,!0);let n=q(t,`conversationAgents`,19,()=>[]),r=k(()=>t.systemPromptUrl?.()),i=A(!0),a=A(!0),o=A(!0),s=k(()=>[{label:`Project`,value:t.activeProject?.name},{label:`Directory`,value:t.activeProject?.dir},{label:`Conversation`,value:t.activeConversation?.id},{label:`Agent`,value:t.activeAgent?.id},{label:`Daemon`,value:t.status?.daemonId},{label:`Data`,value:t.status?.dataDir}]),c=k(()=>n().filter(e=>!e.parentAgentId)),l=k(()=>n().filter(e=>e.parentAgentId));function u(e){let t=e.split(`_`);return t.length>1?t.at(-1)??e:e.slice(-6)}function d(e){return e.status===`running`||e.status===`awaiting_user`}function f(e){return[...e].sort((e,n)=>{let r=+(e.id===t.activeAgent?.id),i=+(n.id===t.activeAgent?.id);if(r!==i)return i-r;let a=+!!d(e),o=+!!d(n);if(a!==o)return o-a;let s=new Date(e.updatedAt).getTime(),c=new Date(n.updatedAt).getTime();if(s!==c)return c-s;let l=new Date(e.createdAt).getTime();return new Date(n.createdAt).getTime()-l})}let p=A(!1);rr(()=>{I(l).some(d)&&j(p,!0)});var m=pT(),h=M(m);tT(h,{title:`Active Context`,get icon(){return Hw},get open(){return I(i)},set open(e){j(i,e,!0)},children:(e,t)=>{var n=rT();Ni(n,21,()=>I(s),Ai,(e,t)=>{var n=nT(),r=N(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),F(()=>{B(i,I(t).label),W(a,`title`,I(t).value),B(o,I(t).value??`—`)}),z(e,n)}),T(n),z(e,n)},$$slots:{default:!0}});var g=P(h,2);tT(g,{title:`Agents`,get icon(){return Pw},get open(){return I(a)},set open(e){j(a,e,!0)},children:(e,r)=>{var i=lT(),a=M(i),o=e=>{z(e,iT())};V(a,e=>{n().length===0&&e(o)});var s=P(a,2),d=e=>{var n=oT();Ni(P(N(n),2),17,()=>f(I(c)),e=>e.id,(e,n)=>{var r=aT(),i=M(r);{let e=k(()=>Kw(I(n).status,!1,I(n).mode)),t=k(()=>qw(I(n).status));$S(i,{get tone(){return I(e)},get pulse(){return I(t)}})}var a=P(i,2),o=M(a),s=P(M(o),2),c=M(s,!0);T(s),T(o);var l=P(o,2),d=M(l);T(l),T(a),T(r),F(e=>{Qi(r,1,`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted/60 ${I(n).id===t.activeAgent?.id?`bg-muted/60`:``}`),W(r,`title`,I(n).id),B(c,e),B(d,`${I(n).status??``} · ${I(n).mode??``} · ${I(n).permissionLevel??``}`)},[()=>u(I(n).id)]),_i(`click`,r,()=>t.onSelectAgent?.(I(n))),z(e,r)}),z(e,n)};V(s,e=>{I(c).length>0&&e(d)});var m=P(s,2),h=e=>{var n=cT(),r=N(n),i=M(r),a=e=>{Iw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})},o=e=>{Rw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})};V(i,e=>{I(p)?e(a):e(o,-1)});var s=P(i,4),c=M(s);T(s),T(r);var d=P(r,2),m=e=>{var n=R();Ni(N(n),17,()=>f(I(l)),e=>e.id,(e,n)=>{var r=sT(),i=M(r);{let e=k(()=>Kw(I(n).status,!1,I(n).mode)),t=k(()=>qw(I(n).status));$S(i,{get tone(){return I(e)},get pulse(){return I(t)}})}var a=P(i,2),o=M(a),s=P(M(o),2),c=M(s,!0);T(s),T(o);var l=P(o,2),d=M(l);T(l),T(a),T(r),F(e=>{Qi(r,1,`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted/60 ${I(n).id===t.activeAgent?.id?`bg-muted/60`:``}`),W(r,`title`,I(n).id),B(c,e),B(d,`${I(n).status??``} · ${I(n).mode??``} · ${I(n).permissionLevel??``}`)},[()=>u(I(n).id)]),_i(`click`,r,()=>t.onSelectAgent?.(I(n))),z(e,r)}),z(e,n)};V(d,e=>{I(p)&&e(m)}),F(()=>B(c,`· ${I(l).length??``}`)),_i(`click`,r,()=>j(p,!I(p))),z(e,n)};V(m,e=>{I(l).length>0&&e(h)}),T(i),z(e,i)},$$slots:{default:!0}});var _=P(g,2),v=e=>{tT(e,{title:`Export`,get icon(){return Bw},get open(){return I(o)},set open(e){j(o,e,!0)},children:(e,n)=>{var i=fT(),a=M(i),o=P(M(a),2),s=M(o);{let e=k(()=>t.exportUrl?.(`json`)),n=k(()=>`conversation-${t.activeConversation.id}.json`);of(s,{get href(){return I(e)},get download(){return I(n)},variant:`outline`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`JSON`))},$$slots:{default:!0}})}var c=P(s,2);{let e=k(()=>t.exportUrl?.(`md`)),n=k(()=>`conversation-${t.activeConversation.id}.md`);of(c,{get href(){return I(e)},get download(){return I(n)},variant:`outline`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`Markdown`))},$$slots:{default:!0}})}var l=P(c,2);{let e=k(()=>t.exportUrl?.(`html`)),n=k(()=>`conversation-${t.activeConversation.id}.html`);of(l,{get href(){return I(e)},get download(){return I(n)},variant:`outline`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`HTML`))},$$slots:{default:!0}})}T(o),T(a);var u=P(a,2),d=P(M(u),2),f=e=>{var t=uT();Ww(M(t),{size:13,strokeWidth:2.2}),E(),T(t),F(()=>W(t,`href`,I(r))),z(e,t)},p=e=>{z(e,dT())};V(d,e=>{I(r)?e(f):e(p,-1)}),T(u),T(i),z(e,i)},$$slots:{default:!0}})};V(_,e=>{t.activeConversation&&e(v)}),T(m),z(e,m),O()}vi([`click`]);var Y=Mn({status:void 0,config:void 0,connection:`connecting`,lastEventSeq:0,error:void 0,projects:[],conversations:[],agents:[],approvals:[],userQuestions:[],planReviews:[],openCenterTabs:[],activeCenterTab:void 0,projectPickerOpen:!1}),hT=Mn({projectId:void 0,conversationId:void 0,agentId:void 0,entryId:void 0});Mn({items:[]});var gT=Mn({text:``,projectDir:``});function _T(){hT.projectId=void 0,hT.conversationId=void 0,hT.agentId=void 0,hT.entryId=void 0}var vT=Mn({authTabOpen:!1,catalogLoaded:!1,customProviders:[],modelDefinitions:[]}),yT=Mn({conversationViews:{},pendingConversations:{},openConversationTabIds:[],activeConversationTabId:void 0,slashCompletions:[],selectedModelKey:`nerve-faux:faux-fast`,selectedThinkingLevel:`off`,selectedMode:`coding`,selectedPermissionLevel:`autonomous`}),bT=Mn({fileViews:{},openFileTabIds:[]}),xT=Mn({gitContext:void 0,gitRefreshToken:0,prViews:{},openPrTabIds:[]}),ST=Mn({logsTabOpen:!1}),CT=Mn({models:[],authProviders:[],settingsDraft:void 0,settingsSaveStatus:`idle`,settingsMessage:void 0,settingsTabOpen:!1}),wT=Mn({tasks:[],selectedTaskId:void 0,taskLogs:void 0,openTaskTabIds:[]});function TT(e){return`${e.kind}:${e.id}`}function ET(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}var DT,OT;function kT(e){DT=e.select,OT=e.close}function AT(e,t){return e?.[t.kind]}function jT(e,t){let n=t instanceof Error?t.message:String(t);Y.error=n,id.error(`Could not ${e} pane`,{description:n})}function MT(){yT.openConversationTabIds=Y.openCenterTabs.filter(e=>e.kind===`conversation`).map(e=>e.id),wT.openTaskTabIds=Y.openCenterTabs.filter(e=>e.kind===`task`).map(e=>e.id),bT.openFileTabIds=Y.openCenterTabs.filter(e=>e.kind===`file`).map(e=>e.id),xT.openPrTabIds=Y.openCenterTabs.filter(e=>e.kind===`pr`).map(e=>e.id),CT.settingsTabOpen=Y.openCenterTabs.some(e=>e.kind===`settings`),vT.authTabOpen=Y.openCenterTabs.some(e=>e.kind===`auth`),ST.logsTabOpen=Y.openCenterTabs.some(e=>e.kind===`logs`)}function NT(e){let t=new Set;Y.openCenterTabs=e.filter(e=>{let n=TT(e);return t.has(n)?!1:(t.add(n),!0)}),MT()}function PT(e){Y.openCenterTabs.some(t=>ET(t,e))||(Y.openCenterTabs=[...Y.openCenterTabs,e],MT())}function FT(e,t){NT(Y.openCenterTabs.map(n=>ET(n,e)?t:n)),ET(Y.activeCenterTab,e)&&(Y.activeCenterTab=t)}function IT(e){let t=Y.openCenterTabs,n=t.findIndex(t=>ET(t,e));if(n===-1)return zT(e);let r=t.filter(t=>!ET(t,e));return r[n]??r[n-1]??r[0]}function LT(e){NT(Y.openCenterTabs.filter(t=>!ET(t,e)))}function RT(e){e&&PT(e),Y.activeCenterTab=e,e?.kind===`task`&&(wT.selectedTaskId=e.id)}function zT(e){return Y.openCenterTabs.find(t=>!e||!ET(t,e))}async function BT(e){if(!e){RT(void 0);return}try{let t=AT(DT,e);if(!t)throw Error(`No select handler for ${e.kind} panes`);await t(e)}catch(e){jT(`switch`,e)}}async function VT(e){try{let t=AT(OT,e);if(!t)throw Error(`No close handler for ${e.kind} panes`);await t(e)}catch(e){jT(`close`,e)}}function HT(){RT(zT())}function UT(e){return`conversation-view:${e}`}function WT(e){return`pending-conversation:${e}`}function GT(e){return`file-view:${e}`}function KT(e){return`pr-view:${e}`}function qT(e){return`git-project:${e}`}function JT(e){return`git-repo:${e}`}function YT(e){return`${e.provider}:${e.modelId}`}function XT(e){let[t,...n]=e.split(`:`),r=n.join(`:`);return t&&r?{provider:t,modelId:r}:void 0}function ZT(e){return e.replace(/^claude-/,`claude `).replace(/^gpt-/,`gpt `)}var QT={"nerve-faux":`Nerve Faux`,anthropic:`Anthropic`,google:`Google`,"google-vertex":`Google Vertex`,openai:`OpenAI`,"openai-codex":`OpenAI Codex`,openrouter:`OpenRouter`,xai:`xAI`};function $T(e){let t={ai:`AI`,api:`API`,aws:`AWS`,cn:`CN`,gpt:`GPT`,oauth:`OAuth`,ui:`UI`},n=e.toLowerCase();return t[n]??n[0].toUpperCase()+n.slice(1)}function eE(e){return QT[e]??e.split(/[-_\s/]+/).filter(Boolean).map($T).join(` `)}function tE(e){return e.name||e.label||e.modelId}function nE(e){let t=new Map;for(let n of e){let e=tE(n);t.set(e,(t.get(e)??0)+1)}return t}function rE(e,t){return(nE(t).get(tE(e))??0)>1}function iE(e,t){let n=tE(e);return rE(e,t)?`${eE(e.provider)} / ${n}`:n}function aE(e,t){let n=new Set(t.filter(e=>e.configured).map(e=>e.provider));return e.filter(e=>e.faux||n.has(e.provider))}function oE(e,t,n){let r=aE(e,t);if(!n?.length)return r;let i=new Set(n.map(YT));return r.filter(e=>i.has(YT(e)))}function sE(e,t){return aE(e,t).filter(e=>!e.faux)}var cE=new Set([`$$slots`,`$$events`,`$$legacy`]);function lE(e,t){let n=G(t,cE),r=[[`path`,{d:`M12 5v14`}],[`path`,{d:`m19 12-7 7-7-7`}]];ic(e,K({name:`arrow-down`},()=>n,{get iconNode(){return r}}))}async function uE(e){let t=Ju();if(t){await t.clipboard.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n?.writeText){await n.writeText(e);return}throw Error(`Clipboard API is not available.`)}function dE(e){return e.dir.replace(/[\\/]+$/,``)||e.dir}function fE(e){let t=e.replace(/[\\/]+$/,``),n=t.split(/[\\/]/);return n[n.length-1]||t}function pE(e,t){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``),r=t?.replace(/\\/g,`/`).replace(/\/+$/,``),i=/^[A-Za-z]:\//.test(n)?n.toLowerCase():n,a=r&&/^[A-Za-z]:\//.test(r)?r.toLowerCase():r;r&&a&&(i===a||i.startsWith(`${a}/`))&&(n=`~${n.slice(r.length)}`);let o=n.split(`/`);return o.map((e,t)=>t===o.length-1||e===``||e===`~`?e:e.startsWith(`.`)?e.slice(0,2):e.charAt(0)).join(`/`)}function mE(e){return e?.model?ZT(e.model.modelId):`model pending`}function hE(e,t){if(!t)return!0;let n=t.toLowerCase();return e.project.name.toLowerCase().includes(n)||e.project.dir.toLowerCase().includes(n)||e.projects.some(e=>e.name.toLowerCase().includes(n)||e.dir.toLowerCase().includes(n))||e.rows.some(e=>e.conversation.title.toLowerCase().includes(n)||e.conversation.id.toLowerCase().includes(n))}function gE(e,t){return t.find(t=>t.id===e.activeAgentId)??t.find(t=>t.conversationId===e.id)}function _E(e){let{conversations:t,agents:n}=e,r=new Set(e.projectIds),i=e.filter?.trim().toLowerCase()??``;return t.filter(e=>r.has(e.projectId)).filter(e=>!i||e.title.toLowerCase().includes(i)||e.id.toLowerCase().includes(i)).map(e=>({conversation:e,agent:gE(e,n)})).sort((e,t)=>t.conversation.updatedAt.localeCompare(e.conversation.updatedAt))}function vE(e){let{projects:t,conversations:n,agents:r,homeDir:i}=e,a=e.filter?.trim()??``,o=e.maxProjects??5,s=e.maxRowsPerProject??5,c=new Map(t.map(e=>[e.id,e])),l=new Map;for(let e of t){let t=dE(e),n=l.get(t);n?(n.projects.push(e),e.updatedAt>n.updatedAt&&(n.updatedAt=e.updatedAt),e.updatedAt>n.project.updatedAt&&(n.project=e)):l.set(t,{key:t,project:e,projects:[e],rows:[],hiddenRows:0,totalRows:0,label:fE(e.dir),updatedAt:e.updatedAt})}for(let e of n){let t=c.get(e.projectId);if(!t)continue;let n=dE(t),i=l.get(n)??{key:n,project:t,projects:[t],rows:[],hiddenRows:0,totalRows:0,label:fE(t.dir),updatedAt:t.updatedAt};i.rows.push({conversation:e,agent:gE(e,r)}),e.updatedAt>i.updatedAt&&(i.updatedAt=e.updatedAt),l.set(n,i)}let u=[...l.values()].filter(e=>hE(e,a)).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),d=Math.max(0,u.length-o),f=new Map;for(let e of u){let t=fE(e.project.dir);f.set(t,(f.get(t)??0)+1)}return{groups:u.slice(0,o).map(e=>{let t=e.rows.sort((e,t)=>t.conversation.updatedAt.localeCompare(e.conversation.updatedAt)),n=fE(e.project.dir),r=(f.get(n)??0)>1?pE(e.project.dir,i):n;return{...e,label:r,totalRows:t.length,hiddenRows:Math.max(0,t.length-s),rows:t.slice(0,s)}}),hiddenProjects:d}}var yE=/^\[Tool call:[\s\S]*\]$/;function bE(e){return e.role===`assistant`&&e.displayKind!==`thinking`&&yE.test(e.text.trim())}function xE(e,t){let n=e.createdAt.localeCompare(t.createdAt);return n===0?e.id.localeCompare(t.id):n}function SE(e){return e.status===`requested`||e.status===`pending_approval`||e.status===`waiting_for_user`||e.status===`running`}function CE(e){return Array.from(new Set([e.sourceToolCallId,e.providerToolCallId].filter(e=>!!e)))}function wE(e,t){return!!(t?.runId&&e.runId===t.runId&&typeof e.contentIndex==`number`)}function TE(e,t,n){return t?!0:n?.runId?e.runId===n.runId:SE(e)}function EE(e,t){return e?.toolOutputByToolCallId[t]}function DE(e){return typeof e.contentIndex==`number`?e.contentIndex:2**53-1}function OE(e){return e?.match(/^live:([^:]+):/)?.[1]}function kE(e){return e.type===`message`?OE(e.item.id):e.type===`draft`?OE(e.draft.key):e.toolCall.liveMessageId}function AE(e){return e.type===`message`?DE(e.item):e.type===`draft`?DE(e.draft):DE(e.toolCall)}function jE(e){return e.type===`message`?e.item.createdAt??``:e.type===`draft`?e.draft.createdAt:e.toolCall.createdAt}function ME(e){return e.type===`message`?e.item.id??``:e.type===`draft`?e.draft.key:e.toolCall.id}function NE(e){return e.type===`message`?0:e.type===`draft`?1:2}function PE(e){let t=new Map;for(let[n,r]of e.entries()){let e=kE(r);if(!e)continue;let i=jE(r),a=t.get(e);a&&(a.createdAt||`9999`)<=(i||`9999`)||t.set(e,{createdAt:i,sequence:n})}return new Map([...t.entries()].sort(([,e],[,t])=>{let n=(e.createdAt||`9999`).localeCompare(t.createdAt||`9999`);return n===0?e.sequence-t.sequence:n}).map(([e],t)=>[e,t]))}function FE(e,t,n){let r=e.get(kE(t)??``)??e.size,i=e.get(kE(n)??``)??e.size;if(r!==i)return r-i;let a=AE(t),o=AE(n);if(a!==o)return a-o;let s=NE(t),c=NE(n);if(s!==c)return s-c;let l=jE(t).localeCompare(jE(n));return l===0?ME(t).localeCompare(ME(n)):l}function IE(e,t){return e.runId?`run-status:${e.runId}`:t}function LE(e,t){return e===t||e.startsWith(`${t}:`)}function RE(e,t){return!!(e.id&&[...t].some(t=>LE(e.id,t)))}function zE(e,t){return e.role===`assistant`&&e.stopReason===`error`&&!!(e.runId&&t.has(e.runId))}function BE(e,t){let n=[],r=t.filter(e=>!e.hidden).sort(xE),i=new Map(r.map(e=>[e.id,e])),a=new Map,o=new Map,s=[];for(let e of r){for(let t of CE(e))a.has(t)||a.set(t,e);if(e.runId){let t=o.get(e.runId)??[];t.push(e),o.set(e.runId,t)}SE(e)&&s.push(e)}let c=new Set,l=new Set,u=new Set;for(let t of e)t.runStatus?.failedEntryId&&l.add(t.runStatus.failedEntryId),t.runStatus?.runId&&u.add(t.runStatus.runId);let d=e=>RE(e,l)||zE(e,u);return e.forEach((e,t)=>{if(bE(e))return;if(e.compaction){n.push({kind:`compaction`,key:e.compaction.entryId??e.id??`compaction-${t}`,notice:e.compaction});return}if(e.runStatus){n.push({kind:`run_status`,key:IE(e.runStatus,e.id??`run-status-${t}`),notice:e.runStatus});return}if(e.taskEvent){n.push({kind:`task_event`,key:e.taskEvent.entryId??e.id??`task-event-${t}`,notice:e.taskEvent});return}if(d(e))return;let r=e.toolRecordId?i.get(e.toolRecordId):e.toolCallId?a.get(e.toolCallId):void 0;if(r){n.push({kind:`tool`,key:r.id,toolCall:r,anchorEntryId:e.id}),c.add(r.id);return}if(e.role===`system`&&e.isToolError&&e.toolName){n.push({kind:`tool_result_error`,key:e.id??`tool-result-error-${t}`,toolName:e.toolName,error:e.text});return}n.push({kind:`message`,key:e.id??`msg-${t}`,item:e})}),{items:n,context:{orderedToolCalls:r,toolCallsById:i,toolCallsByProviderId:a,toolCallsByRunId:o,liveCandidateToolCalls:s,consumedToolCallIds:c,statusRunIds:new Set(n.flatMap(e=>e.kind===`run_status`&&e.notice.runId?[e.notice.runId]:[])),completedCompactionKeys:new Set(n.flatMap(e=>{if(e.kind!==`compaction`)return[];let t=[e.notice.id,e.notice.entryId].filter(e=>!!e);return e.notice.runId&&t.push(`run:${e.notice.runId}`),t}))}}}function VE(e){if(e.kind===`message`)return e.item.id;if(e.kind===`tool`)return e.anchorEntryId;if(e.kind===`tool_result_error`)return e.key}function HE(e,t){let n=new Set(t?.hiddenEntryIds??[]);t?.runStatus?.failedEntryId&&n.add(t.runStatus.failedEntryId),t?.compaction?.failedEntryId&&n.add(t.compaction.failedEntryId);let r=t?.runStatus?.runId;if(n.size===0&&!r)return e;let i=[...n];return e.filter(e=>{let t=VE(e);return!(t&&i.some(e=>LE(t,e))||r&&e.kind===`message`&&e.item.role===`assistant`&&e.item.stopReason===`error`&&e.item.runId===r)})}function UE(e,t){let n=[],{toolCallsById:r,toolCallsByProviderId:i,toolCallsByRunId:a,liveCandidateToolCalls:o,statusRunIds:s,completedCompactionKeys:c}=t,l=new Set,u=e?.runId?a.get(e.runId)??[]:[],d=e=>t.consumedToolCallIds.has(e)||l.has(e),f=e=>{l.add(e)},p=[...(e?.messages??[]).map(e=>({type:`message`,item:e})),...(e?.toolDrafts??[]).map(e=>({type:`draft`,draft:e})),...u.filter(t=>wE(t,e)).map(e=>({type:`tool`,toolCall:e}))],m=PE(p);p.sort((e,t)=>FE(m,e,t));for(let t of p){if(t.type===`message`){if(!t.item.text&&t.item.displayKind!==`thinking`)continue;n.push({kind:`message`,key:t.item.id??`live-msg-${t.item.contentIndex??n.length}`,item:t.item});continue}if(t.type===`tool`){d(t.toolCall.id)||(n.push({kind:`tool`,key:t.toolCall.id,toolCall:t.toolCall,liveOutput:EE(e,t.toolCall.id)}),f(t.toolCall.id));continue}let r=t.draft.providerToolCallId?i.get(t.draft.providerToolCallId):void 0;if(r){d(r.id)||(n.push({kind:`tool`,key:r.id,toolCall:r,liveOutput:EE(e,r.id)}),f(r.id));continue}n.push({kind:`tool_draft`,key:t.draft.key,draft:t.draft})}e?.runStatus&&!s.has(e.runStatus.runId??``)&&n.push({kind:`run_status`,key:IE(e.runStatus,`live:run-status:${e.runStatus.runId??e.runId??`active`}`),notice:e.runStatus}),e?.compaction&&([e.compaction.id,e.compaction.entryId,e.compaction.runId?`run:${e.compaction.runId}`:void 0].filter(e=>!!e).some(e=>c.has(e))||n.push({kind:`compaction`,key:e.compaction.id,notice:e.compaction}));let h=new Map,g=e=>{e&&!h.has(e.id)&&h.set(e.id,e)};for(let e of o)g(e);for(let e of u)g(e);for(let t of Object.keys(e?.toolOutputByToolCallId??{}))g(r.get(t));for(let t of[...h.values()].sort(xE)){let r=EE(e,t.id);d(t.id)||!TE(t,r,e)||n.push({kind:`tool`,key:t.id,toolCall:t,liveOutput:r})}return n}var WE=new Set([`$$slots`,`$$events`,`$$legacy`]);function GE(e,t){let n=G(t,WE),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];ic(e,K({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var KE=new Set([`$$slots`,`$$events`,`$$legacy`]);function qE(e,t){let n=G(t,KE),r=[[`path`,{d:`M12 19v3`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`}]];ic(e,K({name:`mic`},()=>n,{get iconNode(){return r}}))}var JE=new Set([`$$slots`,`$$events`,`$$legacy`]);function YE(e,t){let n=G(t,JE),r=[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`}],[`path`,{d:`m21.854 2.147-10.94 10.939`}]];ic(e,K({name:`send`},()=>n,{get iconNode(){return r}}))}var XE=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZE(e,t){let n=G(t,XE),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];ic(e,K({name:`square`},()=>n,{get iconNode(){return r}}))}async function QE(e,t){return(await ww(`/api/agents/${_w(e)}`,t)).agent}function $E(e){switch(e.split(`;`)[0]?.trim().toLowerCase()){case`audio/wav`:case`audio/wave`:case`audio/x-wav`:return`wav`;case`audio/mp4`:case`audio/m4a`:case`audio/x-m4a`:return`mp4`;case`audio/mpeg`:case`audio/mp3`:case`audio/x-mpeg`:return`mp3`;case`audio/mpga`:return`mpga`;case`audio/flac`:case`audio/x-flac`:return`flac`;case`audio/ogg`:case`audio/oga`:return`ogg`;default:return`webm`}}async function eD(e){if(!e.ok){let t=await e.text().catch(()=>``),n=Ow(t);throw new hw(e.status,n.code,n.message||t||e.statusText||`Transcription failed.`)}let t=e.headers.get(`content-type`)??``;if(!t.includes(`application/json`)){let n=await e.text();throw new hw(e.status,void 0,`Expected JSON response from transcription API, received ${t||`unknown content type`}. ${n.slice(0,80)}`)}return await e.json()}async function tD(e,t,n={}){let r=new FormData;return r.append(`file`,e,`composer-recording.${$E(e.type)}`),r.append(`durationMs`,String(Math.max(1,Math.round(t)))),(await eD(await fetch(`/api/transcription/audio`,{method:`POST`,credentials:`same-origin`,body:r,signal:n.signal}))).text}async function nD(){return(await xw(`/api/auth/providers`)).providers}async function rD(){return xw(`/api/auth/credential-key`)}async function iD(e,t){await Cw(`/api/provider-keys`,{provider:e,encryptedApiKey:t})}async function aD(e){await Tw(`/api/auth/providers/${_w(e)}`)}async function oD(e){return(await Sw(`/api/auth/oauth/flows`,{provider:e})).flow}async function sD(e){return(await xw(`/api/auth/oauth/flows/${_w(e)}`)).flow}async function cD(e,t){return(await Sw(`/api/auth/oauth/flows/${_w(e)}/respond`,t)).flow}async function lD(e){return(await Sw(`/api/auth/oauth/flows/${_w(e)}/cancel`,{})).flow}async function uD(){return xw(`/api/providers/catalog`)}async function dD(e){return Cw(`/api/providers/custom`,e)}async function fD(e){return Tw(`/api/providers/custom/${_w(e)}`)}async function pD(e){return Cw(`/api/providers/models`,e)}async function mD(e,t){return Tw(`/api/providers/models/${_w(e)}/${_w(t)}`)}async function hD(){return xw(`/api/client-config`)}async function gD(){return(await xw(`/api/models`)).models}async function Bre(){return(await xw(`/api/completions/slash`)).items}async function Vre(e,t){return e?(await xw(`/api/completions/files?${new URLSearchParams({projectId:e,q:t}).toString()}`)).items:[]}async function Hre(e){return(await Sw(`/api/filesystem/clipboard-image`,{name:e.name,type:e.type,dataBase64:await Dw(e)})).path}async function Ure(e,t=!1){let n=new URLSearchParams;e&&n.set(`path`,e),t&&n.set(`showHidden`,`true`);let r=n.toString();return xw(`/api/filesystem/directories${r?`?${r}`:``}`)}async function Wre(e,t,n){let r=new URLSearchParams({projectId:e,path:t});return n!==void 0&&r.set(`line`,String(n)),xw(`/api/filesystem/file?${r.toString()}`)}async function Gre(e){return xw(`/api/projects/${_w(e)}/git/repos`)}async function Kre(e,t){let n=new URLSearchParams({repo:t});return xw(`/api/projects/${_w(e)}/git/overview?${n.toString()}`)}async function qre(e,t){let n=new URLSearchParams({repo:t});return xw(`/api/projects/${_w(e)}/git/branches?${n.toString()}`)}async function Jre(e,t,n){return Sw(`/api/projects/${_w(e)}/git/branch`,{repo:t,name:n})}async function Yre(e,t,n){return Sw(`/api/projects/${_w(e)}/git/switch-branch`,{repo:t,name:n})}async function Xre(e,t){return Sw(`/api/projects/${_w(e)}/git/sync`,{repo:t})}async function Zre(e,t){return Sw(`/api/projects/${_w(e)}/git/fetch`,{repo:t})}async function _D(e,t,n){return Sw(`/api/projects/${_w(e)}/git/stage-file`,{repo:t,path:n})}async function vD(e,t,n){return Sw(`/api/projects/${_w(e)}/git/unstage-file`,{repo:t,path:n})}async function Qre(e,t,n){return Sw(`/api/projects/${_w(e)}/git/discard-file`,{repo:t,path:n})}async function $re(e,t){let n=new URLSearchParams({repo:t});return xw(`/api/projects/${_w(e)}/github/status?${n.toString()}`)}async function eie(e,t){let n=new URLSearchParams({repo:t});return xw(`/api/projects/${_w(e)}/github/prs?${n.toString()}`)}async function tie(e,t,n){let r=new URLSearchParams({repo:t});return xw(`/api/projects/${_w(e)}/github/pr/${_w(n)}?${r.toString()}`)}async function nie(e,t,n){return Sw(`/api/projects/${_w(e)}/github/pr/${_w(n)}/checkout`,{repo:t})}async function rie(e={}){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&String(r).length>0&&t.set(n,String(r));return xw(`/api/logs${t.size?`?${t.toString()}`:``}`)}async function iie(e){return Sw(`/api/logs/prune`,e)}async function aie(e){await Ew(`/api/projects/${_w(e)}`)}async function oie(e,t){return Sw(`/api/projects/${_w(e)}/conversations/prune`,t)}async function sie(e,t){return Sw(`/api/projects/${_w(e)}/open-editor`,{editor:t})}async function cie(e){return(await xw(`/api/projects/${_w(e)}/pinned-commands`)).commands}async function yD(e,t){return(await Sw(`/api/projects/${_w(e)}/pinned-commands`,t)).command}async function lie(e,t){await Ew(`/api/projects/${_w(e)}/pinned-commands/${_w(t)}`)}async function uie(){return xw(`/api/settings`)}async function die(e){return(await Cw(`/api/settings`,e)).settings}async function bD(e,t=`recent`){let n=new URLSearchParams({mode:t,limit:`120`});return xw(`/api/tasks/${_w(e)}/logs?${n.toString()}`)}async function fie(e){return(await Sw(`/api/tasks`,e)).task}async function pie(e){return(await Sw(`/api/tasks/${_w(e)}/cancel`,{})).task}async function mie(e){return(await Sw(`/api/tasks/${_w(e)}/restart`,{})).task}async function hie(e){await Tw(`/api/tasks/${_w(e)}`)}async function gie(){return Sw(`/api/tasks/prune`,{})}async function xD(){let[{approvals:e},{toolCalls:t}]=await Promise.all([xw(`/api/approvals?status=pending`),xw(`/api/tool-calls`)]),n=new Map(t.map(e=>[e.id,e]));return e.map(e=>({...e,toolCall:n.get(e.toolCallId)}))}async function SD(){return(await xw(`/api/user-questions?status=pending`)).questions}async function CD(){return(await xw(`/api/plan-reviews?status=pending`)).planReviews}async function _ie(e,t={}){return(await Sw(`/api/plan-reviews/${_w(e)}/accept`,t)).planReview}async function vie(e,t={}){return Sw(`/api/plan-reviews/${_w(e)}/accept-in-new-chat`,t)}async function yie(e,t){return(await Sw(`/api/plan-reviews/${_w(e)}/reject`,{feedback:t})).planReview}async function bie(e,t){return(await Sw(`/api/user-questions/${_w(e)}/answer`,{answer:t})).question}async function xie(e,t){return(await Sw(`/api/user-questions/${_w(e)}/dismiss`,{reason:t})).question}async function wD(){return(await xw(`/api/usage/subscription`)).usage}async function Sie(){let[e,t,n,r]=await Promise.all([xw(`/api/projects`),xw(`/api/conversations`),xw(`/api/agents`),xw(`/api/tasks`)]);return{projects:e.projects,conversations:[...t.conversations].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),agents:n.agents,tasks:r.tasks}}var Cie=L(`<div aria-live="polite"><span class="activity-sr svelte-9ds0r"> </span> <span aria-hidden="true"> </span></div>`);function TD(e,t){D(t,!0);let n=q(t,`recording`,3,!1),r=q(t,`transcribing`,3,!1),i=q(t,`elapsedMs`,3,0),a=q(t,`maxDurationMs`,3,1),o=q(t,`retryAttempt`,3,0),s=q(t,`maxRetries`,3,0),c=q(t,`class`,3,``),l=k(()=>n()||r()),u=k(()=>g(i())),d=k(()=>g(a())),f=k(()=>Math.max(0,Math.min(1,a()>0?i()/a():0))),p=k(()=>I(f)>=.85),m=k(()=>n()?`${I(u)} / ${I(d)}`:o()>0?`Retry ${o()}/${s()}`:`Transcribing…`),h=k(()=>n()?`Recording ${I(u)} of ${I(d)}`:o()>0?`Retrying transcription ${o()} of ${s()}`:`Transcribing audio`);function g(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}var _=R(),v=N(_),y=e=>{var t=Cie(),r=M(t),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(t),F(()=>{Qi(t,1,`transcription-activity ${c()}`,`svelte-9ds0r`),W(t,`data-state`,n()?`recording`:`transcribing`),W(t,`data-near-limit`,I(p)?`true`:void 0),B(i,I(h)),B(o,I(m))}),z(e,t)};V(v,e=>{I(l)&&e(y)}),z(e,_),O()}var ED=`nerve.conversationTabs.v1`,wie=12;function Tie(e){if(!e)return{tabIds:[]};try{let t=JSON.parse(e);return{tabIds:Array.isArray(t.tabIds)?t.tabIds.filter(e=>typeof e==`string`):[],activeId:typeof t.activeId==`string`?t.activeId:void 0}}catch{return{tabIds:[]}}}function DD(e){return[...new Set(e.filter(e=>e.startsWith(`conv_`)))].slice(0,wie)}function Eie(){if(typeof localStorage>`u`)return{tabIds:[]};let e=Tie(localStorage.getItem(ED));return{tabIds:DD(e.tabIds),activeId:e.activeId?.startsWith(`conv_`)?e.activeId:void 0}}function OD(e,t){if(typeof localStorage>`u`)return;let n=DD(e),r={tabIds:n,activeId:t&&n.includes(t)?t:void 0};localStorage.setItem(ED,JSON.stringify(r))}function Die(e,t){let n=new Set(t.map(e=>e.id));return DD(e).filter(e=>n.has(e))}function kD(e){let t=UT(e);return yT.conversationViews[t]??={conversationId:e,activeEntryId:void 0,activeEntryIds:[],transcript:[],toolCalls:[],treeNodes:[],streamingText:``,live:{messages:[],toolDrafts:[],toolOutputByToolCallId:{}},queuedPrompts:[],cursorSeq:0,sending:!1,composerText:``,loading:!1},yT.conversationViews[t]}function AD(){OD(yT.openConversationTabIds,yT.activeConversationTabId)}function Oie(e){PT({kind:`conversation`,id:e}),kD(e)}var jD=0;function kie(){return jD+=1,`pending_${Date.now().toString(36)}_${jD.toString(36)}`}function MD(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return yT.pendingConversations[WT(e.id)]}function ND(){Y.error=void 0}function PD(){_T(),yT.activeConversationTabId=void 0,ND(),gT.text=``}Object.freeze({status:`aborted`});function FD(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var ID=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},LD=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},RD={};function zD(e){return e&&Object.assign(RD,e),RD}function Aie(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function BD(e,t){return typeof t==`bigint`?t.toString():t}function VD(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function HD(e){return e==null}function UD(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function jie(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var WD=Symbol(`evaluating`);function GD(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==WD)return r===void 0&&(r=WD,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function KD(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function qD(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function JD(e){return JSON.stringify(e)}var YD=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function XD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Mie=VD(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ZD(e){if(XD(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(XD(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function QD(e){return ZD(e)?{...e}:Array.isArray(e)?[...e]:e}var Nie=new Set([`string`,`number`,`symbol`]);function $D(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function eO(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function tO(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Pie(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Fie={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Iie(e,t){let n=e._zod.def;return eO(e,qD(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return KD(this,`shape`,e),e},checks:[]}))}function Lie(e,t){let n=e._zod.def;return eO(e,qD(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return KD(this,`shape`,r),r},checks:[]}))}function Rie(e,t){if(!ZD(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return eO(e,qD(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return KD(this,`shape`,n),n},checks:[]}))}function zie(e,t){if(!ZD(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return eO(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return KD(this,`shape`,n),n},checks:e._zod.def.checks})}function Bie(e,t){return eO(e,qD(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return KD(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Vie(e,t,n){return eO(t,qD(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return KD(this,`shape`,i),i},checks:[]}))}function Hie(e,t,n){return eO(t,qD(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return KD(this,`shape`,i),i},checks:[]}))}function nO(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function rO(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function iO(e){return typeof e==`string`?e:e?.message}function aO(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=iO(e.inst?._zod.def?.error?.(e))??iO(t?.error?.(e))??iO(n.customError?.(e))??iO(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function oO(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function sO(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var cO=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,BD,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lO=FD(`$ZodError`,cO),uO=FD(`$ZodError`,cO,{Parent:Error});function Uie(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Wie(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var dO=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ID;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>aO(e,a,zD())));throw YD(t,i?.callee),t}return o.value},fO=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>aO(e,a,zD())));throw YD(t,i?.callee),t}return o.value},pO=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ID;return a.issues.length?{success:!1,error:new(e??lO)(a.issues.map(e=>aO(e,i,zD())))}:{success:!0,data:a.value}},Gie=pO(uO),mO=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>aO(e,i,zD())))}:{success:!0,data:a.value}},Kie=mO(uO),qie=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return dO(e)(t,n,i)},Jie=e=>(t,n,r)=>dO(e)(t,n,r),Yie=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return fO(e)(t,n,i)},Xie=e=>async(t,n,r)=>fO(e)(t,n,r),Zie=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return pO(e)(t,n,i)},Qie=e=>(t,n,r)=>pO(e)(t,n,r),$ie=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return mO(e)(t,n,i)},eae=e=>async(t,n,r)=>mO(e)(t,n,r),tae=/^[cC][^\s-]{8,}$/,nae=/^[0-9a-z]+$/,rae=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iae=/^[0-9a-vA-V]{20}$/,aae=/^[A-Za-z0-9]{27}$/,oae=/^[a-zA-Z0-9_-]{21}$/,sae=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cae=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,hO=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lae=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uae=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function dae(){return new RegExp(uae,`u`)}var fae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pae=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mae=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hae=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gae=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gO=/^[A-Za-z0-9_-]*$/,_ae=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,vae=/^\+(?:[0-9]){6,14}[0-9]$/,_O=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,yae=RegExp(`^${_O}$`);function vO(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bae(e){return RegExp(`^${vO(e)}$`)}function xae(e){let t=vO({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${_O}T(?:${r})$`)}var Sae=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Cae=/^-?\d+$/,wae=/^-?\d+(?:\.\d+)?/,Tae=/^(?:true|false)$/i,Eae=/^[^A-Z]*$/,Dae=/^[^a-z]*$/,yO=FD(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bO={number:`number`,bigint:`bigint`,object:`date`},xO=FD(`$ZodCheckLessThan`,(e,t)=>{yO.init(e,t);let n=bO[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),SO=FD(`$ZodCheckGreaterThan`,(e,t)=>{yO.init(e,t);let n=bO[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oae=FD(`$ZodCheckMultipleOf`,(e,t)=>{yO.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):jie(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),kae=FD(`$ZodCheckNumberFormat`,(e,t)=>{yO.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Fie[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Cae)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Aae=FD(`$ZodCheckMaxLength`,(e,t)=>{var n;yO.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!HD(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=oO(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jae=FD(`$ZodCheckMinLength`,(e,t)=>{var n;yO.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!HD(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=oO(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mae=FD(`$ZodCheckLengthEquals`,(e,t)=>{var n;yO.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!HD(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=oO(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),CO=FD(`$ZodCheckStringFormat`,(e,t)=>{var n,r;yO.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Nae=FD(`$ZodCheckRegex`,(e,t)=>{CO.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pae=FD(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Eae,CO.init(e,t)}),Fae=FD(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Dae,CO.init(e,t)}),Iae=FD(`$ZodCheckIncludes`,(e,t)=>{yO.init(e,t);let n=$D(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Lae=FD(`$ZodCheckStartsWith`,(e,t)=>{yO.init(e,t);let n=RegExp(`^${$D(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Rae=FD(`$ZodCheckEndsWith`,(e,t)=>{yO.init(e,t);let n=RegExp(`.*${$D(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),zae=FD(`$ZodCheckOverwrite`,(e,t)=>{yO.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Bae=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
18
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
19
|
-
`))}},Vae={major:4,minor:1,patch:12},wO=FD(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vae;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=nO(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ID;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=nO(e,t))});else{if(e.issues.length===t)continue;r||=nO(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(nO(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ID;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ID;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=Gie(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Kie(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),TO=FD(`$ZodString`,(e,t)=>{wO.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Sae(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),EO=FD(`$ZodStringFormat`,(e,t)=>{CO.init(e,t),TO.init(e,t)}),Hae=FD(`$ZodGUID`,(e,t)=>{t.pattern??=cae,EO.init(e,t)}),Uae=FD(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=hO(e)}else t.pattern??=hO();EO.init(e,t)}),Wae=FD(`$ZodEmail`,(e,t)=>{t.pattern??=lae,EO.init(e,t)}),Gae=FD(`$ZodURL`,(e,t)=>{EO.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:_ae.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Kae=FD(`$ZodEmoji`,(e,t)=>{t.pattern??=dae(),EO.init(e,t)}),qae=FD(`$ZodNanoID`,(e,t)=>{t.pattern??=oae,EO.init(e,t)}),Jae=FD(`$ZodCUID`,(e,t)=>{t.pattern??=tae,EO.init(e,t)}),Yae=FD(`$ZodCUID2`,(e,t)=>{t.pattern??=nae,EO.init(e,t)}),Xae=FD(`$ZodULID`,(e,t)=>{t.pattern??=rae,EO.init(e,t)}),Zae=FD(`$ZodXID`,(e,t)=>{t.pattern??=iae,EO.init(e,t)}),Qae=FD(`$ZodKSUID`,(e,t)=>{t.pattern??=aae,EO.init(e,t)}),$ae=FD(`$ZodISODateTime`,(e,t)=>{t.pattern??=xae(t),EO.init(e,t)}),eoe=FD(`$ZodISODate`,(e,t)=>{t.pattern??=yae,EO.init(e,t)}),toe=FD(`$ZodISOTime`,(e,t)=>{t.pattern??=bae(t),EO.init(e,t)}),noe=FD(`$ZodISODuration`,(e,t)=>{t.pattern??=sae,EO.init(e,t)}),roe=FD(`$ZodIPv4`,(e,t)=>{t.pattern??=fae,EO.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),ioe=FD(`$ZodIPv6`,(e,t)=>{t.pattern??=pae,EO.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),aoe=FD(`$ZodCIDRv4`,(e,t)=>{t.pattern??=mae,EO.init(e,t)}),ooe=FD(`$ZodCIDRv6`,(e,t)=>{t.pattern??=hae,EO.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function DO(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var soe=FD(`$ZodBase64`,(e,t)=>{t.pattern??=gae,EO.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{DO(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function coe(e){if(!gO.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return DO(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var loe=FD(`$ZodBase64URL`,(e,t)=>{t.pattern??=gO,EO.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{coe(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),uoe=FD(`$ZodE164`,(e,t)=>{t.pattern??=vae,EO.init(e,t)});function doe(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var foe=FD(`$ZodJWT`,(e,t)=>{EO.init(e,t),e._zod.check=n=>{doe(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),OO=FD(`$ZodNumber`,(e,t)=>{wO.init(e,t),e._zod.pattern=e._zod.bag.pattern??wae,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),poe=FD(`$ZodNumber`,(e,t)=>{kae.init(e,t),OO.init(e,t)}),moe=FD(`$ZodBoolean`,(e,t)=>{wO.init(e,t),e._zod.pattern=Tae,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),hoe=FD(`$ZodUnknown`,(e,t)=>{wO.init(e,t),e._zod.parse=e=>e}),goe=FD(`$ZodNever`,(e,t)=>{wO.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function kO(e,t,n){e.issues.length&&t.issues.push(...rO(n,e.issues)),t.value[n]=e.value}var _oe=FD(`$ZodArray`,(e,t)=>{wO.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>kO(t,n,e))):kO(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function AO(e,t,n,r){e.issues.length&&t.issues.push(...rO(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function jO(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Pie(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function MO(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>AO(e,n,i,t))):AO(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var voe=FD(`$ZodObject`,(e,t)=>{if(wO.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=VD(()=>jO(t));GD(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=XD,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>AO(n,t,e,s))):AO(n,t,e,s)}return i?MO(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),yoe=FD(`$ZodObjectJIT`,(e,t)=>{voe.init(e,t);let n=e._zod.parse,r=VD(()=>jO(t)),i=e=>{let t=new Bae([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=JD(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=JD(e);t.write(`const ${n} = ${i(e)};`),t.write(`
|
|
20
|
-
if (${n}.issues.length) {
|
|
21
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
22
|
-
...iss,
|
|
23
|
-
path: iss.path ? [${r}, ...iss.path] : [${r}]
|
|
24
|
-
})));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (${n}.value === undefined) {
|
|
29
|
-
if (${r} in input) {
|
|
30
|
-
newResult[${r}] = undefined;
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
newResult[${r}] = ${n}.value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=XD,s=!RD.jitless,c=s&&Mie.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?MO([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function NO(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!nO(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>aO(e,r,zD())))}),t)}var PO=FD(`$ZodUnion`,(e,t)=>{wO.init(e,t),GD(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),GD(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),GD(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),GD(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>UD(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>NO(t,i,e,a)):NO(s,i,e,a)}}),boe=FD(`$ZodDiscriminatedUnion`,(e,t)=>{PO.init(e,t);let n=e._zod.parse;GD(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=VD(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!XD(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),xoe=FD(`$ZodIntersection`,(e,t)=>{wO.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>IO(e,t,n)):IO(e,i,a)}});function FO(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ZD(e)&&ZD(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=FO(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=FO(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function IO(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),nO(e))return e;let r=FO(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var Soe=FD(`$ZodTuple`,(e,t)=>{wO.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length},input:o,inst:e,origin:`array`}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>LO(e,i,c))):LO(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>LO(e,i,c))):LO(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function LO(e,t,n){e.issues.length&&t.issues.push(...rO(n,e.issues)),t.value[n]=e.value}var Coe=FD(`$ZodRecord`,(e,t)=>{wO.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ZD(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...rO(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...rO(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>aO(e,r,zD())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...rO(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...rO(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),woe=FD(`$ZodEnum`,(e,t)=>{wO.init(e,t);let n=Aie(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Nie.has(typeof e)).map(e=>typeof e==`string`?$D(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Toe=FD(`$ZodLiteral`,(e,t)=>{if(wO.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?$D(e):e?$D(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Eoe=FD(`$ZodTransform`,(e,t)=>{wO.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new LD(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ID;return n.value=i,n}});function RO(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Doe=FD(`$ZodOptional`,(e,t)=>{wO.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,GD(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),GD(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${UD(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>RO(t,e.value)):RO(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ooe=FD(`$ZodNullable`,(e,t)=>{wO.init(e,t),GD(e._zod,`optin`,()=>t.innerType._zod.optin),GD(e._zod,`optout`,()=>t.innerType._zod.optout),GD(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${UD(e.source)}|null)$`):void 0}),GD(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),koe=FD(`$ZodDefault`,(e,t)=>{wO.init(e,t),e._zod.optin=`optional`,GD(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zO(e,t)):zO(r,t)}});function zO(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Aoe=FD(`$ZodPrefault`,(e,t)=>{wO.init(e,t),e._zod.optin=`optional`,GD(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),joe=FD(`$ZodNonOptional`,(e,t)=>{wO.init(e,t),GD(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>BO(t,e)):BO(i,e)}});function BO(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Moe=FD(`$ZodCatch`,(e,t)=>{wO.init(e,t),GD(e._zod,`optin`,()=>t.innerType._zod.optin),GD(e._zod,`optout`,()=>t.innerType._zod.optout),GD(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>aO(e,n,zD()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>aO(e,n,zD()))},input:e.value}),e.issues=[]),e)}}),Noe=FD(`$ZodPipe`,(e,t)=>{wO.init(e,t),GD(e._zod,`values`,()=>t.in._zod.values),GD(e._zod,`optin`,()=>t.in._zod.optin),GD(e._zod,`optout`,()=>t.out._zod.optout),GD(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>VO(e,t.in,n)):VO(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>VO(e,t.out,n)):VO(r,t.out,n)}});function VO(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Poe=FD(`$ZodReadonly`,(e,t)=>{wO.init(e,t),GD(e._zod,`propValues`,()=>t.innerType._zod.propValues),GD(e._zod,`values`,()=>t.innerType._zod.values),GD(e._zod,`optin`,()=>t.innerType._zod.optin),GD(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(HO):HO(r)}});function HO(e){return e.value=Object.freeze(e.value),e}var Foe=FD(`$ZodCustom`,(e,t)=>{yO.init(e,t),wO.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>UO(t,n,r,e));UO(i,n,r,e)}});function UO(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(sO(e))}}var Ioe=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Loe(){return new Ioe}var WO=Loe();function Roe(e,t){return new e({type:`string`,...tO(t)})}function zoe(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...tO(t)})}function GO(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...tO(t)})}function Boe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...tO(t)})}function Voe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...tO(t)})}function Hoe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...tO(t)})}function Uoe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...tO(t)})}function Woe(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...tO(t)})}function Goe(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...tO(t)})}function Koe(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...tO(t)})}function qoe(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...tO(t)})}function Joe(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...tO(t)})}function Yoe(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...tO(t)})}function Xoe(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...tO(t)})}function Zoe(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...tO(t)})}function Qoe(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...tO(t)})}function $oe(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...tO(t)})}function ese(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...tO(t)})}function tse(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...tO(t)})}function nse(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...tO(t)})}function rse(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...tO(t)})}function ise(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...tO(t)})}function ase(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...tO(t)})}function ose(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...tO(t)})}function sse(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...tO(t)})}function cse(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...tO(t)})}function lse(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...tO(t)})}function use(e,t){return new e({type:`number`,checks:[],...tO(t)})}function dse(e,t){return new e({type:`number`,coerce:!0,checks:[],...tO(t)})}function fse(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...tO(t)})}function pse(e,t){return new e({type:`boolean`,...tO(t)})}function mse(e,t){return new e({type:`boolean`,coerce:!0,...tO(t)})}function hse(e){return new e({type:`unknown`})}function gse(e,t){return new e({type:`never`,...tO(t)})}function KO(e,t){return new xO({check:`less_than`,...tO(t),value:e,inclusive:!1})}function qO(e,t){return new xO({check:`less_than`,...tO(t),value:e,inclusive:!0})}function JO(e,t){return new SO({check:`greater_than`,...tO(t),value:e,inclusive:!1})}function YO(e,t){return new SO({check:`greater_than`,...tO(t),value:e,inclusive:!0})}function XO(e,t){return new Oae({check:`multiple_of`,...tO(t),value:e})}function ZO(e,t){return new Aae({check:`max_length`,...tO(t),maximum:e})}function QO(e,t){return new jae({check:`min_length`,...tO(t),minimum:e})}function $O(e,t){return new Mae({check:`length_equals`,...tO(t),length:e})}function _se(e,t){return new Nae({check:`string_format`,format:`regex`,...tO(t),pattern:e})}function vse(e){return new Pae({check:`string_format`,format:`lowercase`,...tO(e)})}function yse(e){return new Fae({check:`string_format`,format:`uppercase`,...tO(e)})}function bse(e,t){return new Iae({check:`string_format`,format:`includes`,...tO(t),includes:e})}function xse(e,t){return new Lae({check:`string_format`,format:`starts_with`,...tO(t),prefix:e})}function Sse(e,t){return new Rae({check:`string_format`,format:`ends_with`,...tO(t),suffix:e})}function ek(e){return new zae({check:`overwrite`,tx:e})}function Cse(e){return ek(t=>t.normalize(e))}function wse(){return ek(e=>e.trim())}function Tse(){return ek(e=>e.toLowerCase())}function Ese(){return ek(e=>e.toUpperCase())}function Dse(e,t,n){return new e({type:`array`,element:t,...tO(n)})}function Ose(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...tO(n)})}function kse(e){let t=Ase(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(sO(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(sO(r))}},e(n.value,n)));return t}function Ase(e,t){let n=new yO({check:`custom`,...tO(t)});return n._zod.check=e,n}var jse=FD(`ZodISODateTime`,(e,t)=>{$ae.init(e,t),ak.init(e,t)});function Mse(e){return ose(jse,e)}var Nse=FD(`ZodISODate`,(e,t)=>{eoe.init(e,t),ak.init(e,t)});function Pse(e){return sse(Nse,e)}var Fse=FD(`ZodISOTime`,(e,t)=>{toe.init(e,t),ak.init(e,t)});function Ise(e){return cse(Fse,e)}var Lse=FD(`ZodISODuration`,(e,t)=>{noe.init(e,t),ak.init(e,t)});function Rse(e){return lse(Lse,e)}var tk=(e,t)=>{lO.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Wie(e,t)},flatten:{value:t=>Uie(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,BD,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,BD,2)}},isEmpty:{get(){return e.issues.length===0}}})};FD(`ZodError`,tk);var nk=FD(`ZodError`,tk,{Parent:Error}),zse=dO(nk),Bse=fO(nk),Vse=pO(nk),Hse=mO(nk),Use=qie(nk),Wse=Jie(nk),Gse=Yie(nk),Kse=Xie(nk),qse=Zie(nk),Jse=Qie(nk),Yse=$ie(nk),Xse=eae(nk),rk=FD(`ZodType`,(e,t)=>(wO.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(qD(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>eO(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>zse(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Vse(e,t,n),e.parseAsync=async(t,n)=>Bse(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Hse(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Use(e,t,n),e.decode=(t,n)=>Wse(e,t,n),e.encodeAsync=async(t,n)=>Gse(e,t,n),e.decodeAsync=async(t,n)=>Kse(e,t,n),e.safeEncode=(t,n)=>qse(e,t,n),e.safeDecode=(t,n)=>Jse(e,t,n),e.safeEncodeAsync=async(t,n)=>Yse(e,t,n),e.safeDecodeAsync=async(t,n)=>Xse(e,t,n),e.refine=(t,n)=>e.check(Vce(t,n)),e.superRefine=t=>e.check(Hce(t)),e.overwrite=t=>e.check(ek(t)),e.optional=()=>Ck(e),e.nullable=()=>wk(e),e.nullish=()=>Ck(wk(e)),e.nonoptional=t=>Pce(e,t),e.array=()=>pk(e),e.or=t=>hk([e,t]),e.and=t=>Cce(e,t),e.transform=t=>Ek(e,xk(t)),e.default=t=>jce(e,t),e.prefault=t=>Nce(e,t),e.catch=t=>Ice(e,t),e.pipe=t=>Ek(e,t),e.readonly=()=>zce(e),e.describe=t=>{let n=e.clone();return WO.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return WO.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return WO.get(e);let n=e.clone();return WO.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ik=FD(`_ZodString`,(e,t)=>{TO.init(e,t),rk.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(_se(...t)),e.includes=(...t)=>e.check(bse(...t)),e.startsWith=(...t)=>e.check(xse(...t)),e.endsWith=(...t)=>e.check(Sse(...t)),e.min=(...t)=>e.check(QO(...t)),e.max=(...t)=>e.check(ZO(...t)),e.length=(...t)=>e.check($O(...t)),e.nonempty=(...t)=>e.check(QO(1,...t)),e.lowercase=t=>e.check(vse(t)),e.uppercase=t=>e.check(yse(t)),e.trim=()=>e.check(wse()),e.normalize=(...t)=>e.check(Cse(...t)),e.toLowerCase=()=>e.check(Tse()),e.toUpperCase=()=>e.check(Ese())}),Zse=FD(`ZodString`,(e,t)=>{TO.init(e,t),ik.init(e,t),e.email=t=>e.check(zoe(Qse,t)),e.url=t=>e.check(Woe($se,t)),e.jwt=t=>e.check(ase(mce,t)),e.emoji=t=>e.check(Goe(ece,t)),e.guid=t=>e.check(GO(ok,t)),e.uuid=t=>e.check(Boe(sk,t)),e.uuidv4=t=>e.check(Voe(sk,t)),e.uuidv6=t=>e.check(Hoe(sk,t)),e.uuidv7=t=>e.check(Uoe(sk,t)),e.nanoid=t=>e.check(Koe(tce,t)),e.guid=t=>e.check(GO(ok,t)),e.cuid=t=>e.check(qoe(nce,t)),e.cuid2=t=>e.check(Joe(rce,t)),e.ulid=t=>e.check(Yoe(ice,t)),e.base64=t=>e.check(nse(dce,t)),e.base64url=t=>e.check(rse(fce,t)),e.xid=t=>e.check(Xoe(ace,t)),e.ksuid=t=>e.check(Zoe(oce,t)),e.ipv4=t=>e.check(Qoe(sce,t)),e.ipv6=t=>e.check($oe(cce,t)),e.cidrv4=t=>e.check(ese(lce,t)),e.cidrv6=t=>e.check(tse(uce,t)),e.e164=t=>e.check(ise(pce,t)),e.datetime=t=>e.check(Mse(t)),e.date=t=>e.check(Pse(t)),e.time=t=>e.check(Ise(t)),e.duration=t=>e.check(Rse(t))});function X(e){return Roe(Zse,e)}var ak=FD(`ZodStringFormat`,(e,t)=>{EO.init(e,t),ik.init(e,t)}),Qse=FD(`ZodEmail`,(e,t)=>{Wae.init(e,t),ak.init(e,t)}),ok=FD(`ZodGUID`,(e,t)=>{Hae.init(e,t),ak.init(e,t)}),sk=FD(`ZodUUID`,(e,t)=>{Uae.init(e,t),ak.init(e,t)}),$se=FD(`ZodURL`,(e,t)=>{Gae.init(e,t),ak.init(e,t)}),ece=FD(`ZodEmoji`,(e,t)=>{Kae.init(e,t),ak.init(e,t)}),tce=FD(`ZodNanoID`,(e,t)=>{qae.init(e,t),ak.init(e,t)}),nce=FD(`ZodCUID`,(e,t)=>{Jae.init(e,t),ak.init(e,t)}),rce=FD(`ZodCUID2`,(e,t)=>{Yae.init(e,t),ak.init(e,t)}),ice=FD(`ZodULID`,(e,t)=>{Xae.init(e,t),ak.init(e,t)}),ace=FD(`ZodXID`,(e,t)=>{Zae.init(e,t),ak.init(e,t)}),oce=FD(`ZodKSUID`,(e,t)=>{Qae.init(e,t),ak.init(e,t)}),sce=FD(`ZodIPv4`,(e,t)=>{roe.init(e,t),ak.init(e,t)}),cce=FD(`ZodIPv6`,(e,t)=>{ioe.init(e,t),ak.init(e,t)}),lce=FD(`ZodCIDRv4`,(e,t)=>{aoe.init(e,t),ak.init(e,t)}),uce=FD(`ZodCIDRv6`,(e,t)=>{ooe.init(e,t),ak.init(e,t)}),dce=FD(`ZodBase64`,(e,t)=>{soe.init(e,t),ak.init(e,t)}),fce=FD(`ZodBase64URL`,(e,t)=>{loe.init(e,t),ak.init(e,t)}),pce=FD(`ZodE164`,(e,t)=>{uoe.init(e,t),ak.init(e,t)}),mce=FD(`ZodJWT`,(e,t)=>{foe.init(e,t),ak.init(e,t)}),ck=FD(`ZodNumber`,(e,t)=>{OO.init(e,t),rk.init(e,t),e.gt=(t,n)=>e.check(JO(t,n)),e.gte=(t,n)=>e.check(YO(t,n)),e.min=(t,n)=>e.check(YO(t,n)),e.lt=(t,n)=>e.check(KO(t,n)),e.lte=(t,n)=>e.check(qO(t,n)),e.max=(t,n)=>e.check(qO(t,n)),e.int=t=>e.check(lk(t)),e.safe=t=>e.check(lk(t)),e.positive=t=>e.check(JO(0,t)),e.nonnegative=t=>e.check(YO(0,t)),e.negative=t=>e.check(KO(0,t)),e.nonpositive=t=>e.check(qO(0,t)),e.multipleOf=(t,n)=>e.check(XO(t,n)),e.step=(t,n)=>e.check(XO(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Z(e){return use(ck,e)}var hce=FD(`ZodNumberFormat`,(e,t)=>{poe.init(e,t),ck.init(e,t)});function lk(e){return fse(hce,e)}var uk=FD(`ZodBoolean`,(e,t)=>{moe.init(e,t),rk.init(e,t)});function dk(e){return pse(uk,e)}var gce=FD(`ZodUnknown`,(e,t)=>{hoe.init(e,t),rk.init(e,t)});function fk(){return hse(gce)}var _ce=FD(`ZodNever`,(e,t)=>{goe.init(e,t),rk.init(e,t)});function vce(e){return gse(_ce,e)}var yce=FD(`ZodArray`,(e,t)=>{_oe.init(e,t),rk.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(QO(t,n)),e.nonempty=t=>e.check(QO(1,t)),e.max=(t,n)=>e.check(ZO(t,n)),e.length=(t,n)=>e.check($O(t,n)),e.unwrap=()=>e.element});function pk(e,t){return Dse(yce,e,t)}var bce=FD(`ZodObject`,(e,t)=>{yoe.init(e,t),rk.init(e,t),GD(e,`shape`,()=>t.shape),e.keyof=()=>yk(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fk()}),e.loose=()=>e.clone({...e._zod.def,catchall:fk()}),e.strict=()=>e.clone({...e._zod.def,catchall:vce()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Rie(e,t),e.safeExtend=t=>zie(e,t),e.merge=t=>Bie(e,t),e.pick=t=>Iie(e,t),e.omit=t=>Lie(e,t),e.partial=(...t)=>Vie(Sk,e,t[0]),e.required=(...t)=>Hie(Tk,e,t[0])});function Q(e,t){return new bce({type:`object`,shape:e??{},...tO(t)})}var mk=FD(`ZodUnion`,(e,t)=>{PO.init(e,t),rk.init(e,t),e.options=t.options});function hk(e,t){return new mk({type:`union`,options:e,...tO(t)})}var xce=FD(`ZodDiscriminatedUnion`,(e,t)=>{mk.init(e,t),boe.init(e,t)});function gk(e,t,n){return new xce({type:`union`,options:t,discriminator:e,...tO(n)})}var Sce=FD(`ZodIntersection`,(e,t)=>{xoe.init(e,t),rk.init(e,t)});function Cce(e,t){return new Sce({type:`intersection`,left:e,right:t})}var wce=FD(`ZodTuple`,(e,t)=>{Soe.init(e,t),rk.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Tce(e,t,n){let r=t instanceof wO;return new wce({type:`tuple`,items:e,rest:r?t:null,...tO(r?n:t)})}var Ece=FD(`ZodRecord`,(e,t)=>{Coe.init(e,t),rk.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function _k(e,t,n){return new Ece({type:`record`,keyType:e,valueType:t,...tO(n)})}var vk=FD(`ZodEnum`,(e,t)=>{woe.init(e,t),rk.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new vk({...t,checks:[],...tO(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new vk({...t,checks:[],...tO(r),entries:i})}});function yk(e,t){return new vk({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...tO(t)})}var Dce=FD(`ZodLiteral`,(e,t)=>{Toe.init(e,t),rk.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function bk(e,t){return new Dce({type:`literal`,values:Array.isArray(e)?e:[e],...tO(t)})}var Oce=FD(`ZodTransform`,(e,t)=>{Eoe.init(e,t),rk.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new LD(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(sO(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(sO(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xk(e){return new Oce({type:`transform`,transform:e})}var Sk=FD(`ZodOptional`,(e,t)=>{Doe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ck(e){return new Sk({type:`optional`,innerType:e})}var kce=FD(`ZodNullable`,(e,t)=>{Ooe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType});function wk(e){return new kce({type:`nullable`,innerType:e})}var Ace=FD(`ZodDefault`,(e,t)=>{koe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jce(e,t){return new Ace({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():QD(t)}})}var Mce=FD(`ZodPrefault`,(e,t)=>{Aoe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Nce(e,t){return new Mce({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():QD(t)}})}var Tk=FD(`ZodNonOptional`,(e,t)=>{joe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Pce(e,t){return new Tk({type:`nonoptional`,innerType:e,...tO(t)})}var Fce=FD(`ZodCatch`,(e,t)=>{Moe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ice(e,t){return new Fce({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Lce=FD(`ZodPipe`,(e,t)=>{Noe.init(e,t),rk.init(e,t),e.in=t.in,e.out=t.out});function Ek(e,t){return new Lce({type:`pipe`,in:e,out:t})}var Rce=FD(`ZodReadonly`,(e,t)=>{Poe.init(e,t),rk.init(e,t),e.unwrap=()=>e._zod.def.innerType});function zce(e){return new Rce({type:`readonly`,innerType:e})}var Bce=FD(`ZodCustom`,(e,t)=>{Foe.init(e,t),rk.init(e,t)});function Vce(e,t={}){return Ose(Bce,e,t)}function Hce(e){return kse(e)}function Uce(e,t){return Ek(xk(e),t)}function Dk(e){return dse(ck,e)}function Wce(e){return mse(uk,e)}Q({error:Q({code:X(),message:X(),details:fk().optional()})});var Ok=yk([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),kk=Q({provider:X().min(1),modelId:X().min(1)});Q({provider:X(),modelId:X(),name:X(),label:X(),reasoning:dk().default(!1),supportedThinkingLevels:pk(Ok).default([`off`]),faux:dk().optional(),contextWindow:Z().int().nonnegative().default(0),maxOutputTokens:Z().int().nonnegative().default(0)}),Q({tokens:Z().int().nonnegative().nullable(),contextWindow:Z().int().nonnegative(),percent:Z().nullable()});var Ak=yk([`debug`,`info`,`warn`,`error`]),jk=yk([`orchestrator`,`desktop`,`web`,`cli`]),Gce=Q({name:X().optional(),message:X(),stack:X().optional(),cause:X().optional()}),Mk=Q({seq:Z().int().positive(),id:X().startsWith(`log_`),ts:X().datetime(),level:Ak,source:jk,component:X().min(1),message:X().min(1),requestId:X().optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),runId:X().startsWith(`run_`).optional(),toolCallId:X().startsWith(`tool_`).optional(),taskId:X().startsWith(`task_`).optional(),workerId:X().startsWith(`worker_`).optional(),durationMs:Z().nonnegative().optional(),context:_k(X(),fk()).optional(),error:Gce.optional()}),Kce=Q({level:Ak.optional(),source:jk.optional(),component:X().min(1).optional(),contains:X().optional(),sinceSeq:Z().int().nonnegative().optional(),limit:Z().int().positive().max(500).optional(),requestId:X().optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),runId:X().startsWith(`run_`).optional(),toolCallId:X().startsWith(`tool_`).optional(),taskId:X().startsWith(`task_`).optional(),workerId:X().startsWith(`worker_`).optional()});Q({logs:pk(Mk),nextCursor:Z().int().nonnegative()}),Kce.omit({limit:!0,sinceSeq:!0}),Q({pruned:Z().int().nonnegative(),remaining:Z().int().nonnegative()}),Q({logs:pk(Mk.omit({seq:!0,id:!0,ts:!0,source:!0}).extend({ts:X().datetime().optional(),source:bk(`web`).optional()})).min(1).max(50)});var Nk=yk([`planning`,`coding`]),Pk=yk([`autonomous`,`supervised`,`read_only`]),qce=Q({mode:Nk.default(`coding`),permissionLevel:Pk.default(`autonomous`),model:kk.optional(),thinkingLevel:Ok.default(`off`)}),Jce=Q({pythonExecutablePath:X().trim().min(1).optional()});Q({defaultMode:Nk,defaultPermissionLevel:Pk,defaultModel:kk.optional(),defaultThinkingLevel:Ok.default(`off`),rememberLastAgentSelection:dk().default(!1),lastAgentSelection:qce.default({mode:`coding`,permissionLevel:`autonomous`,thinkingLevel:`off`}),exploreAgent:Q({model:kk.optional(),thinkingLevel:Ok.default(`off`)}),server:Q({host:X().default(`127.0.0.1`),port:Z().int().positive().default(3747),allowRemote:dk().default(!1)}),ui:Q({theme:yk([`system`,`light`,`dark`]),zoomLevel:Z().int().min(-8).max(8).default(0)}),desktop:Q({closeToTray:dk().default(!0)}),compaction:Q({auto:dk().default(!0)}),logging:Q({level:Ak.default(`info`),retentionDays:Z().int().positive().default(14),maxBufferedLogs:Z().int().positive().default(2e3)}),retry:Q({enabled:dk().default(!0),maxRetries:Z().int().nonnegative().default(3),baseDelayMs:Z().int().positive().default(2e3)}),runtime:Jce.default({}),scopedModels:pk(kk).default([])}),Q({defaultMode:Nk.optional(),defaultPermissionLevel:Pk.optional(),defaultModel:kk.nullable().optional(),defaultThinkingLevel:Ok.optional(),rememberLastAgentSelection:dk().optional(),lastAgentSelection:Q({mode:Nk.optional(),permissionLevel:Pk.optional(),model:kk.nullable().optional(),thinkingLevel:Ok.optional()}).optional(),exploreAgent:Q({model:kk.nullable().optional(),thinkingLevel:Ok.optional()}).optional(),server:Q({host:X().optional(),port:Z().int().positive().optional(),allowRemote:dk().optional()}).optional(),ui:Q({theme:yk([`system`,`light`,`dark`]).optional(),zoomLevel:Z().int().min(-8).max(8).optional()}).optional(),desktop:Q({closeToTray:dk().optional()}).optional(),compaction:Q({auto:dk().optional()}).optional(),logging:Q({level:Ak.optional(),retentionDays:Z().int().positive().optional(),maxBufferedLogs:Z().int().positive().optional()}).optional(),retry:Q({enabled:dk().optional(),maxRetries:Z().int().nonnegative().optional(),baseDelayMs:Z().int().positive().optional()}).optional(),runtime:Q({pythonExecutablePath:X().trim().min(1).nullable().optional()}).optional(),scopedModels:pk(kk).optional()});var Fk=Q({roots:pk(X()).min(1),readonly:dk().optional()});Q({mode:Nk.optional(),permissionLevel:Pk.optional(),model:kk.nullable().optional(),thinkingLevel:Ok.optional()});var Yce=yk([`idle`,`running`,`awaiting_user`,`aborted`,`error`]),Ik=Q({depth:Z().int().nonnegative().default(0),maxDepth:Z().int().positive().max(8).default(3),maxRuns:Z().int().positive().max(64).default(8),usedRuns:Z().int().nonnegative().default(0)}),Xce=Ik.partial();Q({id:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),projectDir:X().min(1),workerId:X().startsWith(`worker_`).optional(),parentAgentId:X().startsWith(`agent_`).optional(),rootAgentId:X().startsWith(`agent_`),mode:Nk,permissionLevel:Pk,workspaceScope:Fk,systemPrompt:X().min(1).optional(),budget:Ik.default({depth:0,maxDepth:3,maxRuns:8,usedRuns:0}),model:kk.optional(),thinkingLevel:Ok.default(`off`),status:Yce,createdAt:X().datetime(),updatedAt:X().datetime()}),Q({conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),projectDir:X().min(1).optional(),workerId:X().startsWith(`worker_`).optional(),parentAgentId:X().startsWith(`agent_`).optional(),task:X().optional(),mode:Nk.optional(),permissionLevel:Pk.optional(),workspaceScope:Fk.optional(),systemPrompt:X().min(1).optional(),budget:Xce.optional(),model:kk.optional(),thinkingLevel:Ok.optional()});var Lk=Q({type:bk(`image`),data:X(),mimeType:X()}),Zce=yk([`reject-if-busy`,`steer`,`follow-up`]);Q({text:X().min(1),images:pk(Lk).optional(),behavior:Zce.optional()}),Q({statusEntryId:X().startsWith(`entry_`)});var Qce=yk([`queued`,`accepted`,`delivered`,`cancelled`,`failed`]);Q({id:X().startsWith(`promptq_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),runId:X().startsWith(`run_`).optional(),behavior:yk([`steer`,`follow-up`]),text:X().min(1),images:pk(Lk).optional(),status:Qce,createdAt:X().datetime(),updatedAt:X().datetime(),deliveredEntryId:X().startsWith(`entry_`).optional(),error:X().optional()});var $ce=yk([`api_key`,`oauth`]);Q({provider:X().min(1),envVar:X().min(1),configured:dk()}),Q({provider:X().min(1),displayName:X().min(1),supportsApiKey:dk(),supportsOAuth:dk(),oauthName:X().optional(),configured:dk(),credentialType:$ce.optional(),envVar:X().optional(),warning:X().optional()});var ele=Q({keyId:X().min(1),encryptedKey:X().min(1),iv:X().min(1),ciphertext:X().min(1)});Q({keyId:X().min(1),algorithm:bk(`RSA-OAEP-256+A256GCM`),publicKey:X().min(1)}),Q({provider:X().min(1),apiKey:X().min(1).optional(),encryptedApiKey:ele.optional()}).refine(e=>!!e.apiKey!=!!e.encryptedApiKey,{message:`Provide exactly one of apiKey or encryptedApiKey.`}),Q({provider:X().min(1)});var tle=yk([`starting`,`select`,`auth_url`,`device_code`,`prompt`,`progress`,`succeeded`,`failed`,`cancelled`]);Q({flowId:X().startsWith(`authflow_`),provider:X().min(1),providerName:X().min(1),status:tle,promptId:X().optional(),message:X().optional(),authUrl:X().optional(),instructions:X().optional(),options:pk(Q({id:X(),label:X()})).optional(),deviceCode:Q({userCode:X(),verificationUri:X(),intervalSeconds:Z().optional(),expiresInSeconds:Z().optional()}).optional(),placeholder:X().optional(),allowEmpty:dk().optional(),error:X().optional(),createdAt:X().datetime(),updatedAt:X().datetime()}),Q({promptId:X().min(1),value:X().optional(),selectedId:X().optional()});var nle=yk([`slash`,`file`,`directory`]),rle=Tce([Z().int().nonnegative(),Z().int().nonnegative()]);Q({items:pk(Q({label:X().min(1),detail:X().optional(),info:X().optional(),kind:nle,apply:X().optional(),displayLabel:X().optional(),sortScore:Z().optional(),matchRanges:pk(rle).optional()}))}),Q({projectId:X().min(1).optional(),q:X().optional().default(``),limit:Dk().int().positive().max(200).optional()}),X().startsWith(`run_`),X().startsWith(`turn_`),X().startsWith(`msg_`),X().startsWith(`block_`);var ile=`New Conversation`,ale=`Image Review`,ole=`File Review`,sle=`Link Review`,Rk=3,zk=`astro.bash.c.cc.conf.cpp.cs.css.csv.go.h.hpp.html.java.jpeg.jpg.js.json.jsx.kt.lock.log.lua.md.mdx.php.png.py.rb.rs.scss.sh.sql.svg.svelte.swift.toml.ts.tsx.txt.vue.webp.xml.yaml.yml`.split(`.`).join(`|`),Bk=[`avif`,`bmp`,`gif`,`jpeg`,`jpg`,`png`,`svg`,`tiff`,`webp`].join(`|`);function cle(e=zk){return new RegExp(String.raw`(?:\b[A-Za-z]:[\\/][^\s),;]+|(?:^|\s)(?:~|\.{1,2}|/)?(?:[\w.-]+[\\/])+[\w.-]+(?::\d+(?::\d+)?)?|\b[\w.-]+\.(?:${e})(?::\d+(?::\d+)?)?)`,`i`)}function lle(e){return e.replace(/```[\s\S]*?```/g,` `).replace(/~~~[\s\S]*?~~~/g,` `)}function ule(e){return e.replace(/https?:\/\/\S+|www\.\S+/gi,` `)}function dle(e){return e.replace(/\b[A-Za-z]:[\\/][^\s),;]+/g,` `).replace(/(?:^|\s)(?:~|\.{1,2}|\/)?(?:[\w.-]+[\\/])+[\w.-]+(?::\d+(?::\d+)?)?/g,` `).replace(RegExp(`\\b[\\w.-]+\\.(?:${zk})(?::\\d+(?::\\d+)?)?`,`gi`),` `)}function fle(e){return e.replace(/!\[[^\]]*\]\([^)]*\)/g,` `).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/[*_~]/g,``).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s*[-*+]\s+/gm,``).replace(/^\s*\d+[.)]\s+/gm,``)}function Vk(e){return(e.match(/[\p{L}\p{N}]/gu)??[]).length}function Hk(e){return(e.match(/[\p{L}\p{N}]+/gu)??[]).length}function ple(e){let t=e.trim();if(!t||/^(>|\$|>>>|\.\.\.|at\s+|\+{3}|-{3}|@@|\[[\w:-]+\])/.test(t))return!0;let n=t.replace(/[\p{L}\p{N}\s]/gu,``);return t.length>=8&&n.length/t.length>.45}function Uk(e){return dle(ule(fle(e))).replace(/[“”]/g,`"`).replace(/[‘’]/g,`'`).replace(/\btoolcall\b/giu,`tool call`).replace(/\bthe similar UI to the write and edit tool calls?\b/giu,`similar UI for write and edit tool calls`).replace(/[\r\n\t]+/g,` `).replace(/\s+/g,` `).replace(/\s+([,.;:!?])/g,`$1`).replace(/^(?:i\s+think\s+)?(?:we\s+)?should\s+(?=[\p{L}\p{N}])/iu,``).replace(/^please\s+(?=[\p{L}\p{N}])/iu,``).replace(/^(?:fix|update|change|edit|review|check|open|look at)\s+(?:and\s+)?(?=[\p{Lu}\p{N}])/iu,``).replace(/\b(?:in|at|from|for|and|or)\s+([,.;:!?])/giu,`$1`).replace(/\b(?:in|at|from|for|and|or)$/iu,``).replace(/[([\]{}<>]/g,` `).replace(/\s+/g,` `).trim()}function mle(e){return(e.match(/[^.!?]+[.!?]?/gu)??[e]).map(e=>e.trim()).filter(Boolean)}function hle(e){let t=lle(e),n=[];for(let e of t.split(/\r?\n+/)){let t=e.trim();if(ple(t))continue;let r=Uk(t);for(let e of mle(r))n.push(Uk(e))}return n}function gle(e){let t=e.toLocaleLowerCase().replace(/[^\p{L}\p{N}\s]/gu,` `).replace(/\s+/g,` `).trim();return!!(!t||Vk(t)<Rk||/^(?:what do you think|thoughts|wdyt)$/u.test(t)||/^(?:(?:please|can you|could you|would you)\s+)?(?:see|look|look at|check|review|open|inspect|read|fix|update|edit|change|help)$/u.test(t)||Hk(t)<=2&&/^(?:please\s+)?(?:see|look|check|review|open|inspect|read)\b/u.test(t))}function _le(e,t){if(gle(e))return-1/0;let n=Hk(e);if(n<3)return-1/0;let r=Math.min(n,12)*2;return n>16&&(r-=(n-16)*.5),/\b(?:improve|fix|update|change|edit|review|redesign|test|build|add|remove|show|generate|write|create|make|debug|investigate|explain|compare|refactor|implement)\b/iu.test(e)&&(r+=20),/^(?:improve|fix|update|change|edit|review|redesign|test|build|add|remove|show|generate|write|create|make|debug|investigate|explain|compare|refactor|implement)\b/iu.test(e)&&(r+=16),/\b(?:ui|tool|call|title|conversation|settings|error|issue|bug|status|display|page|component|api|name)\b/iu.test(e)&&(r+=8),/\b(?:broken|hard|slow|fail|fails|error|issue|problem|confusing|unclear)\b/iu.test(e)&&(r+=8),/^(?:because|sometime|sometimes|here is|this is)\b/iu.test(e)&&(r-=12),r-t*.1}function vle(e){return(e.match(/^(.{12,}?[.!?])(?:\s|$)/u)?.[1]??e).trim()}function yle(e){let t=e.replace(/^[\s:;,.!?\-–—]+/u,``).replace(/[\s:;,\-–—]+$/u,``).replace(/\s+/g,` `).trim();return t?t.replace(/^\p{Ll}/u,e=>e.toLocaleUpperCase()):``}function ble(e){return new RegExp(String.raw`(?:!\[[^\]]*\]\([^)]*\.(?:${Bk})(?:[?#][^)]*)?\)|\b[A-Za-z]:[\\/][^\s),;]+\.(?:${Bk})(?::\d+(?::\d+)?)?|(?:^|\s)(?:~|\.{1,2}|/)?(?:[\w.-]+[\\/])+[\w.-]+\.(?:${Bk})(?::\d+(?::\d+)?)?|\b[\w.-]+\.(?:${Bk})(?::\d+(?::\d+)?)?)`,`i`).test(e)}function xle(e){return cle().test(e)}function Sle(e){return/https?:\/\/\S+|www\.\S+/i.test(e)}function Cle(e){return ble(e)?ale:xle(e)?ole:Sle(e)?sle:ile}function wle(e){let t=hle(e).map(e=>yle(vle(e))).filter(e=>Vk(e)>=Rk),n=``,r=-1/0;return t.forEach((e,t)=>{let i=_le(e,t);i>r&&(n=e,r=i)}),n||Cle(e)}Q({id:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),title:X().min(1),mode:Nk,permissionLevel:Pk,activeAgentId:X().startsWith(`agent_`).optional(),activeEntryId:X().startsWith(`entry_`).optional(),createdAt:X().datetime(),updatedAt:X().datetime()}),Q({projectId:X().startsWith(`proj_`),title:X().min(1).optional(),mode:Nk.optional(),permissionLevel:Pk.optional()}),Q({project:Q({name:X().min(1).optional(),dir:X().min(1)}).optional(),conversation:Q({title:X().min(1).optional(),mode:Nk.optional(),permissionLevel:Pk.optional()}),agents:pk(fk()).default([]),entries:pk(fk()).default([])});var Tle=Q({input:Z().int().nonnegative(),output:Z().int().nonnegative(),cacheRead:Z().int().nonnegative(),cacheWrite:Z().int().nonnegative(),totalTokens:Z().int().nonnegative(),cost:Z().nonnegative()}),Ele=yk([`message`,`compaction`,`branch_summary`,`explore_report`,`run_status`,`task_event`]),Dle=Q({entry:Q({id:X().startsWith(`entry_`),conversationId:X().startsWith(`conv_`),agentId:X().startsWith(`agent_`).optional(),runId:X().startsWith(`run_`).optional(),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),parentEntryId:X().startsWith(`entry_`).optional(),role:yk([`user`,`assistant`,`system`]),kind:Ele.default(`message`),text:X(),summary:X().optional(),tokensBefore:Z().int().nonnegative().optional(),usage:Tle.optional(),firstKeptEntryId:X().startsWith(`entry_`).optional(),fromEntryId:X().startsWith(`entry_`).optional(),details:fk().optional(),createdAt:X().datetime()}),childEntryIds:pk(X().startsWith(`entry_`))});Q({conversationId:X().startsWith(`conv_`),activeEntryId:X().startsWith(`entry_`).optional(),rootEntryIds:pk(X().startsWith(`entry_`)),nodes:pk(Dle)}),Q({activeEntryId:X().startsWith(`entry_`).nullable(),summarize:dk().optional(),summaryInstructions:X().optional()}),Q({instructions:X().optional(),keepRecentTokens:Z().int().positive().optional()}),Q({seq:Z().int().nonnegative(),id:X().startsWith(`evt_`),ts:X().datetime(),type:X().min(1),durability:yk([`durable`,`transient`]).default(`durable`),data:fk()});var Wk=yk([`git`,`package`,`workspace`,`python`,`rust`,`go`]),Ole=Q({name:X().min(1),path:X().min(1),kind:bk(`directory`),hidden:dk(),signals:pk(Wk)});Q({path:X().min(1),parent:X().min(1).optional(),signals:pk(Wk),entries:pk(Ole)}),Q({path:X().optional(),showHidden:Wce().optional()}),Q({projectId:X().min(1),path:X().min(1),line:Dk().int().positive().optional()}),Q({projectId:X().min(1),path:X().min(1),relativePath:X(),name:X().min(1),size:Z().nonnegative(),mtimeMs:Z().nonnegative(),type:yk([`text`,`image`,`binary`]),binary:dk(),text:X().optional(),dataBase64:X().optional(),mimeType:X().optional(),lineStart:Z().int().positive().optional(),targetLine:Z().int().positive().optional(),truncated:dk()}),Q({name:X().optional(),type:X().min(1),dataBase64:X().min(1)}),Q({path:X().min(1)});var Gk=yk([`M`,`A`,`D`,`R`,`C`,`U`,`?`,`!`,` `]),Kk=Q({relativePath:X(),absDir:X(),name:X(),isRepo:bk(!0),currentBranch:X().nullable(),detached:dk(),ahead:Z().int().nullable(),behind:Z().int().nullable(),hasUpstream:dk(),hasRemote:dk(),hasGithubRemote:dk(),baseBranch:X(),onBaseBranch:dk(),mergedToBase:dk(),dirty:dk(),changeCount:Z().int().nonnegative()});Q({projectIsRepo:dk(),repos:pk(Kk)});var kle=Q({path:X(),renamedFrom:X().optional(),index:Gk,worktree:Gk,staged:dk(),untracked:dk()}),Ale=Q({hash:X(),subject:X(),relativeDate:X()});Q({repo:Kk,baseBranch:X(),onBaseBranch:dk(),files:pk(kle),stagedCount:Z().int().nonnegative(),unstagedCount:Z().int().nonnegative(),untrackedCount:Z().int().nonnegative(),insertions:Z().int().nonnegative(),deletions:Z().int().nonnegative(),recentCommits:pk(Ale)}),Q({branches:pk(Q({name:X(),current:dk(),remote:dk(),upstream:X().nullable()}))}),Q({repo:X().default(`.`),name:X().min(1)}),Q({repo:X().default(`.`),name:X().min(1)}),Q({repo:X().default(`.`)}),Q({repo:X().default(`.`),path:X().min(1)}),Q({repo:Kk}),Q({available:dk(),authenticated:dk(),login:X().nullable(),reason:X().optional()});var jle=Q({name:X(),status:X(),conclusion:X().nullable(),url:X().optional()}),Mle=Q({status:yk([`pending`,`passing`,`failing`,`none`]),total:Z().int().nonnegative(),passed:Z().int().nonnegative(),failed:Z().int().nonnegative(),pending:Z().int().nonnegative(),runs:pk(jle)}),qk=Q({number:Z().int(),title:X(),url:X(),state:X(),isDraft:dk(),headRefName:X(),baseRefName:X(),updatedAt:X(),checks:Mle});Q({prs:pk(qk)});var Nle=Q({path:X(),additions:Z().int().nonnegative(),deletions:Z().int().nonnegative()}),Ple=Q({oid:X(),abbrev:X(),messageHeadline:X(),authoredDate:X().optional(),authorName:X().optional()});qk.extend({body:X(),author:X().nullable(),createdAt:X(),additions:Z().int().nonnegative(),deletions:Z().int().nonnegative(),changedFiles:Z().int().nonnegative(),mergeable:X().nullable(),reviewDecision:X().nullable(),files:pk(Nle),commits:pk(Ple)}),Q({repo:Kk,number:Z().int()});var Fle=Q({id:X().startsWith(`pin_`),projectId:X().startsWith(`proj_`),label:X().min(1).optional(),command:X().min(1),cwd:X().min(1).optional(),createdAt:X().datetime(),updatedAt:X().datetime()});Q({command:X().min(1),label:X().min(1).optional(),cwd:X().min(1).optional()}),Q({commands:pk(Fle)});var Ile=X().min(1).max(80).regex(/^[a-z0-9][a-z0-9._-]{0,79}$/),Lle=yk([`pending`,`accepted`,`accepted_in_new_chat`,`changes_requested`,`discarded`,`force_exited`]);Q({id:X().startsWith(`plan_review_`),toolCallId:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),slug:Ile,title:X().min(1).optional(),summary:X().min(1).optional(),planPath:X().min(1),content:X().optional(),status:Lle,feedback:X().optional(),requestedAt:X().datetime(),resolvedAt:X().datetime().optional(),updatedAt:X().datetime()}),Q({feedback:X().optional(),implementationModel:kk.optional(),implementationThinkingLevel:Ok.optional()}),Q({id:X().startsWith(`proj_`),name:X().min(1),dir:X().min(1),createdAt:X().datetime(),updatedAt:X().datetime()});var Jk=yk([`vscode`,`zed`]);Q({editor:Jk}),Q({projectId:X().startsWith(`proj_`),editor:Jk,dir:X().min(1)}),Q({dir:X().min(1),name:X().min(1).optional()});var Rle=yk([`olderThanDays`,`keepLatest`]);gk(`strategy`,[Q({strategy:bk(`olderThanDays`),olderThanDays:Z().int().positive().max(3650)}),Q({strategy:bk(`keepLatest`),keepLatest:Z().int().nonnegative().max(1e4)})]);var zle=yk([`active_agent`,`active_task`]);Q({projectId:X().startsWith(`proj_`),strategy:Rle,prunedConversationIds:pk(X().startsWith(`conv_`)),prunedTaskIds:pk(X().startsWith(`task_`)),skipped:pk(Q({conversationId:X().startsWith(`conv_`),reason:zle}))});var Yk=yk([`openai-completions`,`openai-responses`,`azure-openai-responses`,`openai-codex-responses`,`anthropic-messages`,`bedrock-converse-stream`,`google-generative-ai`,`google-vertex`,`mistral-conversations`]),Ble=yk([`text`,`image`]),Vle=Q({input:Z().nonnegative().default(0),output:Z().nonnegative().default(0),cacheRead:Z().nonnegative().default(0),cacheWrite:Z().nonnegative().default(0)}),Hle=X().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*$/,`Use lowercase letters, numbers, and dashes (must start with a letter or number).`),Xk=_k(X(),fk()),Ule=Q({id:Hle,displayName:X().min(1),api:Yk,baseUrl:X().url(),headers:_k(X(),X()).default({}),compat:Xk.optional()}),Wle=Q({provider:X().min(1),modelId:X().min(1),name:X().min(1),api:Yk.optional(),baseUrl:X().url().optional(),headers:_k(X(),X()).optional(),compat:Xk.optional(),reasoning:dk().default(!1),supportedThinkingLevels:pk(Ok).default([`off`]),thinkingLevelMap:_k(X(),X().nullable()).optional(),input:pk(Ble).default([`text`]),cost:Vle.default({input:0,output:0,cacheRead:0,cacheWrite:0}),contextWindow:Z().int().nonnegative().default(0),maxTokens:Z().int().nonnegative().default(0)});Q({version:bk(1).default(1),providers:pk(Ule).default([]),models:pk(Wle).default([])});var Gle=Q({available:dk(),source:yk([`manual`,`project_venv`,`path`,`windows_launcher`,`uv`,`unavailable`]),executable:X().optional(),version:X().optional(),error:X().optional()}),Zk=Q({available:dk(),source:yk([`path`,`app`,`known_path`]).optional(),executable:X().optional(),error:X().optional()}),Kle=Q({vscode:Zk,zed:Zk}),Qk=Q({port:Z().int().positive(),url:X().url(),caCertUrl:X().url()});Q({daemonId:X().startsWith(`daemon_`),version:X(),startedAt:X().datetime(),dataDir:X(),mobileHttps:Qk.optional(),storage:Q({home:X(),sqlitePath:X(),indexHealthy:dk()}),runtime:Q({python:Gle,editors:Kle})}),Q({daemonId:X().startsWith(`daemon_`),pid:Z().int().positive(),host:X(),port:Z().int().positive(),url:X().url(),mobileHttps:Qk.optional(),startedAt:X().datetime(),dataDir:X(),version:X()}),Q({dataDir:X(),sqlitePath:X(),configPath:X(),counts:Q({projects:Z().int().nonnegative(),conversations:Z().int().nonnegative(),agents:Z().int().nonnegative(),events:Z().int().nonnegative(),tasks:Z().int().nonnegative(),workers:Z().int().nonnegative()}).optional()});var qle=Q({key:yk([`conversations`,`logs`,`sqliteIndex`,`exploreReports`,`plans`,`agents`,`tasks`,`workflowState`,`projects`,`workers`,`cache`,`tmp`,`protected`,`other`]),label:X(),description:X(),bytes:Z().int().nonnegative(),fileCount:Z().int().nonnegative(),cleanable:dk(),protected:dk()}),Jle=Q({conversationId:X(),title:X().nullable(),bytes:Z().int().nonnegative()}),Yle=Q({dataDir:X(),generatedAt:X().datetime(),totalBytes:Z().int().nonnegative(),categories:pk(qle),sqlite:Q({dbBytes:Z().int().nonnegative(),walBytes:Z().int().nonnegative(),shmBytes:Z().int().nonnegative()}),conversations:Q({total:Z().int().nonnegative(),largest:pk(Jle)})});Q({conversationsOlderThanDays:Z().int().positive().max(3650).optional(),logsOlderThanDays:Z().int().positive().max(3650).optional(),truncateEventLog:dk().optional(),clearToolCallLog:dk().optional(),clearExploreReports:dk().optional(),clearCache:dk().optional(),clearTmp:dk().optional(),vacuumSqlite:dk().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0&&e!==!1),{message:`Select at least one cleanup target.`});var Xle=Q({target:X(),freedBytes:Z().int().nonnegative(),removedItems:Z().int().nonnegative(),skipped:Z().int().nonnegative(),note:X().optional()});Q({freedBytes:Z().int().nonnegative(),results:pk(Xle),usage:Yle});var Zle=yk([`pending`,`resuming`,`resumed`,`cancelled`,`error`]),Qle=yk([`ask_user`,`plan_mode_present`]),$le=Q({id:X().min(1),name:X().min(1),arguments:_k(X(),fk())});Q({id:X().startsWith(`susp_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),runId:X().startsWith(`run_`),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),assistantEntryId:X().startsWith(`entry_`).optional(),toolCallId:X().startsWith(`tool_`),providerToolCallId:X().min(1),toolName:Qle,remainingToolCalls:pk($le).default([]),status:Zle,reason:X(),createdAt:X().datetime(),updatedAt:X().datetime(),resolvedAt:X().datetime().optional(),error:X().optional()});var $k=yk([`starting`,`running`,`ready`,`stopping`,`completed`,`failed`,`timed_out`,`cancelled`,`orphaned`]),eue=yk([`foreground`,`background`]),tue=Q({readyUrl:X().url().optional(),readyOnUrl:dk().optional(),readyPattern:X().optional(),timeoutMs:Z().int().nonnegative().optional(),outcome:yk([`pending`,`ready`,`timeout`,`exited`,`none`]),matched:X().optional(),readyAt:X().datetime().optional()}),nue=Q({platform:X().min(1),childPid:Z().int().positive().optional(),processGroupId:Z().int().positive().optional(),detached:dk(),shell:dk(),spawnedAt:X().datetime()}),rue=Q({keys:pk(X().min(1)).default([]),persisted:dk(),redacted:bk(!0).default(!0)});Q({version:bk(1),env:_k(X(),X()).optional(),createdAt:X().datetime(),updatedAt:X().datetime()});var iue=gk(`kind`,[Q({kind:bk(`api`)}),Q({kind:bk(`utility_panel`)}),Q({kind:bk(`agent_tool`),toolCallId:X().startsWith(`tool_`),providerToolCallId:X().min(1).optional(),runId:X().startsWith(`run_`).optional(),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),contentIndex:Z().int().nonnegative().optional()})]),aue=Q({inject:dk().default(!1),entryId:X().startsWith(`entry_`).optional(),injectedAt:X().datetime().optional(),outputTailLineCount:Z().int().positive().max(200).default(80)}),oue=Q({enabled:dk().default(!1),ready:dk().default(!1),terminal:dk().default(!1),readyEntryId:X().startsWith(`entry_`).optional(),terminalEntryId:X().startsWith(`entry_`).optional(),readyDeliveredAt:X().datetime().optional(),terminalDeliveredAt:X().datetime().optional(),outputTailLineCount:Z().int().positive().max(200).default(80)}),eA=Q({id:X().startsWith(`task_`),name:X().min(1).optional(),groupId:X().startsWith(`taskgrp_`).optional(),groupName:X().min(1).optional(),workerId:X().startsWith(`worker_`).optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),cwd:X().min(1),command:X().min(1),envInfo:rue.optional(),status:$k,readiness:tue,stdoutPath:X().min(1),stderrPath:X().min(1),combinedPath:X().min(1).optional(),logsPath:X().min(1),startedAt:X().datetime(),updatedAt:X().datetime(),finishedAt:X().datetime().optional(),exitCode:Z().int().nullable().optional(),signal:X().nullable().optional(),error:X().optional(),timeoutMs:Z().int().positive().optional(),restartedFromTaskId:X().startsWith(`task_`).optional(),restartRootTaskId:X().startsWith(`task_`).optional(),restartGeneration:Z().int().nonnegative().optional(),legacyProcessId:X().startsWith(`proc_`).optional(),runtime:nue.optional(),origin:iue.default({kind:`api`}),completion:aue.optional(),notifications:oue.optional(),visibility:eue.default(`background`)});Q({name:X().min(1).optional(),groupId:X().startsWith(`taskgrp_`).optional(),groupName:X().min(1).optional(),workerId:X().startsWith(`worker_`).optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),cwd:X().min(1),command:X().min(1),env:_k(X(),X()).optional(),readyUrl:X().url().optional(),readyOnUrl:dk().optional(),readyPattern:X().min(1).optional(),readyTimeoutMs:Z().int().nonnegative().max(6e4).optional(),timeoutMs:Z().int().positive().max(864e5).optional(),notify:dk().optional(),injectCompletion:dk().optional()}),Q({signal:yk([`SIGTERM`,`SIGINT`,`SIGKILL`]).optional(),timeoutMs:Z().int().positive().max(3e4).optional(),reason:X().min(1).optional()}),Q({removed:pk(X().startsWith(`task_`))});var sue=Q({seq:Z().int().positive(),ts:X().datetime(),stream:yk([`stdout`,`stderr`]),level:yk([`info`,`warn`,`error`]),line:X()});Q({mode:yk([`recent`,`errors`,`warnings`,`since_cursor`,`first_failure`]).optional(),sinceSeq:Z().int().nonnegative().optional(),contains:X().optional(),regex:X().optional(),contextLines:Z().int().nonnegative().max(20).optional(),limit:Z().int().positive().max(500).optional()});var cue=Q({task:eA,events:pk(sue),nextCursor:Z().int().nonnegative(),mode:X(),previewPath:X().min(1).optional(),truncated:dk().optional()}),tA=yk([`read`,`workspace_write`,`command`,`network`,`secret`,`destructive`,`agent_spawn`,`deployment`,`interaction`]),lue=yk([`read`,`bash`,`python`,`edit`,`write`,`grep`,`find`,`ls`,`ask_user`,`todos_set`,`todos_get`,`web_search`,`web_fetch`]),uue=yk([`task_start`,`task_status`,`task_logs`,`task_cancel`,`task_restart`,`task_list`,`explore`,`plan_mode_enter`,`plan_mode_present`,`plan_mode_force_exit`]),nA=yk([...lue.options,...uue.options]);Q({name:nA,risk:tA,description:X()});var due=yk([`requested`,`pending_approval`,`waiting_for_user`,`running`,`completed`,`denied`,`error`]),fue=Q({code:X().min(1),message:X().min(1),retryable:dk().optional(),details:_k(X(),fk()).optional()}),pue=Q({id:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),toolName:nA,sourceToolCallId:X().min(1).optional(),providerToolCallId:X().min(1).optional(),runId:X().startsWith(`run_`).optional(),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),contentIndex:Z().int().nonnegative().optional(),risk:tA,args:fk(),cwd:X().min(1),status:due,hidden:dk().optional(),approvalId:X().startsWith(`approval_`).optional(),suspensionId:X().startsWith(`susp_`).optional(),result:fk().optional(),error:X().optional(),errorDetails:fue.optional(),createdAt:X().datetime(),updatedAt:X().datetime()}),mue=yk([`pending`,`granted`,`denied`]);Q({id:X().startsWith(`approval_`),toolCallId:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),risk:tA,reason:X(),status:mue,requestedAt:X().datetime(),resolvedAt:X().datetime().optional()});var hue=yk([`pending`,`answered`,`dismissed`]);Q({id:X().startsWith(`question_`),toolCallId:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),question:X().min(1),context:X().optional(),recommendation:X().optional(),placeholder:X().optional(),status:hue,answer:X().optional(),dismissedReason:X().optional(),requestedAt:X().datetime(),resolvedAt:X().datetime().optional(),updatedAt:X().datetime()}),Q({answer:X().min(1)}),Q({reason:X().optional()}),Q({toolName:nA,args:_k(X(),fk()).default({})}),Q({note:X().optional()});var rA=hk([Q({type:bk(`text`),text:X()}),Q({type:bk(`image`),data:X(),mimeType:X()})]),iA=Q({truncated:dk().optional(),omittedLines:Z().optional(),omittedBytes:Z().optional(),truncatedLines:Z().optional(),direction:yk([`head`,`tail`,`line`,`head_tail`]).optional(),partialLine:dk().optional(),nextOffset:Z().optional(),nextByteOffset:Z().optional(),maxLines:Z().optional(),maxBytes:Z().optional(),maxLineChars:Z().optional(),byteOffset:Z().optional(),byteLimit:Z().optional(),rawResultPath:X().optional()}).passthrough(),aA=Q({bytes:Z().optional(),lines:Z().optional(),displayedBytes:Z().optional(),displayedLines:Z().optional(),truncated:dk().optional(),omittedLines:Z().optional(),omittedBytes:Z().optional(),truncatedLines:Z().optional(),direction:yk([`head`,`tail`,`line`,`head_tail`]).optional(),maxLineChars:Z().optional(),savedTo:X().optional()}).passthrough(),gue=Q({stdout:aA.optional(),stderr:aA.optional(),combined:aA.optional()}).passthrough(),_ue=Q({diff:X(),firstChangedLine:Z().optional(),lineEnding:hk([bk(`
|
|
37
|
-
`),bk(`\r
|
|
38
|
-
`)]),bom:dk()}).passthrough(),vue=Q({index:Z().int().nonnegative(),type:yk([`replace_text`,`insert_text`,`replace_lines`,`insert_lines`,`apply_patch`]),source:yk([`replacements`,`insertions`,`lineReplacements`,`lineInsertions`,`patch`]).optional(),sourceIndex:Z().int().nonnegative().optional(),matchMode:yk([`exact`,`trimmed`,`whitespace`]).optional(),occurrence:Z().int().positive().optional(),matchCount:Z().int().nonnegative().optional(),startLine:Z().int().positive().optional(),endLine:Z().int().positive().optional(),matchedBy:yk([`unique`,`occurrence`,`line_range`,`line_insert`,`patch`])}).passthrough(),yue=_ue.extend({dryRun:dk(),operationCount:Z().int().nonnegative(),operations:pk(vue)}),bue=Q({truncation:iA.optional(),fullOutputPath:X().optional(),rawResultPath:X().optional(),signal:X().nullable().optional()}).passthrough(),xue=Q({path:X(),size:Z().nonnegative().optional()}).passthrough(),Sue=Q({truncation:iA.optional(),fullOutputPath:X().optional(),rawResultPath:X().optional(),signal:X().nullable().optional(),executable:X().optional(),version:X().optional(),timeoutSeconds:Z().optional(),durationMs:Z().optional(),timedOut:dk().optional(),timeoutKilled:dk().optional(),allowNetwork:dk().optional(),allowFileWrite:dk().optional(),inputMode:yk([`inline`,`file`]).optional(),scriptPath:X().optional(),streams:gue.optional(),artifactDir:X().optional(),artifacts:pk(xue).optional(),envKeys:pk(X()).optional()}).passthrough(),Cue=Q({path:X(),kind:yk([`file`,`directory`,`other`])}),wue=Q({path:X(),line:Z(),text:X()}),Tue=Q({query:X(),answer:X().optional(),results:pk(Q({title:X(),url:X()}))}),Eue=Q({url:X(),status:Z(),contentType:X(),size:Z(),savedTo:X().optional(),converted:dk()}),oA=Q({content:X().optional(),contentBlocks:pk(rA).optional(),details:fk().optional(),path:X().optional(),entries:pk(Cue).optional(),matches:pk(wue).optional(),stdout:X().optional(),stderr:X().optional(),exitCode:Z().optional()}),Due=yk([`cancelled`,`force_cancelled`,`already_terminal`,`became_terminal_before_cancel`,`no_matching_active_task`]),Oue=Q({taskId:X().startsWith(`task_`).optional(),taskName:X().optional(),requestedSignal:yk([`SIGTERM`,`SIGINT`,`SIGKILL`]).optional(),outcome:Due,status:$k.optional(),message:X()}),kue=Q({task:eA.optional(),tasks:pk(eA).optional(),groupId:X().startsWith(`taskgrp_`).optional(),groupName:X().optional(),restartedFromTaskId:X().startsWith(`task_`).optional(),newTaskId:X().startsWith(`task_`).optional(),restartRootTaskId:X().startsWith(`task_`).optional(),cancelResults:pk(Oue).optional(),contentBlocks:pk(rA).optional()}),Aue=Q({tasks:pk(eA),groupId:X().startsWith(`taskgrp_`).optional(),contentBlocks:pk(rA).optional()}),jue=cue.extend({contentBlocks:pk(rA).optional()}),Mue=Q({input:Z().nonnegative().default(0),output:Z().nonnegative().default(0),cacheRead:Z().nonnegative().default(0),cacheWrite:Z().nonnegative().default(0),totalTokens:Z().nonnegative().default(0),cost:Z().nonnegative().default(0),turns:Z().int().nonnegative().default(0)}),Nue=Q({type:yk([`tool_call`,`tool_result`,`assistant`]),toolName:X().optional(),message:X(),timestamp:X().datetime().optional()}),Pue=Q({reports:pk(Q({agentId:X().startsWith(`agent_`),task:X(),label:X().optional(),status:yk([`completed`,`failed`,`aborted`]).default(`completed`),report:X(),reportPath:X().min(1).optional(),summaryPreview:X().optional(),usage:Mue.optional(),model:X().optional(),stopReason:X().optional(),errorMessage:X().optional(),steps:pk(Nue).optional()})),contentBlocks:pk(rA).optional()}),Fue=Q({question:X(),context:X().optional(),recommendation:X().optional(),response:X().optional(),dismissed:dk().optional(),dismissedReason:X().optional()}),Iue=Q({todo:X(),done:dk()}),Lue=Q({contentBlocks:pk(rA).optional(),details:Q({todos:pk(Iue)}).optional()}),Rue=480*1e3;Q({text:X()});var zue=yk([`anthropic`,`openai-codex`]),sA=Q({usedPercent:Z().nullable(),resetsAt:X().datetime().nullable(),resetAfterSeconds:Z().nullable(),windowMinutes:Z().nullable()});pk(Q({provider:zue,session:sA.nullable(),weekly:sA.nullable(),planType:X().nullable().optional(),updatedAt:X().datetime()}));var Bue=Q({apiKey:X().optional(),headers:_k(X(),X()).optional()});gk(`type`,[Q({type:bk(`prompt`),id:X().startsWith(`run_`),systemPrompt:X().optional(),messages:pk(fk()),model:kk.optional(),auth:Bue.optional()}),Q({type:bk(`abort`),id:X().startsWith(`run_`)})]),gk(`type`,[Q({type:bk(`ready`)}),Q({type:bk(`started`),id:X().startsWith(`run_`)}),Q({type:bk(`text_delta`),id:X().startsWith(`run_`),delta:X()}),Q({type:bk(`done`),id:X().startsWith(`run_`),text:X(),message:fk().optional()}),Q({type:bk(`error`),id:X().startsWith(`run_`).optional(),message:X(),aborted:dk().optional(),fatal:dk().optional()})]);var Vue=yk([`local`]),Hue=yk([`online`,`offline`,`error`]);Q({id:X().startsWith(`worker_`),kind:Vue,name:X().min(1),status:Hue,capabilities:Uce(e=>Array.isArray(e)?e.map(e=>e===`process`?`task`:e):e,pk(yk([`agent`,`task`]))).default([`agent`,`task`]),endpoint:Q({pid:Z().int().positive().optional(),host:X().optional(),port:Z().int().positive().optional()}).optional(),createdAt:X().datetime(),updatedAt:X().datetime()});var cA=16e3,lA=`audio/wav`,Uue=4096;function Wue(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Gue(e,t,n=cA){if(e.length===0)return new Float32Array;if(t===n)return new Float32Array(e);if(t<=0||n<=0)throw Error(`Sample rates must be positive.`);let r=Math.max(1,Math.round(e.length*n/t)),i=new Float32Array(r),a=t/n;for(let t=0;t<r;t+=1){let n=t*a,r=Math.floor(n),o=Math.min(r+1,e.length-1),s=n-r;i[t]=e[r]*(1-s)+e[o]*s}return i}function Kue(e){let t=Math.max(-1,Math.min(1,e));return Math.round(t<0?t*32768:t*32767)}function que(e,t,n){if(!n)return e;let r=Math.max(1,Math.round(t*n/1e3));return e.length<=r?e:e.slice(0,r)}function Jue(e,t=cA){let n=t*2,r=e.length*2,i=new ArrayBuffer(44+r),a=new DataView(i);uA(a,0,`RIFF`),a.setUint32(4,36+r,!0),uA(a,8,`WAVE`),uA(a,12,`fmt `),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,n,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),uA(a,36,`data`),a.setUint32(40,r,!0);let o=44;for(let t of e)a.setInt16(o,Kue(t),!0),o+=2;return new Uint8Array(i)}function uA(e,t,n){for(let r=0;r<n.length;r+=1)e.setUint8(t+r,n.charCodeAt(r))}function Yue(e){let t=e.numberOfChannels,n=e.length;if(t===1)return new Float32Array(e.getChannelData(0));let r=new Float32Array(n);for(let i=0;i<t;i+=1){let a=e.getChannelData(i);for(let e=0;e<n;e+=1)r[e]+=a[e]/t}return r}function dA(){if(!(typeof window>`u`))return window.AudioContext??window.webkitAudioContext}function Xue(e){try{return new e({sampleRate:cA})}catch{return new e}}var fA=class e{audioContext;processor;source;stream;chunks=[];startedAt=0;stopped=!0;static isSupported(){return!!(typeof navigator<`u`&&navigator.mediaDevices?.getUserMedia&&dA())}async start(){if(!e.isSupported())throw Error(`Audio recording is not supported in this browser.`);if(!this.stopped)throw Error(`Recording is already in progress.`);let t=dA();if(!t)throw Error(`Web Audio is not supported in this browser.`);this.chunks=[],this.stopped=!1,this.startedAt=Date.now();try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:{ideal:1},sampleRate:{ideal:cA},sampleSize:{ideal:16},echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}}),this.audioContext=Xue(t),this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(Uue,1,1),this.processor.onaudioprocess=e=>{if(!this.stopped){this.chunks.push(Yue(e.inputBuffer));for(let t=0;t<e.outputBuffer.numberOfChannels;t+=1)e.outputBuffer.getChannelData(t).fill(0)}},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(e){throw await this.cleanup(),e}}async stop(e={}){if(this.stopped)throw Error(`No recording is in progress.`);this.stopped=!0;let t=Math.max(1,Date.now()-this.startedAt),n=e.maxDurationMs?Math.min(t,e.maxDurationMs):t,r=this.audioContext?.sampleRate??16e3,i=this.chunks;this.chunks=[],await this.cleanup();let a=Wue(i);if(a.length===0)throw Error(`No audio was captured.`);let o=Jue(que(Gue(a,r,cA),cA,e.maxDurationMs),cA),s=new ArrayBuffer(o.byteLength);return new Uint8Array(s).set(o),{blob:new Blob([s],{type:lA}),durationMs:n,mimeType:lA}}async cancel(){this.stopped=!0,this.chunks=[],await this.cleanup()}async cleanup(){this.processor?.disconnect(),this.processor=void 0,this.source?.disconnect(),this.source=void 0,this.stream?.getTracks().forEach(e=>{e.stop()}),this.stream=void 0;let e=this.audioContext;this.audioContext=void 0,e&&e.state!==`closed`&&await e.close().catch(()=>void 0)}},pA=[500,1e3,2e3];function mA(e){return e instanceof DOMException&&e.name===`AbortError`}function Zue(e){return pA[e-1]??pA.at(-1)??2e3}function Que(e,t){return new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Transcription was cancelled.`,`AbortError`));return}let i=window.setTimeout(n,e);t.addEventListener(`abort`,()=>{window.clearTimeout(i),r(new DOMException(`Transcription was cancelled.`,`AbortError`))},{once:!0})})}function $ue(e){return mA(e)?!1:e instanceof hw&&e.status?e.status===408||e.status===429||e.status>=500:!0}function hA(e){return e instanceof Error?e.message:String(e)}var gA=class e{#e=A(!1);get recording(){return I(this.#e)}set recording(e){j(this.#e,e,!0)}#t=A(!1);get transcribing(){return I(this.#t)}set transcribing(e){j(this.#t,e,!0)}#n=A(void 0);get error(){return I(this.#n)}set error(e){j(this.#n,e,!0)}#r=A(0);get elapsedMs(){return I(this.#r)}set elapsedMs(e){j(this.#r,e,!0)}#i=A(0);get retryAttempt(){return I(this.#i)}set retryAttempt(e){j(this.#i,e,!0)}maxDurationMs=Rue;maxRetries=3;#a=A(!1);#o;#s=0;#c;#l;#u;#d;#f;constructor(e){this.#d=e.onTranscript,this.#f=e.onError}static isSupported(){return fA.isSupported()}get pending(){return this.transcribing||I(this.#a)}#p(e){this.error=e,this.#f?.(e)}toggle(){this.recording?this.stop():this.start()}async start(){if(!(this.recording||this.pending)){if(!e.isSupported()){this.#p(`Audio recording is not supported in this browser.`);return}this.error=void 0,this.retryAttempt=0,this.elapsedMs=0;try{let e=new fA;await e.start(),this.#o=e,this.recording=!0,this.#m()}catch(e){await this.#o?.cancel(),this.#o=void 0,this.#h(),this.recording=!1,this.#p(hA(e))}}}async stop(){if(!this.#o||I(this.#a))return!1;let e=this.#o;j(this.#a,!0),this.#o=void 0,this.#h();try{let t=await e.stop({maxDurationMs:this.maxDurationMs});return this.recording=!1,this.elapsedMs=t.durationMs,await this.#_(t)}catch(e){return this.recording=!1,this.#p(hA(e)),!1}finally{j(this.#a,!1)}}async cancel(){this.#u?.abort();let e=this.#o;this.#o=void 0,this.#h(),this.recording=!1,this.transcribing=!1,this.retryAttempt=0,this.elapsedMs=0,await e?.cancel()}#m(){this.#h(),this.#s=Date.now(),this.#g(),this.#c=window.setInterval(()=>this.#g(),250),this.#l=window.setTimeout(()=>{this.recording&&this.stop()},this.maxDurationMs)}#h(){this.#c&&window.clearInterval(this.#c),this.#l&&window.clearTimeout(this.#l),this.#c=void 0,this.#l=void 0}#g(){this.#s&&(this.elapsedMs=Math.min(Math.max(0,Date.now()-this.#s),this.maxDurationMs))}async#_(e){let t=new AbortController;this.#u=t,this.transcribing=!0,this.error=void 0,this.retryAttempt=0;let n=!1;try{for(let r=0;r<=this.maxRetries;r+=1){r>0&&(this.retryAttempt=r,await Que(Zue(r),t.signal));try{let n=await tD(e.blob,e.durationMs,{signal:t.signal});return t.signal.aborted||!n.trim()?!1:(this.#d(n),!0)}catch(e){if(t.signal.aborted||mA(e))return!1;if(r>=this.maxRetries||!$ue(e))throw n=r>=this.maxRetries,e}}}catch(e){if(t.signal.aborted||mA(e))return!1;let r=hA(e);this.#p(n?`Transcription failed after ${this.maxRetries} retries: ${r}`:r)}finally{this.#u===t&&(this.#u=void 0),this.transcribing=!1,this.retryAttempt=0}return!1}};function _A(e){return`${e.kind}:${e.id}`}function vA(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function yA(e,t){let n=t.trim();return n?`${e}${e.trim()?/\s$/.test(e)?``:`
|
|
39
|
-
|
|
40
|
-
`:``}${n} `:e}function ede(e){id.error(`Voice input failed`,{description:e})}var bA=new class{#e=A(void 0);#t=A(!1);#n=new Map;#r=new gA({onTranscript:e=>this.#o(e),onError:e=>this.#a(e)});get activeTarget(){return I(this.#e)}get recording(){return this.#r.recording}get transcribing(){return this.#r.transcribing}get pending(){return I(this.#t)||this.#r.pending}get elapsedMs(){return this.#r.elapsedMs}get retryAttempt(){return this.#r.retryAttempt}get maxDurationMs(){return this.#r.maxDurationMs}get maxRetries(){return this.#r.maxRetries}isSupported(){return gA.isSupported()}isTargetActive(e){return vA(I(this.#e),e)}isBusyForOtherTarget(e){return!!(I(this.#e)&&!vA(I(this.#e),e))}registerTargetHandlers(e,t){let n=_A(e);return this.#n.set(n,t),()=>{this.#n.get(n)===t&&this.#n.delete(n)}}async toggle(e){if(this.isTargetActive(e)&&this.recording){await this.stop(e);return}await this.start(e)}async start(e){if(I(this.#e))return!1;if(!this.isSupported())return this.#a(`Audio recording is not supported in this browser.`,e),!1;j(this.#e,e,!0),j(this.#t,!0);try{await this.#r.start()}finally{j(this.#t,!1)}return!this.#r.recording&&!this.#r.pending?(vA(I(this.#e),e)&&j(this.#e,void 0),!1):!0}async stop(e){let t=I(this.#e);if(!t||e&&!vA(t,e))return!1;let n=await this.#r.stop();return vA(I(this.#e),t)&&j(this.#e,void 0),n}async cancel(e){let t=I(this.#e);e&&!vA(t,e)||(j(this.#e,void 0),j(this.#t,!1),await this.#r.cancel())}async cancelIfTarget(e){this.isTargetActive(e)&&await this.cancel(e)}async cancelIfTargets(e){let t=I(this.#e);t&&e.some(e=>vA(t,e))&&await this.cancel(t)}#i(e=I(this.#e)){return e?this.#n.get(_A(e)):void 0}#a(e,t=I(this.#e)){let n=this.#i(t)?.onError;n?n(e):ede(e)}#o(e){let t=I(this.#e);if(!t)return;let n=this.#i(t);if(n?.appendTranscript){n.appendTranscript(e);return}if(t.kind===`conversation`){let n=kD(t.id);n.composerText=yA(n.composerText,e);return}if(t.kind===`pending-conversation`){let n=yT.pendingConversations[WT(t.id)];n&&(n.composerText=yA(n.composerText,e))}}},xA=[],SA=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?SA:xA).push(n+=e[t])})();function tde(e){if(e<768)return!1;for(let t=0,n=xA.length;;){let r=t+n>>1;if(e<xA[r])n=r;else if(e>=SA[r])t=r+1;else return!0;if(t==n)return!1}}function CA(e){return e>=127462&&e<=127487}var wA=8205;function nde(e,t,n=!0,r=!0){return(n?TA:rde)(e,t,r)}function TA(e,t,n){if(t==e.length)return t;t&&DA(e.charCodeAt(t))&&OA(e.charCodeAt(t-1))&&t--;let r=EA(e,t);for(t+=kA(r);t<e.length;){let i=EA(e,t);if(r==wA||i==wA||n&&tde(i))t+=kA(i),r=i;else if(CA(i)){let n=0,r=t-2;for(;r>=0&&CA(EA(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function rde(e,t,n){for(;t>0;){let r=TA(e,t-2,n);if(r<t)return r;t--}return 0}function EA(e,t){let n=e.charCodeAt(t);if(!OA(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return DA(r)?(n-55296<<10)+(r-56320)+65536:n}function DA(e){return e>=56320&&e<57344}function OA(e){return e>=55296&&e<56320}function kA(e){return e<65536?1:2}var AA=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=RA(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),MA.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=RA(this,e,t);let n=[];return this.decompose(e,t,n,0),MA.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new FA(this),i=new FA(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new FA(this,e)}iterRange(e,t=this.length){return new IA(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new LA(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new jA(t):MA.from(jA.split(t,[]))}},jA=class e extends AA{constructor(e,t=ide(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new ade(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(PA(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=NA(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=RA(this,t,n);let i=NA(this.text,NA(r.text,PA(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):MA.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
41
|
-
`){[e,t]=RA(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},MA=class e extends AA{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=RA(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
42
|
-
`){[e,t]=RA(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new jA(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof jA&&c&&(n=u[u.length-1])instanceof jA&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new jA(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};AA.empty=new jA([``],0);function ide(e){let t=-1;for(let n of e)t+=n.length+1;return t}function NA(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function PA(e,t,n){return NA(e,[``],t,n)}var FA=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof jA?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof jA?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
43
|
-
`,this;e--}else if(r instanceof jA){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof jA?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},IA=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new FA(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},LA=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(AA.prototype[Symbol.iterator]=function(){return this.iter()},FA.prototype[Symbol.iterator]=IA.prototype[Symbol.iterator]=LA.prototype[Symbol.iterator]=function(){return this});var ade=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function RA(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function zA(e,t,n=!0,r=!0){return nde(e,t,n,r)}function ode(e){return e>=56320&&e<57344}function sde(e){return e>=55296&&e<56320}function BA(e,t){let n=e.charCodeAt(t);if(!sde(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return ode(r)?(n-55296<<10)+(r-56320)+65536:n}function cde(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function VA(e){return e<65536?1:2}var HA=/\r\n?|\n/,UA=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(UA||={}),WA=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){JA(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:XA(this,e)}mapDesc(e,t=!1){return e.empty?this:YA(this,e,t)}mapPos(e,t=-1,n=UA.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=UA.Simple&&c>=e&&(n==UA.TrackDel&&r<e&&c>e||n==UA.TrackBefore&&r<e||n==UA.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},GA=class e extends WA{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return JA(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return YA(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(AA.empty);r.push(a?t.slice(i,i+a):AA.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:XA(this,e,!0)}map(e,t=!1){return e.empty?this:YA(this,e,t,!0)}iterChanges(e,t=!1){JA(this,e,t)}get desc(){return WA.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new ZA(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);KA(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;KA(n,e,t),t>0&&qA(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);KA(n,e,-1),KA(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:WA.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&KA(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?AA.of(l.split(r||HA)):l:AA.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&KA(i,e-o,-1),KA(i,s-e,d),qA(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(AA.empty);r[e]=AA.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function KA(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function qA(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(AA.empty);e.push(n)}}function JA(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=AA.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function YA(e,t,n,r=!1){let i=[],a=r?[]:null,o=new ZA(e),s=new ZA(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);KA(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(KA(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(KA(i,0,o.ins),a&&qA(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;KA(i,t,e<o.i?o.ins:0),a&&e<o.i&&qA(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?GA.createSet(i,a):WA.create(i);else throw Error(`Mismatched change set lengths`)}function XA(e,t,n=!1){let r=[],i=n?[]:null,a=new ZA(e),o=new ZA(t);for(let e=!1;;)if(a.done&&o.done)return i?GA.createSet(r,i):WA.create(r);else if(a.ins==0)KA(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)KA(r,0,o.ins,e),i&&qA(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;KA(r,t,n,e),i&&n&&qA(i,r,o.text)}else o.ins==-1?(KA(r,a.off?0:a.len,t,e),i&&qA(i,r,a.textBit(t))):(KA(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&qA(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var ZA=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?AA.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?AA.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},QA=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return $A.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return $A.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return $A.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},$A=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>QA.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return QA.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?QA.create(t,e,48|a):QA.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function ej(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var tj=0,nj=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=tj++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:rj),!!t.static,t.enables)}of(e){return new ij([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new ij(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new ij(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function rj(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var ij=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=tj++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||oj(e,c)){let r=t(e);if(a?!aj(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=yj(o,c);if(this.dependencies.every(t=>t instanceof nj?o.facet(t)===e.facet(t):t instanceof lj?o.field(t,!1)==e.field(t,!1):!0)||(a?aj(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function aj(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function oj(e,t){let n=!1;for(let r of t)vj(e,r)&1&&(n=!0);return n}function sj(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=yj(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)vj(e,t);return e.values[o]=s(e),1},update(e,n){if(!oj(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=oj(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&rj(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var cj=nj.define({static:!0}),lj=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(tj++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(cj).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(cj),i=n.facet(cj),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,cj.of({field:this,create:e})]}get extension(){return this}},uj={lowest:4,low:3,default:2,high:1,highest:0};function dj(e){return t=>new pj(t,e)}var fj={highest:dj(uj.highest),high:dj(uj.high),default:dj(uj.default),low:dj(uj.low),lowest:dj(uj.lowest)},pj=class{constructor(e,t){this.inner=e,this.prec=t}},mj=class e{of(e){return new hj(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},hj=class{constructor(e,t){this.compartment=e,this.inner=t}},gj=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of _j(t,n,o))e instanceof lj?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,rj(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>sj(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function _j(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof hj&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof hj){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof pj)a(e.inner,e.prec);else if(e instanceof lj)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof ij)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,uj.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,uj.default),r.reduce((e,t)=>e.concat(t))}function vj(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function yj(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var bj=nj.define(),xj=nj.define({combine:e=>e.some(e=>e),static:!0}),Sj=nj.define({combine:e=>e.length?e[0]:void 0,static:!0}),Cj=nj.define(),wj=nj.define(),Tj=nj.define(),Ej=nj.define({combine:e=>e.length?e[0]:!1}),Dj=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Oj}},Oj=class{of(e){return new Dj(this,e)}},kj=class{constructor(e){this.map=e}of(e){return new Aj(this,e)}},Aj=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new kj(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};Aj.reconfigure=Aj.define(),Aj.appendConfig=Aj.define();var jj=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&ej(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};jj.time=Dj.define(),jj.userEvent=Dj.define(),jj.addToHistory=Dj.define(),jj.remote=Dj.define();function Mj(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Nj(e,t,n){let r,i,a;return n?(r=t.changes,i=GA.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:Aj.mapEffects(e.effects,r).concat(Aj.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Pj(e,t,n){let r=t.selection,i=zj(t.annotations);return t.userEvent&&(i=i.concat(jj.userEvent.of(t.userEvent))),{changes:t.changes instanceof GA?t.changes:GA.of(t.changes||[],n,e.facet(Sj)),selection:r&&(r instanceof $A?r:$A.single(r.anchor,r.head)),effects:zj(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Fj(e,t,n){let r=Pj(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Nj(r,Pj(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=jj.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Lj(n?Ij(i):i)}function Ij(e){let t=e.startState,n=!0;for(let r of t.facet(Cj)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:Mj(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=GA.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=jj.create(t,r,e.selection&&e.selection.map(i),Aj.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(wj);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof jj?i:Array.isArray(i)&&i.length==1&&i[0]instanceof jj?i[0]:Fj(t,zj(i),!1)}return e}function Lj(e){let t=e.startState,n=t.facet(Tj),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Nj(r,Pj(t,a,e.changes.newLength),!0))}return r==e?e:jj.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Rj=[];function zj(e){return e==null?Rj:Array.isArray(e)?e:[e]}var Bj=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(Bj||={}),Vj=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Hj;try{Hj=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function Uj(e){if(Hj)return Hj.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||Vj.test(n)))return!0}return!1}function Wj(e){return t=>{if(!/\S/.test(t))return Bj.Space;if(Uj(t))return Bj.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return Bj.Word;return Bj.Other}}var Gj=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)vj(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return vj(this,n),yj(this,n)}update(...e){return Fj(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(mj.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(Aj.reconfigure)?(n=null,r=e.value):e.is(Aj.appendConfig)&&(n=null,r=zj(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=gj.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(xj)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:$A.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=zj(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=Aj.mapEffects(a,c).concat(Aj.mapEffects(zj(o.effects),l))}return{changes:r,selection:$A.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof GA?t:GA.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return AA.of(t.split(this.facet(e.lineSeparator)||HA))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(vj(this,t),yj(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof lj&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:$A.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=gj.resolve(t.extensions||[],new Map),r=t.doc instanceof AA?t.doc:AA.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||HA)),i=t.selection?t.selection instanceof $A?t.selection:$A.single(t.selection.anchor,t.selection.head):$A.single(0);return ej(i,r.length),n.staticFacet(xj)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
44
|
-
`}get readOnly(){return this.facet(Ej)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(bj))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return Wj(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=zA(t,a,!1);if(i(t.slice(e,a))!=Bj.Word)break;a=e}for(;o<r;){let e=zA(t,o);if(i(t.slice(o,e))!=Bj.Word)break;o=e}return a==o?null:$A.range(a+n,o+n)}};Gj.allowMultipleSelections=xj,Gj.tabSize=nj.define({combine:e=>e.length?e[0]:4}),Gj.lineSeparator=Sj,Gj.readOnly=Ej,Gj.phrases=nj.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),Gj.languageData=bj,Gj.changeFilter=Cj,Gj.transactionFilter=wj,Gj.transactionExtender=Tj,mj.reconfigure=Aj.define();function Kj(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var qj=class{eq(e){return this==e}range(e,t=e){return Yj.create(e,t,this)}};qj.prototype.startSide=qj.prototype.endSide=0,qj.prototype.point=!1,qj.prototype.mapMode=UA.TrackDel;function Jj(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var Yj=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function Xj(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var Zj=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},Qj=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(Xj)),this.isEmpty)return n.length?e.of(n):this;let s=new nM(this,null,-1).goto(0),c=0,l=[],u=new eM;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(Yj.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return rM.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return rM.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=tM(a,o,n),c=new aM(a,s,i),l=new aM(o,s,i);n.iterGaps((e,t,n)=>oM(c,e,l,t,n,r)),n.empty&&n.length==0&&oM(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=tM(i,a),s=new aM(i,o,0).goto(n),c=new aM(a,o,0).goto(n);for(;;){if(s.to!=c.to||!sM(s.active,c.active)||s.point&&(!c.point||!Jj(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new aM(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new eM;for(let r of e instanceof Yj?[e]:t?$j(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};Qj.empty=new Qj([],[],null,-1);function $j(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(Xj(t,r)>0)return e.slice().sort(Xj);t=r}return e}Qj.empty.nextLayer=Qj.empty;var eM=class e{finishChunk(e){this.chunks.push(new Zj(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Qj.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Qj.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function tM(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var nM=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},rM=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new nM(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)iM(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)iM(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),iM(this.heap,0)}}};function iM(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var aM=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=rM.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){cM(this.active,e),cM(this.activeTo,e),cM(this.activeRank,e),this.minActive=uM(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;lM(this.active,t,n),lM(this.activeTo,t,r),lM(this.activeRank,t,i),e&&lM(e,t,this.cursor.from),this.minActive=uM(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&cM(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function oM(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&Jj(e.point,n.point)&&sM(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!sM(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function sM(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!Jj(e[n],t[n]))return!1;return!0}function cM(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function lM(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function uM(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function dM(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=zA(e,i));return r}function fM(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=zA(e,r)}return r===!0?-1:e.length}for(var pM=`ͼ`,mM=typeof Symbol>`u`?`__ͼ`:Symbol.for(pM),hM=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),gM=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},_M=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
|
45
|
-
`)}static newName(){let e=gM[mM]||1;return gM[mM]=e+1,pM+e.toString(36)}static mount(e,t,n){let r=e[hM],i=n&&n.nonce;r?i&&r.setNonce(i):r=new yM(e,i),r.mount(Array.isArray(t)?t:[t],e)}},vM=new Map,yM=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=vM.get(n);if(t)return e[hM]=t;this.sheet=new r.CSSStyleSheet,vM.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[hM]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
|
|
46
|
-
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},bM={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},xM={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},SM=typeof navigator<`u`&&/Mac/.test(navigator.platform),CM=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),wM=0;wM<10;wM++)bM[48+wM]=bM[96+wM]=String(wM);for(var wM=1;wM<=24;wM++)bM[wM+111]=`F`+wM;for(var wM=65;wM<=90;wM++)bM[wM]=String.fromCharCode(wM+32),xM[wM]=String.fromCharCode(wM);for(var TM in bM)xM.hasOwnProperty(TM)||(xM[TM]=bM[TM]);function EM(e){var t=!(SM&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||CM&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?xM:bM)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var DM=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},OM=typeof document<`u`?document:{documentElement:{style:{}}},kM=/Edge\/(\d+)/.exec(DM.userAgent),AM=/MSIE \d/.test(DM.userAgent),jM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(DM.userAgent),MM=!!(AM||jM||kM),NM=!MM&&/gecko\/(\d+)/i.test(DM.userAgent),PM=!MM&&/Chrome\/(\d+)/.exec(DM.userAgent),FM=`webkitFontSmoothing`in OM.documentElement.style,IM=!MM&&/Apple Computer/.test(DM.vendor),LM=IM&&(/Mobile\/\w+/.test(DM.userAgent)||DM.maxTouchPoints>2),RM={mac:LM||/Mac/.test(DM.platform),windows:/Win/.test(DM.platform),linux:/Linux|X11/.test(DM.platform),ie:MM,ie_version:AM?OM.documentMode||6:jM?+jM[1]:kM?+kM[1]:0,gecko:NM,gecko_version:NM?+(/Firefox\/(\d+)/.exec(DM.userAgent)||[0,0])[1]:0,chrome:!!PM,chrome_version:PM?+PM[1]:0,ios:LM,android:/Android\b/.test(DM.userAgent),webkit:FM,webkit_version:FM?+(/\bAppleWebKit\/(\d+)/.exec(DM.userAgent)||[0,0])[1]:0,safari:IM,safari_version:IM?+(/\bVersion\/(\d+(\.\d+)?)/.exec(DM.userAgent)||[0,0])[1]:0,tabSize:OM.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function zM(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var BM=Object.create(null);function VM(e,t,n){if(e==t)return!0;e||=BM,t||=BM;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function HM(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function UM(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function WM(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var GM=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},KM=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(KM||={}),qM=class extends qj{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new JM(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new XM(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=ZM(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new XM(e,n,r,t,e.widget||null,!0)}static line(e){return new YM(e)}static set(e,t=!1){return Qj.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};qM.none=Qj.empty;var JM=class e extends qM{constructor(e){let{start:t,end:n}=ZM(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?zM(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||BM}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&VM(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};JM.prototype.point=!1;var YM=class e extends qM{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&VM(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};YM.prototype.mapMode=UA.TrackBefore,YM.prototype.point=!0;var XM=class e extends qM{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?UA.TrackBefore:UA.TrackAfter:UA.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?KM.WidgetBefore:KM.WidgetAfter:KM.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&QM(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};XM.prototype.point=!0;function ZM(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function QM(e,t){return e==t||!!(e&&t&&e.compare(t))}function $M(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var eN=class e extends qj{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&VM(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||BM,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return Qj.of(e,t)}};eN.prototype.startSide=eN.prototype.endSide=-1;function tN(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function nN(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function rN(e,t){if(!t.anchorNode)return!1;try{return nN(e,t.anchorNode)}catch{return!1}}function iN(e){return e.nodeType==3?yN(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function aN(e,t,n,r){return n?cN(e,t,n,r,-1)||cN(e,t,n,r,1):!1}function oN(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function sN(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function cN(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:lN(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=oN(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?lN(e):0}else return!1}}function lN(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function uN(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function dN(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function fN(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function pN(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=dN(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=fN(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function mN(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var hN=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?lN(t):0),n,Math.min(e.focusOffset,n?lN(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},gN=null;RM.safari&&RM.safari_version>=26&&(gN=!1);function _N(e){if(e.setActive)return e.setActive();if(gN)return e.focus(gN);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(gN==null?{get preventScroll(){return gN={preventScroll:!0},!0}}:void 0),!gN){gN=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var vN;function yN(e,t,n=t){let r=vN||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function bN(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function xN(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function SN(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,lN(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=lN(n))}else if(n==e)return!0;else r=oN(n),n=n.parentNode}function CN(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function wN(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=lN(n)}else if(n.parentNode&&!sN(n))r=oN(n),n=n.parentNode;else return null}function TN(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!sN(n))r=oN(n)+1,n=n.parentNode;else return null}var EN=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,oN(t),n)}static after(t,n){return new e(t.parentNode,oN(t)+1,n)}},DN=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(DN||={}),ON=DN.LTR,kN=DN.RTL;function AN(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var jN=AN(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),MN=AN(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),NN=Object.create(null),PN=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);NN[t]=n,NN[n]=-t}function FN(e){return e<=247?jN[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?MN[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var IN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,LN=class{get dir(){return this.level%2?kN:ON}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function RN(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!RN(r.inner,i.inner))return!1}return!0}var zN=[];function BN(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=FN(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),zN[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=zN[e];if(i==128)e<s-1&&t==zN[e+1]&&t&24?i=zN[e]=t:zN[e]=256;else if(i==64){let i=e+1;for(;i<s&&zN[i]==64;)i++;let a=e&&t==8||i<n&&zN[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)zN[t]=a;e=i-1}else i==8&&r==1&&(zN[e]=1);t=i,i&7&&(r=i)}}}function VN(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=NN[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(PN[e+1]==-r){let n=PN[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(zN[t]=zN[PN[e]]=r),s=e;break}}else if(PN.length==189)break;else PN[s++]=t,PN[s++]=n,PN[s++]=c;else if((o=zN[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=PN[t+2];if(n&2)break;if(e)PN[t+2]|=2;else{if(n&4)break;PN[t+2]|=4}}}}}function HN(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=zN[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(zN[o]==256)o++;else break;let l=a==1,u=l==((o<t?zN[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),zN[--t]=u;c=o}else a=o,c++}}}function UN(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=zN[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(zN[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new LN(c,m.from,f)),WN(e,m.direction==ON==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?zN[p]!=s:zN[p]==s))break;else p++;d?UN(e,c,p,r+1,i,d,o):c<p&&o.push(new LN(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=zN[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(zN[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new LN(m.to,c,f)),WN(e,m.direction==ON==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?zN[p-1]!=s:zN[p-1]==s))break;else p--;d?UN(e,p,c,r+1,i,d,o):p<c&&o.push(new LN(p,c,f)),c=p}}function WN(e,t,n,r,i,a,o){let s=t%2?2:1;BN(e,i,a,r,s),VN(e,i,a,r,s),HN(i,a,r,s),UN(e,i,a,t,n,r,o)}function GN(e,t,n){if(!e)return[new LN(0,0,+(t==kN))];if(t==ON&&!n.length&&!IN.test(e))return KN(e.length);if(n.length)for(;e.length>zN.length;)zN[zN.length]=256;let r=[],i=t==ON?0:1;return WN(e,i,i,n,0,e.length,r),r}function KN(e){return[new LN(0,e,0)]}var qN=``;function JN(e,t,n,r,i){let a=r.head-e.from,o=LN.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=zA(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),qN=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?$A.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):$A.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function YN(e,t,n){for(let r=t;r<n;r++){let t=FN(e.charCodeAt(r));if(t==1)return ON;if(t==2||t==4)return kN}return ON}var XN=nj.define(),ZN=nj.define(),QN=nj.define(),$N=nj.define(),eP=nj.define(),tP=nj.define(),nP=nj.define(),rP=nj.define(),iP=nj.define(),aP=nj.define({combine:e=>e.some(e=>e)}),oP=nj.define({combine:e=>e.some(e=>e)}),sP=nj.define(),cP=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e($A.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},lP=Aj.define({map:(e,t)=>e.map(t)}),uP=Aj.define();function dP(e,t,n){let r=e.facet($N);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var fP=nj.define({combine:e=>e.length?e[0]:!0}),pP=0,mP=nj.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),hP=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(mP.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(mP.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(pP++,t,r,i,e=>{let t=[];return o&&t.push(yP.of(t=>{let n=t.plugin(e);return n?o(n):qM.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},gP=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){dP(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(dP(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){dP(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},_P=nj.define(),vP=nj.define(),yP=nj.define(),bP=nj.define(),xP=nj.define(),SP=nj.define(),CP=nj.define();function wP(e,t){let n=e.state.facet(CP);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return Qj.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=YN(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var TP=nj.define();function EP(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(TP)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var DP=nj.define(),OP=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},kP=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=GA.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new OP(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},AP=[],jP=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return AP}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&HM(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=oN(this.dom),r=this.length?e>0:t>0;return new EN(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof PP)return e;return null}static get(e){return e.cmTile}},MP=class extends jP{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=NP(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=NP(r);this.length=a}};function NP(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var PP=class extends MP{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=jP.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof FP)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},FP=class e extends MP{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},IP=class e extends MP{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&RP(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):LP(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new EN(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new EN(e.dom,0);e==n.tile&&(a=!0)}}return new EN(this.dom,0)}};function LP(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=iN(t);return n[n.length-1]||null}function RP(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var zP=class e extends MP{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},BP=class e extends jP{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?RM.chrome||RM.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=yN(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return RM.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?uN(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},VP=class e extends jP{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return uN(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return uN(n,!r)}}get overrideDOMText(){if(!this.length)return AA.empty;let{root:e}=this;if(!e)return AA.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},HP=class extends jP{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return AA.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},UP=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},WP=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},GP=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new BP(a.dom,a.text+e);t.parent=i}else i.append(r||BP.of(e,this.cache.find(BP)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?tF(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof zP&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(tF(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=jP.get(n.dom);e&&e.setDOM(tF(n.dom))}let e=zP.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=jP.get(e.text);i&&this.cache.reused.set(i,2);let a=new BP(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=QP;let n=IP.start(e,t||this.cache.find(IP)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof zP&&a.mark.eq(i))n=a,t--;else{let e=zP.of(i,this.cache.find(zP,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!XP(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(RM.ios&&XP(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(rF,0,32)||new VP(rF.toDOM(),0,rF,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new WP(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof FP&&n.wrapper.eq(t.wrapper))e=n;else{let n=FP.of(t.wrapper,this.cache.find(FP,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(HP,void 0,1);return n&&(n.flags=t),n||new HP(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},KP=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},qP=[VP,IP,BP,zP,HP,FP,PP];for(let e=0;e<qP.length;e++)qP[e].bucket=e;var JP=class{constructor(e){this.view=e,this.buckets=qP.map(()=>[]),this.index=qP.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new VP(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},YP=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new JP(e),this.text=new KP(e.state.doc),this.builder=new GP(this.cache,new PP(e,e.contentDOM),Qj.iter(n)),this.cache.reused.set(t,2),this.old=new UP(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=eF(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?VP.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof HP)this.cache.add(e);else if(e instanceof zP)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof zP&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof zP&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=Qj.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof XM){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?nF.block:nF.inline),c=ZP(a),l=this.cache.findWidget(i,t-e,c)||VP.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=$P(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=jP.get(r);if(r==this.view.contentDOM)break;e instanceof zP?t.push(e):e?.isLine()?n=e:e instanceof FP||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new IP(r,QP):n||t.push(zP.of(new JM({tagName:r.nodeName.toLowerCase(),attributes:WM(r)}),r)))}return{line:n,marks:t}}};function XP(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function ZP(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var QP={class:`cm-line`};function $P(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&zM(n,e),r&&(e.class+=` `+r),e)}function eF(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof zP&&t.push(r.mark)}return t}function tF(e){let t=jP.get(e);return t&&t.setDOM(e.cloneNode()),e}var nF=class extends GM{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};nF.inline=new nF(`span`),nF.block=new nF(`div`);var rF=new class extends GM{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},iF=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=qM.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new PP(e,e.contentDOM),this.updateInner([new OP(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!hF(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?cF(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new OP(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(RM.ie||RM.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=dF(i,this.decorations,e.changes);o.length&&(t=OP.extendWithRanges(t,o));let s=pF(a,this.blockWrappers,e.changes);return s.length&&(t=OP.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new YP(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&jP.get(t.text)&&r.cache.reused.set(jP.get(t.text),2),this.tile=r.run(e,t),aF(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=RM.chrome||RM.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof gF&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(uP)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(fP)||n.tabIndex>-1)&&rN(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),RM.gecko&&s.empty&&!this.hasComposition&&oF(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new EN(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!aN(c.node,c.offset,u.anchorNode,u.anchorOffset)||!aN(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{RM.android&&RM.chrome&&n.contains(u.focusNode)&&mF(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=tN(this.view.root);if(e)if(s.empty){if(RM.gecko){let e=lF(c.node,c.offset);if(e&&e!=3){let t=(e==1?wN:TN)(c.node,c.offset);t&&(c=new EN(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new EN(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new EN(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&aN(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=tN(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=lN(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!jP.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof gF?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=zA(e.text,t);if(n==t)return null;let r=yN(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==DN.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof FP)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?iN(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?DN.RTL:DN.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=iN(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=iN(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(qM.replace({widget:new gF(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return qM.set(e)}updateDeco(){let e=1,t=this.view.state.facet(yP).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(xP).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(Qj.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(bP).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(sP))try{if(t(this.view,e.range,e))return!0}catch(e){dP(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0:t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=EP(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(pN(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==DN.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){aF(this.tile)}};function aF(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)aF(n,t)}}function oF(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function sF(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=wN(n.focusNode,n.focusOffset),i=TN(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=jP.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=jP.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function cF(e,t,n){let r=sF(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new OP(c.mapPos(a),c.mapPos(o),a,o),text:i}}function lF(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var uF=class{constructor(){this.changes=[]}compareRange(e,t){$M(e,t,this.changes)}comparePoint(e,t){$M(e,t,this.changes)}boundChange(e){$M(e,e,this.changes)}};function dF(e,t,n){let r=new uF;return Qj.compare(e,t,n,r),r.changes}var fF=class{constructor(){this.changes=[]}compareRange(e,t){$M(e,t,this.changes)}comparePoint(){}boundChange(e){$M(e,e,this.changes)}};function pF(e,t,n){let r=new fF;return Qj.compare(e,t,n,r),r.changes}function mF(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function hF(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var gF=class extends GM{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function _F(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return $A.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=zA(i.text,a,!1):s=zA(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=zA(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=zA(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return $A.range(o+i.from,s+i.from)}function vF(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+fM(o,a,e.state.tabSize)}function yF(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==KM.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function bF(e,t,n,r){let i=yF(e,t.head,t.assoc||-1),a=!r||i.type!=KM.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==DN.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return $A.cursor(o,n?-1:1)}return $A.cursor(n?i.to:i.from,n?-1:1)}function xF(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=JN(i,a,o,s,n),l=qN;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
47
|
-
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function SF(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==Bj.Space&&(i=t),i==t}}function CF(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return $A.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=OF(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return $A.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return $A.cursor(i.pos,i.assoc,void 0,o)}}function wF(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function TF(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=wF(e,i.from,0);t!=i.from&&(a=$A.cursor(t,-1))}else{let t=wF(e,i.from,-1),n=wF(e,i.to,1);(t!=i.from||n!=i.to)&&(a=$A.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?$A.create(n,t.mainIndex):t}function EF(e,t,n){let r=wF(e.state.facet(SP).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:$A.cursor(r,r<n.from?1:-1)}var DF=class{constructor(e,t){this.pos=e,this.assoc=t}};function OF(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new DF(0,1);if(c>e.viewState.docHeight)return new DF(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==KM.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==KM.Text){let t=vF(e,i,l,o,s);return new DF(t,t==l.from?1:-1)}}if(l.type!=KM.Text)return c<(l.top+l.bottom)/2?new DF(l.from,1):new DF(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new kF(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var kF=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[LN.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[LN.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){let e=r+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!a.has(e)){f=e;break adjust}e++,e==i&&(e=r)}break search}a.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let n=p[t],a=0;if(!(n.width==0&&p.length>1)){if(n.bottom<this.y)(!s||s.bottom<n.bottom)&&(s=n),a=1;else if(n.top>this.y)(!c||c.top>n.top)&&(c=n),a=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<u&&(l=f,u=t,d=n),e&&(a=e<0==(this.baseDir==DN.LTR)?-1:1)}a==-1&&(!o||this.baseDirAt(e[f],1))?i=f:a==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}}}if(!d){let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==DN.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=zA(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return yN(e.dom,i,a).getClientRects()});return r.after?new DF(n[r.i+1],-1):new DF(n[r.i],1)}scanTile(e,t){if(!e.length)return new DF(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:yN(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new DF(n[r.i+1],-1):new DF(a,1)}},AF=``,jF=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(Gj.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=AF}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=jP.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=jP.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:sN(r))||sN(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!NF(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=jP.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(MF(e,n.node,n.offset)?t:0))}};function MF(e,t,n){for(;;){if(!t||n<lN(t))return!1;if(t==e)return!0;n=oN(t)+1,t=t.parentNode}}function NF(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=jP.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var PF=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},FF=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=IF(e.docView.tile,t,n,0))){let t=i||a?[]:VF(e),n=new jF(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=HF(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!nN(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!nN(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((RM.ios||RM.chrome)&&o.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange($A.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=$A.create([$A.cursor(n,r)])}else this.newSel=$A.single(r,n)}}};function IF(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return IF(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function LF(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||RM.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,AF),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:AA.of(t.text.slice(a.from-e,u).split(AF))}:(d=BF(l,t.text,s-e,c))&&(RM.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==``&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:AA.of(t.text.slice(d.from,d.toB).split(AF))})}else r&&(!e.hasFocus&&i.facet(fP)||UF(r,a))&&(r=null);if(!n&&!r)return!1;if((RM.mac||RM.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=$A.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:AA.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:RM.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
48
|
-
`&&e.lineWrapping&&(r&&=$A.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:AA.of([` `])}),n)return RF(e,n,r,o);if(r&&!UF(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=TF(i.facet(SP).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function RF(e,t,n,r=-1){if(RM.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(RM.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&bN(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&bN(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&bN(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=zF(e,t,n);return e.state.facet(tP).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function zF(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=wF(i.facet(SP).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:$A.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&sF(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?$A.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function BF(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function VF(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new PF(n,r)),(i!=n||a!=r)&&t.push(new PF(i,a))),t}function HF(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?$A.single(n+t,r+t):null}function UF(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var WF=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,RM.safari&&e.contentDOM.addEventListener(`input`,()=>null),RM.gecko&&EI(e.contentDOM.ownerDocument)}handleEvent(e){!rI(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=KF(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&YF.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),RM.android&&RM.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return RM.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=qF.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||JF.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,bN(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:RM.safari&&!RM.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function GF(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){dP(n.state,e)}}}function KF(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(GF(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(GF(t.value,r))}}for(let e in iI)n(e).handlers.push(iI[e]);for(let e in aI)n(e).observers.push(aI[e]);return t}var qF=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],JF=`dthko`,YF=[16,17,18,20,91,92,224,225],XF=6;function ZF(e){return Math.max(0,e)*.7+8}function QF(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var $F=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=mN(e.contentDOM),this.atoms=e.state.facet(SP).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Gj.allowMultipleSelections)&&eI(e,t),this.dragging=nI(e,t)&&hI(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&QF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=EP(this.view);e.clientX-s.left<=r+XF?t=-ZF(r-e.clientX):e.clientX+s.right>=a-XF&&(t=ZF(e.clientX-a)),e.clientY-s.top<=i+XF?n=-ZF(i-e.clientY):e.clientY+s.bottom>=o-XF&&(n=ZF(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=TF(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function eI(e,t){let n=e.state.facet(XN);return n.length?n[0](t):RM.mac?t.metaKey:t.ctrlKey}function tI(e,t){let n=e.state.facet(ZN);return n.length?n[0](t):RM.mac?!t.altKey:!t.ctrlKey}function nI(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=tN(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function rI(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=jP.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var iI=Object.create(null),aI=Object.create(null),oI=RM.ie&&RM.ie_version<15||RM.ios&&RM.webkit_version<604;function sI(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),lI(e,n.value)},50)}function cI(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function lI(e,t){t=cI(e.state,rP,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(xI!=null&&n.selection.ranges.every(e=>e.empty)&&xI==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:$A.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:$A.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}aI.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},aI.wheel=aI.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},iI.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),aI.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},aI.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},iI.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(QN))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=gI(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new $F(e,t,n,r)),r&&e.observer.ignore(()=>{_N(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function uI(e,t,n,r){if(r==1)return $A.cursor(t,n);if(r==2)return _F(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,$A.range(a,o)}}var dI=RM.ie&&RM.ie_version<=11,fI=null,pI=0,mI=0;function hI(e){if(!dI)return e.detail;let t=fI,n=mI;return fI=e,mI=Date.now(),pI=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(pI+1)%3:1}function gI(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=hI(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=uI(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=uI(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?$A.range(i,a,l.assoc):$A.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=_I(i,s.pos))?c:o?i.addRange(l):$A.create([l])}}}function _I(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return $A.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}iI.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=$A.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,cI(e.state,iP,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},iI.dragend=e=>(e.inputState.draggedContent=null,!1);function vI(e,t,n,r){if(n=cI(e.state,rP,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&tI(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}iI.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&vI(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return vI(e,t,n,!0),!0}return!1},iI.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=oI?null:t.clipboardData;return n?(lI(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(sI(e),!1)};function yI(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function bI(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:cI(e,iP,t.join(e.lineBreak)),ranges:n,linewise:r}}var xI=null;iI.copy=iI.cut=(e,t)=>{if(!rN(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=bI(e.state);if(!n&&!i)return!1;xI=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=oI?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(yI(e,n),!1)};var SI=Dj.define();function CI(e,t){let n=[];for(let r of e.facet(nP)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:SI.of(!0)}):null}function wI(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=CI(e.state,t);n?e.dispatch(n):e.update([])}},10)}aI.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),wI(e)},aI.blur=e=>{e.observer.clearSelectionRange(),wI(e)},aI.compositionstart=aI.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},aI.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,RM.chrome&&RM.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},aI.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},iI.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return RF(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(RM.chrome&&RM.android&&(n=qF.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return RM.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),RM.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>aI.compositionend(e,t),20),!1};var TI=new Set;function EI(e){TI.has(e)||(TI.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var DI=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],OI=!1;function kI(){OI=!1}var AI=class{constructor(e){this.lineWrapping=e,this.doc=AA.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return DI.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=DI.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},jI=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},MI=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?KM.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof XM?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},NI=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(NI||={}),PI=.001,FI=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>PI&&(OI=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,NI.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,NI.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,NI.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=WI.build(n.setDoc(a),e,l,u);i=II(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new zI(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new VI(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function II(e,t){return e==t?e:(e.constructor!=t.constructor&&(OI=!0),t)}FI.prototype.size=1;var LI=qM.replace({}),RI=class extends FI{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new MI(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new MI(r,0,n,this.spaceAbove,LI):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,NI.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},zI=class e extends RI{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new MI(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof BI&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof BI?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):FI.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},BI=class e extends FI{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new MI(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new MI(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==NI.ByHeight)return this.blockAt(e,n,r,i);if(t==NI.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new MI(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new MI(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new MI(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return FI.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=PI&&(s=-2);let c=new zI(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=FI.of(r);return(s<0||Math.abs(c.height-this.height)>=PI||Math.abs(s-this.heightMetrics(t,n).perLine)>=PI)&&(OI=!0),II(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},VI=class extends FI{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==NI.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==NI.ByPosNoHeight?NI.ByPosNoHeight:NI.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,NI.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&HI(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),HI(i,e)}return FI.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?FI.of(this.break?[e,null,t]:[e,t]):(this.left=II(this.left,e),this.right=II(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function HI(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof BI&&(r=e[t+1])instanceof BI&&e.splice(t-1,3,new BI(n.length+1+r.length))}var UI=5,WI=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof zI?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new zI(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new RI(a,r,n)):(a||i||r>=UI)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new zI(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new BI(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zI)return e;let t=new zI(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof zI)&&!this.isCovered?this.nodes.push(new zI(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof zI&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return Qj.spans(n,r,i,a,0),a.finish(r)}};function GI(e,t,n){let r=new KI;return Qj.compare(e,t,n,r,0),r.changes}var KI=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&$M(e,t,this.changes,5)}};function qI(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function JI(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function YI(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var XI=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return qM.replace({widget:new ZI(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},ZI=class extends GM{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},QI=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=iL,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=DN.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(vP).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new AI(n),this.stateDeco=aL(t),this.heightMap=FI.empty().applyChanges(this.stateDeco,AA.empty,this.heightOracle.setDoc(t.doc),[new OP(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=qM.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new $I(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iL:new oL(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(sL(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=aL(this.state);let r=e.changedRanges,i=OP.extendWithRanges(r,GI(n,this.stateDeco,e?e.changes:GA.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);kI(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||OI)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(oP)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?DN.RTL:DN.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=fN(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=mN(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=CN(this.scrollParent||e.win);let m=(this.printing?YI:qI)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!JI(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),kI();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?FI.empty().applyChanges(this.stateDeco,AA.empty,this.heightOracle,[new OP(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new jI(n.from,i))}OI&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new $I(r.lineAt(a-n*1e3,NI.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,NI.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,NI.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new $I(r.lineAt(o-1e3/2,NI.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,NI.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new $I(this.heightMap.lineAt(n,NI.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,NI.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,NI.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,NI.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new XI(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=DN.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=rL(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary($A.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new XI(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=KM.Text)return;let i=eL(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=nL(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=tL(i,n),l=tL(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=nL(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=tL(i,f),l=tL(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=nL(r,n)-nL(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){XI.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=qM.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];Qj.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||sL(this.heightMap.lineAt(e,NI.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||sL(this.heightMap.lineAt(this.scaler.fromDOM(e),NI.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return sL(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},$I=class{constructor(e,t){this.from=e,this.to=t}};function eL(e,t,n){let r=[],i=e,a=0;return Qj.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function tL({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function nL(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function rL(e,t){for(let n of e)if(t(n))return n}var iL={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function aL(e){let t=e.facet(yP).filter(e=>typeof e!=`function`),n=e.facet(xP).filter(e=>typeof e!=`function`);return n.length&&t.push(Qj.join(n)),t}var oL=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,NI.ByPos,e,0,0).top,o=t.lineAt(i,NI.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function sL(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new MI(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>sL(e,t)):e._content)}var cL=nj.define({combine:e=>e.join(` `)}),lL=nj.define({combine:e=>e.indexOf(!0)>-1}),uL=_M.newName(),dL=_M.newName(),fL=_M.newName(),pL={"&light":`.`+dL,"&dark":`.`+fL};function mL(e,t,n){return new _M(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var hL=mL(`.`+uL,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},pL),gL={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},_L=RM.ie&&RM.ie_version<=11,vL=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new hN,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(RM.ie&&RM.ie_version<=11||RM.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&RM.android&&e.constructor.EDIT_CONTEXT!==!1&&!(RM.chrome&&RM.chrome_version<126)&&(this.editContext=new SL(e),e.state.facet(fP)&&(e.contentDOM.editContext=this.editContext.editContext)),_L&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(fP)?n.root.activeElement!=this.dom:!rN(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(RM.ie&&RM.ie_version<=11||RM.android&&RM.chrome)&&!n.state.selection.main.empty&&r.focusNode&&aN(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=tN(e.root);if(!t)return!1;let n=RM.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&xL(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=rN(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&SN(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,gL),_L&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),_L&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&bN(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&rN(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new FF(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=LF(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!UF(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=yL(t,e.previousSibling||e.target.previousSibling,-1),r=yL(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(fP)!=e.state.facet(fP)&&(e.view.contentDOM.editContext=e.state.facet(fP)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function yL(e,t,n){for(;t;){let r=jP.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function bL(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return aN(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function xL(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return bL(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?bL(e,n):null}var SL=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=BF(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=$A.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));UF(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:AA.of(n.text.slice(l.from,l.toB).split(`
|
|
49
|
-
`))};if((RM.mac||RM.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:AA.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);RF(e,u,$A.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(qM.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:uP.of(qM.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=tN(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},CL=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||xN(e.parent)||document,this.viewState=new QI(this,e.state||Gj.create(e)),e.scrollTo&&e.scrollTo.is(lP)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(mP).map(e=>new gP(e));for(let e of this.plugins)e.update(this);this.observer=new vL(this),this.inputState=new WF(this),this.inputState.ensureHandlers(this.plugins),this.docView=new iF(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof jj?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(SI))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=CI(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(Gj.phrases)!=this.state.facet(Gj.phrases))return this.setState(a);i=kP.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new cP(t.empty?t:$A.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(lP)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=EL.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(DP)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(cL)!=i.state.facet(cL)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(eP))try{e(i)}catch(e){dP(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!LF(this,u)&&l.force&&bN(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new QI(this,e),this.plugins=e.facet(mP).map(e=>new gP(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new iF(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(mP),n=e.state.facet(mP);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new gP(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){dP(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(CN(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return dP(this.state,e),TL}}),l=kP.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=TL)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){dP(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(eP))e(t)}get themeClasses(){return uL+` `+(this.state.facet(lL)?fL:dL)+` `+this.state.facet(cL)}updateAttrs(){let e=DL(this,_P,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(fP)?`true`:`false`,class:`cm-content`,style:`${RM.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),DL(this,vP,t);let n=this.observer.ignore(()=>{let n=UM(this.contentDOM,this.contentAttrs,t),r=UM(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(DP);let t=this.state.facet(e.cspNonce);_M.mount(this.root,this.styleModules.concat(hL).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return EF(this,e,xF(this,e,t,n))}moveByGroup(e,t){return EF(this,e,xF(this,e,t,t=>SF(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return $A.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return bF(this,e,t,n)}moveVertically(e,t,n){return EF(this,e,CF(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=OF(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),OF(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[LN.find(i,e-r.from,-1,t)];return uN(n,a.dir==DN.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(aP)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>wL)return KN(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||RN(r.isolates,n=wP(this,e))))return r.order;n||=wP(this,e);let r=GN(e.text,t,n);return this.bidiCache.push(new EL(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||RM.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_N(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return lP.of(new cP(typeof e==`number`?$A.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return lP.of(new cP($A.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return hP.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return hP.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=_M.newName(),r=[cL.of(n),DP.of(mL(`.${n}`,e))];return t&&t.dark&&r.push(lL.of(!0)),r}static baseTheme(e){return fj.lowest(DP.of(mL(`.`+uL,e,pL)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&jP.get(t)||jP.get(e))?.root?.view||null}};CL.styleModule=DP,CL.inputHandler=tP,CL.clipboardInputFilter=rP,CL.clipboardOutputFilter=iP,CL.scrollHandler=sP,CL.focusChangeEffect=nP,CL.perLineTextDirection=aP,CL.exceptionSink=$N,CL.updateListener=eP,CL.editable=fP,CL.mouseSelectionStyle=QN,CL.dragMovesSelection=ZN,CL.clickAddsSelectionRange=XN,CL.decorations=yP,CL.blockWrappers=bP,CL.outerDecorations=xP,CL.atomicRanges=SP,CL.bidiIsolatedRanges=CP,CL.cursorScrollMargin=nj.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),CL.scrollMargins=TP,CL.darkTheme=lL,CL.cspNonce=nj.define({combine:e=>e.length?e[0]:``}),CL.contentAttributes=vP,CL.editorAttributes=_P,CL.lineWrapping=CL.contentAttributes.of({class:`cm-lineWrapping`}),CL.announce=Aj.define();var wL=4096,TL={},EL=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:DN.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function DL(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&zM(a,n)}return n}var OL=RM.mac?`mac`:RM.windows?`win`:RM.linux?`linux`:`key`;function kL(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function AL(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var jL=fj.default(CL.domEventHandlers({keydown(e,t){return zL(PL(t.state),e,t,`editor`)}})),ML=nj.define({enables:jL}),NL=new WeakMap;function PL(e){let t=e.facet(ML),n=NL.get(t);return n||NL.set(t,n=LL(t.reduce((e,t)=>e.concat(t),[]))),n}var FL=null,IL=4e3;function LL(e,t=OL){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>kL(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=FL={view:t,prefix:n,scope:e};return setTimeout(()=>{FL==r&&(FL=null)},IL),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,RL))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var RL=null;function zL(e,t,n,r){RL=t;let i=EM(t),a=VA(BA(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;FL&&FL.view==n&&FL.scope==r&&(o=FL.prefix+` `,YF.indexOf(t.keyCode)<0&&(c=!0,FL=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+AL(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(RM.windows&&t.ctrlKey&&t.altKey)&&!(RM.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=bM[t.keyCode])&&p!=i?(d(f[o+AL(p,t,!0)])||t.shiftKey&&(m=xM[t.keyCode])!=i&&m!=p&&d(f[o+AL(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+AL(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),RL=null,s}/x/.unicode;var BL=class extends GM{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?iN(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=uN(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function VL(e){let t=hP.fromClass(class{constructor(t){this.view=t,this.placeholder=e?qM.set([qM.widget({widget:new BL(e),side:1}).range(0)]):qM.none}get decorations(){return this.view.state.doc.length?qM.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,CL.contentAttributes.of({"aria-placeholder":e})]:t}var HL=`-10000px`,UL=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function WL(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var GL=nj.define({combine:e=>({position:RM.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||WL})}),KL=new WeakMap,qL=hP.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(GL);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new UL(e,ZL,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(GL);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=HL,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(RM.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=EP(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(GL).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=HL;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=KL.get(c)??d.bottom-d.top,g=c.offset||XL,_=this.view.textDirection==DN.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=HL;continue}KL.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,JL(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,JL(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=HL}},{eventObservers:{scroll(){this.maybeMeasure()}}});function JL(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var YL=CL.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),XL={x:0,y:0},ZL=nj.define({enables:[qL,YL]});function QL(e,t){let n=e.plugin(qL);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var $L=class extends qj{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};$L.prototype.elementClass=``,$L.prototype.toDOM=void 0,$L.prototype.mapMode=UA.TrackBefore,$L.prototype.startSide=$L.prototype.endSide=-1,$L.prototype.point=!0;var eR=1024,tR=0,nR=class{constructor(e,t){this.from=e,this.to=t}},rR=class{constructor(e={}){this.id=tR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=oR.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};rR.closedBy=new rR({deserialize:e=>e.split(` `)}),rR.openedBy=new rR({deserialize:e=>e.split(` `)}),rR.group=new rR({deserialize:e=>e.split(` `)}),rR.isolate=new rR({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),rR.contextHash=new rR({perNode:!0}),rR.lookAhead=new rR({perNode:!0}),rR.mounted=new rR({perNode:!0});var iR=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[rR.mounted.id]}},aR=Object.create(null),oR=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):aR,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(rR.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(rR.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};oR.none=new oR(``,Object.create(null),0,8);var sR=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new oR(e.name,r,e.id,e.flags):e)}return new e(n)}},cR=new WeakMap,lR=new WeakMap,uR;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(uR||={});var dR=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=iR.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new TR(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new TR(cR.get(this)||this.topNode);return r.moveTo(e,t),cR.set(this,r._tree),r}get topNode(){return new _R(this,0,0,null)}resolve(e,t=0){let n=hR(cR.get(this)||this.topNode,e,t,!1);return cR.set(this,n),n}resolveInner(e,t=0){let n=hR(lR.get(this)||this.topNode,e,t,!0);return lR.set(this,n),n}resolveStack(e,t=0){return wR(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&uR.IncludeAnonymous)>0;for(let e=this.cursor(a|uR.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:AR(oR.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(oR.none,t,n,r)))}static build(e){return DR(e)}};dR.empty=new dR(oR.none,[],[],0);var fR=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},pR=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return oR.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(mR(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function mR(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function hR(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof _R&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:uR.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof _R&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var gR=class{cursor(e=0){return new TR(this,e)}getChild(e,t=null,n=null){let r=vR(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return vR(this,e,t,n)}resolve(e,t=0){return hR(this,e,t,!1)}resolveInner(e,t=0){return hR(this,e,t,!0)}matchContext(e){return yR(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},_R=class e extends gR{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&uR.EnterBracketed&&l instanceof dR&&(d=iR.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!mR(i,r,u,u+l.length))){if(l instanceof pR){if(a&uR.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new xR(new bR(o,l,t,u),null,e)}else if(a&uR.IncludeAnonymous||!l.type.isAnonymous||ER(l)){let s;if(!(a&uR.IgnoreMounts)&&(s=iR.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&uR.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&uR.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&uR.IgnoreOverlays)&&(i=iR.get(this._tree))&&i.overlay){let a=t-this.from,o=r&uR.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function vR(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function yR(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var bR=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},xR=class e extends gR{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&uR.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new dR(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function SR(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof _R&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new CR(i,n)}var CR=class{constructor(e,t){this.heads=e,this.node=t}get next(){return SR(this.heads)}};function wR(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof _R?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=iR.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new _R(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(hR(o,t,n,!1))}}return i?SR(i):r}var TR=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~uR.EnterBracketed,e instanceof _R)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof _R?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&uR.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&uR.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&uR.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&uR.IncludeAnonymous||e instanceof pR||!e.type.isAnonymous||ER(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new xR(this.buffer,t,this.stack[e]);return this.bufferNode=new xR(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return yR(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return yR(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function ER(e){return e.children.some(e=>e instanceof pR||!e.type.isAnonymous||ER(e))}function DR(e){let{buffer:t,nodeSet:n,maxBufferLength:r=eR,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new fR(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:ee,size:C}=o,te=l,ne=c;if(C<0)if(o.next(),C==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(C==-3){c=x;return}else if(C==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${C}`);let re=s[x],ie,ae,oe=S-e;if(ee-S<=r&&(ae=h(o.pos-t,y))){let t=new Uint16Array(ae.size-ae.skip),r=o.pos-ae.size,i=t.length;for(;o.pos>r;)i=g(ae.start,t,i);ie=new pR(t,ee-ae.start,n),oe=ae.start-e}else{let e=o.pos-C;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=ee;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,te,ne),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,te,ne),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(re,ne);ie=AR(re,t,n,0,t.length,0,ee-S,e,e)}else ie=m(re,t,n,ee-S,te-ee,ne)}_.push(ie),v.push(oe)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new pR(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof dR){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(rR.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[rR.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[rR.lookAhead,i];o=o?[e].concat(o):[e]}return new dR(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new dR(s[e.topID],_.reverse(),v.reverse(),y)}var OR=new WeakMap;function kR(e,t){if(!e.isAnonymous||t instanceof pR||t.type!=e)return 1;let n=OR.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof dR)){n=1;break}n+=kR(e,r)}OR.set(t,n)}return n}function AR(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=kR(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=kR(e,t[s]);for(s++;s<i;s++){let n=kR(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(AR(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var jR=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof xR?this.setBuffer(e.context.buffer,e.index,t):e instanceof _R&&this.map.set(e.tree,t)}get(e){return e instanceof xR?this.getBuffer(e.context.buffer,e.index):e instanceof _R?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},MR=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},NR=class{startParse(e,t,n){return typeof e==`string`&&(e=new PR(e)),n=n?n.length?n.map(e=>new nR(e.from,e.to)):[new nR(0,0)]:[new nR(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},PR=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function FR(e){return(t,n,r,i)=>new BR(t,e,n,r,i)}var IR=class{constructor(e,t,n,r,i,a){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=i,this.from=a}};function LR(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError(`Invalid inner parse ranges given: `+JSON.stringify(e))}var RR=class{constructor(e,t,n,r,i,a,o,s){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.bracketed=a,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}},zR=new rR({perNode:!0}),BR=class{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),this.stoppedAt!=null)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return this.stoppedAt!=null&&(e=new dR(e.type,e.children,e.positions,e.length,e.propValues.concat([[zR,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[rR.mounted.id]=new iR(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new GR(this.fragments),t=null,n=null,r=new TR(new _R(this.baseTree,this.ranges[0].from,0,null),uR.IncludeAnonymous|uR.IgnoreMounts);scan:for(let i,a;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let e=t.mounts.find(e=>e.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let i=n.from+e.pos,a=n.to+e.pos;i>=r.from&&a<=r.to&&!t.ranges.some(e=>e.from<a&&e.to>i)&&t.ranges.push({from:i,to:a})}}o=!1}else if(n&&(a=VR(n.ranges,r.from,r.to)))o=a!=2;else if(!r.type.isAnonymous&&(i=this.nest(r,this.input))&&(r.from<r.to||!i.overlay)){r.tree||(UR(r),t&&t.depth++,n&&n.depth++);let a=e.findMounts(r.from,i.parser);if(typeof i.overlay==`function`)t=new RR(i.parser,i.overlay,a,this.inner.length,r.from,!!i.bracketed,r.tree,t);else{let e=KR(this.ranges,i.overlay||(r.from<r.to?[new nR(r.from,r.to)]:[]));e.length&&LR(e),(e.length||!i.overlay)&&this.inner.push(new IR(i.parser,e.length?i.parser.startParse(this.input,JR(a,e),e):i.parser.startParse(``),i.overlay?i.overlay.map(e=>new nR(e.from-r.from,e.to-r.from)):null,!!i.bracketed,r.tree,e.length?e[0].from:r.from)),i.overlay?e.length&&(n={ranges:e,depth:0,prev:n}):o=!1}}else if(t&&(s=t.predicate(r))&&(s===!0&&(s=new nR(r.from,r.to)),s.from<s.to)){let e=t.ranges.length-1;e>=0&&t.ranges[e].to==s.from?t.ranges[e]={from:t.ranges[e].from,to:s.to}:t.ranges.push(s)}if(o&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break scan;if(t&&!--t.depth){let e=KR(this.ranges,t.ranges);e.length&&(LR(e),this.inner.splice(t.index,0,new IR(t.parser,t.parser.startParse(this.input,JR(t.mounts,e),e),t.ranges.map(e=>new nR(e.from-t.start,e.to-t.start)),t.bracketed,t.target,e[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function VR(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function HR(e,t,n,r,i,a){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-a)}}function UR(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,a=i.children.indexOf(r),o=i.children[a],s=o.buffer,c=[a];function l(e,r,i,a,u,d){let f=n[d],p=[],m=[];HR(o,e,f,p,m,a);let h=s[f+1],g=s[f+2];c.push(p.length);let _=d?l(f+4,s[f+3],o.set.types[s[f]],h,g-h,d-1):t.toTree();return p.push(_),m.push(h-a),HR(o,s[f+3],r,p,m,a),new dR(i,p,m,u)}i.children[a]=l(0,s.length,oR.none,0,o.length,n.length-1);for(let t of c){let n=e.tree.children[t],r=e.tree.positions[t];e.yield(new _R(n,r+e.from,t,e._tree))}}var WR=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(uR.IncludeAnonymous|uR.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=e&&t.enter(n,1,uR.IgnoreOverlays|uR.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof dR)t=t.children[0];else break}return!1}},GR=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=t.tree.prop(zR)??t.to,this.inner=new WR(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=e.tree.prop(zR)??e.to,this.inner=new WR(e.tree,-e.offset)}}findMounts(e,t){let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=e.tree?.prop(rR.mounted);if(r&&r.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let i=this.fragments[t];if(i.from>=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}};function KR(e,t){let n=null,r=t;for(let i=1,a=0;i<e.length;i++){let o=e[i-1].to,s=e[i].from;for(;a<r.length;a++){let e=r[a];if(e.from>=s)break;e.to<=o||(n||(r=n=t.slice()),e.from<o?(n[a]=new nR(e.from,o),e.to>s&&n.splice(a+1,0,new nR(s,e.to))):e.to>s?n[a--]=new nR(s,e.to):n.splice(a--,1))}}return r}function qR(e,t,n,r){let i=0,a=0,o=!1,s=!1,c=-1e9,l=[];for(;;){let u=i==e.length?1e9:o?e[i].to:e[i].from,d=a==t.length?1e9:s?t[a].to:t[a].from;if(o!=s){let e=Math.max(c,n),t=Math.min(u,d,r);e<t&&l.push(new nR(e,t))}if(c=Math.min(u,d),c==1e9)break;u==c&&(o?(o=!1,i++):o=!0),d==c&&(s?(s=!1,a++):s=!0)}return l}function JR(e,t){let n=[];for(let{pos:r,mount:i,frag:a}of e){let e=r+(i.overlay?i.overlay[0].from:0),o=e+i.tree.length,s=Math.max(a.from,e),c=Math.min(a.to,o);if(i.overlay){let o=qR(t,i.overlay.map(e=>new nR(e.from+r,e.to+r)),s,c);for(let t=0,r=s;;t++){let s=t==o.length,l=s?c:o[t].from;if(l>r&&n.push(new MR(r,l,i.tree,-e,a.from>=r||a.openStart,a.to<=l||a.openEnd)),s)break;r=o[t].to}}else n.push(new MR(s,c,i.tree,-e,a.from>=e||a.openStart,a.to<=o||a.openEnd))}return n}var YR=0,XR=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=YR++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new QR(e);return e=>e.modified.indexOf(t)>-1?e:QR.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},ZR=0,QR=class e{constructor(e){this.name=e,this.instances=[],this.id=ZR++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&$R(n,e.modified));if(r)return r;let i=[],a=new XR(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=ez(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function $R(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function ez(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function tz(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new rz(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return nz.add(t)}var nz=new rR({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new rz(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),rz=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};rz.empty=new rz([],2,null);function iz(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}var az=XR.define,oz=az(),sz=az(),cz=az(sz),lz=az(sz),uz=az(),dz=az(uz),fz=az(uz),pz=az(),mz=az(pz),hz=az(),gz=az(),_z=az(),vz=az(_z),yz=az(),$={comment:oz,lineComment:az(oz),blockComment:az(oz),docComment:az(oz),name:sz,variableName:az(sz),typeName:cz,tagName:az(cz),propertyName:lz,attributeName:az(lz),className:az(sz),labelName:az(sz),namespace:az(sz),macroName:az(sz),literal:uz,string:dz,docString:az(dz),character:az(dz),attributeValue:az(dz),number:fz,integer:az(fz),float:az(fz),bool:az(uz),regexp:az(uz),escape:az(uz),color:az(uz),url:az(uz),keyword:hz,self:az(hz),null:az(hz),atom:az(hz),unit:az(hz),modifier:az(hz),operatorKeyword:az(hz),controlKeyword:az(hz),definitionKeyword:az(hz),moduleKeyword:az(hz),operator:gz,derefOperator:az(gz),arithmeticOperator:az(gz),logicOperator:az(gz),bitwiseOperator:az(gz),compareOperator:az(gz),updateOperator:az(gz),definitionOperator:az(gz),typeOperator:az(gz),controlOperator:az(gz),punctuation:_z,separator:az(_z),bracket:vz,angleBracket:az(vz),squareBracket:az(vz),paren:az(vz),brace:az(vz),content:pz,heading:mz,heading1:az(mz),heading2:az(mz),heading3:az(mz),heading4:az(mz),heading5:az(mz),heading6:az(mz),contentSeparator:az(pz),list:az(pz),quote:az(pz),emphasis:az(pz),strong:az(pz),link:az(pz),monospace:az(pz),strikethrough:az(pz),inserted:az(),deleted:az(),changed:az(),invalid:az(),meta:yz,documentMeta:az(yz),annotation:az(yz),processingInstruction:az(yz),definition:XR.defineModifier(`definition`),constant:XR.defineModifier(`constant`),function:XR.defineModifier(`function`),standard:XR.defineModifier(`standard`),local:XR.defineModifier(`local`),special:XR.defineModifier(`special`)};for(let e in $){let t=$[e];t instanceof XR&&(t.name=e)}iz([{tag:$.link,class:`tok-link`},{tag:$.heading,class:`tok-heading`},{tag:$.emphasis,class:`tok-emphasis`},{tag:$.strong,class:`tok-strong`},{tag:$.keyword,class:`tok-keyword`},{tag:$.atom,class:`tok-atom`},{tag:$.bool,class:`tok-bool`},{tag:$.url,class:`tok-url`},{tag:$.labelName,class:`tok-labelName`},{tag:$.inserted,class:`tok-inserted`},{tag:$.deleted,class:`tok-deleted`},{tag:$.literal,class:`tok-literal`},{tag:$.string,class:`tok-string`},{tag:$.number,class:`tok-number`},{tag:[$.regexp,$.escape,$.special($.string)],class:`tok-string2`},{tag:$.variableName,class:`tok-variableName`},{tag:$.local($.variableName),class:`tok-variableName tok-local`},{tag:$.definition($.variableName),class:`tok-variableName tok-definition`},{tag:$.special($.variableName),class:`tok-variableName2`},{tag:$.definition($.propertyName),class:`tok-propertyName tok-definition`},{tag:$.typeName,class:`tok-typeName`},{tag:$.namespace,class:`tok-namespace`},{tag:$.className,class:`tok-className`},{tag:$.macroName,class:`tok-macroName`},{tag:$.propertyName,class:`tok-propertyName`},{tag:$.operator,class:`tok-operator`},{tag:$.comment,class:`tok-comment`},{tag:$.meta,class:`tok-meta`},{tag:$.invalid,class:`tok-invalid`},{tag:$.punctuation,class:`tok-punctuation`}]);var bz=new rR;function xz(e){return nj.define({combine:e?t=>t.concat(e):void 0})}var Sz=new rR,Cz=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,Gj.prototype.hasOwnProperty(`tree`)||Object.defineProperty(Gj.prototype,"tree",{get(){return Ez(this)}}),this.parser=t,this.extension=[Fz.of(this),Gj.languageData.of((e,t,n)=>{let r=wz(e,t,n),i=r.type.prop(bz);if(!i)return[];let a=e.facet(i),o=r.type.prop(Sz);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return wz(e,t,n).type.prop(bz)==this.data}findRegions(e){let t=e.facet(Fz);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(bz)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(rR.mounted);if(i){if(i.tree.prop(bz)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof dR&&r(i,e.positions[n]+t)}};return r(Ez(e),0),n}get allowsNesting(){return!0}};Cz.setState=Aj.define();function wz(e,t,n){let r=e.facet(Fz),i=Ez(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,uR.ExcludeBuffers|uR.EnterBracketed))e.type.isTop&&(i=e);return i}var Tz=class e extends Cz{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=xz(t.languageData);return new e(n,t.parser.configure({props:[bz.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function Ez(e){let t=e.field(Cz.state,!1);return t?t.tree:dR.empty}var Dz=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},Oz=null,kz=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],dR.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Dz(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=dR.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(MR.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(MR.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Oz;Oz=this;try{return e()}finally{Oz=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Az(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=MR.applyChanges(r,e),i=dR.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=Az(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends NR{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=Oz;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new dR(oR.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Oz}};function Az(e,t,n){return MR.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var jz=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=kz.create(t.facet(Fz).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};Cz.state=lj.define({create:jz.init,update(e,t){for(let e of t.effects)if(e.is(Cz.setState))return e.value;return t.startState.facet(Fz)==t.state.facet(Fz)?e.apply(t):jz.init(t.state)}});var Mz=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(Mz=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var Nz=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,Pz=hP.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Cz.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Cz.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Mz(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(Cz.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Nz?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>Nz&&Nz()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Cz.setState.of(new jz(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>dP(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Fz=nj.define({combine(e){return e.length?e[0]:null},enables:e=>[Cz.state,Pz,CL.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),Iz=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},Lz=class e{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e})}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw RangeError(`Must pass either 'load' or 'support' to LanguageDescription.of`);n=()=>Promise.resolve(r)}return new e(t.name,(t.alias||[]).concat(t.name).map(e=>e.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}},Rz=nj.define(),zz=nj.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function Bz(e){let t=e.facet(zz);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Vz(e,t){let n=``,r=e.tabSize,i=e.facet(zz)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function Hz(e,t){e instanceof Gj&&(e=new Uz(e));for(let n of e.state.facet(Rz)){let r=n(e,t);if(r!==void 0)return r}let n=Ez(e.state);return n.length>=t?Gz(e,n,t):null}var Uz=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Bz(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return dM(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},Wz=new rR;function Gz(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return Kz(r,e,n)}function Kz(e,t,n){for(let r=e;r;r=r.next){let e=Jz(r.node);if(e)return e(Xz.create(t,n,r))}return 0}function qz(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Jz(e){let t=e.type.prop(Wz);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(rR.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>eB(e,!0,1,void 0,n&&!qz(e)?t.from:void 0)}return e.parent==null?Yz:null}function Yz(){return 0}var Xz=class e extends Uz{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Zz(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Kz(this.context.next,this.base,this.pos)}};function Zz(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Qz(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function $z({closing:e,align:t=!0,units:n=1}){return r=>eB(r,t,n,e)}function eB(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?Qz(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}var tB=e=>e.baseIndent;function nB({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var rB=nj.define(),iB=new rR;function aB(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}$.meta,$.link,$.heading,$.emphasis,$.strong,$.strikethrough,$.keyword,$.atom,$.bool,$.url,$.contentSeparator,$.labelName,$.literal,$.inserted,$.string,$.deleted,$.regexp,$.escape,$.string,$.variableName,$.variableName,$.typeName,$.namespace,$.className,$.variableName,$.macroName,$.propertyName,$.comment,$.invalid;var oB=1e4,sB=`()[]{}`,cB=new rR;function lB(e,t,n){let r=e.prop(t<0?rR.openedBy:rR.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function uB(e){let t=e.type.prop(cB);return t?t(e.node):e}function dB(e,t,n,r={}){let i=r.maxScanDistance||oB,a=r.brackets||sB,o=Ez(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=lB(r.type,n,a);if(i&&r.from<r.to){let o=uB(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return fB(e,t,n,r,o,i,a)}}return pB(e,t,n,o,s.type,i,a)}function fB(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=uB(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(lB(u.type,n,o))l++;else if(lB(u.type,-n,o)){if(l==0){let e=uB(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function pB(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var mB=Object.create(null),hB=[oR.none],gB=[],_B=Object.create(null),vB=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])vB[e]=bB(mB,t);function yB(e,t){gB.indexOf(e)>-1||(gB.push(e),console.warn(t))}function bB(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||$[n];r?typeof r==`function`?t.length?t=t.map(r):yB(n,`Modifier ${n} used at start of tag`):t.length?yB(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:yB(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=_B[i];if(a)return a.id;let o=_B[i]=oR.define({id:hB.length,name:r,props:[tz({[r]:n})]});return hB.push(o),o.id}DN.RTL,DN.LTR;var xB=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Ez(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(OB(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function SB(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function CB(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=SB(t)+SB(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function wB(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:CB(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function TB(e,t){return n=>{for(let t=Ez(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var EB=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function DB(e){return e.selection.main.from}function OB(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var kB=Dj.define();function AB(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:$A.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var jB=new WeakMap;function MB(e){if(!Array.isArray(e))return e;let t=jB.get(e);return t||jB.set(e,t=wB(e)),t}var NB=Aj.define(),PB=Aj.define(),FB=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=BA(e,t),r=VA(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(BA(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=BA(e,0),i=VA(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=BA(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=VA(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=BA(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=cde(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=VA(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?VA(BA(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},IB=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},LB=nj.define({combine(e){return Kj(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:zB,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>RB(e(n),t(n)),optionClass:(e,t)=>n=>RB(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function RB(e,t){return e?t?e+` `+t:e:t}function zB(e,t,n,r,i,a){let o=e.textDirection==DN.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var BB=Aj.define();function VB(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function HB(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var UB=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(LB);this.optionContent=VB(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=HB(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:BB.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(LB).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:PB.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=HB(r.length,i,e.state.facet(LB).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=HB(t.options.length,t.selected,this.view.state.facet(LB).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>dP(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&GB(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(LB).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function WB(e,t){return n=>new UB(n,e,t)}function GB(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function KB(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function qB(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(LB);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new EB(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new IB(n):new FB(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new EB(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):KB(e.completion)>KB(c)&&(s[s.length-1]=e),c=e.completion}return s}var JB=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,$B(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=qB(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(LB).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,$B(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:cV,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},YB=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(eV,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(LB),i=(r.override||n.languageDataAt(`autocomplete`,DB(n)).map(MB)).map(e=>(this.active.find(t=>t.source==e)||new nV(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(aV));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!XB(i,this.active)||o?a=JB.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new nV(e.source,0):e));for(let e of t.effects)e.is(BB)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ZB:QB}};function XB(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var ZB={"aria-autocomplete":`list`},QB={};function $B(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var eV=[];function tV(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(kB);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var nV=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=tV(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(NB))i=new e(i.source,1,n.value);else if(n.is(PB))i=new e(i.source,0);else if(n.is(aV))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(DB(e.state))}},rV=class e extends nV{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=DB(t.state);if(o>a||!r||n&2&&(DB(t.startState)==this.from||o<this.limit))return new nV(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return iV(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new xB(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??DB(t.state)):new nV(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new nV(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function iV(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):OB(e,!0).test(i)}var aV=Aj.define({map(e,t){return e.map(e=>e.map(t))}}),oV=lj.define({create(){return YB.start()},update(e,t){return e.update(t)},provide:e=>[ZL.from(e,e=>e.tooltip),CL.contentAttributes.from(e,e=>e.attrs)]});function sV(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(oV).active.find(e=>e.source==t.source);return r instanceof rV?(typeof n==`string`?e.dispatch({...AB(e.state,n,r.from,r.to),annotations:kB.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var cV=WB(oV,sV);function lV(e,t=`option`){return n=>{let r=n.state.field(oV,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(LB).interactionDelay)return!1;let i=1,a;t==`page`&&(a=QL(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:BB.of(s)}),!0}}var uV=e=>{let t=e.state.field(oV,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(LB).interactionDelay?!1:sV(e,t.open.options[t.open.selected])},dV=e=>e.state.field(oV,!1)?(e.dispatch({effects:NB.of(!0)}),!0):!1,fV=e=>{let t=e.state.field(oV,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:PB.of(null)}),!0)},pV=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},mV=50,hV=1e3,gV=hP.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(oV).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(oV),n=e.state.facet(LB);if(!e.selectionSet&&!e.docChanged&&e.startState.field(oV)==t)return;let r=e.transactions.some(e=>{let t=tV(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>mV&&Date.now()-n.time>hV){for(let e of n.context.abortListeners)try{e()}catch(e){dP(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(NB)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(oV);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(LB).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new xB(t,DB(t),e.explicit,this.view),r=new pV(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:PB.of(null)}),dP(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(LB).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(LB),n=this.view.state.field(oV);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=DB(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new rV(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new nV(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:aV.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(oV,!1);if(t&&t.tooltip&&this.view.state.facet(LB).closeOnBlur){let n=t.open&&QL(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:PB.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:NB.of(!1)}),20),this.composing=0}}}),_V=typeof navigator==`object`&&/Win/.test(navigator.platform),vV=fj.highest(CL.domEventHandlers({keydown(e,t){let n=t.state.field(oV,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(_V&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&sV(t,r),!1}})),yV=CL.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),bV=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},xV=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,UA.TrackDel),r=t.mapPos(this.to,1,UA.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},SV=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(zz);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new xV(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new bV(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},CV=qM.widget({widget:new class extends GM{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),wV=qM.mark({class:`cm-snippetField`}),TV=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=qM.set(e.map(e=>(e.from==e.to?CV:wV).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},EV=Aj.define({map(e,t){return e&&e.map(t)}}),DV=Aj.define(),OV=lj.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(EV))return n.value;if(n.is(DV)&&e)return new TV(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>CL.decorations.from(e,e=>e?e.deco:qM.none)});function kV(e,t){return $A.create(e.filter(e=>e.field==t).map(e=>$A.range(e.from,e.to)))}function AV(e){let t=SV.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:AA.of(a)},scrollIntoView:!0,annotations:n?[kB.of(n),jj.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=kV(o,0)),o.some(e=>e.field>0)){let t=new TV(o,0),n=c.effects=[EV.of(t)];e.state.field(OV,!1)===void 0&&n.push(Aj.appendConfig.of([OV,PV,IV,yV]))}e.dispatch(e.state.update(c))}}function jV(e){return({state:t,dispatch:n})=>{let r=t.field(OV,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:kV(r.ranges,i),effects:EV.of(a?null:new TV(r.ranges,i)),scrollIntoView:!0})),!0}}var MV=[{key:`Tab`,run:jV(1),shift:jV(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(OV,!1)?(t(e.update({effects:EV.of(null)})),!0):!1}],NV=nj.define({combine(e){return e.length?e[0]:MV}}),PV=fj.highest(ML.compute([NV],e=>e.facet(NV)));function FV(e,t){return{...t,apply:AV(e)}}var IV=CL.domEventHandlers({mousedown(e,t){let n=t.state.field(OV,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:kV(n.ranges,i.field),effects:EV.of(n.ranges.some(e=>e.field>i.field)?new TV(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),LV=new class extends qj{};LV.startSide=1,LV.endSide=-1,typeof navigator==`object`&&navigator.userAgent;function RV(e={}){return[vV,oV,LB.of(e),gV,BV,yV]}var zV=[{key:`Ctrl-Space`,run:dV},{mac:"Alt-`",run:dV},{mac:`Alt-i`,run:dV},{key:`Escape`,run:fV},{key:`ArrowDown`,run:lV(!0)},{key:`ArrowUp`,run:lV(!1)},{key:`PageDown`,run:lV(!0,`page`)},{key:`PageUp`,run:lV(!1,`page`)},{key:`Enter`,run:uV}],BV=fj.highest(ML.computeN([LB],e=>e.facet(LB).defaultKeymap?[zV]:[]));function VV(e){let t=e.field(oV,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}var HV=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[rR.contextHash,r]]}addChild(e,t){e.prop(rR.contextHash)!=this.hash&&(e=new dR(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new dR(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new dR(oR.none,e,t,n,this.hashProp)})}},UV;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(UV||={});var WV=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},GV=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return YV(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function KV(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==UV.OrderedList?nH:tH)(n,t,!1);return r>0&&(e.type!=UV.BulletList||$V(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var qV={[UV.Blockquote](e,t,n){return n.next==62?(n.markers.push(AH(UV.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(JV(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[UV.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[UV.OrderedList]:KV,[UV.BulletList]:KV,[UV.Document](){return!0}};function JV(e){return e==32||e==9||e==10||e==13}function YV(e,t=0){for(;t<e.length&&JV(e.charCodeAt(t));)t++;return t}function XV(e,t,n){for(;t>n&&JV(e.charCodeAt(t-1));)t--;return t}function ZV(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function QV(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function $V(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!JV(n))return-1}return n&&e.next==45&&iH(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(gH.SetextHeading)>-1||r<3?-1:1}function eH(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function tH(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||JV(e.text.charCodeAt(e.pos+1)))&&(!n||eH(t,UV.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function nH(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!JV(e.text.charCodeAt(r+1))||n&&!eH(t,UV.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function rH(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function iH(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&JV(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var aH=/^[ \t]*$/,oH=/-->/,sH=/\?>/,cH=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,oH],[/^\s*<\?/,sH],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,aH],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,aH]];function lH(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=cH.length-+!!n;e<t;e++)if(cH[e][0].test(r))return e;return-1}function uH(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function dH(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==UV.CodeText?e[r].to=n:e.push(AH(UV.CodeText,t,n))}var fH={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(dH(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){dH(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==UV.CodeText?dH(o,e.from,e.to):o.push(e);s=[]}dH(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&dH(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=UV.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(UV.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ZV(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=XV(t.text,t.text.length,o),c=[AH(UV.CodeMark,r,r+a)];o<s&&c.push(AH(UV.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&dH(c,e.lineStart-1,e.lineStart),c.push(AH(UV.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(dH(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(dH(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(UV.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=QV(t);return n<0?!1:(e.startContext(UV.Blockquote,t.pos),e.addNode(UV.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if($V(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(UV.HorizontalRule,n),!0},BulletList(e,t){let n=tH(t,e,!1);if(n<0)return!1;e.block.type!=UV.BulletList&&e.startContext(UV.BulletList,t.basePos,t.next);let r=uH(t,t.pos+1);return e.startContext(UV.ListItem,t.basePos,r-t.baseIndent),e.addNode(UV.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=nH(t,e,!1);if(n<0)return!1;e.block.type!=UV.OrderedList&&e.startContext(UV.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=uH(t,t.pos+n);return e.startContext(UV.ListItem,t.basePos,r-t.baseIndent),e.addNode(UV.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=rH(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=XV(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!JV(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(UV.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(UV.HeaderMark,o-r,a-r);let c=s.finish(UV.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=lH(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=cH[n][1],a=[],o=i!=aH;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==oH?UV.CommentBlock:i==sH?UV.ProcessingInstructionBlock:UV.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},pH=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
50
|
-
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&YV(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,AH(UV.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(HH(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(AH(UV.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(BH(e,YV(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=YV(e,this.pos),n=0;if(t>this.pos){let r=VH(e,t,this.start);if(r){let t=mH(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=mH(e,this.pos),n>0&&n<e.length?n:-1}else return mH(e,this.pos)}};function mH(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!JV(n))return-1}return t}var hH=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:iH(t),i=t.next;if(r<0)return!1;let a=AH(UV.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,AH(i==61?UV.SetextHeading1:UV.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},gH={LinkReference(e,t){return t.content.charCodeAt(0)==91?new pH(t):null},SetextHeading(){return new hH}},_H=[(e,t)=>rH(t)>=0,(e,t)=>ZV(t)>=0,(e,t)=>QV(t)>=0,(e,t)=>tH(t,e,!0)>=0,(e,t)=>nH(t,e,!0)>=0,(e,t)=>$V(t,e,!0)>=0,(e,t)=>lH(t,e,!0)>=0],vH={text:``,end:0},yH=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new GV,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=HV.create(UV.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new KH(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new WV(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
51
|
-
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=qH(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=vH;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+UV[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
52
|
-
`?``:t;else{let e=t.indexOf(`
|
|
53
|
-
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=HV.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new dR(this.parser.nodeSet.types[e],EH,EH,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(WH(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?bH(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=WH(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(UV.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?AH(this.parser.getNodeType(e),t,n,r):new kH(e,t)}get buffer(){return new DH(this.parser.nodeSet)}};function bH(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=bH(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new dR(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var xH=class e extends NR{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new yH(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=CH(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(SH(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=UV.ATXHeading1&&c<=UV.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(oR.define({id:c,name:n,props:l&&[[rR.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof XR?t[n]=s:Object.assign(t,s))}r=new sR(e),t&&(r=r.extend(tz(t)))}if(SH(n.props)&&(r=r.extend(...n.props)),SH(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(SH(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?wH(s,e.before):e.after?wH(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(SH(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?wH(l,e.before):e.after?wH(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new UH(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function SH(e){return e!=null&&e.length>0}function CH(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=CH(e[0]);if(e.length==1)return t;let n=CH(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||EH).concat(t||EH),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function wH(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var TH=[oR.none];for(let e=1,t;t=UV[e];e++)TH[e]=oR.define({id:e,name:t,props:e>=UV.Escape?[]:[[rR.group,e in qV?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var EH=[],DH=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return dR.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},OH=class{constructor(e,t,n,r=EH){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new DH(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},kH=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return EH}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function AH(e,t,n,r){return new OH(e,t,n,r)}var jH={resolve:`Emphasis`,mark:`EmphasisMark`},MH={resolve:`Emphasis`,mark:`EmphasisMark`},NH={},PH={},FH=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},IH=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,LH=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{LH=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var RH={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(IH.charCodeAt(t)==r)return e.append(AH(UV.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(AH(UV.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(AH(UV.InlineCode,n,r+1,[AH(UV.CodeMark,n,n+i),AH(UV.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(AH(UV.Autolink,n,n+1+i[0].length,[AH(UV.LinkMark,n,n+1),AH(UV.URL,n+1,n+i[0].length),AH(UV.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(AH(UV.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(AH(UV.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(AH(UV.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=LH.test(i),s=LH.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new FH(t==95?jH:MH,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(AH(UV.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(AH(UV.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new FH(NH,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new FH(PH,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof FH&&(r.type==NH||r.type==PH)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=zH(e,i,r.type==NH?UV.Link:UV.Image,r.from,n+1);if(r.type==NH)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof FH&&t.type==NH&&(t.side=0)}return a.to}}return-1}};function zH(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(AH(UV.LinkMark,r,r+(n==UV.Image?2:1))),t.push(AH(UV.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=BH(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=VH(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(AH(UV.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(AH(UV.LinkMark,n,s)))}else if(o==91){let n=HH(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return AH(n,r,s,t)}function BH(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return AH(UV.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(JV(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?AH(UV.URL,t+n,i+n):i==e.length?null:!1}}function VH(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return AH(UV.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function HH(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:AH(UV.LinkLabel,t+n,a+1+n);else{if(r&&!JV(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var UH=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new FH(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof FH&&(t.type==NH||t.type==PH))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof FH&&n.type.resolve&&n.side&2))continue;let r=n.type==jH||n.type==MH,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof FH&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof OH&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new FH(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new FH(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof OH&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof FH&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof FH?t:null}skipSpace(e){return YV(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?AH(this.parser.getNodeType(e),t,n,r):new kH(e,t)}};UH.linkStart=NH,UH.imageStart=PH;function WH(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof OH&&(n[r]=new OH(t.type,t.from,t.to,WH(t.children,[e])))}else n.splice(r++,0,e)}return n}var GH=[UV.CodeBlock,UV.ListItem,UV.OrderedList,UV.BulletList],KH=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
54
|
-
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(rR.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=qH(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new dR(e.parser.nodeSet.types[UV.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(GH.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function qH(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var JH=tz({"Blockquote/...":$.quote,HorizontalRule:$.contentSeparator,"ATXHeading1/... SetextHeading1/...":$.heading1,"ATXHeading2/... SetextHeading2/...":$.heading2,"ATXHeading3/...":$.heading3,"ATXHeading4/...":$.heading4,"ATXHeading5/...":$.heading5,"ATXHeading6/...":$.heading6,"Comment CommentBlock":$.comment,Escape:$.escape,Entity:$.character,"Emphasis/...":$.emphasis,"StrongEmphasis/...":$.strong,"Link/... Image/...":$.link,"OrderedList/... BulletList/...":$.list,"BlockQuote/...":$.quote,"InlineCode CodeText":$.monospace,"URL Autolink":$.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":$.processingInstruction,"CodeInfo LinkLabel":$.labelName,LinkTitle:$.string,Paragraph:$.content}),YH=new xH(new sR(TH).extend(JH),Object.keys(fH).map(e=>fH[e]),Object.keys(fH).map(e=>gH[e]),Object.keys(fH),_H,qV,Object.keys(RH).map(e=>RH[e]),Object.keys(RH),[]);function XH(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function ZH(e){let{codeParser:t,htmlParser:n}=e;return{wrap:FR((e,r)=>{let i=e.type.id;if(t&&(i==UV.CodeBlock||i==UV.FencedCode)){let n=``;if(i==UV.FencedCode){let t=e.node.getChild(UV.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==UV.CodeText,bracketed:i==UV.FencedCode}}else if(n&&(i==UV.HTMLBlock||i==UV.HTMLTag||i==UV.CommentBlock))return{parser:n,overlay:XH(e.node,e.from,e.to)};return null})}}var QH={resolve:`Strikethrough`,mark:`StrikethroughMark`},$H={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":$.strikethrough}},{name:`StrikethroughMark`,style:$.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=LH.test(r),c=LH.test(i);return e.addDelimiter(QH,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function eU(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function tU(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var nU=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,rU=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&nU.test(r=t.text.slice(t.pos))){let i=[];eU(e,n.content,0,i,n.start)==eU(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];eU(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},iU={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":$.heading}},`TableRow`,{name:`TableCell`,style:$.content},{name:`TableDelimiter`,style:$.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return tU(t.content,0)?new rU:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof rU)||!tU(t.text,t.basePos))return!1;let r=e.peekLine();return nU.test(r)&&eU(e,t.text,t.basePos)==eU(e,r,t.basePos)},before:`SetextHeading`}]},aU=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},oU={defineNodes:[{name:`Task`,block:!0,style:$.list},{name:`TaskMarker`,style:$.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new aU:null},after:`SetextHeading`}]},sU=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,cU=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,lU=/[\w-]+\.[\w-]+($|[/:])/,uU=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,dU=/\/[a-zA-Z\d@.]+/gy;function fU(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function pU(e,t){cU.lastIndex=t;let n=cU.exec(e);if(!n||lU.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&fU(e,t,r,`)`)>fU(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function mU(e,t){uU.lastIndex=t;let n=uU.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var hU=[iU,oU,$H,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;sU.lastIndex=r;let i=sU.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=pU(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=mU(e.text,r):(a=mU(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(dU.lastIndex=a,i=dU.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function gU(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),JV(s))break}return-1}}var _U={defineNodes:[{name:`Superscript`,style:$.special($.content)},{name:`SuperscriptMark`,style:$.processingInstruction}],parseInline:[{name:`Superscript`,parse:gU(94,`Superscript`,`SuperscriptMark`)}]},vU={defineNodes:[{name:`Subscript`,style:$.special($.content)},{name:`SubscriptMark`,style:$.processingInstruction}],parseInline:[{name:`Subscript`,parse:gU(126,`Subscript`,`SubscriptMark`)}]},yU={defineNodes:[{name:`Emoji`,style:$.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},bU=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new xU(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new SU(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new xU(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},xU=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},SU=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},CU=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function wU(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var TU=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},EU=new TU,DU=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=EU,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=EU,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},OU=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;jU(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};OU.prototype.contextual=OU.prototype.fallback=OU.prototype.extend=!1;var kU=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?wU(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(jU(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};kU.prototype.contextual=OU.prototype.fallback=OU.prototype.extend=!1;var AU=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function jU(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||NU(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function MU(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function NU(e,t,n,r){let i=MU(n,r,t);return i<0||MU(n,r,e)<i}var PU=typeof process<`u`&&/\bparse\b/.test({}.LOG),FU=null;function IU(e,t,n){let r=e.cursor(uR.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var LU=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?IU(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?IU(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof dR){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(rR.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},RU=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new TU)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new TU,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new TU,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=GU(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(GU(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(GU(o,s+1),t,n,r))}return r}},zU=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new DU(t,r),this.tokens=new RU(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[bU.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new LU(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&KU(r);if(e)return PU&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw PU&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return PU&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=PU?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(rR.contextHash)||0)==n))return e.useNode(o,r),PU&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof dR)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof dR&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),PU&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),PU&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return BU(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=PU?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),PU&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(PU&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)PU&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))PU&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),PU&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),BU(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),dR.build({buffer:CU.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(FU||=new WeakMap).get(e);return t||FU.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function BU(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var VU=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},HU=e=>e,UU=class{constructor(e){this.start=e.start,this.shift=e.shift||HU,this.reduce=e.reduce||HU,this.reuse=e.reuse||HU,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},WU=class e extends NR{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=rR[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new sR(t.map((t,i)=>oR.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=eR;let a=wU(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(qU),this.states=wU(e.states,Uint32Array),this.data=wU(e.stateData),this.goto=wU(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new OU(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new zU(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=GU(n,i+2)];else if(n[i+1]==2)return GU(n,i+2);else break;if(a==t||a==0)return GU(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=GU(this.data,n+2);else break;r=t(GU(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=GU(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=qU(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new VU(e,n,r)}static deserialize(t){return new e(t)}};function GU(e,t){return e[t]|e[t+1]<<16}function KU(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function qU(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var JU=55,YU=1,XU=56,ZU=2,QU=57,$U=3,eW=4,tW=5,nW=6,rW=7,iW=8,aW=9,oW=10,sW=11,cW=12,lW=13,uW=58,dW=14,fW=15,pW=59,mW=21,hW=23,gW=24,_W=25,vW=27,yW=28,bW=29,xW=32,SW=35,CW=37,wW=38,TW=0,EW=1,DW={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},OW={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},kW={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function AW(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var jW=null,MW=null,NW=0;function PW(e,t){let n=e.pos+t;if(NW==n&&MW==e)return jW;let r=e.peek(t),i=``;for(;AW(r);)i+=String.fromCharCode(r),r=e.peek(++t);return MW=e,NW=n,jW=i?i.toLowerCase():r==RW||r==zW?void 0:null}var FW=60,IW=62,LW=47,RW=63,zW=33,BW=45;function VW(e,t){this.name=e,this.parent=t}var HW=[nW,oW,rW,iW,aW],UW=new UU({start:null,shift(e,t,n,r){return HW.indexOf(t)>-1?new VW(PW(r,1)||``,e):e},reduce(e,t){return t==mW&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==nW||i==CW?new VW(PW(r,1)||``,e):e},strict:!1}),WW=new AU((e,t)=>{if(e.next!=FW){e.next<0&&t.context&&e.acceptToken(uW);return}e.advance();let n=e.next==LW;n&&e.advance();let r=PW(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?fW:dW);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(sW);if(i&&OW[i])return e.acceptToken(uW,-2);if(t.dialectEnabled(TW))return e.acceptToken(cW);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(lW)}else{if(r==`script`)return e.acceptToken(rW);if(r==`style`)return e.acceptToken(iW);if(r==`textarea`)return e.acceptToken(aW);if(DW.hasOwnProperty(r))return e.acceptToken(oW);i&&kW[i]&&kW[i][r]?e.acceptToken(uW,-1):e.acceptToken(nW)}},{contextual:!0}),GW=new AU(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(pW);break}if(e.next==BW)t++;else if(e.next==IW&&t>=2){n>=3&&e.acceptToken(pW,-2);break}else t=0;e.advance()}});function KW(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var qW=new AU((e,t)=>{if(e.next==LW&&e.peek(1)==IW){let n=t.dialectEnabled(EW)||KW(t.context);e.acceptToken(n?tW:eW,2)}else e.next==IW&&e.acceptToken(eW,1)});function JW(e,t,n){let r=2+e.length;return new AU(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==FW||a==1&&i.next==LW||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==IW){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var YW=JW(`script`,JU,YU),XW=JW(`style`,XU,ZU),ZW=JW(`textarea`,QU,$U),QW=tz({"Text RawText IncompleteTag IncompleteCloseTag":$.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":$.angleBracket,TagName:$.tagName,"MismatchedCloseTag/TagName":[$.tagName,$.invalid],AttributeName:$.attributeName,"AttributeValue UnquotedAttributeValue":$.attributeValue,Is:$.definitionOperator,"EntityReference CharacterReference":$.character,Comment:$.blockComment,ProcessingInst:$.processingInstruction,DoctypeDecl:$.documentMeta}),$W=WU.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:UW,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[QW],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[YW,XW,ZW,qW,WW,GW,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function eG(e,t){let n=Object.create(null);for(let r of e.getChildren(gW)){let e=r.getChild(_W),i=r.getChild(vW)||r.getChild(yW);e&&(n[t.read(e.from,e.to)]=i?i.type.id==vW?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function tG(e,t){let n=e.getChild(hW);return n?t.read(n.from,n.to):` `}function nG(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=eG(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function rG(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return FR((e,t)=>{let s=e.type.id;if(s==bW)return nG(e,t,n);if(s==xW)return nG(e,t,r);if(s==SW)return nG(e,t,i);if(s==mW&&a.length){let n=e.node,r=n.firstChild,i=r&&tG(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=eG(r,t)))){let t=n.lastChild,i=t.type.id==wW?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==gW){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=tG(n.parent,t))continue;let e=n.lastChild;if(e.type.id==vW){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==yW)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var iG=135,aG=1,oG=136,sG=137,cG=2,lG=138,uG=3,dG=4,fG=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],pG=58,mG=40,hG=95,gG=91,_G=45,vG=46,yG=35,bG=37,xG=38,SG=92,CG=10,wG=42;function TG(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function EG(e){return e>=48&&e<=57}function DG(e){return EG(e)||e>=97&&e<=102||e>=65&&e<=70}var OG=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(TG(c)||c==_G||c==hG||a&&EG(c))!a&&(c!=_G||s>0)&&(a=!0),o===s&&c==_G&&o++,r.advance();else if(c==SG&&r.peek(1)!=CG){if(r.advance(),DG(r.next)){do r.advance();while(DG(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(cG)?t:c==mG?n:e);break}}},kG=new AU(OG(oG,cG,sG),{contextual:!0}),AG=new AU(OG(lG,uG,dG),{contextual:!0}),jG=new AU(e=>{if(fG.includes(e.peek(-1))){let{next:t}=e;(TG(t)||t==hG||t==yG||t==vG||t==wG||t==gG||t==pG&&TG(e.peek(1))||t==_G||t==xG)&&e.acceptToken(iG)}}),MG=new AU(e=>{if(!fG.includes(e.peek(-1))){let{next:t}=e;if(t==bG&&(e.advance(),e.acceptToken(aG)),TG(t)){do e.advance();while(TG(e.next)||EG(e.next));e.acceptToken(aG)}}}),NG=tz({"AtKeyword import charset namespace keyframes media supports font-feature-values":$.definitionKeyword,"from to selector scope MatchFlag":$.keyword,NamespaceName:$.namespace,KeyframeName:$.labelName,KeyframeRangeName:$.operatorKeyword,TagName:$.tagName,ClassName:$.className,PseudoClassName:$.constant($.className),IdName:$.labelName,"FeatureName PropertyName":$.propertyName,AttributeName:$.attributeName,NumberLiteral:$.number,KeywordQuery:$.keyword,UnaryQueryOp:$.operatorKeyword,"CallTag ValueName FontName":$.atom,VariableName:$.variableName,Callee:$.operatorKeyword,Unit:$.unit,"UniversalSelector NestingSelector":$.definitionOperator,"MatchOp CompareOp":$.compareOperator,"ChildOp SiblingOp, LogicOp":$.logicOperator,BinOp:$.arithmeticOperator,Important:$.modifier,Comment:$.blockComment,ColorLiteral:$.color,"ParenthesizedContent StringLiteral":$.string,":":$.punctuation,"PseudoOp #":$.derefOperator,"; , |":$.separator,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace}),PG={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},FG={__proto__:null,or:104,and:104,not:112,only:112,layer:186},IG={__proto__:null,selector:118,layer:182},LG={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},RG={__proto__:null,to:223},zG=WU.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[NG],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[jG,MG,kG,AG,1,2,3,4,new kU(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>PG[e]||-1},{term:138,get:e=>FG[e]||-1},{term:4,get:e=>IG[e]||-1},{term:28,get:e=>LG[e]||-1},{term:136,get:e=>RG[e]||-1}],tokenPrec:2256}),BG=null;function VG(){if(!BG&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));BG=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return BG||[]}var HG=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),UG=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),WG=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),GG=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),KG=/^(\w[\w-]*|-\w[\w-]*|)$/,qG=/^-(-[\w-]*)?$/;function JG(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var YG=new jR,XG=[`Declaration`];function ZG(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function QG(e,t,n){if(t.to-t.from>4096){let r=YG.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(uR.IncludeAnonymous);if(o.firstChild())do for(let t of QG(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return YG.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(XG)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var $G=(e=>t=>{let{state:n,pos:r}=t,i=Ez(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:VG(),validFor:KG};if(i.name==`ValueName`)return{from:i.from,options:UG,validFor:KG};if(i.name==`PseudoClassName`)return{from:i.from,options:HG,validFor:KG};if(e(i)||(t.explicit||a)&&JG(i,n.doc))return{from:e(i)||a?i.from:r,options:QG(n.doc,ZG(i),e),validFor:qG};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:VG(),validFor:KG};return{from:i.from,options:WG,validFor:KG}}if(i.name==`AtKeyword`)return{from:i.from,options:GG,validFor:KG};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:HG,validFor:KG}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:UG,validFor:KG}:o.name==`Block`||o.name==`Styles`?{from:r,options:VG(),validFor:KG}:null})(e=>e.name==`VariableName`),eK=Tz.define({name:`css`,parser:zG.configure({props:[Wz.add({Declaration:nB()}),iB.add({"Block KeyframeList":aB})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function tK(){return new Iz(eK,eK.data.of({autocomplete:$G}))}var nK=316,rK=317,iK=1,aK=2,oK=3,sK=4,cK=318,lK=320,uK=321,dK=5,fK=6,pK=0,mK=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],hK=125,gK=59,_K=47,vK=42,yK=43,bK=45,xK=60,SK=44,CK=63,wK=46,TK=91,EK=new UU({start:!1,shift(e,t){return t==dK||t==fK||t==lK?e:t==uK},strict:!1}),DK=new AU((e,t)=>{let{next:n}=e;(n==hK||n==-1||t.context)&&e.acceptToken(cK)},{contextual:!0,fallback:!0}),OK=new AU((e,t)=>{let{next:n}=e,r;mK.indexOf(n)>-1||n==_K&&((r=e.peek(1))==_K||r==vK)||n!=hK&&n!=gK&&n!=-1&&!t.context&&e.acceptToken(nK)},{contextual:!0}),kK=new AU((e,t)=>{e.next==TK&&!t.context&&e.acceptToken(rK)},{contextual:!0}),AK=new AU((e,t)=>{let{next:n}=e;if(n==yK||n==bK){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(iK);e.acceptToken(n?iK:aK)}}else n==CK&&e.peek(1)==wK&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(oK))},{contextual:!0});function jK(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var MK=new AU((e,t)=>{if(e.next!=xK||!t.dialectEnabled(pK)||(e.advance(),e.next==_K))return;let n=0;for(;mK.indexOf(e.next)>-1;)e.advance(),n++;if(jK(e.next,!0)){for(e.advance(),n++;jK(e.next,!1);)e.advance(),n++;for(;mK.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==SK)return;for(let t=0;;t++){if(t==7){if(!jK(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(sK,-n)}),NK=tz({"get set async static":$.modifier,"for while do if else switch try catch finally return throw break continue default case defer":$.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":$.operatorKeyword,"let var const using function class extends":$.definitionKeyword,"import export from":$.moduleKeyword,"with debugger new":$.keyword,TemplateString:$.special($.string),super:$.atom,BooleanLiteral:$.bool,this:$.self,null:$.null,Star:$.modifier,VariableName:$.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":$.function($.variableName),VariableDefinition:$.definition($.variableName),Label:$.labelName,PropertyName:$.propertyName,PrivatePropertyName:$.special($.propertyName),"CallExpression/MemberExpression/PropertyName":$.function($.propertyName),"FunctionDeclaration/VariableDefinition":$.function($.definition($.variableName)),"ClassDeclaration/VariableDefinition":$.definition($.className),"NewExpression/VariableName":$.className,PropertyDefinition:$.definition($.propertyName),PrivatePropertyDefinition:$.definition($.special($.propertyName)),UpdateOp:$.updateOperator,"LineComment Hashbang":$.lineComment,BlockComment:$.blockComment,Number:$.number,String:$.string,Escape:$.escape,ArithOp:$.arithmeticOperator,LogicOp:$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,RegExp:$.regexp,Equals:$.definitionOperator,Arrow:$.function($.punctuation),": Spread":$.punctuation,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace,"InterpolationStart InterpolationEnd":$.special($.brace),".":$.derefOperator,", ;":$.separator,"@":$.meta,TypeName:$.typeName,TypeDefinition:$.definition($.typeName),"type enum interface implements namespace module declare":$.definitionKeyword,"abstract global Privacy readonly override":$.modifier,"is keyof unique infer asserts":$.operatorKeyword,JSXAttributeValue:$.attributeValue,JSXText:$.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":$.angleBracket,"JSXIdentifier JSXNameSpacedName":$.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":$.attributeName,"JSXBuiltin/JSXIdentifier":$.standard($.tagName)}),PK={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},FK={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},IK={__proto__:null,"<":193},LK=WU.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hOTX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WOPP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:EK,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[NK],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[OK,kK,AK,MK,2,3,4,5,6,7,8,9,10,11,12,13,14,DK,new kU("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new kU(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>PK[e]||-1},{term:343,get:e=>FK[e]||-1},{term:95,get:e=>IK[e]||-1}],tokenPrec:15201}),RK=[FV("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),FV("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),FV("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),FV(`do {
|
|
55
|
-
\${}
|
|
56
|
-
} while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),FV(`while (\${}) {
|
|
57
|
-
\${}
|
|
58
|
-
}`,{label:`while`,detail:`loop`,type:`keyword`}),FV(`try {
|
|
59
|
-
\${}
|
|
60
|
-
} catch (\${error}) {
|
|
61
|
-
\${}
|
|
62
|
-
}`,{label:`try`,detail:`/ catch block`,type:`keyword`}),FV(`if (\${}) {
|
|
63
|
-
\${}
|
|
64
|
-
}`,{label:`if`,detail:`block`,type:`keyword`}),FV(`if (\${}) {
|
|
65
|
-
\${}
|
|
66
|
-
} else {
|
|
67
|
-
\${}
|
|
68
|
-
}`,{label:`if`,detail:`/ else block`,type:`keyword`}),FV(`class \${name} {
|
|
69
|
-
constructor(\${params}) {
|
|
70
|
-
\${}
|
|
71
|
-
}
|
|
72
|
-
}`,{label:`class`,detail:`definition`,type:`keyword`}),FV('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),FV('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],zK=RK.concat([FV(`interface \${name} {
|
|
73
|
-
\${}
|
|
74
|
-
}`,{label:`interface`,detail:`definition`,type:`keyword`}),FV("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),FV(`enum \${name} {
|
|
75
|
-
\${}
|
|
76
|
-
}`,{label:`enum`,detail:`definition`,type:`keyword`})]),BK=new jR,VK=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function HK(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var UK=[`FunctionDeclaration`],WK={FunctionDeclaration:HK(`function`),ClassDeclaration:HK(`class`),ClassExpression:()=>!0,EnumDeclaration:HK(`constant`),TypeAliasDeclaration:HK(`type`),NamespaceDeclaration:HK(`namespace`),VariableDefinition(e,t){e.matchContext(UK)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function GK(e,t){let n=BK.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(uR.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=WK[t.name];if(e&&e(t,a)||VK.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of GK(e,t.node))r.push(n);return!1}}),BK.set(t,r),r}var KK=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,qK=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function JK(e){let t=Ez(e.state).resolveInner(e.pos,-1);if(qK.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&KK.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)VK.has(n.name)&&(r=r.concat(GK(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:KK}}var YK=Tz.define({name:`javascript`,parser:LK.configure({props:[Wz.add({IfStatement:nB({except:/^\s*({|else\b)/}),TryStatement:nB({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:tB,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:$z({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":nB({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),iB.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":aB,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),XK={test:e=>/^JSX/.test(e.name),facet:xz({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},ZK=YK.configure({dialect:`ts`},`typescript`),QK=YK.configure({dialect:`jsx`,props:[Sz.add(e=>e.isTop?[XK]:void 0)]}),$K=YK.configure({dialect:`jsx ts`,props:[Sz.add(e=>e.isTop?[XK]:void 0)]},`typescript`),eq=e=>({label:e,type:`keyword`}),tq=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(eq),nq=tq.concat([`declare`,`implements`,`private`,`protected`,`public`].map(eq));function rq(e={}){let t=e.jsx?e.typescript?$K:QK:e.typescript?ZK:YK,n=e.typescript?zK.concat(nq):RK.concat(tq);return new Iz(t,[YK.data.of({autocomplete:TB(qK,wB(n))}),YK.data.of({autocomplete:JK}),e.jsx?sq:[]])}function iq(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function aq(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var oq=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),sq=CL.inputHandler.of((e,t,n,r,i)=>{if((oq?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!YK.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=Ez(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=aq(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:$A.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=iq(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=aq(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),cq=[`_blank`,`_self`,`_top`,`_parent`],lq=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],uq=[`get`,`post`,`put`,`delete`],dq=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],fq=[`true`,`false`],pq={},mq={a:{attrs:{href:null,ping:null,type:null,media:null,target:cq,hreflang:null}},abbr:pq,address:pq,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:pq,aside:pq,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:pq,base:{attrs:{href:null,target:cq}},bdi:pq,bdo:pq,blockquote:{attrs:{cite:null}},body:pq,br:pq,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:dq,formmethod:uq,formnovalidate:[`novalidate`],formtarget:cq,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:pq,center:pq,cite:pq,code:pq,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:pq,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:pq,div:pq,dl:pq,dt:pq,em:pq,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:pq,figure:pq,footer:pq,form:{attrs:{action:null,name:null,"accept-charset":lq,autocomplete:[`on`,`off`],enctype:dq,method:uq,novalidate:[`novalidate`],target:cq}},h1:pq,h2:pq,h3:pq,h4:pq,h5:pq,h6:pq,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:pq,hgroup:pq,hr:pq,html:{attrs:{manifest:null}},i:pq,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:dq,formmethod:uq,formnovalidate:[`novalidate`],formtarget:cq,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:pq,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:pq,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:pq,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:lq,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:pq,noscript:pq,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:pq,param:{attrs:{name:null,value:null}},pre:pq,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:pq,rt:pq,ruby:pq,samp:pq,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:lq}},section:pq,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:pq,source:{attrs:{src:null,type:null,media:null}},span:pq,strong:pq,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:pq,summary:pq,sup:pq,table:pq,tbody:pq,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:pq,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:pq,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:pq,time:{attrs:{datetime:null}},title:pq,tr:pq,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:pq,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:pq},hq={accesskey:null,class:null,contenteditable:fq,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:fq,autocorrect:fq,autocapitalize:fq,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":fq,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":fq,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":fq,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":fq,"aria-hidden":fq,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":fq,"aria-multiselectable":fq,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":fq,"aria-relevant":null,"aria-required":fq,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},gq=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of gq)hq[e]=null;var _q=class{constructor(e,t){this.tags={...mq,...e},this.globalAttrs={...hq,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};_q.default=new _q;function vq(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function yq(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function bq(e,t,n){return n.tags[vq(e,yq(t))]?.children||n.allTags}function xq(e,t){let n=[];for(let r=yq(t);r&&!r.type.isTop;r=yq(r.parent)){let i=vq(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var Sq=/^[:\-\.\w\u00b7-\uffff]*$/;function Cq(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=yq(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:bq(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(xq(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function wq(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:xq(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:Sq}}function Tq(e,t,n,r){let i=[],a=0;for(let r of bq(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of xq(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Eq(e,t,n,r,i){let a=yq(n),o=a?t.tags[vq(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:Sq}}function Dq(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=yq(n),i=r?t.tags[vq(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function Oq(e,t){let{state:n,pos:r}=t,i=Ez(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?wq(n,i,i.from,r):Cq(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?Cq(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?wq(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?Eq(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?Dq(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?Tq(n,e,i,r):null}function kq(e){return Oq(_q.default,e)}function Aq(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new _q(t,n):_q.default;return e=>Oq(r,e)}var jq=YK.parser.configure({top:`SingleExpression`}),Mq=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:ZK.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:QK.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:$K.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:jq},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:YK.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:eK.parser}],Nq=[{name:`style`,parser:eK.parser.configure({top:`Styles`})}].concat(gq.map(e=>({name:e,parser:YK.parser}))),Pq=Tz.define({name:`html`,parser:$W.configure({props:[Wz.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),iB.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),cB.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),Fq=Pq.configure({wrap:rG(Mq,Nq)});function Iq(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=rG((e.nestedLanguages||[]).concat(Mq),(e.nestedAttributes||[]).concat(Nq))),new Iz(n?Pq.configure({wrap:n,dialect:t}):t?Fq.configure({dialect:t}):Fq,[Fq.data.of({autocomplete:Aq(e)}),e.autoCloseTags===!1?[]:Rq,rq().support,tK().support])}var Lq=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),Rq=CL.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!Fq.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=Ez(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=vq(o.doc,t.parent,n))&&!Lq.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=vq(o.doc,e,n))&&!Lq.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:$A.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),zq=xz({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Bq=new rR,Vq=YH.configure({props:[iB.add(e=>!e.is(`Block`)||e.is(`Document`)||Hq(e)!=null||Uq(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Bq.add(Hq),Wz.add({Document:()=>null}),bz.add({Document:zq})]});function Hq(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Uq(e){return e.name==`OrderedList`||e.name==`BulletList`}function Wq(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=Hq(e.type))!=null&&r<=t)break;n=e}return n.to}var Gq=rB.of((e,t,n)=>{for(let r=Ez(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Bq);if(e==null)continue;let t=Wq(r,e);if(t>n)return{from:n,to:t}}return null});function Kq(e){return new Cz(zq,e,[],`markdown`)}var qq=Kq(Vq),Jq=Kq(Vq.configure([hU,vU,_U,yU,{props:[iB.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function Yq(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):Lz.matchLanguageName(e,n,!0),t instanceof Lz)return t.support?t.support.language.parser:kz.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var Xq=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+Qq(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Zq(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new Xq(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Xq(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new Xq(i.parent,s,s+t,a[1],e,n,i))}}return r}function Qq(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function $q(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Qq(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function eJ(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(zz)!=` `)return e;let r=dM(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var tJ=((e={})=>({state:t,dispatch:n})=>{let r=Ez(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!Jq.isActiveAt(t,n.from,-1)&&!Jq.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=Zq(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&$q(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&$q(e.item,i,r),{range:$A.cursor(t+n.length),changes:r}}else{let e=iJ(c,t,s);return{range:$A.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&$q(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?dM(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=eJ(p,t),rJ(l.node,t.doc)&&(p=iJ(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:$A.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function nJ(e){return e.name==`QuoteMark`||e.name==`ListMark`}function rJ(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function iJ(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?dM(n.text,4,e[t+1].from)-r.length:null,t<i);return eJ(r,t)}function aJ(e,t){let n=e.resolveInner(t,-1),r=t;nJ(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(nJ(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var oJ=[{key:`Enter`,run:tJ},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=Ez(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&Jq.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Zq(aJ(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:$A.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(dM(t.text,4,n.to)-dM(t.text,4,n.from));return r==t.from&&(i=eJ(i,e)),{range:$A.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:$A.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],sJ=Iq({matchClosingTags:!1});function cJ(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=qq,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=sJ}=e;if(!(i instanceof xH))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,Gq],u;o&&l.push(pJ),n instanceof Iz?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?Yq(t,u):void 0;c.push(ZH({codeParser:d,htmlParser:s.language.parser})),r&&l.push(fj.high(ML.of(oJ)));let f=Kq(i.configure(c));return a&&l.push(f.data.of({autocomplete:lJ})),new Iz(f,l)}function lJ(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=Ez(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:dJ(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var uJ=null;function dJ(){if(uJ)return uJ;let e=kq(new xB(Gj.create({extensions:sJ}),0,!0));return uJ=e?e.options:[]}var fJ=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,pJ=CL.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Jq.isActiveAt(t.state,n.from,1)))return!1;let i=Ez(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||fJ.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),mJ=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=yJ(e.state,n.from);return r.line?gJ(e):r.block?vJ(e):!1};function hJ(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var gJ=hJ(wJ,0),_J=hJ(CJ,0),vJ=hJ((e,t)=>CJ(e,t,SJ(t)),0);function yJ(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var bJ=50;function xJ(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-bJ,r),o=e.sliceDoc(i,i+bJ),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*bJ?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+bJ),d=e.sliceDoc(i-bJ,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function SJ(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function CJ(e,t,n=t.selection.ranges){let r=n.map(e=>yJ(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>xJ(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function wJ(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=yJ(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var TJ=Dj.define(),EJ=Dj.define(),DJ=nj.define(),OJ=nj.define({combine(e){return Kj(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),kJ=lj.define({create(){return JJ.empty},update(e,t){let n=t.state.facet(OJ),r=t.annotation(TJ);if(r){let i=IJ.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?LJ(o,o.length,n.minDepth,i):UJ(o,t.startState.selection),new JJ(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(EJ);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(jj.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=IJ.fromTransaction(t),o=t.annotation(jj.time),s=t.annotation(jj.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new JJ(e.done.map(IJ.fromJSON),e.undone.map(IJ.fromJSON))}});function AJ(e={}){return[kJ,OJ.of(e),CL.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?MJ:e.inputType==`historyRedo`?NJ:null;return n?(e.preventDefault(),n(t)):!1}})]}function jJ(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(kJ,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var MJ=jJ(0,!1),NJ=jJ(1,!1),PJ=jJ(0,!0),FJ=jJ(1,!0),IJ=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&GA.fromJSON(t.changes),[],t.mapped&&WA.fromJSON(t.mapped),t.startSelection&&$A.fromJSON(t.startSelection),t.selectionsAfter.map($A.fromJSON))}static fromTransaction(t,n){let r=VJ;for(let e of t.startState.facet(DJ)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,VJ)}static selection(t){return new e(void 0,VJ,void 0,void 0,t)}};function LJ(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function RJ(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function zJ(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function BJ(e,t){return e.length?t.length?e.concat(t):e:t}var VJ=[],HJ=200;function UJ(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-HJ));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),LJ(e,e.length-1,1e9,n.setSelAfter(r)))}else return[IJ.selection([t])]}function WJ(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function GJ(e,t){if(!e.length)return e;let n=e.length,r=VJ;for(;n;){let i=KJ(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[IJ.selection(r)]:VJ}function KJ(e,t,n){let r=BJ(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):VJ,n);if(!e.changes)return IJ.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new IJ(i,Aj.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var qJ=/^(input\.type|delete)($|\.)/,JJ=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||qJ.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,RJ(s.changes,t.changes))||r==`input.type.compose`)?LJ(o,o.length-1,i.minDepth,new IJ(t.changes.compose(s.changes),BJ(Aj.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,VJ)):LJ(o,o.length,i.minDepth,t),new e(o,VJ,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:VJ;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&zJ(a[a.length-1],t)?this:new e(UJ(this.done,t),this.undone,n,r)}addMapping(t){return new e(GJ(this.done,t),GJ(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:TJ.of({side:e,rest:WJ(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?VJ:r.slice(0,r.length-1);return i.mapped&&(n=GJ(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:TJ.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};JJ.empty=new JJ(VJ,VJ);var YJ=[{key:`Mod-z`,run:MJ,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:NJ,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:NJ,preventDefault:!0},{key:`Mod-u`,run:PJ,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:FJ,preventDefault:!0}];function XJ(e,t){return $A.create(e.ranges.map(t),e.mainIndex)}function ZJ(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function QJ({state:e,dispatch:t},n){let r=XJ(e.selection,n);return r.eq(e.selection,!0)?!1:(t(ZJ(e,r)),!0)}function $J(e,t){return $A.cursor(t?e.to:e.from)}function eY(e,t){return QJ(e,n=>n.empty?e.moveByChar(n,t):$J(n,t))}function tY(e){return e.textDirectionAt(e.state.selection.main.head)==DN.LTR}var nY=e=>eY(e,!tY(e)),rY=e=>eY(e,tY(e));function iY(e,t){return QJ(e,n=>n.empty?e.moveByGroup(n,t):$J(n,t))}var aY=e=>iY(e,!tY(e)),oY=e=>iY(e,tY(e));typeof Intl<`u`&&Intl.Segmenter;function sY(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function cY(e,t,n){let r=Ez(e).resolveInner(t.head),i=n?rR.closedBy:rR.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;sY(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?dB(e,r.from,1):dB(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,$A.cursor(s,n?-1:1)}var lY=e=>QJ(e,t=>cY(e.state,t,!tY(e))),uY=e=>QJ(e,t=>cY(e.state,t,tY(e)));function dY(e,t){return QJ(e,n=>{if(!n.empty)return $J(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var fY=e=>dY(e,!1),pY=e=>dY(e,!0);function mY(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(CL.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function hY(e,t){let n=mY(e),{state:r}=e,i=XJ(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):$J(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=CL.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(ZJ(r,i),{effects:a}),!0}var gY=e=>hY(e,!1),_Y=e=>hY(e,!0);function vY(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=$A.cursor(r.from+n))}return i}var yY=e=>QJ(e,t=>vY(e,t,!0)),bY=e=>QJ(e,t=>vY(e,t,!1)),xY=e=>QJ(e,t=>vY(e,t,!tY(e))),SY=e=>QJ(e,t=>vY(e,t,tY(e))),CY=e=>QJ(e,t=>$A.cursor(e.lineBlockAt(t.head).from,1)),wY=e=>QJ(e,t=>$A.cursor(e.lineBlockAt(t.head).to,-1));function TY(e,t,n){let r=!1,i=XJ(e.selection,t=>{let i=dB(e,t.head,-1)||dB(e,t.head,1)||t.head>0&&dB(e,t.head-1,1)||t.head<e.doc.length&&dB(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?$A.range(t.anchor,a):$A.cursor(a)});return r?(t(ZJ(e,i)),!0):!1}var EY=({state:e,dispatch:t})=>TY(e,t,!1);function DY(e,t){let n=XJ(e.state.selection,e=>{let n=t(e);return $A.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(ZJ(e.state,n)),!0)}function OY(e,t){return DY(e,n=>e.moveByChar(n,t))}var kY=e=>OY(e,!tY(e)),AY=e=>OY(e,tY(e));function jY(e,t){return DY(e,n=>e.moveByGroup(n,t))}var MY=e=>jY(e,!tY(e)),NY=e=>jY(e,tY(e)),PY=e=>DY(e,t=>cY(e.state,t,!tY(e))),FY=e=>DY(e,t=>cY(e.state,t,tY(e)));function IY(e,t){return DY(e,n=>e.moveVertically(n,t))}var LY=e=>IY(e,!1),RY=e=>IY(e,!0);function zY(e,t){return DY(e,n=>e.moveVertically(n,t,mY(e).height))}var BY=e=>zY(e,!1),VY=e=>zY(e,!0),HY=e=>DY(e,t=>vY(e,t,!0)),UY=e=>DY(e,t=>vY(e,t,!1)),WY=e=>DY(e,t=>vY(e,t,!tY(e))),GY=e=>DY(e,t=>vY(e,t,tY(e))),KY=e=>DY(e,t=>$A.cursor(e.lineBlockAt(t.head).from)),qY=e=>DY(e,t=>$A.cursor(e.lineBlockAt(t.head).to)),JY=({state:e,dispatch:t})=>(t(ZJ(e,{anchor:0})),!0),YY=({state:e,dispatch:t})=>(t(ZJ(e,{anchor:e.doc.length})),!0),XY=({state:e,dispatch:t})=>(t(ZJ(e,{anchor:e.selection.main.anchor,head:0})),!0),ZY=({state:e,dispatch:t})=>(t(ZJ(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),QY=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),$Y=({state:e,dispatch:t})=>{let n=vX(e).map(({from:t,to:n})=>$A.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:$A.create(n),userEvent:`select`})),!0},eX=({state:e,dispatch:t})=>{let n=XJ(e.selection,t=>{let n=Ez(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return $A.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(ZJ(e,n)),!0)};function tX(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(ZJ(n,$A.create(i,i.length-1))),!0)}var nX=e=>tX(e,!1),rX=e=>tX(e,!0),iX=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=$A.create([n.main]):n.main.empty||(r=$A.create([$A.cursor(n.main.head)])),r?(t(ZJ(e,r)),!0):!1};function aX(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=oX(e,o,!1)):o>i&&(n=`delete.forward`,o=oX(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=oX(e,i,!1),a=oX(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:$A.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?CL.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function oX(e,t,n){if(e instanceof CL)for(let r of e.state.facet(CL.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var sX=(e,t,n)=>aX(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=dM(s,a.tabSize)%Bz(a)||Bz(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=zA(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=zA(o.text,c-o.from,!1,!1)+o.from);return c}),cX=e=>sX(e,!1,!0),lX=e=>sX(e,!0,!1),uX=(e,t)=>aX(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=zA(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),dX=e=>uX(e,!1),fX=e=>uX(e,!0),pX=e=>aX(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),mX=e=>aX(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),hX=e=>aX(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),gX=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:AA.of([``,``])},range:$A.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},_X=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:zA(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:zA(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:$A.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function vX(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function yX(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of vX(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push($A.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push($A.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:$A.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var bX=({state:e,dispatch:t})=>yX(e,t,!1),xX=({state:e,dispatch:t})=>yX(e,t,!0);function SX(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of vX(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var CX=({state:e,dispatch:t})=>SX(e,t,!1),wX=({state:e,dispatch:t})=>SX(e,t,!0),TX=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(vX(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=XJ(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function EX(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Ez(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(rR.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var DX=kX(!1),OX=kX(!0);function kX(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&EX(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Uz(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=Hz(s,r);for(c??=dM(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Vz(t,c)];return o&&l.push(Vz(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:AA.of(l)},range:$A.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function AX(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:$A.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var jX=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Uz(e,{overrideIndentation:e=>n[e]??-1}),i=AX(e,(t,i,a)=>{let o=Hz(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Vz(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},MX=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(AX(e,(t,n)=>{n.push({from:t.from,insert:e.facet(zz)})}),{userEvent:`input.indent`})),!0),NX=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(AX(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=dM(r,e.tabSize),a=0,o=Vz(e,Math.max(0,i-Bz(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),PX=e=>(e.setTabFocusMode(),!0),FX=[{key:`Ctrl-b`,run:nY,shift:kY,preventDefault:!0},{key:`Ctrl-f`,run:rY,shift:AY},{key:`Ctrl-p`,run:fY,shift:LY},{key:`Ctrl-n`,run:pY,shift:RY},{key:`Ctrl-a`,run:CY,shift:KY},{key:`Ctrl-e`,run:wY,shift:qY},{key:`Ctrl-d`,run:lX},{key:`Ctrl-h`,run:cX},{key:`Ctrl-k`,run:pX},{key:`Ctrl-Alt-h`,run:dX},{key:`Ctrl-o`,run:gX},{key:`Ctrl-t`,run:_X},{key:`Ctrl-v`,run:_Y}],IX=[{key:`ArrowLeft`,run:nY,shift:kY,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:aY,shift:MY,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:xY,shift:WY,preventDefault:!0},{key:`ArrowRight`,run:rY,shift:AY,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:oY,shift:NY,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:SY,shift:GY,preventDefault:!0},{key:`ArrowUp`,run:fY,shift:LY,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:JY,shift:XY},{mac:`Ctrl-ArrowUp`,run:gY,shift:BY},{key:`ArrowDown`,run:pY,shift:RY,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:YY,shift:ZY},{mac:`Ctrl-ArrowDown`,run:_Y,shift:VY},{key:`PageUp`,run:gY,shift:BY},{key:`PageDown`,run:_Y,shift:VY},{key:`Home`,run:bY,shift:UY,preventDefault:!0},{key:`Mod-Home`,run:JY,shift:XY},{key:`End`,run:yY,shift:HY,preventDefault:!0},{key:`Mod-End`,run:YY,shift:ZY},{key:`Enter`,run:DX,shift:DX},{key:`Mod-a`,run:QY},{key:`Backspace`,run:cX,shift:cX,preventDefault:!0},{key:`Delete`,run:lX,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:dX,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:fX,preventDefault:!0},{mac:`Mod-Backspace`,run:mX,preventDefault:!0},{mac:`Mod-Delete`,run:hX,preventDefault:!0}].concat(FX.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),LX=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:lY,shift:PY},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:uY,shift:FY},{key:`Alt-ArrowUp`,run:bX},{key:`Shift-Alt-ArrowUp`,run:CX},{key:`Alt-ArrowDown`,run:xX},{key:`Shift-Alt-ArrowDown`,run:wX},{key:`Mod-Alt-ArrowUp`,run:nX},{key:`Mod-Alt-ArrowDown`,run:rX},{key:`Escape`,run:iX},{key:`Mod-Enter`,run:OX},{key:`Alt-l`,mac:`Ctrl-l`,run:$Y},{key:`Mod-i`,run:eX,preventDefault:!0},{key:`Mod-[`,run:NX},{key:`Mod-]`,run:MX},{key:`Mod-Alt-\\`,run:jX},{key:`Shift-Mod-k`,run:TX},{key:`Shift-Mod-\\`,run:EY},{key:`Mod-/`,run:mJ},{key:`Alt-A`,run:_J},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:PX}].concat(IX),RX={key:`Tab`,run:MX,shift:NX},zX=L(`<div></div>`);function BX(e,t){D(t,!0);let n={name:`Commands`,rank:0},r={name:`Project references`,rank:10},i=q(t,`placeholder`,3,`Ask the local Nerve agent`),a=q(t,`disabled`,3,!1),o=q(t,`focusToken`,3,0),s=q(t,`slashCompletions`,19,()=>[]),c,l,u=A(``),d=0,f=new mj,p=new mj,m=new mj;function h(e){return[Gj.readOnly.of(e),CL.editable.of(!e)]}function g(e){return e.kind===`directory`||e.kind===`file`?r:n}function _(e){if(e.sortScore!==void 0)return Math.max(-99,Math.min(99,Math.round(e.sortScore/160)))}function v(e){return{label:e.label,displayLabel:e.displayLabel,detail:e.detail,info:e.info,type:e.kind===`directory`?`folder`:e.kind===`file`?`file`:`keyword`,apply:e.apply??e.label,boost:_(e),section:g(e),matchRanges:e.matchRanges?.flatMap(([e,t])=>[e,t]),nerveKind:e.kind}}function y(e){return e.matchRanges??[]}function b(e){return`nerve-completion-option nerve-completion-${e.nerveKind??`slash`}`}let x=`http://www.w3.org/2000/svg`,S={file:[`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,`M14 2v5a1 1 0 0 0 1 1h5`],folder:[`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`]};function ee(e,t=14){let n=document.createElementNS(x,`svg`);n.setAttribute(`viewBox`,`0 0 24 24`),n.setAttribute(`fill`,`none`),n.setAttribute(`stroke`,`currentColor`),n.setAttribute(`stroke-width`,`2`),n.setAttribute(`stroke-linecap`,`round`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`aria-hidden`,`true`);for(let t of S[e]){let e=document.createElementNS(x,`path`);e.setAttribute(`d`,t),n.appendChild(e)}return n}function C(e,t,n){let r=0;for(let[i,a]of n){i>r&&e.appendChild(document.createTextNode(t.slice(r,i)));let n=document.createElement(`span`);n.className=`cm-nerve-match`,n.textContent=t.slice(i,a),e.appendChild(n),r=a}r<t.length&&e.appendChild(document.createTextNode(t.slice(r)))}function te(e){let t=e.nerveKind,n=e.matchRanges??[],r=document.createElement(`span`);r.className=`cm-nerve-row`;let i=document.createElement(`span`);i.className=`cm-nerve-row-icon`,i.appendChild(ee(t===`directory`?`folder`:`file`)),r.appendChild(i);let a=document.createElement(`span`);if(a.className=`cm-nerve-row-main`,t===`file`||t===`directory`){let r=e.label??``,i=e.info,o=typeof i==`string`?i:r.replace(/^@/,``),s=t===`directory`,c=s?o.replace(/\/+$/,``):o,l=c.lastIndexOf(`/`)+1,u=c.slice(0,l),d=c.slice(l)+(s?`/`:``),f=[];for(let e=0;e+1<n.length;e+=2){let t=Math.max(0,n[e]-1),r=Math.min(c.length,n[e+1]-1);r>t&&f.push([t,r])}if(u){let e=document.createElement(`span`);e.className=`cm-nerve-row-dir`,e.textContent=``,C(e,u,f.filter(([e])=>e<l).map(([e,t])=>[e,Math.min(t,l)])),a.appendChild(e)}let p=document.createElement(`span`);p.className=`cm-nerve-row-name`,C(p,d,f.filter(([e,t])=>t>l).map(([e,t])=>[Math.max(e,l)-l,t-l])),a.appendChild(p)}else{let t=document.createElement(`span`);t.className=`cm-nerve-row-name`,t.textContent=e.label??``,a.appendChild(t)}return r.appendChild(a),r}async function ne(e){let n=e.matchBefore(/(?:^|\s)([/@][^\s]*)/);if(!n&&!e.explicit)return null;let r=n?.text.trimStart()??``,i=n?n.to-r.length:e.pos;if(r.startsWith(`/`))return{from:i,options:s().filter(e=>e.label.startsWith(r)||e.label.includes(r.slice(1))).map(v),validFor:/^\/[\w-]*$/};if(r.startsWith(`@`)){e.addEventListener(`abort`,()=>void 0,{onDocChange:!0});let n=r.slice(1),a=(await t.fileCompletions?.(n)??[]).map(v);return e.aborted?null:{from:i,options:a,filter:!1,getMatch:y}}return e.explicit?{from:e.pos,options:s().map(v)}:null}function re(){return RV({override:[ne],icons:!1,maxRenderedOptions:80,tooltipClass:()=>`nerve-composer-completions`,optionClass:b,addToOptions:[{render:te,position:20}]})}function ie(){return a()?!1:(t.onSubmit?.(),!0)}function ae(e){return VV(e.state)===`active`?!1:ie()}function oe(e){if(!l)return;let t=l.state.selection.main;l.dispatch({changes:{from:t.from,to:t.to,insert:e},selection:{anchor:t.from+e.length},scrollIntoView:!0}),l.focus()}function w(e){if(a()||!t.onPasteImage)return!1;let n=Array.from(e.clipboardData?.files??[]).filter(e=>e.type.startsWith(`image/`));return n.length?(e.preventDefault(),Promise.all(n.map(e=>t.onPasteImage(e))).then(e=>oe(e.join(`
|
|
77
|
-
`))).catch(e=>{lw(`error`,`composer`,`Failed to paste clipboard image`,{error:e})}),!0):!1}Oa(()=>{j(u,t.value,!0),l=new CL({parent:c,state:Gj.create({doc:t.value,extensions:[AJ(),cJ(),m.of(VL(i())),f.of(h(a())),p.of(re()),fj.highest(ML.of([{key:`Enter`,run:ae},{key:`Mod-Enter`,run:ie},{key:`Ctrl-Enter`,run:ie},RX])),ML.of([...LX,...YJ]),CL.lineWrapping,CL.domEventHandlers({paste:w}),CL.updateListener.of(e=>{e.docChanged&&(j(u,e.state.doc.toString(),!0),t.onChange?.(I(u)))}),CL.theme({"&":{background:`transparent`,color:`var(--foreground)`,maxHeight:`min(40vh, 320px)`},".cm-content":{caretColor:`var(--primary)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,lineHeight:`1.5`,padding:`18px 46px 14px 11px`},".cm-line":{padding:`0 2px`},".cm-cursor":{borderLeftColor:`var(--primary)`},".cm-placeholder":{color:`color-mix(in oklab, var(--muted-foreground) 75%, transparent)`},".cm-scroller":{minHeight:`92px`,maxHeight:`min(40vh, 320px)`,overflow:`auto`},".cm-tooltip":{border:`1px solid var(--border)`,borderRadius:`var(--radius-md)`,background:`var(--popover)`,color:`var(--popover-foreground)`,boxShadow:`var(--shadow-lg)`,overflow:`hidden`},".cm-tooltip-autocomplete.nerve-composer-completions":{minWidth:`min(28rem, calc(100vw - 2rem))`,maxWidth:`min(38rem, calc(100vw - 2rem))`,padding:`0.25rem`},".cm-tooltip-autocomplete.nerve-composer-completions > ul":{maxHeight:`min(42vh, 22rem)`,padding:`0.15rem`,fontFamily:`var(--font-mono)`,scrollbarWidth:`thin`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > completion-section":{borderBottom:`0`,color:`var(--muted-foreground)`,fontFamily:`var(--font-sans)`,fontSize:`var(--text-xs)`,fontWeight:`700`,letterSpacing:`0.02em`,padding:`0.35rem 0.5rem 0.2rem`,textTransform:`uppercase`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > li":{display:`flex`,alignItems:`center`,minHeight:`1.85rem`,borderRadius:`var(--radius-sm)`,padding:`0.28rem 0.5rem`,color:`var(--popover-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > li[aria-selected]":{background:`var(--accent)`,color:`var(--accent-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-completionLabel":{display:`none`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-completionDetail":{display:`none`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row":{display:`flex`,alignItems:`center`,gap:`0.5rem`,minWidth:`0`,width:`100%`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-icon":{display:`inline-flex`,flexShrink:`0`,alignItems:`center`,color:`var(--muted-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .nerve-completion-directory .cm-nerve-row-icon":{color:`var(--info)`},".cm-tooltip-autocomplete.nerve-composer-completions .nerve-completion-file .cm-nerve-row-icon":{color:`var(--success)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-main":{display:`flex`,alignItems:`baseline`,gap:`0.4rem`,flex:`1`,minWidth:`0`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-dir":{flexShrink:`1`,minWidth:`0`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,direction:`rtl`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`,color:`var(--muted-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-name":{flexShrink:`0`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:`600`,color:`var(--popover-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-match":{color:`var(--primary)`,fontWeight:`700`},".cm-tooltip.cm-completionInfo":{maxWidth:`min(30rem, calc(100vw - 2rem))`,padding:`0.55rem 0.7rem`,color:`var(--popover-foreground)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`},"&.cm-focused":{outline:`none`},"&.cm-focused .cm-cursor":{borderLeftColor:`var(--primary)`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:`color-mix(in oklab, var(--primary) 22%, transparent)`}})]})})}),rr(()=>{l&&l.dispatch({effects:f.reconfigure(h(a()))})}),rr(()=>{l&&(s(),t.fileCompletions,l.dispatch({effects:p.reconfigure(re())}))}),rr(()=>{l&&l.dispatch({effects:m.reconfigure(VL(i()))})}),rr(()=>{!l||a()||o()===d||(d=o(),l.focus())}),rr(()=>{!l||t.value===I(u)||(l.dispatch({changes:{from:0,to:l.state.doc.length,insert:t.value}}),j(u,t.value,!0))}),ka(()=>l?.destroy());var se=zX();let ce;Ta(se,e=>c=e,()=>c),F(()=>ce=Qi(se,1,`composer-editor svelte-glolxd`,null,ce,{disabled:a()})),z(e,se),O()}var VX=new Set([`$$slots`,`$$events`,`$$legacy`]);function HX(e,t){let n=G(t,VX),r=[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];ic(e,K({name:`key-round`},()=>n,{get iconNode(){return r}}))}var UX=new Set([`$$slots`,`$$events`,`$$legacy`]);function WX(e,t){let n=G(t,UX),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`m9 12 2 2 4-4`}]];ic(e,K({name:`shield-check`},()=>n,{get iconNode(){return r}}))}var GX=new Set([`$$slots`,`$$events`,`$$legacy`]);function KX(e,t){let n=G(t,GX),r=[[`path`,{d:`M18 6 6 18`}],[`path`,{d:`m6 6 12 12`}]];ic(e,K({name:`x`},()=>n,{get iconNode(){return r}}))}var qX=L(`<div class="dialog-header-actions svelte-16bs6s2"><!></div>`),JX=L(`<footer class="dialog-footer svelte-16bs6s2"><!></footer>`),YX=L(`<header class="dialog-header svelte-16bs6s2"><div class="dialog-title-block svelte-16bs6s2"><!> <!></div> <!> <!></header> <div class="dialog-body svelte-16bs6s2"><!></div> <!>`,1),XX=L(`<!> <!>`,1);function ZX(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`title`,3,`Dialog`),i=q(t,`class`,3,``),a=q(t,`closeLabel`,3,`Close dialog`);function o(e){n(e),t.onOpenChange?.(e)}var s=R();U(N(s),()=>Fy,(e,s)=>{s(e,{onOpenChange:o,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var o=R();U(N(o),()=>qp,(e,n)=>{n(e,{children:(e,n)=>{var o=XX(),s=N(o);U(s,()=>ch,(e,t)=>{t(e,{class:`dialog-overlay`})});var c=P(s,2);{let e=k(()=>ol(`dialog-content`,i()));U(c,()=>Hy,(n,i)=>{i(n,{get class(){return I(e)},children:(e,n)=>{var i=YX(),o=N(i),s=M(o),c=M(s);U(c,()=>Kp,(e,t)=>{t(e,{class:`dialog-title`,children:(e,t)=>{E();var n=wi();F(()=>B(n,r())),z(e,n)},$$slots:{default:!0}})});var l=P(c,2),u=e=>{var n=R();U(N(n),()=>dh,(e,n)=>{n(e,{class:`dialog-description`,children:(e,n)=>{E();var r=wi();F(()=>B(r,t.description)),z(e,r)},$$slots:{default:!0}})}),z(e,n)};V(l,e=>{t.description&&e(u)}),T(s);var d=P(s,2),f=e=>{var n=qX();H(M(n),()=>t.headerActions),T(n),z(e,n)};V(d,e=>{t.headerActions&&e(f)}),U(P(d,2),()=>Ry,(e,t)=>{t(e,{class:`dialog-close`,get"aria-label"(){return a()},children:(e,t)=>{KX(e,{size:15,strokeWidth:2.25,"aria-hidden":`true`})},$$slots:{default:!0}})}),T(o);var p=P(o,2);H(M(p),()=>t.children??w),T(p);var m=P(p,2),h=e=>{var n=JX();H(M(n),()=>t.footer),T(n),z(e,n)};V(m,e=>{t.footer&&e(h)}),z(e,i)},$$slots:{default:!0}})})}z(e,o)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})}),z(e,s),O()}var QX=new Set([`$$slots`,`$$events`,`$$legacy`]);function $X(e,t){let n=G(t,QX),r=[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}],[`path`,{d:`m7 16.5-4.74-2.85`}],[`path`,{d:`m7 16.5 5-3`}],[`path`,{d:`M7 16.5v5.17`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}],[`path`,{d:`m17 16.5-5-3`}],[`path`,{d:`m17 16.5 4.74-2.85`}],[`path`,{d:`M17 16.5v5.17`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}],[`path`,{d:`M12 8 7.26 5.15`}],[`path`,{d:`m12 8 4.74-2.85`}],[`path`,{d:`M12 13.5V8`}]];ic(e,K({name:`boxes`},()=>n,{get iconNode(){return r}}))}var eZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function tZ(e,t){let n=G(t,eZ),r=[[`path`,{d:`M12 20v2`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M17 20v2`}],[`path`,{d:`M17 2v2`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M2 17h2`}],[`path`,{d:`M2 7h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`M20 17h2`}],[`path`,{d:`M20 7h2`}],[`path`,{d:`M7 20v2`}],[`path`,{d:`M7 2v2`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`}]];ic(e,K({name:`cpu`},()=>n,{get iconNode(){return r}}))}var nZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function rZ(e,t){let n=G(t,nZ),r=[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];ic(e,K({name:`search`},()=>n,{get iconNode(){return r}}))}var iZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function aZ(e,t){let n=G(t,iZ),r=[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}],[`path`,{d:`M20 2v4`}],[`path`,{d:`M22 4h-4`}],[`circle`,{cx:`4`,cy:`20`,r:`2`}]];ic(e,K({name:`sparkles`},()=>n,{get iconNode(){return r}}))}var oZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`viewportRef`,`class`,`orientation`,`scrollbarXClasses`,`scrollbarYClasses`,`viewportClass`,`children`]),sZ=L(`<!> <!> <!> <!>`,1);function cZ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`viewportRef`,15,null),i=q(t,`orientation`,3,`vertical`),a=q(t,`scrollbarXClasses`,3,``),o=q(t,`scrollbarYClasses`,3,``),s=q(t,`viewportClass`,3,``),c=G(t,oZ);var l=R(),u=N(l);{let e=k(()=>ol(`relative`,t.class));U(u,()=>ex,(l,u)=>{u(l,K({"data-slot":`scroll-area`,get class(){return I(e)}},()=>c,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var c=sZ(),l=N(c);{let e=k(()=>ol(`cn-scroll-area-viewport focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,s()));U(l,()=>rx,(n,i)=>{i(n,{"data-slot":`scroll-area-viewport`,get class(){return I(e)},get ref(){return r()},set ref(e){r(e)},children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}})})}var u=P(l,2),d=e=>{dZ(e,{orientation:`vertical`,get class(){return o()}})};V(u,e=>{(i()===`vertical`||i()===`both`)&&e(d)});var f=P(u,2),p=e=>{dZ(e,{orientation:`horizontal`,get class(){return a()}})};V(f,e=>{(i()===`horizontal`||i()===`both`)&&e(p)}),U(P(f,2),()=>Ax,(e,t)=>{t(e,{})}),z(e,c)},$$slots:{default:!0}}))})}z(e,l),O()}var lZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`orientation`,`children`]),uZ=L(`<!> <!>`,1);function dZ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`orientation`,3,`vertical`),i=G(t,lZ);var a=R(),o=N(a);{let e=k(()=>ol(`data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none`,t.class));U(o,()=>bx,(a,o)=>{o(a,K({"data-slot":`scroll-area-scrollbar`,get"data-orientation"(){return r()},get orientation(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=uZ(),i=N(r);H(i,()=>t.children??w),U(P(i,2),()=>Tx,(e,t)=>{t(e,{"data-slot":`scroll-area-thumb`,class:`rounded-full bg-border relative flex-1`})}),z(e,r)},$$slots:{default:!0}}))})}z(e,a),O()}var fZ=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function pZ(e){return e?.supportedThinkingLevels?.length?e.supportedThinkingLevels:[`off`]}function mZ(e,t){let n=pZ(t);if(n.includes(e))return e;let r=fZ.indexOf(e);if(r===-1)return n[0]??`off`;for(let e=r;e<fZ.length;e++){let t=fZ[e];if(n.includes(t))return t}for(let e=r-1;e>=0;e--){let t=fZ[e];if(n.includes(t))return t}return n[0]??`off`}function hZ(e){return e.rememberLastAgentSelection?e.lastAgentSelection:{mode:e.defaultMode,permissionLevel:e.defaultPermissionLevel,model:e.defaultModel,thinkingLevel:e.defaultThinkingLevel}}function gZ(e,t,n){let r=hZ(e),i=oE(t,n,e.scopedModels),a=r.model,o=(a?i.find(e=>YT(e)===YT(a)):void 0)??i[0];return{selectedModelKey:o?YT(o):``,selectedThinkingLevel:mZ(r.thinkingLevel,o),selectedMode:r.mode,selectedPermissionLevel:r.permissionLevel}}var _Z=Mn({subscriptionUsage:{}}),vZ,yZ,bZ=!1,xZ=!1;function SZ(){return Y.agents.find(e=>e.id===hT.agentId)}function CZ(){return CT.models.find(e=>YT(e)===yT.selectedModelKey)}async function wZ(){PT({kind:`settings`,id:`settings`}),RT({kind:`settings`,id:`settings`}),await OZ()}async function TZ(){PT({kind:`settings`,id:`settings`}),RT({kind:`settings`,id:`settings`}),CT.settingsDraft||await OZ()}function EZ(){let e={kind:`settings`,id:`settings`},t=Y.activeCenterTab?.kind===`settings`,n=IT(e);LT(e),t&&BT(n)}async function DZ(){let e=await wD();return _Z.subscriptionUsage=Object.fromEntries(e.map(e=>[e.provider,e])),e}async function OZ(){let[e,t,n,r]=await Promise.all([uie(),gD(),nD(),wD().catch(()=>[])]);CT.settingsDraft=e,OC(e.ui.zoomLevel),CT.models=t,CT.authProviders=n,_Z.subscriptionUsage=Object.fromEntries(r.map(e=>[e.provider,e]));let i=oE(t,n,e.scopedModels),a=gZ(e,t,n),o=SZ();if(o){yT.selectedMode=o.mode,yT.selectedPermissionLevel=o.permissionLevel;let e=o.model;e&&i.some(t=>YT(t)===YT(e))?(yT.selectedModelKey=YT(e),yT.selectedThinkingLevel=o.thinkingLevel):(yT.selectedModelKey=a.selectedModelKey,yT.selectedThinkingLevel=a.selectedThinkingLevel)}else yT.selectedMode=a.selectedMode,yT.selectedPermissionLevel=a.selectedPermissionLevel,yT.selectedModelKey=a.selectedModelKey,yT.selectedThinkingLevel=a.selectedThinkingLevel;yT.selectedThinkingLevel=mZ(yT.selectedThinkingLevel,CZ()),NZ()||(xZ=!1,CT.settingsSaveStatus=`idle`,CT.settingsMessage=void 0)}function kZ(e,t){let n={...e??{},...t};return(e?.server||t.server)&&(n.server={...e?.server??{},...t.server??{}}),(e?.ui||t.ui)&&(n.ui={...e?.ui??{},...t.ui??{}}),(e?.desktop||t.desktop)&&(n.desktop={...e?.desktop??{},...t.desktop??{}}),(e?.lastAgentSelection||t.lastAgentSelection)&&(n.lastAgentSelection={...e?.lastAgentSelection??{},...t.lastAgentSelection??{}}),(e?.exploreAgent||t.exploreAgent)&&(n.exploreAgent={...e?.exploreAgent??{},...t.exploreAgent??{}}),(e?.compaction||t.compaction)&&(n.compaction={...e?.compaction??{},...t.compaction??{}}),(e?.runtime||t.runtime)&&(n.runtime={...e?.runtime??{},...t.runtime??{}}),n}function AZ(e){return!!(e?.server&&Object.keys(e.server).length>0)}function jZ(e){return!!(e?.runtime&&Object.keys(e.runtime).length>0)}function MZ(){yZ&&=(clearTimeout(yZ),void 0)}function NZ(){return!!(vZ||yZ||bZ)}function PZ(e){let t=oE(CT.models,CT.authProviders,e);t.some(e=>YT(e)===yT.selectedModelKey)||(yT.selectedModelKey=t.length>0?YT(t[0]):``,yT.selectedThinkingLevel=mZ(yT.selectedThinkingLevel,CZ()))}function FZ(e,t={}){if(vZ=kZ(vZ,e),`scopedModels`in e&&PZ(e.scopedModels),CT.settingsSaveStatus=`dirty`,CT.settingsMessage=`Unsaved changes`,MZ(),t.immediate){IZ();return}yZ=setTimeout(()=>void IZ(),t.debounceMs??600)}async function IZ(){if(MZ(),bZ||!vZ)return;let e=vZ;vZ=void 0,bZ=!0,CT.settingsSaveStatus=`saving`,CT.settingsMessage=`Saving…`;try{let t=await die(e);if(xZ||=AZ(e),jZ(e)){let e=await hD().catch(()=>void 0);e&&(Y.config=e,Y.status=e.status)}vZ||(CT.settingsDraft=t,CT.settingsSaveStatus=`saved`,CT.settingsMessage=xZ?`Saved — restart the daemon to apply server binding changes.`:`Saved`)}catch(t){let n=t instanceof Error?t.message:String(t);vZ=kZ(e,vZ??{}),CT.settingsSaveStatus=`error`,CT.settingsMessage=n,id.error(`Could not save settings`,{description:n})}finally{bZ=!1,vZ&&CT.settingsSaveStatus!==`error`&&IZ()}}function LZ(e){wC(e)}function RZ(e){let t=TC(e);OC(t),CT.settingsDraft&&(CT.settingsDraft.ui.zoomLevel=t),FZ({ui:{zoomLevel:t}})}var zZ={kind:`auth`,id:`auth`};function BZ(){PT(zZ),RT(zZ),UZ()}function VZ(){PT(zZ),RT(zZ),vT.catalogLoaded||UZ()}function HZ(){let e=Y.activeCenterTab?.kind===`auth`,t=IT(zZ);LT(zZ),e&&BT(t)}async function UZ(){let[e]=await Promise.all([uD(),OZ()]);vT.customProviders=e.providers,vT.modelDefinitions=e.models,vT.catalogLoaded=!0}async function WZ(){let e=await uD();vT.customProviders=e.providers,vT.modelDefinitions=e.models,vT.catalogLoaded=!0,await OZ()}var GZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function KZ(e,t){let n=G(t,GZ),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]];ic(e,K({name:`plus`},()=>n,{get iconNode(){return r}}))}var qZ=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function JZ(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,qZ);var i=R();U(N(i),()=>_ne,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var YZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`variant`,`size`]);function XZ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=q(t,`size`,3,`default`),a=G(t,YZ);var o=R(),s=N(o);{let e=k(()=>ol(wl({variant:r(),size:i()}),`cn-alert-dialog-action`,t.class));U(s,()=>Sne,(t,r)=>{r(t,K({"data-slot":`alert-dialog-action`,get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,o),O()}var ZZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`variant`,`size`]);function QZ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`outline`),i=q(t,`size`,3,`default`),a=G(t,ZZ);var o=R(),s=N(o);{let e=k(()=>ol(wl({variant:r(),size:i()}),`cn-alert-dialog-cancel`,t.class));U(s,()=>Tne,(t,r)=>{r(t,K({"data-slot":`alert-dialog-cancel`,get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,o),O()}var $Z=new Set([`$$slots`,`$$events`,`$$legacy`]);function eQ(e,t){let n=G(t,$Z);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var tQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function nQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,tQ);var i=R(),a=N(i);{let e=k(()=>ol(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-sidebar/70 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,t.class));U(a,()=>ch,(t,i)=>{i(t,K({"data-slot":`alert-dialog-overlay`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var rQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`size`,`portalProps`]),iQ=L(`<!> <!>`,1);function aQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`size`,3,`default`),i=G(t,rQ);eQ(e,K(()=>t.portalProps,{children:(e,a)=>{var o=iQ(),s=N(o);nQ(s,{});var c=P(s,2);{let e=k(()=>ol(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-popover text-popover-foreground ring-foreground/10 gap-6 rounded-xl p-6 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none`,t.class));U(c,()=>ah,(t,a)=>{a(t,K({"data-slot":`alert-dialog-content`,get"data-size"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,o)},$$slots:{default:!0}})),O()}var oQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function sQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,oQ);var i=R(),a=N(i);{let e=k(()=>ol(`text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3`,t.class));U(a,()=>dh,(t,i)=>{i(t,K({"data-slot":`alert-dialog-description`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var cQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),lQ=L(`<div><!></div>`);function uQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,cQ);var i=lQ();_a(i,e=>({"data-slot":`alert-dialog-footer`,class:e,...r}),[()=>ol(`cn-alert-dialog-footer flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,t.class)]),H(M(i),()=>t.children??w),T(i),Ta(i,e=>n(e),()=>n()),z(e,i),O()}var dQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),fQ=L(`<div><!></div>`);function pQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,dQ);var i=fQ();_a(i,e=>({"data-slot":`alert-dialog-header`,class:e,...r}),[()=>ol(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,t.class)]),H(M(i),()=>t.children??w),T(i),Ta(i,e=>n(e),()=>n()),z(e,i),O()}var mQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function hQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,mQ);var i=R(),a=N(i);{let e=k(()=>ol(`text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,t.class));U(a,()=>Kp,(t,i)=>{i(t,K({"data-slot":`alert-dialog-title`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var gQ=L(`<!> <!>`,1);function _Q(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`confirmLabel`,3,`Confirm`),i=q(t,`cancelLabel`,3,`Cancel`),a=q(t,`destructive`,3,!1);function o(){n(!1),t.onOpenChange?.(!1)}function s(){t.onConfirm?.(),o()}function c(){t.onCancel?.(),o()}var l=R();U(N(l),()=>JZ,(e,o)=>{o(e,{get onOpenChange(){return t.onOpenChange},get open(){return n()},set open(e){n(e)},children:(e,n)=>{var o=R();U(N(o),()=>aQ,(e,n)=>{n(e,{get class(){return t.class},children:(e,n)=>{var o=gQ(),l=N(o);U(l,()=>pQ,(e,n)=>{n(e,{children:(e,n)=>{var r=gQ(),i=N(r);U(i,()=>hQ,(e,n)=>{n(e,{children:(e,n)=>{E();var r=wi();F(()=>B(r,t.title)),z(e,r)},$$slots:{default:!0}})});var a=P(i,2),o=e=>{var n=R();U(N(n),()=>sQ,(e,n)=>{n(e,{children:(e,n)=>{E();var r=wi();F(()=>B(r,t.description)),z(e,r)},$$slots:{default:!0}})}),z(e,n)};V(a,e=>{t.description&&e(o)}),z(e,r)},$$slots:{default:!0}})}),U(P(l,2),()=>uQ,(e,t)=>{t(e,{children:(e,t)=>{var n=gQ(),o=N(n);U(o,()=>QZ,(e,t)=>{t(e,{onclick:c,children:(e,t)=>{E();var n=wi();F(()=>B(n,i())),z(e,n)},$$slots:{default:!0}})});var l=P(o,2);{let e=k(()=>a()?`destructive`:`default`);U(l,()=>XZ,(t,n)=>{n(t,{get variant(){return I(e)},onclick:s,children:(e,t)=>{E();var n=wi();F(()=>B(n,r())),z(e,n)},$$slots:{default:!0}})})}z(e,n)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})}),z(e,l),O()}var vQ=new Set([`$$slots`,`$$events`,`$$legacy`]);function yQ(e,t){let n=G(t,vQ),r=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`M10 14 21 3`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]];ic(e,K({name:`external-link`},()=>n,{get iconNode(){return r}}))}var bQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`type`,`files`,`class`,`size`,`ariaLabel`,`data-slot`]),xQ=L(`<input/>`);function SQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15),i=q(t,`files`,15),a=q(t,`size`,3,`default`),o=q(t,`data-slot`,3,`input`),s=G(t,bQ),c=k(()=>a()===`sm`?`h-8`:`h-9`);var l=R(),u=N(l),d=e=>{var a=xQ();_a(a,e=>({"data-slot":o(),"aria-label":t.ariaLabel,class:e,type:`file`,...s}),[()=>ol(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,I(c),t.class)],void 0,void 0,void 0,!0),Ta(a,e=>n(e),()=>n()),Oee(a,i),xa(a,r),z(e,a)},f=e=>{var i=xQ();_a(i,e=>({"data-slot":o(),"aria-label":t.ariaLabel,class:e,type:t.type,...s}),[()=>ol(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,I(c),t.class)],void 0,void 0,void 0,!0),Ta(i,e=>n(e),()=>n()),xa(i,r),z(e,i)};V(u,e=>{t.type===`file`?e(d):e(f,-1)}),z(e,l),O()}function CQ(e){let t=atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}function wQ(e){let t=new TextEncoder().encode(e),n=new ArrayBuffer(t.length);return new Uint8Array(n).set(t),n}function TQ(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}async function EQ(e,t){let n=globalThis.crypto?.subtle;if(!n)throw Error(`Secure cryptography is unavailable. Open the app over HTTPS or on localhost to add credentials.`);let r=await n.importKey(`spki`,CQ(t.publicKey),{name:`RSA-OAEP`,hash:`SHA-256`},!1,[`encrypt`]),i=await n.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`]),a=new ArrayBuffer(12),o=new Uint8Array(a);globalThis.crypto.getRandomValues(o);let s=await n.encrypt({name:`AES-GCM`,iv:o},i,wQ(e)),c=await n.exportKey(`raw`,i),l=await n.encrypt({name:`RSA-OAEP`},r,c);return{keyId:t.keyId,encryptedKey:TQ(l),iv:TQ(a),ciphertext:TQ(s)}}var DQ=class{#e=A(`choose`);get step(){return I(this.#e)}set step(e){j(this.#e,e,!0)}#t=A(void 0);get selected(){return I(this.#t)}set selected(e){j(this.#t,e,!0)}#n=A(``);get apiKey(){return I(this.#n)}set apiKey(e){j(this.#n,e,!0)}#r=A(``);get promptValue(){return I(this.#r)}set promptValue(e){j(this.#r,e,!0)}#i=A(!1);get busy(){return I(this.#i)}set busy(e){j(this.#i,e,!0)}#a=A(void 0);get error(){return I(this.#a)}set error(e){j(this.#a,e,!0)}#o=A(void 0);get flow(){return I(this.#o)}set flow(e){j(this.#o,e,!0)}#s;#c;constructor(e){this.#c=e}get dialogTitle(){return this.step===`choose`?`Add provider`:this.selected?`Connect ${this.selected.displayName}`:`Add provider`}get dialogDescription(){return this.step===`api-key`?`Your API key is encrypted in your browser before it is sent to the orchestrator.`:this.step===`oauth`?`Complete the subscription login. Secrets are exchanged directly between the orchestrator and the provider.`:`Authenticate with a subscription or an API key.`}#l(){this.#s&&=(clearTimeout(this.#s),void 0)}#u(e){return e.status===`succeeded`||e.status===`failed`||e.status===`cancelled`}#d(){this.#l(),this.#s=setTimeout(async()=>{let e=this.flow;if(!(!e||this.#u(e))){try{this.flow=await sD(e.flowId)}catch(e){this.error=e instanceof Error?e.message:String(e)}this.flow&&!this.#u(this.flow)&&this.#d()}},800)}reset(){this.#l(),this.step=`choose`,this.selected=void 0,this.apiKey=``,this.promptValue=``,this.busy=!1,this.error=void 0,this.flow=void 0}async close(){let e=this.flow;if(e&&!this.#u(e))try{await lD(e.flowId)}catch{}this.reset(),this.#c()}chooseProvider(e){this.selected=e,this.error=void 0,e.supportsOAuth?this.beginOAuth(e):this.step=`api-key`}async submitApiKey(){if(!(!this.selected||this.apiKey.trim().length===0)){this.busy=!0,this.error=void 0;try{let e=await rD(),t=await EQ(this.apiKey.trim(),e);await iD(this.selected.provider,t),this.apiKey=``,await this.close()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}}async beginOAuth(e){this.step=`oauth`,this.busy=!0,this.error=void 0;try{this.flow=await oD(e.provider),this.#d()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}async submitPrompt(){let e=this.flow;if(!e?.promptId)return;let t=this.promptValue;if(!(!e.allowEmpty&&t.trim().length===0)){this.busy=!0,this.error=void 0;try{this.flow=await cD(e.flowId,{promptId:e.promptId,value:t}),this.promptValue=``,this.#d()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}}async selectOption(e){let t=this.flow;if(t?.promptId){this.busy=!0,this.error=void 0;try{this.flow=await cD(t.flowId,{promptId:t.promptId,selectedId:e}),this.#d()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}}openExternal(e){window.open(e,`_blank`,`noopener`)}},OQ=L(`<!> <!>`,1),kQ=L(`<p class="add-provider-empty svelte-120w2mx">All known providers are already connected.</p>`),AQ=L(`<li><button type="button" class="provider-choice svelte-120w2mx"><span class="provider-choice-icon svelte-120w2mx" aria-hidden="true"><!></span> <span class="provider-choice-text svelte-120w2mx"><strong class="svelte-120w2mx"> </strong> <span class="svelte-120w2mx"> </span></span> <span class="provider-choice-tags svelte-120w2mx"><!> <!></span></button></li>`),jQ=L(`<ul class="provider-choices svelte-120w2mx"></ul>`),MQ=L(`<span class="api-key-env svelte-120w2mx"> </span>`),NQ=L(`<form class="api-key-form svelte-120w2mx"><label class="api-key-label svelte-120w2mx" for="add-provider-api-key">API key <!></label> <!></form>`),PQ=L(`<p class="oauth-message svelte-120w2mx"> </p>`),FQ=L(`<!> Open login page`,1),IQ=L(`<p class="oauth-hint svelte-120w2mx"> </p>`),LQ=L(`<!> Open verification page`,1),RQ=L(`<div class="device-code svelte-120w2mx"><!> <p class="oauth-hint svelte-120w2mx">Enter this code:</p> <code class="device-user-code svelte-120w2mx"> </code></div>`),zQ=L(`<div class="oauth-options svelte-120w2mx"></div>`),BQ=L(`<form class="oauth-prompt svelte-120w2mx"><!> <!> <!></form>`),VQ=L(`<p class="oauth-success svelte-120w2mx"> </p>`),HQ=L(`<p class="oauth-progress svelte-120w2mx"><!> Working…</p>`),UQ=L(`<p class="oauth-progress svelte-120w2mx"><!> Starting login…</p>`),WQ=L(`<div class="oauth-flow svelte-120w2mx" aria-live="polite"><!></div>`),GQ=L(`<p class="add-provider-error svelte-120w2mx"><!> </p>`),KQ=L(`<div class="add-provider-body svelte-120w2mx"><!> <!></div>`);function qQ(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`authProviders`,19,()=>[]),i=q(t,`kind`,3,`all`),a=q(t,`excludeProviders`,19,()=>[]),o=new DQ(()=>{n(!1),t.onClose?.()}),s=k(()=>new Set(a())),c=k(()=>[...r()].filter(e=>e.configured||I(s).has(e.provider)?!1:i()===`oauth`?e.supportsOAuth:i()===`api_key`?e.supportsApiKey&&!e.supportsOAuth:e.supportsOAuth||e.supportsApiKey).sort((e,t)=>e.displayName.localeCompare(t.displayName)));function l(e){e||o.close()}ZX(e,{get title(){return o.dialogTitle},get description(){return o.dialogDescription},class:`add-provider-dialog`,onOpenChange:l,get open(){return n()},set open(e){n(e)},footer:e=>{var t=OQ(),n=N(t);Ol(n,{variant:`ghost`,onclick:()=>void o.close(),children:(e,t)=>{E(),z(e,wi(`Cancel`))},$$slots:{default:!0}});var r=P(n,2),i=e=>{{let t=k(()=>o.busy||o.apiKey.trim().length===0);Ol(e,{onclick:()=>void o.submitApiKey(),get disabled(){return I(t)},children:(e,t)=>{E();var n=wi();F(()=>B(n,o.busy?`Saving…`:`Save API key`)),z(e,n)},$$slots:{default:!0}})}},a=e=>{{let t=k(()=>o.busy||!o.flow.allowEmpty&&o.promptValue.trim().length===0);Ol(e,{onclick:()=>void o.submitPrompt(),get disabled(){return I(t)},children:(e,t)=>{E(),z(e,wi(`Submit`))},$$slots:{default:!0}})}};V(r,e=>{o.step===`api-key`?e(i):o.step===`oauth`&&o.flow?.status===`prompt`&&e(a,1)}),z(e,t)},children:(e,t)=>{var n=KQ(),r=M(n),i=e=>{var t=R(),n=N(t),r=e=>{z(e,kQ())},i=e=>{var t=jQ();Ni(t,21,()=>I(c),e=>e.provider,(e,t)=>{var n=AQ(),r=M(n),i=M(r),a=M(i),s=e=>{aZ(e,{size:16,strokeWidth:2})},c=e=>{HX(e,{size:16,strokeWidth:2})};V(a,e=>{I(t).supportsOAuth?e(s):e(c,-1)}),T(i);var l=P(i,2),u=M(l),d=M(u,!0);T(u);var f=P(u,2),p=M(f,!0);T(f),T(l);var m=P(l,2),h=M(m),g=e=>{of(e,{tone:`accent`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`Subscription`))},$$slots:{default:!0}})};V(h,e=>{I(t).supportsOAuth&&e(g)});var _=P(h,2),v=e=>{of(e,{tone:`neutral`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`API key`))},$$slots:{default:!0}})};V(_,e=>{I(t).supportsApiKey&&e(v)}),T(m),T(r),T(n),F(()=>{B(d,I(t).displayName),B(p,I(t).provider)}),_i(`click`,r,()=>o.chooseProvider(I(t))),z(e,n)}),T(t),z(e,t)};V(n,e=>{I(c).length===0?e(r):e(i,-1)}),z(e,t)},a=e=>{var t=NQ(),n=M(t),r=P(M(n)),i=e=>{var t=MQ(),n=M(t,!0);T(t),F(()=>B(n,o.selected.envVar)),z(e,t)};V(r,e=>{o.selected?.envVar&&e(i)}),T(n),SQ(P(n,2),{id:`add-provider-api-key`,type:`password`,autocomplete:`off`,placeholder:`Paste your API key`,get disabled(){return o.busy},get value(){return o.apiKey},set value(e){o.apiKey=e}}),T(t),gi(`submit`,t,e=>{e.preventDefault(),o.submitApiKey()}),z(e,t)},s=e=>{var t=WQ(),n=M(t),r=e=>{var t=OQ(),n=N(t),r=e=>{var t=PQ(),n=M(t,!0);T(t),F(()=>B(n,o.flow.message)),z(e,t)};V(n,e=>{o.flow.message&&e(r)});var i=P(n,2),a=e=>{var t=OQ(),n=N(t);Ol(n,{variant:`outline`,onclick:()=>o.flow?.authUrl&&o.openExternal(o.flow.authUrl),children:(e,t)=>{var n=FQ();yQ(N(n),{size:15,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var r=P(n,2),i=e=>{var t=IQ(),n=M(t,!0);T(t),F(()=>B(n,o.flow.instructions)),z(e,t)};V(r,e=>{o.flow.instructions&&e(i)}),z(e,t)},s=e=>{var t=RQ(),n=M(t);Ol(n,{variant:`outline`,onclick:()=>o.flow?.deviceCode&&o.openExternal(o.flow.deviceCode.verificationUri),children:(e,t)=>{var n=LQ();yQ(N(n),{size:15,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var r=P(n,4),i=M(r,!0);T(r),T(t),F(()=>B(i,o.flow.deviceCode.userCode)),z(e,t)},c=e=>{var t=zQ();Ni(t,21,()=>o.flow.options,e=>e.id,(e,t)=>{Ol(e,{variant:`outline`,get disabled(){return o.busy},onclick:()=>void o.selectOption(I(t).id),children:(e,n)=>{E();var r=wi();F(()=>B(r,I(t).label)),z(e,r)},$$slots:{default:!0}})}),T(t),z(e,t)},l=e=>{var t=BQ(),n=M(t),r=e=>{Ol(e,{variant:`outline`,onclick:()=>o.flow?.authUrl&&o.openExternal(o.flow.authUrl),children:(e,t)=>{var n=FQ();yQ(N(n),{size:15,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}})};V(n,e=>{o.flow.authUrl&&e(r)});var i=P(n,2),a=e=>{var t=IQ(),n=M(t,!0);T(t),F(()=>B(n,o.flow.instructions)),z(e,t)};V(i,e=>{o.flow.instructions&&e(a)});var s=P(i,2);{let e=k(()=>o.flow.placeholder??`Paste the code or redirect URL`);SQ(s,{type:`text`,autocomplete:`off`,get placeholder(){return I(e)},get disabled(){return o.busy},get value(){return o.promptValue},set value(e){o.promptValue=e}})}T(t),gi(`submit`,t,e=>{e.preventDefault(),o.submitPrompt()}),z(e,t)},u=e=>{var t=VQ(),n=M(t);T(t),F(()=>B(n,`Connected to ${o.flow.providerName??``}.`)),z(e,t)},d=e=>{var t=HQ();GE(M(t),{class:`spin`,size:16,strokeWidth:2}),E(),T(t),z(e,t)};V(i,e=>{o.flow.status===`auth_url`&&o.flow.authUrl?e(a):o.flow.status===`device_code`&&o.flow.deviceCode?e(s,1):o.flow.status===`select`&&o.flow.options?e(c,2):o.flow.status===`prompt`?e(l,3):o.flow.status===`succeeded`?e(u,4):e(d,-1)}),z(e,t)},i=e=>{var t=UQ();GE(M(t),{class:`spin`,size:16,strokeWidth:2}),E(),T(t),z(e,t)};V(n,e=>{o.flow?e(r):e(i,-1)}),T(t),z(e,t)};V(r,e=>{o.step===`choose`?e(i):o.step===`api-key`?e(a,1):o.step===`oauth`&&e(s,2)});var l=P(r,2),u=e=>{var t=GQ(),n=M(t);Ld(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${o.error??``}`)),z(e,t)};V(l,e=>{o.error&&e(u)}),T(n),z(e,n)},$$slots:{footer:!0,default:!0}}),O()}vi([`click`]);var lde=L(`<!> Add API key`,1),ude=L(`<p class="settings-note">Add a provider API key to authenticate models.</p>`),dde=L(`<span class="svelte-26k56"> </span>`),fde=L(`<li class="provider-item svelte-26k56"><div class="provider-item-text svelte-26k56"><strong class="svelte-26k56"> </strong> <!></div> <div class="provider-item-actions svelte-26k56"><!> <!></div></li>`),pde=L(`<ul class="provider-list svelte-26k56"></ul>`),mde=L(`<section id="auth-api-keys" class="settings-section" data-section="api-keys"><header class="settings-section-header"><div class="settings-section-kicker"><!> API keys</div> <h2>Provider API keys</h2> <p>Add API keys for model providers. Keys are encrypted in your browser before being sent to the orchestrator.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-26k56"><div class="settings-copy"><strong> </strong> <span>Add a key for OpenAI, Anthropic, Google, Groq, OpenRouter, xAI, and more.</span></div> <!></div> <!></div></section> <!> <!>`,1);function hde(e,t){D(t,!0);let n=q(t,`authProviders`,19,()=>[]),r=A(!1),i=A(void 0),a=k(()=>new Set(vT.customProviders.map(e=>e.id))),o=k(()=>new Set([`tavily`,...I(a)])),s=k(()=>n().filter(e=>e.configured&&e.credentialType===`api_key`&&!I(o).has(e.provider)).sort((e,t)=>e.displayName.localeCompare(t.displayName))),c=k(()=>[...I(o)]);async function l(){let e=I(i);if(e)try{await aD(e.provider),await UZ()}catch{}finally{j(i,void 0)}}var u=mde(),d=N(u),f=M(d),p=M(f);HX(M(p),{size:14,strokeWidth:2.1}),E(),T(p),E(4),T(f);var m=P(f,2),h=M(m),g=M(h),_=M(g),v=M(_,!0);T(_),E(2),T(g),Ol(P(g,2),{size:`sm`,onclick:()=>j(r,!0),children:(e,t)=>{var n=lde();KZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}}),T(h);var y=P(h,2),b=e=>{z(e,ude())},x=e=>{var t=pde();Ni(t,21,()=>I(s),e=>e.provider,(e,t)=>{var n=fde(),r=M(n),a=M(r),o=M(a,!0);T(a);var s=P(a,2),c=e=>{var n=dde(),r=M(n,!0);T(n),F(()=>B(r,I(t).envVar)),z(e,n)};V(s,e=>{I(t).envVar&&e(c)}),T(r);var l=P(r,2),u=M(l);of(u,{tone:`good`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`Configured`))},$$slots:{default:!0}}),Ol(P(u,2),{variant:`ghost`,size:`sm`,onclick:()=>j(i,I(t),!0),children:(e,t)=>{E(),z(e,wi(`Remove`))},$$slots:{default:!0}}),T(l),T(n),F(()=>B(o,I(t).displayName)),z(e,n)}),T(t),z(e,t)};V(y,e=>{I(s).length===0?e(b):e(x,-1)}),T(m),T(d);var S=P(d,2);qQ(S,{get authProviders(){return n()},kind:`api_key`,get excludeProviders(){return I(c)},get open(){return I(r)},set open(e){j(r,e,!0)}});var ee=P(S,2);{let e=k(()=>!!I(i)),t=k(()=>I(i)?`This removes the stored API key for “${I(i).displayName}” from the orchestrator.`:``);_Q(ee,{get open(){return I(e)},title:`Remove API key?`,get description(){return I(t)},confirmLabel:`Remove`,destructive:!0,onConfirm:()=>void l(),onOpenChange:e=>{e||j(i,void 0)}})}F(()=>B(v,I(s).length===0?`No API keys configured`:`${I(s).length} configured`)),z(e,u),O()}var gde=new Set([`$$slots`,`$$events`,`$$legacy`]);function JQ(e,t){let n=G(t,gde),r=[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}],[`path`,{d:`m15 5 4 4`}]];ic(e,K({name:`pencil`},()=>n,{get iconNode(){return r}}))}var _de=new Set([`$$slots`,`$$events`,`$$legacy`]);function YQ(e,t){let n=G(t,_de),r=[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]];ic(e,K({name:`trash-2`},()=>n,{get iconNode(){return r}}))}var vde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function XQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,vde);var i=R(),a=N(i);{let e=k(()=>ol(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,t.class));U(a,()=>eb,(t,i)=>{i(t,K({"data-slot":`label`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var yde=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`]);function bde(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`value`,15),i=G(t,yde);var a=R();U(N(a),()=>Mx,(e,t)=>{t(e,K(()=>i,{get open(){return n()},set open(e){n(e)},get value(){return r()},set value(e){r(e)}}))}),z(e,a),O()}var xde=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sde(e,t){let n=G(t,xde);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var Cde=new Set([`$$slots`,`$$events`,`$$legacy`]);function wde(e,t){let n=G(t,Cde),r=[[`path`,{d:`m18 15-6-6-6 6`}]];ic(e,K({name:`chevron-up`},()=>n,{get iconNode(){return r}}))}var Tde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Ede(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Tde);var i=R(),a=N(i);{let e=k(()=>ol(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full`,t.class));U(a,()=>Gv,(t,i)=>{i(t,K({"data-slot":`select-scroll-up-button`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{wde(e,{})},$$slots:{default:!0}}))})}z(e,i),O()}var Dde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Ode(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Dde);var i=R(),a=N(i);{let e=k(()=>ol(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full`,t.class));U(a,()=>Vv,(t,i)=>{i(t,K({"data-slot":`select-scroll-down-button`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{Iw(e,{})},$$slots:{default:!0}}))})}z(e,i),O()}var kde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`portalProps`,`children`,`preventScroll`]),Ade=L(`<!> <!> <!>`,1);function jde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,4),i=q(t,`preventScroll`,3,!0),a=G(t,kde);Sde(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ol(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 overflow-x-hidden overflow-y-auto`,t.class));U(c,()=>kv,(o,s)=>{s(o,K({get sideOffset(){return r()},get preventScroll(){return i()},"data-slot":`select-content`,get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Ade(),i=N(r);Ede(i,{});var a=P(i,2);{let e=k(()=>ol(`max-h-[min(var(--bits-select-content-available-height),18rem)] w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1`));U(a,()=>Lv,(n,r)=>{r(n,{get class(){return I(e)},children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}})})}Ode(P(a,2),{}),z(e,r)},$$slots:{default:!0}}))})}z(e,s)},$$slots:{default:!0}})),O()}var Mde=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZQ(e,t){let n=G(t,Mde),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];ic(e,K({name:`check`},()=>n,{get iconNode(){return r}}))}var Nde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`,`label`,`children`]),Pde=L(`<span class="absolute end-2 flex size-3.5 items-center justify-center"><!></span> <!>`,1);function Fde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Nde);var i=R(),a=N(i);{let e=(e,n)=>{let r=()=>n?.().selected,i=()=>n?.().highlighted;var a=Pde(),o=N(a),s=M(o),c=e=>{ZQ(e,{class:`cn-select-item-indicator-icon`})};V(s,e=>{r()&&e(c)}),T(o);var l=P(o,2),u=e=>{var n=R();H(N(n),()=>t.children,()=>({selected:r(),highlighted:i()})),z(e,n)},d=e=>{var n=wi();F(()=>B(n,t.label||t.value)),z(e,n)};V(l,e=>{t.children?e(u):e(d,-1)}),z(e,a)},i=k(()=>ol(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 focus:bg-accent data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:text-accent-foreground relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(a,()=>Pv,(a,o)=>{o(a,K({get value(){return t.value},"data-slot":`select-item`,get class(){return I(i)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:e,$$slots:{default:!0}}))})}z(e,i),O()}var Ide=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`size`]),Lde=L(`<!> <!>`,1);function Rde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`size`,3,`default`),i=G(t,Ide);var a=R(),o=N(a);{let e=k(()=>ol(`border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(o,()=>Fx,(a,o)=>{o(a,K({"data-slot":`select-trigger`,get"data-size"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Lde(),i=N(r);H(i,()=>t.children??w),Iw(P(i,2),{class:`text-muted-foreground size-4 pointer-events-none`}),z(e,r)},$$slots:{default:!0}}))})}z(e,a),O()}var zde=L(`<span class="truncate"> </span>`),Bde=L(`<span class="truncate text-xs text-muted-foreground"> </span>`),Vde=L(`<div class="flex min-w-0 flex-col items-start"><span class="truncate"> </span> <!></div>`),Hde=L(`<!> <!>`,1);function QQ(e,t){D(t,!0);let n=q(t,`items`,19,()=>[]),r=q(t,`value`,15,``),i=q(t,`placeholder`,3,`Select`),a=q(t,`disabled`,3,!1),o=k(()=>n().find(e=>e.value===r())?.label);var s=R();U(N(s),()=>bde,(e,s)=>{s(e,{type:`single`,get disabled(){return a()},get onValueChange(){return t.onValueChange},get value(){return r()},set value(e){r(e)},children:(e,r)=>{var a=Hde(),s=N(a);{let e=k(()=>ol(`w-full min-w-0`,t.triggerClass,t.class));U(s,()=>Rde,(n,r)=>{r(n,{size:`sm`,get"aria-label"(){return t.ariaLabel},get class(){return I(e)},children:(e,t)=>{var n=zde(),r=M(n,!0);T(n),F(()=>B(r,I(o)??i())),z(e,n)},$$slots:{default:!0}})})}U(P(s,2),()=>jde,(e,r)=>{r(e,{get class(){return t.contentClass},children:(e,t)=>{var r=R();Ni(N(r),17,n,e=>e.value,(e,t)=>{var n=R();U(N(n),()=>Fde,(e,n)=>{n(e,{get value(){return I(t).value},get label(){return I(t).label},get disabled(){return I(t).disabled},children:(e,n)=>{var r=Vde(),i=M(r),a=M(i,!0);T(i);var o=P(i,2),s=e=>{var n=Bde(),r=M(n,!0);T(n),F(()=>B(r,I(t).detail)),z(e,n)};V(o,e=>{I(t).detail&&e(s)}),T(r),F(()=>B(a,I(t).label)),z(e,r)},$$slots:{default:!0}})}),z(e,n)}),z(e,r)},$$slots:{default:!0}})}),z(e,a)},$$slots:{default:!0}})}),z(e,s),O()}var Ude=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`data-slot`]),Wde=L(`<textarea></textarea>`);function $Q(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15),i=q(t,`data-slot`,3,`textarea`),a=G(t,Ude);var o=Wde();Jn(o),_a(o,e=>({"data-slot":i(),class:e,...a}),[()=>ol(`border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50`,t.class)]),Ta(o,e=>n(e),()=>n()),xa(o,r),z(e,o),O()}var Gde=[{value:`openai-completions`,label:`OpenAI Chat Completions`,detail:`OpenAI-compatible (Ollama, vLLM, Together, Groq…)`},{value:`openai-responses`,label:`OpenAI Responses`,detail:`OpenAI Responses API`},{value:`azure-openai-responses`,label:`Azure OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`google-vertex`,label:`Google Vertex AI`},{value:`mistral-conversations`,label:`Mistral Conversations`},{value:`bedrock-converse-stream`,label:`Amazon Bedrock Converse`},{value:`openai-codex-responses`,label:`OpenAI Codex Responses`}],Kde=L(`<!> <!>`,1),qde=L(`<p class="field-hint svelte-1rfwnr9" data-tone="error">Use lowercase letters, numbers, and dashes.</p>`),Jde=L(`<p class="field-hint svelte-1rfwnr9" data-tone="error"><!> </p>`),Yde=L(`<div class="provider-form svelte-1rfwnr9"><div class="field-grid svelte-1rfwnr9"><div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!> <!></div></div> <div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!> <p class="field-hint svelte-1rfwnr9">One <code class="svelte-1rfwnr9">Name: value</code> per line.</p></div> <div class="field svelte-1rfwnr9"><!> <!></div> <!></div>`);function Xde(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`hasKey`,3,!1),i=k(()=>!!t.provider),a=A(``),o=A(``),s=A(`openai-completions`),c=A(``),l=A(``),u=A(``),d=A(``),f=A(!1),p=A(!1),m=A(void 0);rr(()=>{n()&&(j(a,t.provider?.displayName??``,!0),j(o,t.provider?.id??``,!0),j(s,t.provider?.api??`openai-completions`,!0),j(c,t.provider?.baseUrl??``,!0),j(l,g(t.provider?.headers),!0),j(u,t.provider?.compat?JSON.stringify(t.provider.compat,null,2):``,!0),j(d,``),j(f,!1),j(m,void 0))});function h(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,64)}function g(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
78
|
-
`):``}function _(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e)continue;let r=e.indexOf(`:`);if(r===-1)continue;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();i&&(t[i]=a)}return t}function v(e){j(a,e,!0),!I(i)&&!I(f)&&j(o,h(e),!0)}let y=k(()=>/^[a-z0-9][a-z0-9-]*$/.test(I(o))),b=k(()=>I(a).trim().length>0&&I(y)&&I(c).trim().length>0&&!I(p));async function x(){if(I(b)){j(p,!0),j(m,void 0);try{let e;if(I(u).trim())try{e=JSON.parse(I(u))}catch{throw Error(`Compatibility overrides must be valid JSON.`)}await dD({id:I(o),displayName:I(a).trim(),api:I(s),baseUrl:I(c).trim(),headers:_(I(l)),...e?{compat:e}:{}});let t=I(d).trim();if(t){let e=await EQ(t,await rD());await iD(I(o),e)}await WZ(),n(!1)}catch(e){j(m,e instanceof Error?e.message:String(e),!0)}finally{j(p,!1)}}}{let h=e=>{var t=Kde(),r=N(t);Ol(r,{variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{E(),z(e,wi(`Cancel`))},$$slots:{default:!0}});var a=P(r,2);{let e=k(()=>!I(b));Ol(a,{onclick:()=>void x(),get disabled(){return I(e)},children:(e,t)=>{E();var n=wi();F(()=>B(n,I(p)?`Saving…`:I(i)?`Save provider`:`Add provider`)),z(e,n)},$$slots:{default:!0}})}z(e,t)},g=k(()=>I(i)?`Edit ${t.provider?.displayName}`:`Add custom provider`);ZX(e,{get title(){return I(g)},description:`Connect an OpenAI-compatible or other pi-ai supported endpoint.`,get open(){return n()},set open(e){n(e)},footer:h,children:(e,t)=>{var n=Yde(),h=M(n),g=M(h),_=M(g);XQ(_,{for:`custom-provider-name`,children:(e,t)=>{E(),z(e,wi(`Display name`))},$$slots:{default:!0}}),SQ(P(_,2),{id:`custom-provider-name`,get value(){return I(a)},oninput:e=>v(e.currentTarget.value),placeholder:`My local server`,get disabled(){return I(p)}}),T(g);var b=P(g,2),x=M(b);XQ(x,{for:`custom-provider-id`,children:(e,t)=>{E(),z(e,wi(`Provider id`))},$$slots:{default:!0}});var S=P(x,2);{let e=k(()=>I(p)||I(i)),t=k(()=>!I(y)&&I(o).length>0);SQ(S,{id:`custom-provider-id`,oninput:()=>j(f,!0),placeholder:`ollama`,get disabled(){return I(e)},get"aria-invalid"(){return I(t)},get value(){return I(o)},set value(e){j(o,e,!0)}})}var ee=P(S,2),C=e=>{z(e,qde())};V(ee,e=>{I(o).length>0&&!I(y)&&e(C)}),T(b),T(h);var te=P(h,2),ne=M(te);XQ(ne,{children:(e,t)=>{E(),z(e,wi(`API type`))},$$slots:{default:!0}}),QQ(P(ne,2),{get items(){return Gde},get value(){return I(s)},onValueChange:e=>j(s,e,!0),ariaLabel:`API type`}),T(te);var re=P(te,2),ie=M(re);XQ(ie,{for:`custom-provider-base-url`,children:(e,t)=>{E(),z(e,wi(`Base URL`))},$$slots:{default:!0}}),SQ(P(ie,2),{id:`custom-provider-base-url`,placeholder:`http://localhost:11434/v1`,get disabled(){return I(p)},get value(){return I(c)},set value(e){j(c,e,!0)}}),T(re);var ae=P(re,2),oe=M(ae);XQ(oe,{for:`custom-provider-key`,children:(e,t)=>{E();var n=wi();F(()=>B(n,`API key ${r()?`(stored — leave blank to keep)`:`(optional)`}`)),z(e,n)},$$slots:{default:!0}});var w=P(oe,2);{let e=k(()=>r()?`Paste a replacement key`:`Paste an API key`);SQ(w,{id:`custom-provider-key`,type:`password`,autocomplete:`off`,get placeholder(){return I(e)},get disabled(){return I(p)},get value(){return I(d)},set value(e){j(d,e,!0)}})}T(ae);var se=P(ae,2),ce=M(se);XQ(ce,{for:`custom-provider-headers`,children:(e,t)=>{E(),z(e,wi(`Custom headers (optional)`))},$$slots:{default:!0}}),$Q(P(ce,2),{id:`custom-provider-headers`,rows:3,placeholder:`X-Header: value
|
|
79
|
-
Another-Header: value`,get disabled(){return I(p)},get value(){return I(l)},set value(e){j(l,e,!0)}}),E(2),T(se);var le=P(se,2),ue=M(le);XQ(ue,{for:`custom-provider-compat`,children:(e,t)=>{E(),z(e,wi(`Compatibility overrides (optional JSON)`))},$$slots:{default:!0}}),$Q(P(ue,2),{id:`custom-provider-compat`,rows:3,placeholder:`{ "supportsDeveloperRole": false }`,get disabled(){return I(p)},get value(){return I(u)},set value(e){j(u,e,!0)}}),T(le);var de=P(le,2),fe=e=>{var t=Jde(),n=M(t);Ld(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(m)??``}`)),z(e,t)};V(de,e=>{I(m)&&e(fe)}),T(n),z(e,n)},$$slots:{footer:!0,default:!0}})}O()}var Zde=L(`<!> Add provider`,1),Qde=L(`<p class="settings-note">Add a custom provider to connect a local or self-hosted endpoint.</p>`),e$=L(`<li class="provider-item svelte-12qrz9d"><div class="provider-item-text svelte-12qrz9d"><strong class="svelte-12qrz9d"> </strong> <span class="svelte-12qrz9d"> </span></div> <div class="provider-item-actions svelte-12qrz9d"><!> <!> <!> <!></div></li>`),$de=L(`<ul class="provider-list svelte-12qrz9d"></ul>`),efe=L(`<section id="auth-custom-providers" class="settings-section" data-section="custom-providers"><header class="settings-section-header"><div class="settings-section-kicker"><!> Custom providers</div> <h2>Custom providers</h2> <p>Add OpenAI-compatible and other pi-ai supported endpoints (Ollama, vLLM, LM Studio, proxies, …). Add models under a provider in Custom Models.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-12qrz9d"><div class="settings-copy"><strong> </strong> <span>Custom providers expose their models to the composer once you add models.</span></div> <!></div> <!></div></section> <!> <!>`,1);function tfe(e,t){D(t,!0);let n=q(t,`authProviders`,19,()=>[]),r=A(!1),i=A(void 0),a=A(void 0),o=k(()=>[...vT.customProviders].sort((e,t)=>e.displayName.localeCompare(t.displayName))),s=k(()=>vT.modelDefinitions.reduce((e,t)=>(e.set(t.provider,(e.get(t.provider)??0)+1),e),new Map));function c(e){let t=n().find(t=>t.provider===e);return!!(t?.configured&&t.credentialType===`api_key`)}function l(){j(i,void 0),j(r,!0)}function u(e){j(i,e,!0),j(r,!0)}async function d(){let e=I(a);if(e)try{await fD(e.id),await WZ()}catch{}finally{j(a,void 0)}}var f=efe(),p=N(f),m=M(p),h=M(m);$X(M(h),{size:14,strokeWidth:2.1}),E(),T(h),E(4),T(m);var g=P(m,2),_=M(g),v=M(_),y=M(v),b=M(y,!0);T(y),E(2),T(v),Ol(P(v,2),{size:`sm`,onclick:l,children:(e,t)=>{var n=Zde();KZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}}),T(_);var x=P(_,2),S=e=>{z(e,Qde())},ee=e=>{var t=$de();Ni(t,21,()=>I(o),e=>e.id,(e,t)=>{var n=e$(),r=M(n),i=M(r),o=M(i,!0);T(i);var l=P(i,2),d=M(l);T(l),T(r);var f=P(r,2),p=M(f);{let e=k(()=>c(I(t).id)?`good`:`neutral`);of(p,{get tone(){return I(e)},size:`sm`,children:(e,n)=>{E();var r=wi();F(e=>B(r,e),[()=>c(I(t).id)?`Key set`:`No key`]),z(e,r)},$$slots:{default:!0}})}var m=P(p,2);of(m,{tone:`neutral`,size:`sm`,children:(e,n)=>{E();var r=wi();F(e=>B(r,`${e??``} models`),[()=>I(s).get(I(t).id)??0]),z(e,r)},$$slots:{default:!0}});var h=P(m,2);Ol(h,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Edit provider`,onclick:()=>u(I(t)),children:(e,t)=>{JQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),Ol(P(h,2),{variant:`ghost`,size:`icon-sm`,ariaLabel:`Delete provider`,onclick:()=>j(a,I(t),!0),children:(e,t)=>{YQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),T(f),T(n),F(()=>{B(o,I(t).displayName),B(d,`${I(t).id??``} · ${I(t).api??``} · ${I(t).baseUrl??``}`)}),z(e,n)}),T(t),z(e,t)};V(x,e=>{I(o).length===0?e(S):e(ee,-1)}),T(g),T(p);var C=P(p,2);{let e=k(()=>I(i)?c(I(i).id):!1);Xde(C,{get provider(){return I(i)},get hasKey(){return I(e)},get open(){return I(r)},set open(e){j(r,e,!0)}})}var te=P(C,2);{let e=k(()=>!!I(a)),t=k(()=>I(a)?`This removes “${I(a).displayName}”, its stored API key, and its ${I(s).get(I(a).id)??0} model(s).`:``);_Q(te,{get open(){return I(e)},title:`Delete custom provider?`,get description(){return I(t)},confirmLabel:`Delete`,destructive:!0,onConfirm:()=>void d(),onOpenChange:e=>{e||j(a,void 0)}})}F(()=>B(b,I(o).length===0?`No custom providers`:`${I(o).length} configured`)),z(e,f),O()}var nfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function t$(e,t){let n=G(t,nfe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m9 12 2 2 4-4`}]];ic(e,K({name:`circle-check`},()=>n,{get iconNode(){return r}}))}var rfe=L(`<!> `,1),ife=L(`<p class="integrations-message svelte-1921d9" data-tone="error"><!> </p>`),afe=L(`<p class="integrations-message svelte-1921d9" data-tone="success"><!> </p>`),ofe=L(`<section id="auth-integrations" class="settings-section" data-section="integrations"><header class="settings-section-header"><div class="settings-section-kicker"><!> Integrations</div> <h2>Web search (Tavily)</h2> <p>Configure the Tavily API key used by the web_search tool. The key is encrypted in your browser before it is stored by the orchestrator.</p></header> <div class="settings-section-body"><div class="settings-row integrations-summary svelte-1921d9"><div class="settings-copy"><strong> </strong> <span> </span></div> <!></div> <form class="integrations-key-form svelte-1921d9"><label class="integrations-key-label svelte-1921d9" for="integrations-tavily-key"><span class="svelte-1921d9"><!> Tavily API key</span> <!></label> <div class="integrations-actions svelte-1921d9"><!> <!></div></form> <!></div></section> <!>`,1);function sfe(e,t){D(t,!0);let n=`tavily`,r=q(t,`authProviders`,19,()=>[]),i=A(``),a=A(!1),o=A(void 0),s=A(void 0),c=A(!1),l=k(()=>r().find(e=>e.provider===n)),u=k(()=>I(l)?.configured&&I(l).credentialType===`api_key`),d=k(()=>I(l)?.displayName??`Tavily`);async function f(){let e=I(i).trim();if(e){j(a,!0),j(o,void 0),j(s,void 0);try{await iD(n,await EQ(e,await rD())),j(i,``),j(s,`${I(d)} API key saved.`),await UZ()}catch(e){j(o,e instanceof Error?e.message:String(e),!0)}finally{j(a,!1)}}}async function p(){j(a,!0),j(o,void 0),j(s,void 0);try{await aD(n),j(i,``),j(s,`${I(d)} API key removed.`),await UZ()}catch(e){j(o,e instanceof Error?e.message:String(e),!0)}finally{j(a,!1),j(c,!1)}}var m=ofe(),h=N(m),g=M(h),_=M(g);rZ(M(_),{size:14,strokeWidth:2.1}),E(),T(_),E(4),T(g);var v=P(g,2),y=M(v),b=M(y),x=M(b),S=M(x,!0);T(x);var ee=P(x,2),C=M(ee,!0);T(ee),T(b);var te=P(b,2);{let e=k(()=>I(u)?`good`:`neutral`);of(te,{get tone(){return I(e)},size:`sm`,children:(e,t)=>{E();var n=wi();F(()=>B(n,I(u)?`Configured`:`Missing key`)),z(e,n)},$$slots:{default:!0}})}T(y);var ne=P(y,2),re=M(ne),ie=M(re);HX(M(ie),{size:13,strokeWidth:2}),E(),T(ie);var ae=P(ie,2);{let e=k(()=>I(u)?`Paste a replacement key`:`Paste your Tavily API key`);SQ(ae,{id:`integrations-tavily-key`,type:`password`,autocomplete:`off`,get placeholder(){return I(e)},get disabled(){return I(a)},get value(){return I(i)},set value(e){j(i,e,!0)}})}T(re);var oe=P(re,2),w=M(oe);{let e=k(()=>I(a)||I(i).trim().length===0);Ol(w,{type:`submit`,size:`sm`,get disabled(){return I(e)},children:(e,t)=>{var n=rfe(),r=N(n),i=e=>{GE(e,{size:14,strokeWidth:2,class:`animate-spin`})};V(r,e=>{I(a)&&e(i)});var o=P(r);F(()=>B(o,` ${I(u)?`Replace key`:`Save key`}`)),z(e,n)},$$slots:{default:!0}})}var se=P(w,2),ce=e=>{Ol(e,{type:`button`,variant:`ghost`,size:`sm`,get disabled(){return I(a)},onclick:()=>j(c,!0),children:(e,t)=>{E(),z(e,wi(`Remove`))},$$slots:{default:!0}})};V(se,e=>{I(u)&&e(ce)}),T(oe),T(ne);var le=P(ne,2),ue=e=>{var t=ife(),n=M(t);Ld(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(o)??``}`)),z(e,t)},de=e=>{var t=afe(),n=M(t);t$(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(s)??``}`)),z(e,t)};V(le,e=>{I(o)?e(ue):I(s)&&e(de,1)}),T(v),T(h),_Q(P(h,2),{get open(){return I(c)},title:`Remove Tavily API key?`,description:`This disables the web_search tool until another Tavily key is configured.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>void p(),onOpenChange:e=>{j(c,e,!0)}}),F(()=>{B(S,I(u)?`${I(d)} key configured`:`Web search is not configured`),B(C,I(u)?`Agents can search current external information with Tavily.`:`Add a Tavily key to enable the web_search tool.`)}),gi(`submit`,ne,e=>{e.preventDefault(),f()}),z(e,m),O()}var cfe=L(`<span> </span>`),lfe=L(`<small class="svelte-1dxsajm"> </small>`),ufe=L(`<label><span class="switch-copy svelte-1dxsajm"><!> <!></span> <!></label>`);function n$(e,t){D(t,!0);let n=q(t,`checked`,15,!1),r=q(t,`disabled`,3,!1),i=q(t,`class`,3,``);function a(e){n(e),t.onCheckedChange?.(e)}var o=ufe(),s=M(o),c=M(s),l=e=>{var n=cfe(),r=M(n,!0);T(n),F(()=>B(r,t.label)),z(e,n)};V(c,e=>{t.label&&e(l)});var u=P(c,2),d=e=>{var n=lfe(),r=M(n,!0);T(n),F(()=>B(r,t.description)),z(e,n)};V(u,e=>{t.description&&e(d)}),T(s),U(P(s,2),()=>Gx,(e,i)=>{i(e,{class:`switch-root`,get disabled(){return r()},onCheckedChange:a,get"aria-label"(){return t.label},get checked(){return n()},set checked(e){n(e)},children:(e,t)=>{var n=R();U(N(n),()=>Jx,(e,t)=>{t(e,{class:`switch-thumb`})}),z(e,n)},$$slots:{default:!0}})}),T(o),F(e=>Qi(o,1,e,`svelte-1dxsajm`),[()=>Ki(ol(`ui-switch-row`,i()))]),z(e,o),O()}var dfe=L(`<!> <!>`,1),ffe=L(`<p class="field-hint svelte-y7ltyj" data-tone="error"><!> This provider is not configured or authenticated.</p>`),pfe=L(`<button type="button"> </button>`),mfe=L(`<div class="field svelte-y7ltyj"><!> <!> <p class="field-hint svelte-y7ltyj">Merged on top of the provider headers. One <code class="svelte-y7ltyj">Name: value</code> per line.</p></div>`),hfe=L(`<p class="field-hint svelte-y7ltyj" data-tone="error"><!> </p>`),gfe=L(`<div class="model-form svelte-y7ltyj"><div class="field svelte-y7ltyj"><!> <!></div> <div class="field-grid svelte-y7ltyj"><div class="field svelte-y7ltyj"><!> <!></div> <div class="field svelte-y7ltyj"><!> <!></div></div> <!> <div class="field-grid svelte-y7ltyj"><div class="field svelte-y7ltyj"><!> <!></div> <div class="field svelte-y7ltyj"><!> <!></div></div> <!> <div class="field svelte-y7ltyj"><!> <div class="chip-row svelte-y7ltyj"></div></div> <!> <!> <!></div>`);function _fe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`providerItems`,19,()=>[]),i=k(()=>!!t.model),a=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],o=A(``),s=A(``),c=A(``),l=A(!1),u=A(Mn([`off`])),d=A(!1),f=A(0),p=A(0),m=A(``),h=A(!1),g=A(void 0),_=k(()=>I(i)&&t.model?.provider&&!r().some(e=>e.value===t.model.provider)?[{value:t.model.provider,label:t.model.provider,detail:`Unavailable`},...r()]:r()),v=k(()=>vT.customProviders.some(e=>e.id===I(o))),y=k(()=>r().some(e=>e.value===I(o)));rr(()=>{n()&&(j(o,t.model?.provider??``,!0),j(s,t.model?.modelId??``,!0),j(c,t.model?.name??``,!0),j(l,t.model?.reasoning??!1,!0),j(u,t.model?.supportedThinkingLevels??[`off`],!0),j(d,t.model?.input?.includes(`image`)??!1,!0),j(f,t.model?.contextWindow??0,!0),j(p,t.model?.maxTokens??0,!0),j(m,b(t.model?.headers),!0),j(g,void 0))});function b(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
80
|
-
`):``}function x(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e)continue;let r=e.indexOf(`:`);if(r===-1)continue;let i=e.slice(0,r).trim();i&&(t[i]=e.slice(r+1).trim())}return t}function S(e){j(u,I(u).includes(e)?I(u).filter(t=>t!==e):[...I(u),e],!0)}let ee=k(()=>I(o).trim().length>0&&I(y)&&I(s).trim().length>0&&I(c).trim().length>0&&!I(h));async function C(){if(I(ee)){j(h,!0),j(g,void 0);try{let e=x(I(m));await pD({provider:I(o),modelId:I(s).trim(),name:I(c).trim(),reasoning:I(l),supportedThinkingLevels:I(u).length>0?I(u):[`off`],input:I(d)?[`text`,`image`]:[`text`],contextWindow:Math.max(0,Math.trunc(I(f))),maxTokens:Math.max(0,Math.trunc(I(p))),cost:{input:0,output:0,cacheRead:0,cacheWrite:0},...Object.keys(e).length>0?{headers:e}:{}}),await WZ(),n(!1)}catch(e){j(g,e instanceof Error?e.message:String(e),!0)}finally{j(h,!1)}}}{let r=e=>{var t=dfe(),r=N(t);Ol(r,{variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{E(),z(e,wi(`Cancel`))},$$slots:{default:!0}});var a=P(r,2);{let e=k(()=>!I(ee));Ol(a,{onclick:()=>void C(),get disabled(){return I(e)},children:(e,t)=>{E();var n=wi();F(()=>B(n,I(h)?`Saving…`:I(i)?`Save model`:`Add model`)),z(e,n)},$$slots:{default:!0}})}z(e,t)},b=k(()=>I(i)?`Edit ${t.model?.name}`:`Add model`);ZX(e,{get title(){return I(b)},description:`Register a model under a configured or authenticated provider.`,get open(){return n()},set open(e){n(e)},footer:r,children:(e,t)=>{var n=gfe(),r=M(n),b=M(r);XQ(b,{children:(e,t)=>{E(),z(e,wi(`Provider`))},$$slots:{default:!0}}),QQ(P(b,2),{get items(){return I(_)},get value(){return I(o)},onValueChange:e=>j(o,e,!0),placeholder:`Select a provider`,ariaLabel:`Provider`,get disabled(){return I(i)}}),T(r);var x=P(r,2),ee=M(x),C=M(ee);XQ(C,{for:`model-id`,children:(e,t)=>{E(),z(e,wi(`Model id`))},$$slots:{default:!0}});var te=P(C,2);{let e=k(()=>I(h)||I(i));SQ(te,{id:`model-id`,placeholder:`llama-3.1-8b`,get disabled(){return I(e)},get value(){return I(s)},set value(e){j(s,e,!0)}})}T(ee);var ne=P(ee,2),re=M(ne);XQ(re,{for:`model-name`,children:(e,t)=>{E(),z(e,wi(`Display name`))},$$slots:{default:!0}}),SQ(P(re,2),{id:`model-name`,placeholder:`Llama 3.1 8B`,get disabled(){return I(h)},get value(){return I(c)},set value(e){j(c,e,!0)}}),T(ne),T(x);var ie=P(x,2),ae=e=>{var t=ffe();Ld(M(t),{size:14,strokeWidth:2}),E(),T(t),z(e,t)};V(ie,e=>{I(o).length>0&&!I(y)&&e(ae)});var oe=P(ie,2),w=M(oe),se=M(w);XQ(se,{for:`model-context`,children:(e,t)=>{E(),z(e,wi(`Context window (tokens)`))},$$slots:{default:!0}}),SQ(P(se,2),{id:`model-context`,type:`number`,min:`0`,get disabled(){return I(h)},get value(){return I(f)},set value(e){j(f,e,!0)}}),T(w);var ce=P(w,2),le=M(ce);XQ(le,{for:`model-max-tokens`,children:(e,t)=>{E(),z(e,wi(`Max output tokens`))},$$slots:{default:!0}}),SQ(P(le,2),{id:`model-max-tokens`,type:`number`,min:`0`,get disabled(){return I(h)},get value(){return I(p)},set value(e){j(p,e,!0)}}),T(ce),T(oe);var ue=P(oe,2);n$(ue,{class:`settings-full-switch`,get checked(){return I(l)},label:`Reasoning model`,description:`Enable thinking/reasoning controls for this model.`,onCheckedChange:e=>j(l,e,!0)});var de=P(ue,2),fe=M(de);XQ(fe,{children:(e,t)=>{E(),z(e,wi(`Supported thinking levels`))},$$slots:{default:!0}});var pe=P(fe,2);Ni(pe,20,()=>a,e=>e,(e,t)=>{var n=pfe();let r;var i=M(n,!0);T(n),F(e=>{r=Qi(n,1,`chip svelte-y7ltyj`,null,r,e),B(i,t)},[()=>({active:I(u).includes(t)})]),_i(`click`,n,()=>S(t)),z(e,n)}),T(pe),T(de);var me=P(de,2);n$(me,{class:`settings-full-switch`,get checked(){return I(d)},label:`Image input`,description:`The model accepts image content in addition to text.`,onCheckedChange:e=>j(d,e,!0)});var he=P(me,2),ge=e=>{var t=mfe(),n=M(t);XQ(n,{for:`model-headers`,children:(e,t)=>{E(),z(e,wi(`Header overrides (optional)`))},$$slots:{default:!0}}),$Q(P(n,2),{id:`model-headers`,rows:2,placeholder:`X-Header: value`,get disabled(){return I(h)},get value(){return I(m)},set value(e){j(m,e,!0)}}),E(2),T(t),z(e,t)};V(he,e=>{I(v)&&e(ge)});var _e=P(he,2),ve=e=>{var t=hfe(),n=M(t);Ld(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(g)??``}`)),z(e,t)};V(_e,e=>{I(g)&&e(ve)}),T(n),z(e,n)},$$slots:{footer:!0,default:!0}})}O()}vi([`click`]);var vfe=L(`<!> Add model`,1),yfe=L(`<p class="settings-note">Add a custom provider or authenticate a built-in model provider before adding custom models.</p>`),bfe=L(`<p class="settings-note">Add a model to expose it in the composer picker.</p>`),xfe=L(`<span class="orphan-tag svelte-5i6wcq"><!> Unavailable</span>`),Sfe=L(`<li><div class="provider-item-text svelte-5i6wcq"><strong class="svelte-5i6wcq"> </strong> <span class="svelte-5i6wcq"> </span></div> <div class="provider-item-actions svelte-5i6wcq"><!> <!> <!> <!></div></li>`),Cfe=L(`<ul class="provider-list svelte-5i6wcq"></ul>`),wfe=L(`<section id="auth-custom-models" class="settings-section" data-section="custom-models"><header class="settings-section-header"><div class="settings-section-kicker"><!> Custom models</div> <h2>Custom models</h2> <p>Register models under configured custom providers or authenticated built-in providers. Connection settings come from the selected provider.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-5i6wcq"><div class="settings-copy"><strong> </strong> <span>Add a model with its id, context window, and thinking capability.</span></div> <!></div> <!></div></section> <!> <!>`,1);function Tfe(e,t){D(t,!0);let n=q(t,`models`,19,()=>[]),r=q(t,`authProviders`,19,()=>[]),i=A(!1),a=A(void 0),o=A(void 0),s=k(()=>new Set(vT.customProviders.map(e=>e.id))),c=k(()=>new Set(n().filter(e=>!e.faux).map(e=>e.provider))),l=k(()=>r().filter(e=>e.configured&&I(c).has(e.provider)&&!I(s).has(e.provider)).sort((e,t)=>e.displayName.localeCompare(t.displayName))),u=k(()=>[...vT.customProviders.map(e=>({value:e.id,label:e.displayName,detail:`Custom provider`})).sort((e,t)=>e.label.localeCompare(t.label)),...I(l).map(e=>({value:e.provider,label:e.displayName,detail:e.credentialType===`oauth`?`Subscription login`:`API key configured`}))]),d=k(()=>new Set(I(u).map(e=>e.value))),f=k(()=>[...vT.modelDefinitions].sort((e,t)=>e.provider.localeCompare(t.provider)||e.name.localeCompare(t.name)));function p(e){return vT.customProviders.find(t=>t.id===e)?.displayName??r().find(t=>t.provider===e)?.displayName??e}function m(e){return!I(d).has(e.provider)}function h(){I(u).length!==0&&(j(a,void 0),j(i,!0))}function g(e){j(a,e,!0),j(i,!0)}async function _(){let e=I(o);if(e)try{await mD(e.provider,e.modelId),await WZ()}catch{}finally{j(o,void 0)}}var v=wfe(),y=N(v),b=M(y),x=M(b);tZ(M(x),{size:14,strokeWidth:2.1}),E(),T(x),E(4),T(b);var S=P(b,2),ee=M(S),C=M(ee),te=M(C),ne=M(te,!0);T(te),E(2),T(C);var re=P(C,2);{let e=k(()=>I(u).length===0);Ol(re,{size:`sm`,onclick:h,get disabled(){return I(e)},children:(e,t)=>{var n=vfe();KZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}})}T(ee);var ie=P(ee,2),ae=e=>{var t=R(),n=N(t),r=e=>{z(e,yfe())},i=e=>{z(e,bfe())};V(n,e=>{I(u).length===0?e(r):e(i,-1)}),z(e,t)},oe=e=>{var t=Cfe();Ni(t,21,()=>I(f),e=>`${e.provider}:${e.modelId}`,(e,t)=>{var n=Sfe();let r;var i=M(n),a=M(i),s=M(a,!0);T(a);var c=P(a,2),l=M(c);T(c),T(i);var u=P(i,2),d=M(u),f=e=>{var t=xfe();Ld(M(t),{size:13,strokeWidth:2}),E(),T(t),z(e,t)},h=k(()=>m(I(t)));V(d,e=>{I(h)&&e(f)});var _=P(d,2),v=e=>{of(e,{tone:`accent`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`Reasoning`))},$$slots:{default:!0}})};V(_,e=>{I(t).reasoning&&e(v)});var y=P(_,2);Ol(y,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Edit model`,onclick:()=>g(I(t)),children:(e,t)=>{JQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),Ol(P(y,2),{variant:`ghost`,size:`icon-sm`,ariaLabel:`Delete model`,onclick:()=>j(o,I(t),!0),children:(e,t)=>{YQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),T(u),T(n),F((e,i)=>{r=Qi(n,1,`provider-item svelte-5i6wcq`,null,r,e),B(s,I(t).name),B(l,`${i??``} · ${I(t).modelId??``}`)},[()=>({orphan:m(I(t))}),()=>p(I(t).provider)]),z(e,n)}),T(t),z(e,t)};V(ie,e=>{I(f).length===0?e(ae):e(oe,-1)}),T(S),T(y);var w=P(y,2);_fe(w,{get model(){return I(a)},get providerItems(){return I(u)},get open(){return I(i)},set open(e){j(i,e,!0)}});var se=P(w,2);{let e=k(()=>!!I(o)),t=k(()=>I(o)?`This removes “${I(o).name}” (${I(o).modelId}) from the catalog.`:``);_Q(se,{get open(){return I(e)},title:`Delete model?`,get description(){return I(t)},confirmLabel:`Delete`,destructive:!0,onConfirm:()=>void _(),onOpenChange:e=>{e||j(o,void 0)}})}F(()=>B(ne,I(f).length===0?`No custom models`:`${I(f).length} added`)),z(e,v),O()}var Efe=L(`<!> Connect subscription`,1),Dfe=L(`<p class="settings-note">Connect a subscription to start authenticating models.</p>`),Ofe=L(`<p class="provider-warning svelte-2gqlbs"><!> </p>`),kfe=L(`<li class="provider-item svelte-2gqlbs"><div class="provider-item-text svelte-2gqlbs"><strong class="svelte-2gqlbs"> </strong> <span class="svelte-2gqlbs"> </span> <!></div> <div class="provider-item-actions svelte-2gqlbs"><!> <!></div></li>`),Afe=L(`<ul class="provider-list svelte-2gqlbs"></ul>`),jfe=L(`<section id="auth-subscriptions" class="settings-section" data-section="subscriptions"><header class="settings-section-header"><div class="settings-section-kicker"><!> Subscriptions</div> <h2>Subscription logins</h2> <p>Connect a ChatGPT or Anthropic subscription with an OAuth login. Secrets are exchanged directly between the orchestrator and the provider.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-2gqlbs"><div class="settings-copy"><strong> </strong> <span>Use a subscription login to authenticate models without an API key.</span></div> <!></div> <!></div></section> <!> <!>`,1);function Mfe(e,t){D(t,!0);let n=q(t,`authProviders`,19,()=>[]),r=A(!1),i=A(void 0),a=k(()=>n().filter(e=>e.configured&&e.credentialType===`oauth`).sort((e,t)=>e.displayName.localeCompare(t.displayName)));async function o(){let e=I(i);if(e)try{await aD(e.provider),await UZ()}catch{}finally{j(i,void 0)}}var s=jfe(),c=N(s),l=M(c),u=M(l);aZ(M(u),{size:14,strokeWidth:2.1}),E(),T(u),E(4),T(l);var d=P(l,2),f=M(d),p=M(f),m=M(p),h=M(m,!0);T(m),E(2),T(p),Ol(P(p,2),{size:`sm`,onclick:()=>j(r,!0),children:(e,t)=>{var n=Efe();KZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}}),T(f);var g=P(f,2),_=e=>{z(e,Dfe())},v=e=>{var t=Afe();Ni(t,21,()=>I(a),e=>e.provider,(e,t)=>{var n=kfe(),r=M(n),a=M(r),o=M(a,!0);T(a);var s=P(a,2),c=M(s,!0);T(s);var l=P(s,2),u=e=>{var n=Ofe(),r=M(n);Ld(r,{size:13,strokeWidth:2,class:`mt-0.5 flex-none`});var i=P(r);T(n),F(()=>B(i,` ${I(t).warning??``}`)),z(e,n)};V(l,e=>{I(t).warning&&e(u)}),T(r);var d=P(r,2),f=M(d);of(f,{tone:`good`,size:`sm`,children:(e,t)=>{E(),z(e,wi(`Connected`))},$$slots:{default:!0}}),Ol(P(f,2),{variant:`ghost`,size:`sm`,onclick:()=>j(i,I(t),!0),children:(e,t)=>{E(),z(e,wi(`Log out`))},$$slots:{default:!0}}),T(d),T(n),F(()=>{B(o,I(t).displayName),B(c,I(t).oauthName??I(t).provider)}),z(e,n)}),T(t),z(e,t)};V(g,e=>{I(a).length===0?e(_):e(v,-1)}),T(d),T(c);var y=P(c,2);qQ(y,{get authProviders(){return n()},kind:`oauth`,get open(){return I(r)},set open(e){j(r,e,!0)}});var b=P(y,2);{let e=k(()=>!!I(i)),t=k(()=>I(i)?`This removes the stored subscription login for “${I(i).displayName}” from the orchestrator.`:``);_Q(b,{get open(){return I(e)},title:`Log out of provider?`,get description(){return I(t)},confirmLabel:`Log out`,destructive:!0,onConfirm:()=>void o(),onOpenChange:e=>{e||j(i,void 0)}})}F(()=>B(h,I(a).length===0?`No subscriptions connected`:`${I(a).length} connected`)),z(e,s),O()}var Nfe=L(`<button type="button"><!> <span> </span></button>`),Pfe=L(`<button type="button" role="tab"> </button>`),Ffe=L(`<div class="settings-subnav" role="tablist"></div>`),Ife=L(`<!> <!>`,1),Lfe=L(`<div class="settings-main"><header class="settings-panel-header"><h2> </h2> <p> </p> <!></header> <!></div>`),Rfe=L(`<section class="settings-page"><aside class="settings-sidebar" aria-label="Authentication sections"><div class="settings-sidebar-title"><strong>Authentication</strong> <span>Providers & keys</span></div> <nav class="settings-nav"></nav></aside> <!></section>`);function zfe(e,t){D(t,!0);let n=[{id:`connections`,label:`Connections`,description:`Connect subscription logins and provider API keys.`,icon:aZ,sections:[{id:`subscriptions`,label:`Subscriptions`},{id:`api-keys`,label:`API keys`}]},{id:`custom-providers`,label:`Custom Providers`,description:`Manage custom and self-hosted provider endpoints.`,icon:$X,sections:[{id:`custom-providers`,label:`Custom Providers`}]},{id:`custom-models`,label:`Custom Models`,description:`Register models under configured or authenticated providers.`,icon:tZ,sections:[{id:`custom-models`,label:`Custom Models`}]},{id:`integrations`,label:`Integrations`,description:`Configure external services used by tools.`,icon:rZ,sections:[{id:`integrations`,label:`Web search`}]}],r=k(()=>CT.authProviders),i=k(()=>CT.models),a=A(`connections`),o=A(`subscriptions`),s=k(()=>n.find(e=>e.id===I(a))??n[0]);vT.catalogLoaded||UZ();function c(e){if(e===I(a))return;j(a,e,!0);let t=n.find(t=>t.id===e)?.sections[0];t&&j(o,t.id,!0),l()}async function l(){await Jr(),document.querySelector(`.settings-viewport`)?.scrollTo({top:0})}function u(e){j(o,e,!0),document.getElementById(`auth-${e}`)?.scrollIntoView({behavior:`smooth`,block:`start`})}rr(()=>{let e=I(s),t,n=!1;return(async()=>{if(await Jr(),n)return;let r=document.querySelector(`.settings-viewport`),i=e.sections.map(e=>document.getElementById(`auth-${e.id}`)).filter(e=>e!==null);if(i.length!==0){t=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top)[0]?.target.getAttribute(`data-section`);t&&j(o,t,!0)},{root:r,rootMargin:`0px 0px -65% 0px`,threshold:0});for(let e of i)t.observe(e)}})(),()=>{n=!0,t?.disconnect()}});var d=Rfe(),f=M(d),p=P(M(f),2);Ni(p,21,()=>n,Ai,(e,t)=>{let n=k(()=>I(t).icon);var r=Nfe();let i;var o=M(r);U(o,()=>I(n),(e,t)=>{t(e,{size:16,strokeWidth:2})});var s=P(o,2),l=M(s,!0);T(s),T(r),F(()=>{W(r,`aria-current`,I(a)===I(t).id?`page`:void 0),i=Qi(r,1,``,null,i,{active:I(a)===I(t).id}),B(l,I(t).label)}),_i(`click`,r,()=>c(I(t).id)),z(e,r)}),T(p),T(f),cZ(P(f,2),{class:`settings-scroll`,viewportClass:`settings-viewport`,type:`auto`,children:(e,t)=>{var n=Lfe(),c=M(n),l=M(c),d=M(l,!0);T(l);var f=P(l,2),p=M(f,!0);T(f);var m=P(f,2),h=e=>{var t=Ffe();Ni(t,21,()=>I(s).sections,Ai,(e,t)=>{var n=Pfe();let r;var i=M(n,!0);T(n),F(()=>{W(n,`aria-selected`,I(o)===I(t).id),r=Qi(n,1,``,null,r,{active:I(o)===I(t).id}),B(i,I(t).label)}),_i(`click`,n,()=>u(I(t).id)),z(e,n)}),T(t),F(()=>W(t,`aria-label`,`${I(s).label??``} sections`)),z(e,t)};V(m,e=>{I(s).sections.length>1&&e(h)}),T(c);var g=P(c,2),_=e=>{var t=Ife(),n=N(t);Mfe(n,{get authProviders(){return I(r)}}),hde(P(n,2),{get authProviders(){return I(r)}}),z(e,t)},v=e=>{tfe(e,{get authProviders(){return I(r)}})},y=e=>{Tfe(e,{get models(){return I(i)},get authProviders(){return I(r)}})},b=e=>{sfe(e,{get authProviders(){return I(r)}})};V(g,e=>{I(a)===`connections`?e(_):I(a)===`custom-providers`?e(v,1):I(a)===`custom-models`?e(y,2):I(a)===`integrations`&&e(b,3)}),T(n),F(()=>{B(d,I(s).label),B(p,I(s).description)}),z(e,n)},$$slots:{default:!0}}),T(d),z(e,d),O()}vi([`click`]);var r$=new Map,i$=new Set;function a$(e,t){let n=r$.get(e);return n||(n=new Set,r$.set(e,n)),n.add(t),()=>{n?.delete(t),n?.size===0&&r$.delete(e)}}function o$(e){return i$.add(e),()=>{i$.delete(e)}}function Bfe(e){let t=[...r$.get(e.type)??[],...i$];for(let n of t)try{let t=n(e);t instanceof Promise&&t.catch(t=>u$(e,t))}catch(t){u$(e,t)}}var s$=[],c$=!1;function Vfe(){if(c$)return;c$=!0;let e=()=>{c$=!1,l$()};typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)}function Hfe(e){s$.push(e),Vfe()}function l$(){for(let e=0;e<s$.length;e+=1)Bfe(s$[e]);s$.length=0}function u$(e,t){console.error(`Workbench event handler failed`,{type:e.type,seq:e.seq,error:t})}function Ufe(){return o$(Wfe)}function Wfe(e){vT.catalogLoaded&&e.type.startsWith(`providers.`)&&WZ()}var Gfe=L(`<!> Open authentication`,1),Kfe=L(`<!> <!>`,1),qfe=L(`<div class="audio-auth-body svelte-8zh17m"><div class="audio-auth-summary svelte-8zh17m"><span class="audio-auth-icon svelte-8zh17m" aria-hidden="true"><!></span> <div><h3 class="svelte-8zh17m">Audio input is not configured yet</h3> <p class="svelte-8zh17m">Nerve records from your microphone locally, then sends the captured audio to ChatGPT for transcription through the OpenAI Codex OAuth provider.</p></div></div> <div class="audio-auth-detail svelte-8zh17m"><!> <p class="svelte-8zh17m">A free or paid ChatGPT account can be used. It just needs to be connected so the orchestrator can request transcription securely.</p></div> <p class="audio-auth-path svelte-8zh17m">To enable it, open <strong class="svelte-8zh17m">Authentication</strong> → <strong class="svelte-8zh17m">Subscriptions</strong>, then connect <strong class="svelte-8zh17m">OpenAI Codex</strong>.</p></div>`);function d$(e,t){D(t,!0);let n=q(t,`open`,15,!1);function r(){n(!1)}function i(){r(),BZ()}ZX(e,{title:`Connect ChatGPT to use voice input`,description:`Voice input needs a ChatGPT OAuth connection before Nerve can transcribe recordings.`,class:`audio-auth-required-dialog`,get open(){return n()},set open(e){n(e)},footer:e=>{var t=Kfe(),n=N(t);Ol(n,{variant:`ghost`,onclick:r,children:(e,t)=>{E(),z(e,wi(`Close`))},$$slots:{default:!0}}),Ol(P(n,2),{onclick:i,children:(e,t)=>{var n=Gfe();HX(N(n),{size:15,strokeWidth:2.1}),E(),z(e,n)},$$slots:{default:!0}}),z(e,t)},children:(e,t)=>{var n=qfe(),r=M(n),i=M(r);qE(M(i),{size:18,strokeWidth:2.2}),T(i),E(2),T(r);var a=P(r,2);WX(M(a),{size:16,strokeWidth:2.1,"aria-hidden":`true`}),E(2),T(a),E(2),T(n),z(e,n)},$$slots:{footer:!0,default:!0}}),O()}function Jfe(e){return!!e?.some(e=>e.provider===`openai-codex`&&e.configured&&e.credentialType===`oauth`)}var f$={get configured(){return Jfe(CT.authProviders)}},Yfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Xfe(e,t){let n=G(t,Yfe),r=[[`path`,{d:`m14 13-8.381 8.38a1 1 0 0 1-3.001-3l8.384-8.381`}],[`path`,{d:`m16 16 6-6`}],[`path`,{d:`m21.5 10.5-8-8`}],[`path`,{d:`m8 8 6-6`}],[`path`,{d:`m8.5 7.5 8 8`}]];ic(e,K({name:`gavel`},()=>n,{get iconNode(){return r}}))}var Zfe=L(`<!>Approve & Execute`,1),Qfe=L(`<!>Deny`,1),$fe=L(`<article class="approval-card svelte-1v1vlek"><div class="approval-detail svelte-1v1vlek"><div class="detail-row svelte-1v1vlek"><span class="detail-label svelte-1v1vlek">Tool</span> <span class="detail-tool svelte-1v1vlek"> </span></div> <div class="detail-row svelte-1v1vlek"><span class="detail-label svelte-1v1vlek">Risk</span> <span class="detail-risk svelte-1v1vlek"><!> </span></div> <div class="detail-row align-start svelte-1v1vlek"><span class="detail-label svelte-1v1vlek">Reason</span> <span class="detail-reason svelte-1v1vlek"> </span></div> <details class="detail-args svelte-1v1vlek"><summary class="svelte-1v1vlek"> </summary> <pre class="svelte-1v1vlek"> </pre></details></div> <div class="approval-actions svelte-1v1vlek"><!> <!></div></article>`),epe=L(`<section class="approval-strip svelte-1v1vlek" aria-label="Pending tool approvals"><header class="strip-head svelte-1v1vlek"><div class="head-copy svelte-1v1vlek"><span class="head-icon svelte-1v1vlek"><!></span> <div class="svelte-1v1vlek"><strong class="svelte-1v1vlek">Action Required: Approval Needed</strong> <span class="svelte-1v1vlek">The agent has requested permission to proceed.</span></div></div> <!></header> <div class="approval-list svelte-1v1vlek"></div></section>`);function tpe(e,t){D(t,!0);let n=q(t,`approvals`,19,()=>[]);function r(e){return e===`destructive`||e===`secret`||e===`deployment`?`danger`:e===`command`||e===`network`||e===`workspace_write`?`warn`:e===`agent_spawn`?`accent`:`neutral`}function i(e){let t=e.toolCall?.args;if(t===void 0)return`No arguments.`;try{return JSON.stringify(t,null,2)}catch{return String(t)}}var a=R(),o=N(a),s=e=>{var a=epe(),o=M(a),s=M(o),c=M(s);Xfe(M(c),{size:16,strokeWidth:2.1,"aria-hidden":`true`}),T(c),E(2),T(s),of(P(s,2),{size:`xs`,tone:`warn`,children:(e,t)=>{E(),z(e,wi(`pending`))},$$slots:{default:!0}}),T(o);var l=P(o,2);Ni(l,21,n,Ai,(e,n)=>{var a=$fe(),o=M(a),s=M(o),c=P(M(s),2),l=M(c,!0);T(c),T(s);var u=P(s,2),d=P(M(u),2),f=M(d);{let e=k(()=>r(I(n).risk));$S(f,{get tone(){return I(e)},size:`sm`})}var p=P(f,1,!0);T(d),T(u);var m=P(u,2),h=P(M(m),2),g=M(h,!0);T(h),T(m);var _=P(m,2),v=M(_),y=M(v);T(v);var b=P(v,2),x=M(b,!0);T(b),T(_),T(o);var S=P(o,2),ee=M(S);Ol(ee,{size:`sm`,onclick:()=>t.onGrantApproval?.(I(n).id),children:(e,t)=>{var n=Zfe();ZQ(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}}),Ol(P(ee,2),{size:`sm`,variant:`secondary`,onclick:()=>t.onDenyApproval?.(I(n).id),children:(e,t)=>{var n=Qfe();KX(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}}),T(S),T(a),F(e=>{B(l,I(n).toolCall?.toolName??`tool call`),B(p,I(n).risk),B(g,I(n).reason),B(y,`Arguments · ${I(n).toolCallId??``}`),B(x,e)},[()=>i(I(n))]),z(e,a)}),T(l),T(a),z(e,a)};V(o,e=>{n().length>0&&e(s)}),z(e,a),O()}var npe=new Set([`$$slots`,`$$events`,`$$legacy`]);function rpe(e,t){let n=G(t,npe),r=[[`path`,{d:`M6 3v12`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`}],[`path`,{d:`M18 15v6`}],[`path`,{d:`M21 18h-6`}]];ic(e,K({name:`git-branch-plus`},()=>n,{get iconNode(){return r}}))}var ipe=new Set([`$$slots`,`$$events`,`$$legacy`]);function p$(e,t){let n=G(t,ipe),r=[[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`}]];ic(e,K({name:`git-commit-horizontal`},()=>n,{get iconNode(){return r}}))}var ape=new Set([`$$slots`,`$$events`,`$$legacy`]);function m$(e,t){let n=G(t,ape),r=[[`circle`,{cx:`18`,cy:`18`,r:`3`}],[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`}]];ic(e,K({name:`git-pull-request`},()=>n,{get iconNode(){return r}}))}var ope=L(`<button type="button" class="git-suggestion-chip svelte-126jzn8"><!> <span> </span></button>`),spe=L(`<div class="git-suggestions svelte-126jzn8" role="group" aria-label="Suggested git actions"></div>`);function cpe(e,t){D(t,!0);let n=q(t,`suggestions`,19,()=>[]),r=q(t,`disabled`,3,!1),i={commit:p$,"commit-branch":rpe,"open-pr":m$};var a=R(),o=N(a),s=e=>{var a=spe();Ni(a,21,n,e=>e.id,(e,n)=>{let a=k(()=>i[I(n).id]);var o=ope(),s=M(o);U(s,()=>I(a),(e,t)=>{t(e,{size:13,strokeWidth:2.2,"aria-hidden":`true`,class:`text-primary`})});var c=P(s,2),l=M(c,!0);T(c),T(o),F(()=>{o.disabled=r(),W(o,`title`,`Click to send. Right-click to insert into composer.\n\n${I(n).prompt}`),W(o,`aria-label`,`${I(n).label}. Click to send. Right-click to insert into composer.`),B(l,I(n).label)}),_i(`click`,o,()=>t.onSend?.(I(n))),_i(`contextmenu`,o,e=>{e.preventDefault(),t.onDraft?.(I(n))}),z(e,o)}),T(a),z(e,a)};V(o,e=>{n().length>0&&e(s)}),z(e,a),O()}vi([`click`,`contextmenu`]);var lpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function upe(e,t){let n=G(t,lpe),r=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]];ic(e,K({name:`lock`},()=>n,{get iconNode(){return r}}))}var dpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function fpe(e,t){let n=G(t,dpe),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}]];ic(e,K({name:`shield`},()=>n,{get iconNode(){return r}}))}var ppe=new Set([`$$slots`,`$$events`,`$$legacy`]);function mpe(e,t){let n=G(t,ppe),r=[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`}]];ic(e,K({name:`zap`},()=>n,{get iconNode(){return r}}))}var hpe=L(`<span class="model-tab-suffix svelte-11u25ze"> </span>`),gpe=L(`<span><span class="model-tab-label svelte-11u25ze"> </span> <!> <!></span>`),_pe=L(`<p class="model-picker-empty svelte-11u25ze">No models available. Configure a provider or adjust Scoped Models in Settings.</p>`),vpe=L(`<li><button type="button"><span class="model-row-text svelte-11u25ze"><span class="model-row-label svelte-11u25ze"> </span></span> <!></button></li>`),ype=L(`<ul class="model-list svelte-11u25ze"></ul>`),bpe=L(`<button type="button"> </button>`),xpe=L(`<div class="model-picker-section thinking-section svelte-11u25ze"><p class="model-picker-heading svelte-11u25ze">Thinking level</p> <div class="thinking-grid svelte-11u25ze" role="group" aria-label="Thinking level"></div></div>`),Spe=L(`<div class="model-picker svelte-11u25ze"><div class="model-picker-section svelte-11u25ze"><p class="model-picker-heading svelte-11u25ze">Model</p> <!></div> <!></div>`);function Cpe(e,t){D(t,!0);let n=q(t,`models`,19,()=>[]),r=q(t,`selectedModelKey`,3,``),i=q(t,`thinkingLevel`,3,`off`),a=q(t,`disabled`,3,!1),o=A(!1),s=k(()=>n().find(e=>YT(e)===r())),c={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Maximum reasoning`};function l(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}let u=k(()=>I(s)?.supportedThinkingLevels?.length?I(s).supportedThinkingLevels:[`off`]),d=k(()=>I(u).length>1),f=k(()=>I(s)?iE(I(s),n()):`Select model`),p=k(()=>I(d)&&i()!==`off`?l(i()):void 0),m=k(()=>`${I(p)?`${I(f)} (${I(p)})`:I(f)}${t.runtimeChangeHint?` · ${t.runtimeChangeHint}`:``}${t.shortcutLabel?` · Cycle thinking ${t.shortcutLabel}`:``}`);function h(e){j(o,a()?!1:e,!0)}function g(e){if(a())return;let n=YT(e);n!==r()&&t.onModelChange?.(n)}function _(e){a()||e!==i()&&t.onThinkingLevelChange?.(e)}rr(()=>{a()&&j(o,!1)}),XS(e,{get open(){return I(o)},onOpenChange:h,class:`model-picker-content`,triggerClass:`composer-tab model-tab`,ariaLabel:`Model and thinking level`,get triggerTitle(){return I(m)},side:`top`,align:`end`,sideOffset:9,trigger:e=>{var t=gpe();let n;var r=M(t),i=M(r,!0);T(r);var o=P(r,2),s=e=>{var t=hpe(),n=M(t);T(t),F(()=>B(n,`(${I(p)??``})`)),z(e,t)};V(o,e=>{I(p)&&e(s)}),Iw(P(o,2),{size:12,strokeWidth:2.2}),T(t),F(()=>{n=Qi(t,1,`model-tab-inner svelte-11u25ze`,null,n,{disabled:a()}),W(t,`aria-disabled`,a()),B(i,I(f))}),z(e,t)},children:(e,t)=>{var o=Spe(),s=M(o),f=P(M(s),2),p=e=>{z(e,_pe())},m=e=>{var t=ype();Ni(t,21,n,e=>YT(e),(e,t)=>{let i=k(()=>YT(I(t))===r()),o=k(()=>iE(I(t),n()));var s=vpe(),c=M(s);let l;var u=M(c),d=M(u),f=M(d,!0);T(d),T(u);var p=P(u,2),m=e=>{ZQ(e,{size:14,strokeWidth:2.4})};V(p,e=>{I(i)&&e(m)}),T(c),T(s),F(()=>{l=Qi(c,1,`model-row svelte-11u25ze`,null,l,{active:I(i)}),W(c,`aria-pressed`,I(i)),c.disabled=a(),B(f,I(o))}),_i(`click`,c,()=>g(I(t))),z(e,s)}),T(t),z(e,t)};V(f,e=>{n().length===0?e(p):e(m,-1)}),T(s);var h=P(s,2),v=e=>{var t=xpe(),n=P(M(t),2);Ni(n,20,()=>I(u),e=>e,(e,t)=>{let n=k(()=>t===i());var r=bpe();let o;var s=M(r,!0);T(r),F(e=>{o=Qi(r,1,`thinking-chip svelte-11u25ze`,null,o,{active:I(n)}),W(r,`aria-pressed`,I(n)),W(r,`title`,c[t]),r.disabled=a(),B(s,e)},[()=>l(t)]),_i(`click`,r,()=>_(t)),z(e,r)}),T(n),T(t),z(e,t)};V(h,e=>{I(d)&&e(v)}),T(o),z(e,o)},$$slots:{trigger:!0,default:!0}}),O()}vi([`click`]);var wpe=L(`<span class="composer-tab context-usage-tab svelte-1gi3wp6"><span class="ctx-ring svelte-1gi3wp6" aria-hidden="true"><span class="ctx-ring-core svelte-1gi3wp6"></span></span> <span class="ctx-percent svelte-1gi3wp6"> </span> <span class="ctx-window svelte-1gi3wp6"> </span></span>`);function Tpe(e,t){D(t,!0);let n=q(t,`contextWindow`,3,0),r=k(()=>n()||t.contextUsage?.contextWindow||0),i=k(()=>t.contextUsage?.tokens??null),a=k(()=>I(i)!=null&&I(r)>0?I(i)/I(r)*100:t.contextUsage?.percent??null),o=k(()=>I(a)==null?0:Math.max(0,Math.min(100,I(a)))),s=k(()=>Qd(I(a))),c=k(()=>I(a)==null?`?%`:`${Math.round(I(a))}%`),l=k(()=>I(i)!=null&&I(r)>0?`Context: ${I(i).toLocaleString()} / ${I(r).toLocaleString()} tokens`:I(r)>0?`Context usage unknown / ${I(r).toLocaleString()} tokens`:`Context window unknown`),u=k(()=>I(r)>0?Zd(I(r)):`—`);var d=R(),f=N(d),p=e=>{var t=wpe(),n=P(M(t),2),r=M(n,!0);T(n);var i=P(n,2),a=M(i);T(i),T(t),F(()=>{W(t,`data-tone`,I(s)),ea(t,`--ctx-fill: ${I(o)}%;`),W(t,`title`,I(l)),W(t,`aria-label`,`${I(l)}. ${I(c)} of context window.`),B(r,I(c)),B(a,`/${I(u)??``}`)}),z(e,t)};V(f,e=>{(I(r)>0||I(a)!=null)&&e(p)}),z(e,d),O()}var Epe=L(`<span><!></span>`),Dpe=L(`<li><button type="button"><!> <span class="permission-row-text svelte-18t7wl6"><span class="permission-row-label svelte-18t7wl6"> </span> <span class="permission-row-detail svelte-18t7wl6"> </span></span></button></li>`),Ope=L(`<div class="permission-menu svelte-18t7wl6"><p class="permission-heading svelte-18t7wl6">Permission level</p> <ul class="permission-list svelte-18t7wl6"></ul></div>`),kpe=L(`<div class="composer-tabs svelte-18t7wl6"><!> <button type="button" class="composer-tab mode-tab"> </button> <!> <!></div>`);function Ape(e,t){D(t,!0);let n=[{value:`read_only`,label:`Read only`,detail:`No writes or mutating commands`,icon:upe},{value:`supervised`,label:`Supervised`,detail:`Ask before non-read tool calls`,icon:fpe},{value:`autonomous`,label:`Autonomous`,detail:`Allow tool calls without approval`,icon:mpe}],r=k(()=>n.find(e=>e.value===t.permissionLevel)??n[2]),i=A(!1);function a(e){e!==t.permissionLevel&&t.onPermissionChange?.(e),j(i,!1)}function o(){t.onModeChange?.(t.mode===`coding`?`planning`:`coding`)}var s=kpe(),c=M(s);{let e=e=>{let n=k(()=>I(r).icon);var i=Epe();let a;U(M(i),()=>I(n),(e,t)=>{t(e,{size:13,strokeWidth:2.2})}),T(i),F(()=>a=Qi(i,1,`permission-tab-inner svelte-18t7wl6`,null,a,{disabled:t.controlsDisabled})),z(e,i)},o=k(()=>t.permissionShortcut?`Permission: ${I(r).label} (${t.permissionShortcut})`:`Permission: ${I(r).label}`);XS(c,{class:`permission-popover-content`,triggerClass:`composer-tab permission-tab`,ariaLabel:`Permission level`,get triggerTitle(){return I(o)},get triggerAriaKeyShortcuts(){return t.permissionShortcutAria},side:`top`,align:`start`,sideOffset:9,get open(){return I(i)},set open(e){j(i,e,!0)},trigger:e,children:(e,r)=>{var i=Ope(),o=P(M(i),2);Ni(o,21,()=>n,e=>e.value,(e,n)=>{let r=k(()=>I(n).icon);var i=Dpe(),o=M(i);let s;var c=M(o);U(c,()=>I(r),(e,t)=>{t(e,{size:15,strokeWidth:2.1})});var l=P(c,2),u=M(l),d=M(u,!0);T(u);var f=P(u,2),p=M(f,!0);T(f),T(l),T(o),T(i),F(()=>{s=Qi(o,1,`permission-row svelte-18t7wl6`,null,s,{active:I(n).value===t.permissionLevel}),W(o,`aria-pressed`,I(n).value===t.permissionLevel),B(d,I(n).label),B(p,I(n).detail)}),_i(`click`,o,()=>a(I(n).value)),z(e,i)}),T(o),T(i),z(e,i)},$$slots:{trigger:!0,default:!0}})}var l=P(c,2),u=M(l,!0);T(l);var d=P(l,2);Tpe(d,{get contextUsage(){return t.contextUsage},get contextWindow(){return t.contextWindow}}),Cpe(P(d,2),{get models(){return t.models},get selectedModelKey(){return t.selectedModelKey},get thinkingLevel(){return t.thinkingLevel},get disabled(){return t.modelDisabled},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get runtimeChangeHint(){return t.runtimeChangeHint},get shortcutLabel(){return t.thinkingShortcut}}),T(s),F(()=>{l.disabled=t.modeDisabled,W(l,`title`,t.modeShortcut?`Mode: ${t.modeLabel} (${t.modeShortcut})`:`Mode: ${t.modeLabel} (click to switch)`),W(l,`aria-keyshortcuts`,t.modeShortcutAria),B(u,t.modeLabel)}),_i(`click`,l,o),z(e,s),O()}vi([`click`]);function h$(){return typeof navigator>`u`?!1:navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.includes(`Mac OS X`)}function g$(e){return e===` `?`space`:e===`Esc`?`escape`:e.toLowerCase()}function jpe(e){if(/^Key[A-Z]$/.test(e))return e.slice(3).toLowerCase();if(/^Digit[0-9]$/.test(e))return e.slice(5);switch(e){case`BracketLeft`:return`[`;case`BracketRight`:return`]`;case`Minus`:return`-`;case`Equal`:return`=`;case`Period`:return`.`;case`Enter`:case`NumpadEnter`:return`enter`;case`Escape`:return`escape`;default:return}}function Mpe(e){return e instanceof Element?!!e.closest(`input, textarea, select, [contenteditable="true"], .cm-editor`):!1}function Npe(e,t){let n=h$(),r=!!(t.ctrl||t.mod&&!n),i=!!(t.meta||t.mod&&n),a=!!t.alt,o=!!t.shift;if(e.ctrlKey!==r||e.metaKey!==i||e.altKey!==a||e.shiftKey!==o)return!1;let s=g$(t.key);return g$(e.key)===s||g$(jpe(e.code)??``)===s}function _$(e){let t=g$(e);return t===`escape`?`Esc`:t===`enter`?`Enter`:t===`space`?`Space`:t.length===1?t.toUpperCase():e}function Ppe(e){let t=h$(),n=[];return e.mod&&n.push(t?`⌘`:`Ctrl`),e.ctrl&&n.push(t?`⌃`:`Ctrl`),e.alt&&n.push(t?`⌥`:`Alt`),e.shift&&n.push(t?`⇧`:`Shift`),n.push(_$(e.key)),t?n.join(``):n.join(`+`)}function Fpe(e){let t=h$(),n=[];return e.mod&&n.push(t?`Meta`:`Control`),e.ctrl&&n.push(`Control`),e.alt&&n.push(`Alt`),e.shift&&n.push(`Shift`),n.push(_$(e.key)),n.join(`+`)}var v$=[{id:`conversation.new`,label:`New chat`,category:`Conversation`,defaultBinding:{key:`n`,mod:!0}},{id:`conversation.newFromProject`,label:`New chat from project`,category:`Conversation`,defaultBinding:{key:`n`,mod:!0,shift:!0}},{id:`pane.close`,label:`Close pane`,category:`Panes`,defaultBinding:{key:`w`,mod:!0}},{id:`pane.closeOthers`,label:`Close other panes`,category:`Panes`,defaultBinding:{key:`w`,mod:!0,shift:!0}},{id:`pane.refresh`,label:`Refresh pane`,category:`Panes`,defaultBinding:{key:`r`,mod:!0}},{id:`pane.previous`,label:`Previous pane`,category:`Panes`,defaultBinding:{key:`[`,mod:!0}},{id:`pane.next`,label:`Next pane`,category:`Panes`,defaultBinding:{key:`]`,mod:!0}},...Array.from({length:9},(e,t)=>{let n=t+1;return{id:`pane.focusByIndex.${n}`,label:`Focus pane ${n}`,category:`Panes`,defaultBinding:{key:String(n),mod:!0}}}),{id:`projectSearch.focus`,label:`Focus project search`,category:`Conversation`,defaultBinding:{key:`k`,mod:!0}},{id:`composer.focus`,label:`Focus composer`,category:`Composer`,defaultBinding:{key:`escape`},allowInEditable:!0},{id:`composer.send`,label:`Send prompt`,category:`Composer`,defaultBinding:{key:`enter`,mod:!0},allowInEditable:!0},{id:`composer.stopRun`,label:`Stop active run`,category:`Composer`,defaultBinding:{key:`.`,mod:!0},allowInEditable:!0},{id:`composer.toggleMic`,label:`Toggle voice recording`,category:`Composer`,defaultBinding:{key:`v`,alt:!0},allowInEditable:!0},{id:`composer.cancelMic`,label:`Cancel voice recording`,category:`Composer`,defaultBinding:{key:`escape`},allowInEditable:!0},{id:`composer.toggleMode`,label:`Toggle coding/planning mode`,category:`Composer`,defaultBinding:{key:`m`,alt:!0},allowInEditable:!0},{id:`composer.cyclePermission`,label:`Cycle permission level`,category:`Composer`,defaultBinding:{key:`p`,alt:!0},allowInEditable:!0},{id:`composer.cycleThinking`,label:`Cycle thinking level`,category:`Composer`,defaultBinding:{key:`t`,alt:!0},allowInEditable:!0},{id:`zoom.in`,label:`Zoom in`,category:`View`,defaultBinding:{key:`=`,mod:!0}},{id:`zoom.out`,label:`Zoom out`,category:`View`,defaultBinding:{key:`-`,mod:!0}},{id:`zoom.reset`,label:`Reset zoom`,category:`View`,defaultBinding:{key:`0`,mod:!0}}];function Ipe(e){return v$.find(t=>t.id===e)}function y$(e){return Ipe(e)?.defaultBinding}function b$(e){let t=y$(e);return t?Ppe(t):void 0}function x$(e){let t=y$(e);return t?Fpe(t):void 0}var Lpe=L(`<form class="composer svelte-h31act"><!> <!> <div class="composer-surface svelte-h31act"><div class="editor-shell svelte-h31act"><!> <!> <div class="composer-send svelte-h31act"><!> <!> <!> <!></div></div></div></form> <!>`,1);function Rpe(e,t){D(t,!0);let n=q(t,`text`,3,``),r=q(t,`pendingConversationActive`,3,!1),i=q(t,`approvals`,19,()=>[]),a=q(t,`interactive`,3,!0);q(t,`live`,3,!1);let o=q(t,`sending`,3,!1),s=q(t,`compacting`,3,!1),c=q(t,`models`,19,()=>[]),l=q(t,`selectedModelKey`,3,``),u=q(t,`contextWindow`,3,0),d=q(t,`focusToken`,3,0),f=q(t,`composerEscapeToken`,3,0),p=q(t,`micShortcutToken`,3,0),m=q(t,`thinkingLevel`,3,`off`),h=q(t,`mode`,3,`coding`),g=q(t,`permissionLevel`,3,`autonomous`),_=q(t,`slashCompletions`,19,()=>[]),v=q(t,`gitSuggestions`,19,()=>[]),y=A(0),b=A(!1),x=A(void 0),S=A(void 0),ee=A(void 0),C=A(!1),te=b$(`composer.toggleMic`),ne=x$(`composer.toggleMic`),re=b$(`composer.cancelMic`),ie=b$(`composer.toggleMode`),ae=x$(`composer.toggleMode`),oe=b$(`composer.cyclePermission`),w=x$(`composer.cyclePermission`),se=b$(`composer.cycleThinking`),ce=b$(`composer.stopRun`),le=x$(`composer.stopRun`),ue=k(()=>{if(t.activeConversation)return{kind:`conversation`,id:t.activeConversation.id};if(t.activePendingConversation)return{kind:`pending-conversation`,id:t.activePendingConversation.id}}),de=k(()=>!!(I(ue)&&bA.isTargetActive(I(ue))&&bA.recording)),fe=k(()=>!!(I(ue)&&bA.isTargetActive(I(ue))&&bA.transcribing)),pe=k(()=>!!(I(ue)&&bA.isBusyForOtherTarget(I(ue)))),me=k(()=>i().length>0),he=k(()=>!!t.pendingUserQuestion),ge=k(()=>!!t.pendingPlanReview),_e=k(()=>I(me)||I(he)||I(ge)),ve=k(()=>!!(t.activeProject&&(t.activeConversation||r())&&c().length>0&&!I(_e)&&!s())),ye=k(()=>!a()||!I(ve)),be=k(()=>!a()||!I(ve)||I(b)),xe=k(()=>f$.configured),Se=k(()=>bA.isSupported()),Ce=k(()=>!a()||!I(ue)||bA.pending||!I(de)&&(!I(ve)||!I(Se)||I(pe))),we=k(()=>I(de)?`Stop recording${te?` (${te})`:``} — ${re??`Esc`} to cancel; right-click to cancel (${De(bA.elapsedMs)} / ${De(bA.maxDurationMs)})`:I(pe)?`Voice recording is active in another conversation`:bA.retryAttempt>0&&I(ue)&&bA.isTargetActive(I(ue))?`Retrying transcription ${bA.retryAttempt}/${bA.maxRetries}…`:I(fe)?`Transcribing audio…`:I(xe)?te?`Record voice prompt (${te})`:`Record voice prompt`:`Connect ChatGPT to use voice input`),Te=k(()=>I(b)?`Transcribing and sending prompt`:I(de)?`Transcribe and send prompt`:s()?`Compacting context`:o()?`Queue prompt`:`Send prompt`),Ee=k(()=>I(b)?`Transcribing audio, then sending prompt`:I(de)?`Stop recording, transcribe, and send prompt`:s()?`Compacting context`:o()?`Queue prompt for the next agent turn`:`Send prompt`);function De(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}async function Oe(){if(!(!a()||I(_e)||s()||I(b))){if(I(de)&&I(ue)){j(b,!0);try{await bA.stop(I(ue))&&t.onSubmit?.()}finally{j(b,!1)}return}t.onSubmit?.()}}async function ke(e){return Hre(e)}let Ae=k(()=>!a()||!(t.activeConversation||r())||o()||s()||I(_e)),je=k(()=>!a()||!(t.activeConversation||r())),Me=k(()=>!a()||!(t.activeConversation||r())||c().length===0||s()),Ne=k(()=>o()?`Changes apply to the next model request`:void 0),Pe=k(()=>h()===`planning`?`Planning`:`Coding`);function Fe(){if(!(!a()||I(Ce)||s()||!I(ue))){if(!I(de)&&!I(xe)){j(C,!0);return}bA.toggle(I(ue))}}function Ie(){return!I(de)||!I(ue)?!1:(bA.cancel(I(ue)),!0)}rr(()=>{if(I(x)===void 0||!a()){j(x,d());return}d()!==I(x)&&(j(x,d()),j(y,I(y)+1))}),rr(()=>{if(I(S)===void 0||!a()){j(S,f());return}f()!==I(S)&&(j(S,f()),Ie()||j(y,I(y)+1))}),rr(()=>{if(I(ee)===void 0||!a()){j(ee,p());return}p()!==I(ee)&&(j(ee,p()),Fe())});function Le(e){!I(de)||!I(ue)||(e.preventDefault(),bA.cancel(I(ue)))}var Re=Lpe(),ze=N(Re),Be=M(ze);tpe(Be,{get approvals(){return i()},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval}});var Ve=P(Be,2),He=e=>{cpe(e,{get suggestions(){return v()},get onSend(){return t.onSendGitSuggestion},get onDraft(){return t.onDraftGitSuggestion}})};V(Ve,e=>{v().length>0&&!I(_e)&&!o()&&!s()&&I(ve)&&e(He)});var Ue=P(Ve,2),We=M(Ue),Ge=M(We);Ape(Ge,{get controlsDisabled(){return I(Ae)},get modeDisabled(){return I(je)},get modelDisabled(){return I(Me)},get mode(){return h()},get permissionLevel(){return g()},get modeLabel(){return I(Pe)},get permissionShortcut(){return oe},get permissionShortcutAria(){return w},get modeShortcut(){return ie},get modeShortcutAria(){return ae},get thinkingShortcut(){return se},get contextUsage(){return t.contextUsage},get contextWindow(){return u()},get models(){return c()},get selectedModelKey(){return l()},get thinkingLevel(){return m()},get onModeChange(){return t.onModeChange},get runtimeChangeHint(){return I(Ne)},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get onPermissionChange(){return t.onPermissionChange}});var Ke=P(Ge,2);{let e=k(()=>I(me)?`Approval required before the agent can continue`:I(ge)?`Review the plan in the transcript before the agent can continue`:I(he)?`Reply in the transcript before the agent can continue`:s()?`Compacting context…`:o()?`Queue a prompt for the next agent turn`:`Ask the local Nerve agent`);BX(Ke,{get value(){return n()},get disabled(){return I(ye)},get placeholder(){return I(e)},get slashCompletions(){return _()},get fileCompletions(){return t.fileCompletions},get focusToken(){return I(y)},get onChange(){return t.onChange},onSubmit:Oe,onPasteImage:ke})}var qe=P(Ke,2),Je=M(qe);{let e=k(()=>I(ue)&&bA.isTargetActive(I(ue))?bA.retryAttempt:0);TD(Je,{get recording(){return I(de)},get transcribing(){return I(fe)},get elapsedMs(){return bA.elapsedMs},get maxDurationMs(){return bA.maxDurationMs},get retryAttempt(){return I(e)},get maxRetries(){return bA.maxRetries},class:`composer-transcription-status`})}var Ye=P(Je,2);{let e=k(()=>I(de)?`destructive`:`secondary`),t=k(()=>`mic-button${I(de)?` recording`:``}`),n=k(()=>I(de)?`Stop recording; right-click to cancel`:I(xe)?`Record voice prompt`:`Connect ChatGPT to use voice input`);Ol(Ye,{get variant(){return I(e)},size:`icon-sm`,get class(){return I(t)},type:`button`,get disabled(){return I(Ce)},onclick:Fe,oncontextmenu:Le,get"aria-label"(){return I(n)},get"aria-keyshortcuts"(){return ne},get title(){return I(we)},children:(e,t)=>{var n=R(),r=N(n),i=e=>{GE(e,{size:14,strokeWidth:2.4,class:`spin`})},a=e=>{qE(e,{size:14,strokeWidth:2.4})};V(r,e=>{I(fe)?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}var Xe=P(Ye,2),Ze=e=>{{let n=k(()=>ce?`Stop generation (${ce})`:`Stop generation`);Ol(e,{variant:`destructive`,size:`icon-sm`,class:`stop-button`,get onclick(){return t.onAbort},"aria-label":`Stop generation`,get"aria-keyshortcuts"(){return le},get title(){return I(n)},children:(e,t)=>{ZE(e,{size:13,strokeWidth:2.5})},$$slots:{default:!0}})}};V(Xe,e=>{o()&&!I(he)&&!s()&&e(Ze)}),Ol(P(Xe,2),{size:`icon-sm`,class:`send-button`,type:`submit`,get disabled(){return I(be)},get"aria-label"(){return I(Te)},get title(){return I(Ee)},children:(e,t)=>{YE(e,{size:14,strokeWidth:2.4})},$$slots:{default:!0}}),T(qe),T(We),T(Ue),T(ze),d$(P(ze,2),{get open(){return I(C)},set open(e){j(C,e,!0)}}),F(()=>{W(ze,`data-pending-approval`,I(me)?`true`:void 0),W(ze,`data-pending-question`,I(he)?`true`:void 0),W(ze,`data-pending-plan`,I(ge)?`true`:void 0),W(Ue,`data-mode`,h())}),gi(`submit`,ze,e=>{e.preventDefault(),Oe()}),z(e,Re),O()}var zpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function S$(e,t){let n=G(t,zpe),r=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];ic(e,K({name:`folder`},()=>n,{get iconNode(){return r}}))}var Bpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vpe(e,t){let n=G(t,Bpe),r=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]];ic(e,K({name:`list-plus`},()=>n,{get iconNode(){return r}}))}function Hpe(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function C$(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function w$(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Upe=(e,t)=>Math.abs(e-t)<1.01,Wpe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},T$,E$=()=>{if(T$!==void 0)return T$;if(typeof navigator>`u`)return T$=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return T$=!0;let e=navigator.maxTouchPoints;return T$=navigator.platform===`MacIntel`&&e!==void 0&&e>0},D$=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Gpe=e=>e,Kpe=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},qpe=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(D$(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(D$(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},O$={passive:!0},Jpe=typeof window>`u`?!0:`onscrollend`in window,Ype=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Jpe,o=0,s=a?null:Wpe(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,O$),a&&r.addEventListener(`scrollend`,u,O$),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},Xpe=(e,t)=>Ype(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Zpe=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Qpe=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},$pe=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Gpe,rangeExtractor:Kpe,onChange:()=>{},measureElement:Zpe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=C$(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!E$()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,O$),e.addEventListener(`touchend`,n,O$),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(E$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=C$(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=C$(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=Hpe(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=C$(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?eme({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=C$(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=C$(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return w$(t[k$(0,t.length-1,r?e=>n[e*2]:e=>w$(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(E$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Upe(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},k$=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function eme({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=k$(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}function tme(e){let t=new $pe(e),n=t.setOptions,r,i=e=>{let i={...t.options,...e,onChange:e.onChange};n({...i,onChange:(e,t)=>{r.set(e),i.onChange?.(e,t)}}),t._willUpdate(),r.set(t)};return r=zt(t,()=>(i(e),t._didMount())),see(r,e=>Object.assign(e,{setOptions:i}))}function nme(e){return tme({observeElementRect:qpe,observeElementOffset:Xpe,scrollToFn:Qpe,...e})}var A$=class{max;#e=new Map;constructor(e){if(this.max=e,e<=0)throw Error(`LruCache max must be a positive integer.`)}get(e){let t=this.#e.get(e);return t===void 0?this.#e.has(e)?t:void 0:(this.#e.delete(e),this.#e.set(e,t),t)}has(e){return this.#e.has(e)}set(e,t){if(this.#e.has(e)&&this.#e.delete(e),this.#e.set(e,t),this.#e.size>this.max){let e=this.#e.keys().next().value;this.#e.delete(e)}}delete(e){this.#e.delete(e)}clear(){this.#e.clear()}get size(){return this.#e.size}},j$=new A$(12);function rme(e){let t=j$.get(e);t||(t=new Map,j$.set(e,t));let n=t;return{get:e=>n.get(e),set:(e,t)=>{t>0&&n.set(e,t)},get size(){return n.size}}}var ime=L(`<div><!></div>`),ame=L(`<div><div></div></div>`);function M$(e,t){D(t,!0);let n=q(t,`contentVisibility`,3,!1),r=q(t,`overscan`,3,8),i=q(t,`anchor`,3,`start`),a=q(t,`followOutput`,3,!1),o=q(t,`paddingStart`,3,0),s=q(t,`paddingEnd`,3,0),c=q(t,`controller`,15),l=q(t,`atEnd`,15,!0),u=A(null),d=k(()=>t.heightCacheKey?rme(t.heightCacheKey):void 0);function f(e){let n=t.items[e];return n===void 0?`__missing__:${e}`:t.getKey(n,e)}function p(e){let n=I(d)?.get(f(e));return n===void 0?t.estimateSize?.(e)??64:n}let m=nme({count:0,getScrollElement:()=>I(u),estimateSize:e=>p(e),getItemKey:f}),h=cee(m),g=A(Mn(h.getVirtualItems())),_=A(Mn(h.getTotalSize())),v=k(()=>I(g).filter(e=>e.index>=0&&e.index<t.items.length)),y,b=0;function x(){return i()===`end`&&!!a()}function S(){return a()===`smooth`?`smooth`:`auto`}function ee(){y!==void 0&&(cancelAnimationFrame(y),y=void 0)}function C(e=8){x()&&(b=Math.max(b,e),y===void 0&&(y=requestAnimationFrame(()=>{if(y=void 0,!x()){b=0;return}h.scrollToEnd({behavior:S()}),te(),--b,b>0&&!h.isAtEnd(t.scrollEndThreshold)?C(b):b=0})))}function te(){j(g,h.getVirtualItems(),!0),j(_,h.getTotalSize(),!0),l(h.isAtEnd(t.scrollEndThreshold))}rr(()=>m.subscribe(te));let ne=``;rr(()=>{I(u);let e=t.items.length===0?`0`:`${t.items.length}\0${String(f(0))}\0${String(f(t.items.length-1))}`,n=e!==ne;ne=e,h.setOptions({count:t.items.length,overscan:r(),anchorTo:i(),followOnAppend:a(),paddingStart:o(),paddingEnd:s(),...t.scrollEndThreshold===void 0?{}:{scrollEndThreshold:t.scrollEndThreshold},...t.gap===void 0?{}:{gap:t.gap}}),te(),x()?n&&C():(ee(),b=0)});function re(){l(h.isAtEnd(t.scrollEndThreshold))}rr(()=>{I(u),c({scrollToEnd:e=>h.scrollToEnd(e),scrollToIndex:(e,t)=>h.scrollToIndex(e,t),isAtEnd:e=>h.isAtEnd(e??t.scrollEndThreshold),getDistanceFromEnd:()=>h.getDistanceFromEnd(),getViewportElement:()=>I(u),measureAll:()=>h.measure()})});let ie=new Map,ae;function oe(e){return e.getClientRects().length>0}function w(e){if(oe(e))return e.offsetHeight}function se(){if(ae=void 0,ie.size===0)return;let e=[];for(let[t,n]of ie){let r=w(n);r!==void 0&&e.push([t,r])}ie.clear();let t=I(d);for(let[n,r]of e)h.resizeItem(n,r),t?.set(f(n),r);C(3)}function ce(e){if(!oe(e))return;h.measureElement(e);let t=Number(e.dataset.index);Number.isNaN(t)||ie.set(t,e),ae===void 0&&(ae=requestAnimationFrame(se))}function le(){ae!==void 0&&(cancelAnimationFrame(ae),ae=void 0)}function ue(e){let t=w(e)??0,n;return ce(e),typeof ResizeObserver<`u`&&(n=new ResizeObserver(()=>{let n=w(e);n===void 0||n===t||(t=n,ce(e))}),n.observe(e)),{update(){ce(e)},destroy(){n?.disconnect();let t=Number(e.dataset.index);Number.isNaN(t)||ie.delete(t),ie.size===0&&le(),queueMicrotask(()=>h.measureElement(null))}}}rr(()=>()=>{ee(),le()});var de=ame(),fe=M(de);let pe;Ni(fe,21,()=>I(v),e=>e.key,(e,r)=>{let i=k(()=>t.items[I(r).index]);var a=R(),o=N(a),s=e=>{var a=ime();let o,s;H(M(a),()=>t.row,()=>({item:I(i),index:I(r).index})),T(a),Hi(a,e=>ue?.(e)),F(e=>{o=Qi(a,1,`virtual-scroller-row svelte-hoqfty`,null,o,{"cv-auto":n()}),W(a,`data-index`,I(r).index),s=ea(a,``,s,e)},[()=>({transform:`translateY(${I(r).start}px)`,"contain-intrinsic-size":n()?`auto ${Math.max(1,Math.round(I(r).size))}px`:void 0})]),z(e,a)};V(o,e=>{I(i)!==void 0&&e(s)}),z(e,a)}),T(fe),T(de),Ta(de,e=>j(u,e),()=>I(u)),F((e,t)=>{Qi(de,1,e,`svelte-hoqfty`),Qi(fe,1,t,`svelte-hoqfty`),pe=ea(fe,``,pe,{height:`${I(_)}px`})},[()=>Ki(ol(`virtual-scroller-viewport`,t.viewportClass)),()=>Ki(ol(`virtual-scroller-spacer`,t.class))]),gi(`scroll`,de,re),z(e,de),O()}var ome=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function sme(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,ome);var i=R();U(N(i),()=>Kv,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var cme=new Set([`$$slots`,`$$events`,`$$legacy`]);function lme(e,t){let n=G(t,cme);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var ume=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`portalProps`,`class`]);function dme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,ume);lme(e,K(()=>t.portalProps,{children:(e,i)=>{var a=R(),o=N(a);{let e=k(()=>ol(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 z-50 overflow-x-hidden overflow-y-auto outline-none`,t.class));U(o,()=>ay,(t,i)=>{i(t,K({"data-slot":`context-menu-content`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a)},$$slots:{default:!0}})),O()}var fme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function pme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,fme);var i=R();U(N(i),()=>$v,(e,t)=>{t(e,K({"data-slot":`context-menu-group`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),z(e,i),O()}var mme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`]);function hme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,mme);var i=R(),a=N(i);{let e=k(()=>ol(`text-foreground px-2 py-1.5 text-sm font-medium data-inset:ps-8`,t.class));U(a,()=>ny,(i,a)=>{a(i,K({"data-slot":`context-menu-group-heading`,get"data-inset"(){return t.inset},get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var gme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`variant`]);function _me(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=G(t,gme);var a=R(),o=N(a);{let e=k(()=>ol(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(o,()=>Xv,(a,o)=>{o(a,K({"data-slot":`context-menu-item`,get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var vme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function yme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,vme);var i=R(),a=N(i);{let e=k(()=>ol(`bg-border -mx-1 my-1 h-px`,t.class));U(a,()=>dy,(t,i)=>{i(t,K({"data-slot":`context-menu-separator`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var bme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),xme=L(`<span><!></span>`);function Sme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,bme);var i=xme();_a(i,e=>({"data-slot":`context-menu-shortcut`,class:e,...r}),[()=>ol(`text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest`,t.class)]),H(M(i),()=>t.children??w),T(i),Ta(i,e=>n(e),()=>n()),z(e,i),O()}var Cme=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function wme(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,Cme);var i=R();U(N(i),()=>qv,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var Tme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Eme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Tme);var i=R(),a=N(i);{let e=k(()=>ol(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground min-w-32 rounded-md border p-1 shadow-lg duration-100`,t.class));U(a,()=>my,(t,i)=>{i(t,K({"data-slot":`context-menu-sub-content`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Dme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`children`]),Ome=L(`<!> <!>`,1);function kme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Dme);var i=R(),a=N(i);{let e=k(()=>ol(`focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(a,()=>_y,(i,a)=>{a(i,K({"data-slot":`context-menu-sub-trigger`,get"data-inset"(){return t.inset},get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Ome(),i=N(r);H(i,()=>t.children??w),Rw(P(i,2),{class:`ml-auto`}),z(e,r)},$$slots:{default:!0}}))})}z(e,i),O()}var Ame=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function jme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Ame);var i=R(),a=N(i);{let e=k(()=>ol(`cn-context-menu-trigger select-none`,t.class));U(a,()=>cy,(t,i)=>{i(t,K({"data-slot":`context-menu-trigger`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var N$=(e,t=w)=>{var n=R();Ni(N(n),17,t,Ai,(e,t)=>{var n=R(),r=N(n),i=e=>{var t=R();U(N(t),()=>yme,(e,t)=>{t(e,{})}),z(e,t)},a=e=>{var n=R();U(N(n),()=>pme,(e,n)=>{n(e,{children:(e,n)=>{var r=R();U(N(r),()=>hme,(e,n)=>{n(e,{children:(e,n)=>{E();var r=wi();F(()=>B(r,I(t).label)),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}),z(e,n)},o=e=>{let n=k(()=>I(t).icon);var r=R();U(N(r),()=>wme,(e,r)=>{r(e,{children:(e,r)=>{var i=P$(),a=N(i);U(a,()=>kme,(e,r)=>{r(e,{get disabled(){return I(t).disabled},children:(e,r)=>{var i=Mme(),a=N(i),o=e=>{var t=R();U(N(t),()=>I(n),(e,t)=>{t(e,{})}),z(e,t)};V(a,e=>{I(n)&&e(o)});var s=P(a,2),c=M(s,!0);T(s),F(()=>B(c,I(t).label)),z(e,i)},$$slots:{default:!0}})}),U(P(a,2),()=>Eme,(e,n)=>{n(e,{children:(e,n)=>{N$(e,()=>I(t).items)},$$slots:{default:!0}})}),z(e,i)},$$slots:{default:!0}})}),z(e,r)},s=e=>{let n=k(()=>I(t).icon);var r=R(),i=N(r);{let e=k(()=>I(t).destructive?`destructive`:`default`);U(i,()=>_me,(r,i)=>{i(r,{get variant(){return I(e)},get disabled(){return I(t).disabled},get onSelect(){return I(t).onSelect},children:(e,r)=>{var i=Nme(),a=N(i),o=e=>{var t=R();U(N(t),()=>I(n),(e,t)=>{t(e,{})}),z(e,t)};V(a,e=>{I(n)&&e(o)});var s=P(a,2),c=M(s,!0);T(s);var l=P(s,2),u=e=>{var n=R();U(N(n),()=>Sme,(e,n)=>{n(e,{children:(e,n)=>{E();var r=wi();F(()=>B(r,I(t).shortcut)),z(e,r)},$$slots:{default:!0}})}),z(e,n)};V(l,e=>{I(t).shortcut&&e(u)}),F(()=>B(c,I(t).label)),z(e,i)},$$slots:{default:!0}})})}z(e,r)};V(r,e=>{I(t).type===`separator`?e(i):I(t).type===`label`?e(a,1):I(t).type===`submenu`?e(o,2):e(s,-1)}),z(e,n)}),z(e,n)},Mme=L(`<!> <span class="truncate"> </span>`,1),P$=L(`<!> <!>`,1),Nme=L(`<!> <span class="truncate"> </span> <!>`,1);function F$(e,t){var n=R();U(N(n),()=>sme,(e,n)=>{n(e,{get onOpenChange(){return t.onOpenChange},children:(e,n)=>{var r=P$(),i=N(r);U(i,()=>jme,(e,n)=>{n(e,{get class(){return t.triggerClass},children:(e,n)=>{var r=R();H(N(r),()=>t.children),z(e,r)},$$slots:{default:!0}})}),U(P(i,2),()=>dme,(e,n)=>{n(e,{get class(){return t.class},children:(e,n)=>{N$(e,()=>t.items)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}),z(e,n)}var I$=/^[A-Za-z]:[\\/]/,Pme=/^[A-Za-z]:$/;function Fme(e){return I$.test(e)||e.startsWith(`\\\\`)||e.startsWith(`//`)}function Ime(e){return Fme(e)&&e.includes(`\\`)?`\\`:`/`}function Lme(e){return e===`/`||e===`\\`}function Rme(e){if(Pme.test(e))return e;let t=e.length;for(;t>0&&Lme(e[t-1]);)--t;return e.slice(0,t)}function zme(e){let t=e.length;for(;t>0&&e[t-1]===`/`;)--t;return e.slice(0,t)}function L$(e){let t=e.trim();return t.startsWith(`/`)||I$.test(t)||t.startsWith(`\\\\`)}function R$(e){let t=e.trim().replace(/\\/g,`/`),n=t.startsWith(`//`);return t=t.replace(/\/{2,}/g,`/`),n&&!t.startsWith(`//`)&&(t=`/${t}`),t=zme(t),/^[A-Za-z]:($|\/)/.test(t)&&(t=`${t[0]?.toLowerCase()}${t.slice(1)}`),t}function Bme(e,t){let n=t.trim();if(L$(n))return n;let r=Ime(e),i=n.replace(/[\\/]+/g,r),a=Rme(e.trim());return!a||a===`.`?i:`${a}${r}${i.replace(/^[\\/]+/,``)}`}function z$(e,t){if(!e)return;let n=R$(e),r=R$(t);if(n===r)return`.`;let i=r.endsWith(`/`)?r:`${r}/`;return n.startsWith(i)?n.slice(i.length):e.replace(/\\/g,`/`)}function B$(e,t){if(!e)return;let n=e.trim();if(n)return L$(n)?n:Bme(t,n)}function V$(e){try{return decodeURIComponent(e)}catch{return}}function Vme(e){let t=e.trim();if(t&&!t.startsWith(`#`)){if(t.toLowerCase().startsWith(`file://`))try{let e=new URL(t),n=V$(e.pathname);return n?e.hostname?`//${e.hostname}${n}`:n.replace(/^\/([A-Za-z]:\/)/,`$1`):void 0}catch{return}if(!(/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)&&!I$.test(t)))return V$(t.split(/[?#]/,1)[0]??``)}}function Hme(e){let t=e.lastIndexOf(`:`);if(t<=0||t===1&&/^[A-Za-z]$/.test(e[0]??``))return{path:e};let n=e.slice(t+1);if(!/^\d+$/.test(n))return{path:e};let r=Number(n);return!Number.isSafeInteger(r)||r<=0?{path:e}:{path:e.slice(0,t),line:r}}var Ume=24,Wme=8,Gme=12e3;function Kme(e,t){return e>0&&t>0?`… ${e.toLocaleString()} lines / ${t.toLocaleString()} chars omitted …`:e>0?`… ${e.toLocaleString()} lines omitted …`:`… ${t.toLocaleString()} chars omitted …`}function H$(e,t={}){let n=Math.max(0,t.headLines??Ume),r=Math.max(0,t.tailLines??Wme),i=Math.max(0,t.maxChars??Gme),a=t.marker??Kme,o=e,s=0,c=0,l=e.split(`
|
|
81
|
-
`),u=n+r;if(u>0&&l.length>u){s=l.length-u,c=l.slice(n,l.length-r).join(`
|
|
82
|
-
`).length;let e=l.slice(0,n),t=r>0?l.slice(-r):[];o=[...e,a(s,c),...t].join(`
|
|
83
|
-
`)}if(i>0&&o.length>i){let e=o.length-i;c+=e;let t=a(s,c),n=Math.max(0,i-t.length-2),r=Math.ceil(n*.72),l=Math.max(0,n-r);o=[o.slice(0,r),t,l>0?o.slice(-l):``].filter(Boolean).join(`
|
|
84
|
-
`)}return{text:o,omittedLines:s,omittedChars:c,trimmed:o!==e}}var qme=260;function U$(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e;if(typeof e==`string`&&e.trim().startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return{}}function W$(e){return typeof e==`string`?e:void 0}function Jme(e){let t=oA.safeParse(e);if(t.success)return t.data;let n=U$(e);if(Object.keys(n).length===0)return;let r=oA.safeParse(n);return r.success?r.data:void 0}function G$(e){let t=U$(e).contentBlocks;if(!Array.isArray(t))return;let n=t.flatMap(e=>{let t=U$(e);return t.type===`text`&&typeof t.text==`string`?[t.text]:[]});return n.length>0?n.join(`
|
|
85
|
-
`):void 0}function K$(e){let t=U$(e),n=W$(t.stdout),r=W$(t.stderr);if(!(n===void 0&&r===void 0))return n?r?n.endsWith(`
|
|
86
|
-
`)?`${n}${r}`:`${n}\n${r}`:n.length>0?n:void 0:r&&r.length>0?r:void 0}function q$(e,t,n){return e?.content??G$(e)??G$(t)??K$(e)??K$(t)??n?.text??``}function Yme(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=U$(n);if(typeof e.todo!=`string`||typeof e.done!=`boolean`)return;t.push({todo:e.todo,done:e.done})}return t}function J$(e){let t=U$(e).contentBlocks;if(Array.isArray(t))return t.find(e=>e&&typeof e==`object`&&e.type===`text`&&typeof e.text==`string`)?.text}function Y$(e,t){if(e)return e===t?`.`:z$(e,t)}function X$(e,t){return e.length>t?e.slice(e.length-t):e}function Xme(e,t){return`data:${e};base64,${t}`}function Zme(e){return{...e,text:H$(e.text,{headLines:2,tailLines:1,maxChars:qme}).text}}function Qme(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.path);e||(e=[],n.set(r.path,e),t.push({path:r.path,openPath:r.openPath,matches:e})),e.push(r)}return t}function Z$(e,t){if(e)return B$(e,t)}function Q$(e){let t=U$(e),n=iA.safeParse(e);if(n.success&&n.data.truncated)return!0;let r=iA.safeParse(t.truncation);return!!(r.success&&r.data.truncated)}function $me(e){if(!e)return{additions:0,deletions:0};let t=0,n=0;for(let r of e.split(`
|
|
87
|
-
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,deletions:n}}function ehe(e){if(!e)return{updates:[]};let t=[],n=[];for(let r of e.split(/\r?\n/)){let e=r.trim();if(e){try{let n=U$(JSON.parse(e));if(n.type===`explore_progress`&&typeof n.timestamp==`string`&&typeof n.phase==`string`&&typeof n.message==`string`){t.push({type:`explore_progress`,timestamp:n.timestamp,agentId:W$(n.agentId),taskIndex:typeof n.taskIndex==`number`?n.taskIndex:void 0,taskCount:typeof n.taskCount==`number`?n.taskCount:void 0,label:W$(n.label),model:W$(n.model),phase:n.phase,message:n.message});continue}}catch{}n.push(r)}}return{updates:t,fallback:n.length>0?n.join(`
|
|
88
|
-
`):void 0}}var the=new Set([`Assistant response started.`,`Final report received.`]);function nhe(e){switch(e.phase){case`queued`:return;case`started`:return{text:`Starting…`,mono:!1};case`assistant`:return{text:`Thinking…`,mono:!1};case`tool_call`:case`tool_result`:return{text:e.message,mono:!0};default:return{text:e.message,mono:!1}}}var $$=new WeakMap;function e1(e){let t=$$.get(e);if(t)return t;let n=rhe(e);return $$.set(e,n),n}function rhe(e){let t=e.reports,n=new Map,r=-1,i=0;for(let t of e.liveUpdates){if(typeof t.taskCount==`number`&&(i=Math.max(i,t.taskCount)),typeof t.taskIndex!=`number`)continue;r=Math.max(r,t.taskIndex);let e=n.get(t.taskIndex)??[];e.push(t),n.set(t.taskIndex,e)}let a=Math.max(i,t.length,r+1,+(e.liveUpdates.length>0||t.length>0)),o=[];for(let r=0;r<a;r+=1){let i=t[r],s=n.get(r)??[],c=s[s.length-1],l=[...s].reverse().find(e=>(e.phase===`tool_call`||e.phase===`tool_result`)&&!the.has(e.message)),u=s.find(e=>e.phase===`failed`),d;d=i?.status===`failed`||i?.status===`aborted`?`failed`:i?.status===`completed`||i||s.some(e=>e.phase===`completed`)?`completed`:u?`failed`:s.some(e=>[`started`,`tool_call`,`tool_result`,`assistant`].includes(e.phase))?`running`:`queued`;let f=d===`running`?nhe(l??c??s[0]):void 0,p=i?.model??s.find(e=>e.model)?.model??c?.model;o.push({key:`task-${r}`,index:r,count:a||void 0,label:i?.label??c?.label,task:i?.task??e.task,agentId:i?.agentId??c?.agentId,model:p,status:d,currentAction:f?.text,currentActionMono:f?.mono??!1,actionCount:s.filter(e=>e.phase===`tool_call`).length,report:i,error:i?.errorMessage??i?.summaryPreview??u?.message})}let s=o.filter(e=>e.status===`completed`).length,c=o.filter(e=>e.status===`failed`).length;return{tasks:o,summary:{total:a,completed:s,failed:c,running:o.filter(e=>e.status===`running`||e.status===`queued`).length,done:a>0&&s+c===a}}}function t1(e){return Array.isArray(e)?e:[]}function ihe(e){return t1(e.replacements).length+t1(e.insertions).length+t1(e.lineReplacements).length+t1(e.lineInsertions).length+ +(typeof e.patch==`string`&&e.patch.length>0)}var n1=new A$(300);function ahe(e,t){return[e.id,e.status,e.updatedAt,t?.updatedAt??``,t?.text.length??0].join(`\0`)}function ohe(e,t){let n=ahe(e,t),r=n1.get(n);if(r!==void 0)return r;let i=she(e,t);return n1.set(n,i),i}function she(e,t){let n=U$(e.args),r=e.cwd,i=Jme(e.result);switch(e.toolName){case`read`:{let e=Z$(i?.path??W$(n.path),r),t=Y$(e,r),a=i?.contentBlocks?.find(e=>e.type===`image`);if(a&&a.type===`image`)return{kind:`read`,path:e,relPath:t,image:{dataUrl:Xme(a.mimeType,a.data),mimeType:a.mimeType},truncated:!1};let o=i?.content,s=typeof n.offset==`number`||typeof n.limit==`number`,c;if(o!==void 0){let e=o.length===0?0:o.split(`
|
|
89
|
-
`).length;if(s&&typeof n.offset==`number`){let t=n.offset;c=`lines ${t}–${t+e-1}`}else c=`${e} line${e===1?``:`s`}`}return{kind:`read`,path:e,relPath:t,lineLabel:c,content:o,truncated:Q$(i?.details)}}case`bash`:{let r=W$(n.command),a=bue.safeParse(i?.details),o=q$(i,e.result,t);return{kind:`bash`,command:r,exitCode:i?.exitCode,signal:a.success?a.data.signal??void 0:void 0,output:o,savedTo:a.success?a.data.fullOutputPath:void 0,truncated:Q$(i?.details),live:!i&&!!t?.text}}case`python`:{let a=W$(n.code),o=W$(n.path),s=Sue.safeParse(i?.details),c=Z$((s.success?s.data.scriptPath:void 0)??o,r),l=q$(i,e.result,t),u=a?a.split(/\r?\n/).length:0;return{kind:`python`,inputMode:s.success?s.data.inputMode??(c?`file`:`inline`):o?`file`:`inline`,code:a,codeLineCount:u,scriptPath:c,relScriptPath:Y$(c,r),exitCode:i?.exitCode,signal:s.success?s.data.signal??void 0:void 0,output:l,savedTo:s.success?s.data.fullOutputPath:void 0,truncated:Q$(i?.details),live:!i&&!!t?.text,allowNetwork:s.success?s.data.allowNetwork:void 0,allowFileWrite:s.success?s.data.allowFileWrite:void 0,durationMs:s.success?s.data.durationMs:void 0,timedOut:s.success?s.data.timedOut:void 0,timeoutKilled:s.success?s.data.timeoutKilled:void 0,envKeys:s.success?s.data.envKeys:void 0,artifactDir:s.success?s.data.artifactDir:void 0,artifacts:s.success?s.data.artifacts:void 0,streams:s.success?s.data.streams:void 0}}case`edit`:{let e=Z$(i?.path??W$(n.path),r),t=Y$(e,r),a=yue.safeParse(i?.details),o=a.success?a.data.operationCount:ihe(n),s=a.success?a.data.diff:void 0,{additions:c,deletions:l}=$me(s);return{kind:`edit`,path:e,relPath:t,operationCount:o,additions:c,deletions:l,diff:s,dryRun:a.success?a.data.dryRun:void 0}}case`write`:{let e=Z$(i?.path??W$(n.path),r),t=Y$(e,r),a=W$(n.content),o=i?.content?.match(/Wrote (\d+) bytes/);return{kind:`write`,path:e,relPath:t,bytes:o?Number(o[1]):void 0,content:a}}case`grep`:{let e=W$(n.pattern),t=Z$(i?.path,r)??Z$(W$(n.path)??`.`,r)??r,a=(i?.matches??[]).map(e=>Zme({...e,openPath:Z$(e.path,t)??e.path})),o=Qme(a);return{kind:`grep`,pattern:e,matchCount:a.length,fileCount:o.length,allMatches:o}}case`find`:{let e=W$(n.pattern),t=i?.entries??[],a=Z$(i?.path,r)??Z$(W$(n.path)??`.`,r)??r,o=t.map(e=>e.path);return{kind:`find`,pattern:e,paths:o,openPaths:t.map(e=>Z$(e.path,a)??e.path),count:o.length}}case`ls`:{let e=Z$(i?.path??W$(n.path),r),t=Y$(e,r)??`.`,a=(i?.entries??[]).map(t=>({...t,openPath:Z$(t.path,e??r)??t.path}));return{kind:`ls`,path:e,relPath:t,entries:a,total:a.length}}case`ask_user`:{let t=Fue.safeParse(e.result),r=t.success?t.data:void 0;return{kind:`ask_user`,question:r?.question??W$(n.question),context:r?.context??W$(n.context),recommendation:r?.recommendation??W$(n.recommendation),answer:r?.response,dismissed:!!r?.dismissed,dismissedReason:r?.dismissedReason}}case`todos_set`:case`todos_get`:{let t=Lue.safeParse(e.result),r=(t.success?t.data.details?.todos:void 0)??Yme(n.todos)??[];return{kind:`todos`,items:r,completed:r.filter(e=>e.done).length,total:r.length}}case`task_start`:case`task_cancel`:case`task_restart`:{let t=e.toolName.replace(`task_`,``),n=kue.safeParse(e.result);return{kind:`task_action`,action:t,task:n.success?n.data.task:void 0,tasks:n.success?n.data.tasks:void 0}}case`task_status`:{let t=U$(e.result);return{kind:`task_list`,tasks:(Array.isArray(t.tasks)?t.tasks:[]).map(e=>{let t=U$(e);return eA.safeParse(t.task??t)}).filter(e=>e.success).map(e=>e.data)}}case`task_list`:{let t=Aue.safeParse(e.result);return{kind:`task_list`,tasks:t.success?t.data.tasks:[]}}case`task_logs`:{let t=jue.safeParse(e.result),n=t.success?t.data:void 0,r=n?.events??[];return{kind:`task_logs`,task:n?.task,events:r,mode:n?.mode}}case`explore`:{let r=Pue.safeParse(e.result),i=r.success?r.data:void 0,a=W$(n.task),o=ehe(t?.text);return{kind:`explore`,task:a,reports:i?.reports??[],liveUpdates:o.updates,liveLog:o.fallback}}case`plan_mode_enter`:{let t=W$(U$(e.result).planDir);return{kind:`plan_mode`,action:`enter`,summary:J$(e.result),planPath:t}}case`plan_mode_present`:{let t=U$(e.result),r=U$(t.review),i=W$(r.planPath)??W$(n.file_path),a=W$(t.outcome)??W$(r.status);return{kind:`plan_mode`,action:`present`,summary:W$(t.feedback)??J$(e.result),planPath:i,outcome:a}}case`plan_mode_force_exit`:return{kind:`plan_mode`,action:`force_exit`,summary:W$(U$(e.result).reason)};case`web_search`:{let e=Tue.safeParse(i?.details),t=e.success?e.data.query:W$(n.query),r=e.success?e.data.results:[];return{kind:`web_search`,query:t,answer:e.success?e.data.answer:void 0,results:r}}case`web_fetch`:{let e=Eue.safeParse(i?.details),t=e.success?e.data:void 0;return{kind:`web_fetch`,url:t?.url??W$(n.url),status:t?.status,contentType:t?.contentType,size:t?.size,savedTo:t?.savedTo,converted:t?.converted??!1,content:i?.content}}default:return{kind:`generic`}}}function r1(e){return e.split(/[\\/]/).pop()||e}function che(e){if(e===void 0)return;if(e<1024)return`${e} B`;let t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}function lhe(e){if(e!==void 0)return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function i1(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function a1(e){return e?e.length===0?0:e.split(`
|
|
90
|
-
`).length:0}function o1(e,t,n=`head`){let r=e-10;if(!(r<=0))return{hidden:r,expandLabel:`Show ${r} ${n===`tail`?`earlier`:`more`} ${t}`,collapseLabel:`Show less`}}function uhe(e,t){switch(e.status){case`error`:case`denied`:return{tone:`danger`,pulse:!1};case`running`:case`requested`:return{tone:`running`,pulse:!0};case`pending_approval`:case`waiting_for_user`:return{tone:`warn`,pulse:!0};default:break}if((t.kind===`bash`||t.kind===`python`)&&t.exitCode!==void 0&&t.exitCode!==0||t.kind===`explore`&&e1(t).summary.failed>0)return{tone:`danger`,pulse:!1};if(t.kind===`task_action`){let e=t.task??t.tasks?.[0];if(e)return{tone:Jw(e.status),pulse:Yw(e.status)}}return t.kind===`task_logs`&&t.task?{tone:Jw(t.task.status),pulse:Yw(t.task.status)}:{tone:`good`,pulse:!1}}var s1=new WeakMap;function dhe(e,t){let n=s1.get(e);if(n)return n;let r=fhe(e,t);return s1.set(e,r),r}function fhe(e,t){let{tone:n,pulse:r}=uhe(t,e),i={badge:t.toolName,meta:[],dotTone:n,dotPulse:r};switch(e.kind){case`read`:{let t=e.relPath?{text:e.relPath,openPath:e.path}:void 0;if(e.image)return{...i,primaryArg:t,meta:[{text:`image`}]};let n=[];return e.lineLabel&&n.push({text:e.lineLabel}),e.truncated&&n.push({text:`truncated`,tone:`warning`}),{...i,primaryArg:t,meta:n,collapse:o1(a1(e.content),`lines`)}}case`bash`:{let t=[],n=a1(e.output);return e.exitCode!==void 0&&e.exitCode!==0&&t.push({text:`exit ${e.exitCode}`,tone:`error`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),n>0&&t.push({text:i1(n,`line`)}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),e.savedTo&&t.push({text:`saved ${r1(e.savedTo)}`,mono:!0}),{...i,primaryArg:e.command?{text:e.command}:void 0,meta:t,collapse:o1(n,`lines`,`tail`)}}case`python`:{let t=[],n=a1(e.output);e.exitCode!==void 0&&e.exitCode!==0&&t.push({text:`exit ${e.exitCode}`,tone:`error`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),e.timedOut&&t.push({text:`timed out`,tone:`error`});let r=lhe(e.durationMs);r&&t.push({text:r}),e.codeLineCount>0&&t.push({text:i1(e.codeLineCount,`code line`)}),n>0&&t.push({text:i1(n,`line`)}),e.allowFileWrite===!1&&t.push({text:`writes off`,tone:`warning`}),e.envKeys&&e.envKeys.length>0&&t.push({text:i1(e.envKeys.length,`env`)}),e.artifacts&&e.artifacts.length>0&&t.push({text:i1(e.artifacts.length,`artifact`),tone:`info`}),e.streams?.stdout?.truncated&&t.push({text:`stdout truncated`,tone:`warning`}),e.streams?.stderr?.truncated&&t.push({text:`stderr truncated`,tone:`warning`}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),e.savedTo&&t.push({text:`saved ${r1(e.savedTo)}`,mono:!0});let a=Math.max(0,e.codeLineCount-10)+Math.max(0,n-10),o=a>0?{hidden:a,expandLabel:`Show ${a} more lines`,collapseLabel:`Show less`}:void 0,s=e.inputMode===`file`&&e.relScriptPath?{text:e.relScriptPath,openPath:e.scriptPath}:{text:`inline`};return{...i,primaryArg:s,meta:t,collapse:o}}case`edit`:{let t=[{text:i1(e.operationCount,`operation`)}];return e.dryRun&&t.push({text:`preview`,tone:`info`}),e.additions>0&&t.push({text:`+${e.additions}`,tone:`success`}),e.deletions>0&&t.push({text:`−${e.deletions}`,tone:`error`}),{...i,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,collapse:o1(a1(e.diff),`lines`)}}case`write`:{let t=[];return e.bytes!==void 0&&t.push({text:`wrote ${e.bytes} bytes`}),{...i,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,collapse:o1(a1(e.content),`lines`)}}case`grep`:return{...i,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:i1(e.matchCount,`match`,`es`)},{text:i1(e.fileCount,`file`)}],collapse:o1(e.matchCount,`matches`)};case`find`:return{...i,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:i1(e.count,`file`)}],collapse:o1(e.count,`files`)};case`ls`:return{...i,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:[{text:`${e.total} ${e.total===1?`entry`:`entries`}`}],collapse:o1(e.total,`entries`)};case`task_logs`:{let t=[{text:i1(e.events.length,`event`)}];return e.mode&&t.push({text:e.mode}),{...i,primaryArg:e.task?.name?{text:e.task.name}:e.mode?{text:e.mode}:void 0,meta:t,collapse:o1(e.events.length,`events`,`tail`)}}case`web_fetch`:{let t=[];e.status!==void 0&&t.push({text:`${e.status}`,tone:e.status>=400?`error`:`success`}),e.contentType&&t.push({text:e.contentType});let n=che(e.size);return n&&t.push({text:n}),e.converted&&t.push({text:`markdown`,tone:`info`}),e.savedTo&&t.push({text:`saved ${r1(e.savedTo)}`,mono:!0}),{...i,primaryArg:e.url?{text:e.url,href:e.url}:void 0,meta:t,collapse:o1(a1(e.content),`lines`)}}case`web_search`:return{...i,primaryArg:e.query?{text:e.query}:void 0,meta:[{text:i1(e.results.length,`result`)}]};case`todos`:return{...i,badge:`todos`,meta:[{text:`${e.completed}/${e.total} done`}]};case`task_action`:{let t=e.task??e.tasks?.[0];return{...i,badge:`task_${e.action}`,primaryArg:t?.name?{text:t.name}:void 0}}case`task_list`:return{...i,meta:[{text:i1(e.tasks.length,`task`,`s`)}]};case`explore`:{let{summary:t}=e1(e),n=e.reports.length,r=e.reports.filter(e=>e.reportPath).length,a=[];t.done&&(n>0&&a.push({text:i1(n,`report`,`s`),tone:`success`}),r>0&&a.push({text:i1(r,`file`,`s`)})),t.failed>0&&a.push({text:`${t.failed} failed`,tone:`error`});let o=[...new Set(e.reports.map(e=>e.model).filter(Boolean))];o.length===1&&o[0]&&a.push({text:r1(o[0])});let s=e.reports.reduce((e,t)=>e+(t.usage?.turns??0),0);return s>0&&a.push({text:i1(s,`turn`)}),{...i,primaryArg:e.task?{text:e.task}:t.total>1?{text:`${t.total} explore agents`}:void 0,meta:a}}case`ask_user`:return{...i,meta:[]};case`plan_mode`:return{...i,badge:`plan_mode_${e.action}`,primaryArg:e.planPath?{text:e.planPath,openPath:e.planPath}:void 0,meta:[]};default:return i}}var phe=L(`<p class="question svelte-12xgv5f"> </p>`),mhe=L(`<p class="meta svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">context</span> </p>`),hhe=L(`<p class="meta svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">recommendation</span> </p>`),ghe=L(`<button type="button" class="quick-reply svelte-12xgv5f"> </button>`),_he=L(`<div class="reply-voice-controls svelte-12xgv5f"><!> <!></div>`),vhe=L(`<!>Reply`,1),yhe=L(`<!>Dismiss`,1),bhe=L(`<div class="quick-replies svelte-12xgv5f"></div> <form class="reply svelte-12xgv5f"><div class="reply-field svelte-12xgv5f"><textarea class="reply-input svelte-12xgv5f" rows="3" aria-label="Reply to agent question"></textarea> <!></div> <div class="actions svelte-12xgv5f"><!> <!></div></form>`,1),xhe=L(`<p class="meta answer svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">answer</span> </p>`),She=L(`<p class="meta svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">dismissed</span> </p>`),Che=L(`<div class="ask svelte-12xgv5f"><!> <!> <!> <!></div> <!>`,1);function whe(e,t){D(t,!0);let n=[`Yes, go ahead`,`I agree`,`Can you explain further?`,`No, hold on`],r=A(``),i=A(!1),a=k(()=>t.toolCall.status===`waiting_for_user`&&t.questionRecord?.status===`pending`),o=k(()=>t.questionRecord?.question??t.view.question),s=k(()=>t.questionRecord?.context??t.view.context),c=k(()=>t.questionRecord?.recommendation??t.view.recommendation),l=k(()=>t.questionRecord?.answer??t.view.answer),u=k(()=>t.questionRecord?.status===`dismissed`||t.view.dismissed),d=k(()=>t.questionRecord?.dismissedReason??t.view.dismissedReason),f=k(()=>I(r).trim()),p=k(()=>{let e=t.questionRecord?.id??t.toolCall.id;return e?{kind:`ask-user`,id:e}:void 0}),m=k(()=>!!(I(p)&&bA.isTargetActive(I(p))&&bA.recording)),h=k(()=>!!(I(p)&&bA.isTargetActive(I(p))&&bA.transcribing)),g=k(()=>!!(I(p)&&bA.isBusyForOtherTarget(I(p)))),_=k(()=>f$.configured),v=k(()=>bA.isSupported()),y=k(()=>!I(p)||bA.pending||!I(m)&&(!I(a)||I(g))),b=k(()=>I(m)?`Stop recording (${x(bA.elapsedMs)} / ${x(bA.maxDurationMs)}) — right-click to cancel`:I(g)?`Voice recording is active elsewhere`:bA.retryAttempt>0&&I(p)&&bA.isTargetActive(I(p))?`Retrying transcription ${bA.retryAttempt}/${bA.maxRetries}…`:I(h)?`Transcribing audio…`:I(_)?`Record voice reply`:`Connect ChatGPT to use voice input`);rr(()=>{let e=I(p);if(!e)return;let t=bA.registerTargetHandlers(e,{appendTranscript:e=>{j(r,yA(I(r),e),!0)},onError:e=>id.error(`Voice input failed`,{description:e})});return()=>{t(),bA.cancelIfTarget(e)}});function x(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function S(){!I(a)||!t.questionRecord||!I(f)||t.onAnswerUserQuestion?.(t.questionRecord.id,I(f))}function ee(e){!I(a)||!t.questionRecord||t.onAnswerUserQuestion?.(t.questionRecord.id,e)}function C(){if(!(I(y)||!I(p))){if(!I(m)&&!I(_)){j(i,!0);return}bA.toggle(I(p))}}function te(e){!I(m)||!I(p)||(e.preventDefault(),bA.cancel(I(p)))}var ne=Che(),re=N(ne),ie=M(re),ae=e=>{var t=phe(),n=M(t,!0);T(t),F(()=>B(n,I(o))),z(e,t)};V(ie,e=>{I(o)&&e(ae)});var oe=P(ie,2),w=e=>{var t=mhe(),n=P(M(t));T(t),F(()=>B(n,` ${I(s)??``}`)),z(e,t)};V(oe,e=>{I(s)&&e(w)});var se=P(oe,2),ce=e=>{var t=hhe(),n=P(M(t));T(t),F(()=>B(n,` ${I(c)??``}`)),z(e,t)};V(se,e=>{I(c)&&e(ce)});var le=P(se,2),ue=e=>{var i=bhe(),a=N(i);Ni(a,20,()=>n,e=>e,(e,t)=>{var n=ghe(),r=M(n,!0);T(n),F(()=>B(r,t)),_i(`click`,n,()=>ee(t)),z(e,n)}),T(a);var o=P(a,2),s=M(o),c=M(s);Jn(c);var l=P(c,2),u=e=>{var t=_he(),n=M(t);{let e=k(()=>I(p)&&bA.isTargetActive(I(p))?bA.retryAttempt:0);TD(n,{get recording(){return I(m)},get transcribing(){return I(h)},get elapsedMs(){return bA.elapsedMs},get maxDurationMs(){return bA.maxDurationMs},get retryAttempt(){return I(e)},get maxRetries(){return bA.maxRetries},class:`ask-transcription-status`})}var r=P(n,2);{let e=k(()=>I(m)?`destructive`:`ghost`),t=k(()=>`reply-mic${I(m)?` recording`:``}`),n=k(()=>I(m)?`Stop recording; right-click to cancel`:I(_)?`Record voice reply`:`Connect ChatGPT to use voice input`);Ol(r,{get variant(){return I(e)},size:`icon-sm`,get class(){return I(t)},type:`button`,get disabled(){return I(y)},onclick:C,oncontextmenu:te,get"aria-label"(){return I(n)},get title(){return I(b)},children:(e,t)=>{var n=R(),r=N(n),i=e=>{GE(e,{size:14,strokeWidth:2.4,class:`spin`})},a=e=>{qE(e,{size:14,strokeWidth:2.4})};V(r,e=>{I(h)?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}T(t),z(e,t)};V(l,e=>{I(v)&&e(u)}),T(s);var d=P(s,2),g=M(d);{let e=k(()=>!I(f));Ol(g,{size:`sm`,type:`submit`,get disabled(){return I(e)},children:(e,t)=>{var n=vhe();YE(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}})}Ol(P(g,2),{size:`sm`,variant:`secondary`,type:`button`,onclick:()=>t.onDismissUserQuestion?.(t.questionRecord.id),children:(e,t)=>{var n=yhe();KX(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}}),T(d),T(o),F(()=>W(c,`placeholder`,t.questionRecord.placeholder??`Reply to the agent's question`)),gi(`submit`,o,e=>{e.preventDefault(),S()}),xa(c,()=>I(r),e=>j(r,e)),z(e,i)},de=e=>{var t=xhe(),n=P(M(t));T(t),F(()=>B(n,` ${I(l)??``}`)),z(e,t)},fe=e=>{var t=She(),n=P(M(t));T(t),F(()=>B(n,` ${I(d)??`No answer provided`??``}`)),z(e,t)};V(le,e=>{I(a)&&t.questionRecord?e(ue):I(l)?e(de,1):I(u)&&e(fe,2)}),T(re),d$(P(re,2),{get open(){return I(i)},set open(e){j(i,e,!0)}}),z(e,ne),O()}vi([`click`]);var c1={bash:()=>p(()=>import(`./bash-B7CDPTg5.js`),__vite__mapDeps([0,1])),css:()=>p(()=>import(`./css-BsVw1vtW.js`),[]),diff:()=>p(()=>import(`./diff-woXpYk--.js`),[]),html:()=>p(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([2,3,4])),javascript:()=>p(()=>import(`./javascript-BgS3c2Ky.js`),[]),json:()=>p(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>p(()=>import(`./jsonc-CYpm1nAK.js`),[]),jsx:()=>p(()=>import(`./jsx-Bz0zcwM4.js`),[]),markdown:()=>p(()=>import(`./markdown-BYOwaDjH.js`),[]),python:()=>p(()=>import(`./python-gzcpVVnB.js`),[]),shellscript:()=>p(()=>import(`./shellscript-CLZ0U2zV.js`),[]),svelte:()=>p(()=>import(`./svelte-Uaf2W_lJ.js`),__vite__mapDeps([5,3,4,6])),tsx:()=>p(()=>import(`./tsx-udAQXfEw.js`),[]),typescript:()=>p(()=>import(`./typescript-bsJCZSQ-.js`),[]),yaml:()=>p(()=>import(`./yaml-rwi0_p6S.js`),[])},The={"github-light":()=>p(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-dark-dimmed":()=>p(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[])},Ehe=new Map([[``,`markdown`],[`text`,`markdown`],[`plain`,`markdown`],[`plaintext`,`markdown`],[`sh`,`bash`],[`shell`,`shellscript`],[`zsh`,`shellscript`],[`js`,`javascript`],[`ts`,`typescript`],[`md`,`markdown`],[`yml`,`yaml`]]),Dhe=new Set(Object.keys(c1)),l1,u1=new A$(500);function d1(e){let t=(e??``).toLowerCase().trim();return Ehe.get(t)||(Dhe.has(t)?t:void 0)}function Ohe(e){return typeof window>`u`||typeof window.requestIdleCallback!=`function`?e():new Promise((t,n)=>{window.requestIdleCallback(()=>{e().then(t,n)},{timeout:750})})}async function khe(){return l1??=Promise.all([p(()=>import(`./dist-DVpGQCt0.js`),[]),p(()=>import(`./dist-FQvzRocB.js`),[])]).then(([e,t])=>{let n=e.createBundledHighlighter({langs:c1,themes:The,engine:()=>t.createJavaScriptRegexEngine()});return e.createSingletonShorthands(n)}),l1}async function Ahe(e,t){let n=d1(t);if(n)return Ohe(async()=>(await khe()).codeToHtml(e,{lang:n,themes:{light:`github-light`,dark:`github-dark-dimmed`},defaultColor:!1}))}function jhe(e,t){return`${t}\0${e}`}function f1(e,t){let n=d1(t);if(!n)return;let r=jhe(e,n),i=u1.get(r);if(i!==void 0||u1.has(r))return i;let a=Ahe(e,n).then(e=>(u1.set(r,e),e)).catch(()=>{u1.delete(r)});return u1.set(r,a),a}var Mhe=L(`<div class="code-block svelte-tohjmn"></div>`),Nhe=L(`<pre class="code-block plain svelte-tohjmn"> </pre>`);function p1(e,t){D(t,!0);let n=q(t,`maxHeight`,3,`18rem`),r=q(t,`trim`,3,!0),i=A(void 0),a=A(void 0),o=A(void 0),s=k(()=>r()?H$(t.code):{text:t.code}),c=k(()=>`${t.language??``}\0${I(s).text}`);rr(()=>{let e=I(c);if(I(a)===e||I(o)===e)return;let n=f1(I(s).text,t.language);if(typeof n==`string`){j(i,n,!0),j(a,e,!0),j(o,void 0);return}if(!n){j(o,e,!0);return}let r=!1;return n.then(t=>{r||I(c)!==e||(t?(j(i,t,!0),j(a,e,!0),j(o,void 0)):j(o,e,!0))}),()=>{r=!0}});var l=R(),u=N(l),d=e=>{var t=Mhe();let r;zi(t,()=>I(i),!0),T(t),F(()=>r=ea(t,``,r,{"max-height":n()})),z(e,t)},f=e=>{var t=Nhe();let r;var i=M(t,!0);T(t),F(()=>{r=ea(t,``,r,{"max-height":n()}),B(i,I(s).text)}),z(e,t)};V(u,e=>{I(i)&&I(a)===I(c)?e(d):e(f,-1)}),z(e,l),O()}function m1(e,t){D(t,!0);let n=q(t,`direction`,3,`head`),r=q(t,`collapsedLines`,3,10),i=q(t,`expanded`,3,!1),a=k(()=>{if(i())return t.text;let e=t.text.split(`
|
|
91
|
-
`);return e.length<=r()?t.text:n()===`tail`?X$(e,r()).join(`
|
|
92
|
-
`):e.slice(0,r()).join(`
|
|
93
|
-
`)});p1(e,{get code(){return I(a)},get language(){return t.language},trim:!1}),O()}var Phe=L(`<p class="m-0 text-xs text-muted-foreground">Waiting for command output…</p>`),Fhe=L(`<p class="m-0 text-xs text-muted-foreground">Streaming live output…</p>`),Ihe=L(`<!> <!>`,1);function Lhe(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);var r=Ihe(),i=N(r),a=e=>{m1(e,{get text(){return t.view.output},direction:`tail`,get expanded(){return n()}})},o=e=>{z(e,Phe())};V(i,e=>{t.view.output.length>0?e(a):t.toolCall.status===`running`&&e(o,1)});var s=P(i,2),c=e=>{z(e,Fhe())};V(s,e=>{t.view.live&&e(c)}),z(e,r),O()}function Rhe(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);var r=R(),i=N(r),a=e=>{m1(e,{get text(){return t.view.diff},language:`diff`,get expanded(){return n()}})};V(i,e=>{t.view.diff&&e(a)}),z(e,r),O()}var zhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Bhe(e,t){let n=G(t,zhe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]];ic(e,K({name:`circle-alert`},()=>n,{get iconNode(){return r}}))}var Vhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Hhe(e,t){let n=G(t,Vhe),r=[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`}]];ic(e,K({name:`circle-dashed`},()=>n,{get iconNode(){return r}}))}var Uhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function h1(e,t){let n=G(t,Uhe),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]];ic(e,K({name:`file-text`},()=>n,{get iconNode(){return r}}))}var Whe=new Set([`$$slots`,`$$events`,`$$legacy`]);function g1(e,t){let n=G(t,Whe),r=[[`path`,{d:`m13 13.5 2-2.5-2-2.5`}],[`path`,{d:`m21 21-4.3-4.3`}],[`path`,{d:`M9 8.5 7 11l2 2.5`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];ic(e,K({name:`search-code`},()=>n,{get iconNode(){return r}}))}var Ghe=L(`<header class="grid gap-1.5"><div class="flex items-center justify-between gap-2 text-xs font-medium text-muted-foreground"><span class="flex min-w-0 items-center gap-2"><!> </span> <span class="tabular-nums"> </span></div> <div class="h-1 overflow-hidden rounded-full bg-muted" aria-hidden="true"><div></div></div></header>`),Khe=L(`<span class="shrink-0 rounded border border-border px-1.5 py-0.5 text-xs leading-none text-muted-foreground"> </span>`),qhe=L(`<span class="ml-auto shrink-0 text-xs tabular-nums text-muted-foreground"> </span>`),Jhe=L(`<p class="m-0 truncate text-xs text-muted-foreground/80"> </p>`),Yhe=L(`<p class="m-0 line-clamp-2 text-sm leading-relaxed text-muted-foreground"> </p>`),Xhe=L(`<p class="m-0 text-xs text-muted-foreground"> </p>`),Zhe=L(`<button type="button" class="mt-0.5 inline-flex w-fit items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1 text-xs font-medium text-primary hover:bg-muted"><!> Open report <span class="font-mono text-muted-foreground"> </span></button>`),Qhe=L(`<!> <!> <!>`,1),$he=L(`<p class="m-0 truncate font-mono text-xs text-muted-foreground"> </p>`),ege=L(`<p class="m-0 break-words text-sm leading-relaxed text-destructive"> </p> <!>`,1),tge=L(`<span class="shrink-0 text-muted-foreground/70"> </span>`),nge=L(`<p class="m-0 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground"><span> </span> <!></p>`),rge=L(`<p class="m-0 text-xs text-muted-foreground">Queued…</p>`),ige=L(`<li class="grid grid-cols-[auto_minmax(0,1fr)] items-start gap-2.5 rounded-lg border border-border bg-card px-3 py-2.5"><span class="mt-0.5" aria-hidden="true"><!></span> <div class="grid min-w-0 gap-1"><div class="flex min-w-0 items-baseline gap-2"><strong class="truncate text-sm font-medium leading-tight"> </strong> <!> <!></div> <!> <!></div></li>`),age=L(`<ol class="grid gap-1.5"></ol>`),oge=L(`<pre class="overflow-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-xs text-muted-foreground"> </pre>`),sge=L(`<p class="flex items-center gap-2 text-sm leading-relaxed text-muted-foreground"><!> Explore agents are working…</p>`),cge=L(`<p class="text-sm leading-relaxed text-muted-foreground">Explore completed without report files.</p>`),lge=L(`<div class="grid gap-2.5"><!> <!></div>`);function uge(e,t){D(t,!0);let n=k(()=>e1(t.view)),r=k(()=>I(n).tasks),i=k(()=>I(n).summary),a=k(()=>I(i).total>1),o=k(()=>I(i).total>0?Math.round(I(i).completed/I(i).total*100):0);function s(e){return e.split(/[\\/]/).pop()||e}function c(e){return e.split(/[/:]/).pop()??e}function l(e){if(e.task)return e.task===u(e)?void 0:e.task}function u(e){return e.label??e.task??(e.index===void 0?`Explore`:`Explore ${e.index+1}`)}function d(e){let t=[];return e.usage?.turns&&t.push(`${e.usage.turns} turn${e.usage.turns===1?``:`s`}`),(e.usage?.input||e.usage?.output)&&t.push(`${e.usage.input+e.usage.output} tokens`),t.length>0?t.join(` · `):void 0}var f=lge(),p=M(f),m=e=>{var t=Ghe(),n=M(t),r=M(n),a=M(r);g1(a,{size:14,strokeWidth:2.1});var s=P(a);T(r);var c=P(r,2),l=M(c);T(c),T(n);var u=P(n,2),d=M(u);T(u),T(t),F(()=>{B(s,` ${I(i).done?`Explored codebase`:`Exploring codebase`}`),B(l,`${I(i).completed??``}/${I(i).total??``} agents`),Qi(d,1,`h-full rounded-full transition-[width] duration-500 ease-out ${I(i).failed>0&&I(i).done?`bg-warning`:I(i).done?`bg-success`:`bg-info`}`),ea(d,`width: ${I(o)}%`)}),z(e,t)};V(p,e=>{I(a)&&e(m)});var h=P(p,2),g=e=>{var n=age();Ni(n,21,()=>I(r),e=>e.key,(e,n)=>{var r=ige(),i=M(r),a=M(i),o=e=>{t$(e,{size:16,strokeWidth:2.1,class:`text-success`})},f=e=>{Bhe(e,{size:16,strokeWidth:2.1,class:`text-destructive`})},p=e=>{GE(e,{size:16,strokeWidth:2.1,class:`animate-spin text-info`})},m=e=>{Hhe(e,{size:16,strokeWidth:2.1,class:`text-muted-foreground`})};V(a,e=>{I(n).status===`completed`?e(o):I(n).status===`failed`?e(f,1):I(n).status===`running`?e(p,2):e(m,-1)}),T(i);var h=P(i,2),g=M(h),_=M(g),v=M(_,!0);T(_);var y=P(_,2),b=e=>{var t=Khe(),r=M(t,!0);T(t),F(e=>{W(t,`title`,I(n).model),B(r,e)},[()=>c(I(n).model)]),z(e,t)};V(y,e=>{I(n).model&&e(b)});var x=P(y,2),S=e=>{var t=qhe(),r=M(t);T(t),F(()=>B(r,`${I(n).index+1}/${I(n).count??``}`)),z(e,t)};V(x,e=>{I(n).count&&I(n).count>1&&I(n).index!==void 0&&e(S)}),T(g);var ee=P(g,2),C=e=>{let t=k(()=>l(I(n)));var r=R(),i=N(r),a=e=>{var n=Jhe(),r=M(n,!0);T(n),F(()=>B(r,I(t))),z(e,n)};V(i,e=>{I(t)&&e(a)}),z(e,r)};V(ee,e=>{I(n).status!==`completed`&&e(C)});var te=P(ee,2),ne=e=>{let r=k(()=>d(I(n).report));var i=Qhe(),a=N(i),o=e=>{var t=Yhe(),r=M(t,!0);T(t),F(()=>B(r,I(n).report.summaryPreview)),z(e,t)};V(a,e=>{I(n).report.summaryPreview&&e(o)});var c=P(a,2),l=e=>{var t=Xhe(),n=M(t,!0);T(t),F(()=>B(n,I(r))),z(e,t)};V(c,e=>{I(r)&&e(l)});var u=P(c,2),f=e=>{var r=Zhe(),i=M(r);h1(i,{size:13,strokeWidth:2.1});var a=P(i,2),o=M(a,!0);T(a),T(r),F(e=>{W(r,`title`,I(n).report.reportPath),B(o,e)},[()=>s(I(n).report.reportPath)]),_i(`click`,r,()=>I(n).report?.reportPath&&t.onOpenFile?.(I(n).report.reportPath)),z(e,r)};V(u,e=>{I(n).report.reportPath&&e(f)}),z(e,i)},re=e=>{var t=ege(),r=N(t),i=M(r,!0);T(r);var a=P(r,2),o=e=>{var t=$he(),r=M(t,!0);T(t),F(()=>B(r,I(n).report.steps[I(n).report.steps.length-1]?.message)),z(e,t)};V(a,e=>{I(n).report?.steps?.length&&e(o)}),F(()=>B(i,I(n).error??`Explore agent failed.`)),z(e,t)},ie=e=>{var t=nge(),r=M(t),i=M(r,!0);T(r);var a=P(r,2),o=e=>{var t=tge(),r=M(t);T(t),F(()=>B(r,`· ${I(n).actionCount??``} actions`)),z(e,t)};V(a,e=>{I(n).actionCount>1&&e(o)}),T(t),F(()=>{Qi(r,1,`truncate ${I(n).currentActionMono?`font-mono`:``}`),B(i,I(n).currentAction)}),z(e,t)},ae=e=>{z(e,rge())};V(te,e=>{I(n).status===`completed`&&I(n).report?e(ne):I(n).status===`failed`?e(re,1):I(n).currentAction?e(ie,2):e(ae,-1)}),T(h),T(r),F(e=>B(v,e),[()=>u(I(n))]),z(e,r)}),T(n),z(e,n)},_=e=>{var n=oge(),r=M(n,!0);T(n),F(()=>B(r,t.view.liveLog)),z(e,n)},v=e=>{var t=sge();GE(M(t),{size:14,strokeWidth:2.1,class:`animate-spin text-info`}),E(),T(t),z(e,t)},y=e=>{z(e,cge())};V(h,e=>{I(r).length>0?e(g):t.view.liveLog?e(_,1):t.toolCall.status===`running`||t.toolCall.status===`requested`?e(v,2):e(y,-1)}),T(f),z(e,f),O()}vi([`click`]);var dge=L(`<p class="m-0 text-xs text-muted-foreground">No files found.</p>`),fge=L(`<li><button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-xs text-primary hover:underline"> </button></li>`),pge=L(`<ul class="m-0 list-none rounded-sm border bg-sidebar px-2.5 py-2 font-mono text-xs leading-snug text-sidebar-foreground"></ul>`);function mge(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>(n()?t.view.paths:t.view.paths.slice(0,10)).map((e,n)=>({path:e,openPath:t.view.openPaths[n]??e})));var i=R(),a=N(i),o=e=>{z(e,dge())},s=e=>{var n=pge();Ni(n,21,()=>I(r),e=>e.path,(e,n)=>{var r=fge(),i=M(r),a=M(i,!0);T(i),T(r),F(()=>B(a,I(n).path)),_i(`click`,i,()=>t.onOpenFile?.(I(n).openPath)),z(e,r)}),T(n),z(e,n)};V(a,e=>{t.view.count===0?e(o):e(s,-1)}),z(e,i),O()}vi([`click`]);function _1(e,t){}var hge=L(`<button class="match svelte-1pkduer" type="button"><span class="line-no svelte-1pkduer"> </span><span class="line-text svelte-1pkduer"> </span></button>`),gge=L(`<div class="file"><button class="file-path svelte-1pkduer" type="button" title="Open file pane"> </button> <!></div>`),_ge=L(`<div class="matches svelte-1pkduer"></div>`),vge=L(`<p class="note svelte-1pkduer">No matches.</p>`);function yge(e,t){D(t,!0);let n=(e,n=w)=>{var r=_ge();Ni(r,21,n,e=>e.path,(e,n)=>{var r=gge(),i=M(r),a=M(i,!0);T(i),Ni(P(i,2),19,()=>I(n).matches,(e,t)=>`${I(n).path}:${e.line}:${t}:${e.text}`,(e,r)=>{var i=hge(),a=M(i),o=M(a,!0);T(a);var s=P(a),c=M(s,!0);T(s),T(i),F(()=>{W(i,`title`,`Open ${I(n).path}:${I(r).line}`),B(o,I(r).line),B(c,I(r).text)}),_i(`click`,i,()=>t.onOpenFile?.(I(r).openPath??I(n).openPath??I(n).path,I(r).line)),z(e,i)}),T(r),F(()=>B(a,I(n).path)),_i(`click`,i,()=>t.onOpenFile?.(I(n).openPath??I(n).path)),z(e,r)}),T(r),z(e,r)},r=q(t,`expanded`,3,!1),i=k(()=>{if(r())return t.view.allMatches;let e=[],n=0;for(let r of t.view.allMatches){if(n>=10)break;let t=r.matches.slice(0,10-n);e.push({path:r.path,openPath:r.openPath,matches:t}),n+=t.length}return e});var a=R(),o=N(a),s=e=>{z(e,vge())},c=e=>{n(e,()=>I(i))};V(o,e=>{t.view.matchCount===0?e(s):e(c,-1)}),z(e,a),O()}vi([`click`]);var bge=new Set([`$$slots`,`$$events`,`$$legacy`]);function xge(e,t){let n=G(t,bge),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];ic(e,K({name:`file`},()=>n,{get iconNode(){return r}}))}var Sge=L(`<p class="m-0 text-xs text-muted-foreground">Empty directory.</p>`),Cge=L(`<button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-xs text-primary hover:underline"> </button>`),wge=L(`<span> </span>`),Tge=L(`<li class="flex items-center gap-1.5"><!> <!></li>`),Ege=L(`<ul class="m-0 list-none rounded-sm border bg-sidebar px-2.5 py-2 font-mono text-xs leading-normal text-sidebar-foreground"></ul>`);function Dge(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);function r(e){return[...e].sort((e,t)=>e.kind===t.kind?e.path.localeCompare(t.path):e.kind===`directory`?-1:1)}let i=k(()=>r(t.view.entries)),a=k(()=>n()?I(i):I(i).slice(0,10));var o=R(),s=N(o),c=e=>{z(e,Sge())},l=e=>{var n=Ege();Ni(n,21,()=>I(a),e=>e.path,(e,n)=>{var r=Tge(),i=M(r),a=e=>{S$(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})},o=e=>{xge(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})};V(i,e=>{I(n).kind===`directory`?e(a):e(o,-1)});var s=P(i,2),c=e=>{var r=Cge(),i=M(r,!0);T(r),F(()=>B(i,I(n).path)),_i(`click`,r,()=>t.onOpenFile?.(I(n).openPath??I(n).path)),z(e,r)},l=e=>{var t=wge(),r=M(t,!0);T(t),F(()=>B(r,I(n).path)),z(e,t)};V(s,e=>{I(n).kind===`file`?e(c):e(l,-1)}),T(r),z(e,r)}),T(n),z(e,n)};V(s,e=>{t.view.total===0?e(c):e(l,-1)}),z(e,o),O()}vi([`click`]);var Oge=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function v1(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,Oge);var i=R();U(N(i),()=>Uy,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var kge=new Set([`$$slots`,`$$events`,`$$legacy`]);function y1(e,t){let n=G(t,kge),r=[[`path`,{d:`M5 12h14`}]];ic(e,K({name:`minus`},()=>n,{get iconNode(){return r}}))}var Age=new Set([`$$slots`,`$$events`,`$$legacy`]);function jge(e,t){let n=G(t,Age);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var Mge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`sideOffset`,`align`,`portalProps`,`class`]);function b1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,4),i=q(t,`align`,3,`start`),a=G(t,Mge);jge(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ol(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-(--bits-dropdown-menu-anchor-width) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden`,t.class));U(c,()=>Ky,(t,o)=>{o(t,K({"data-slot":`dropdown-menu-content`,get sideOffset(){return r()},get align(){return i()},get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,s)},$$slots:{default:!0}})),O()}var Nge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`variant`]);function x1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=G(t,Nge);var a=R(),o=N(a);{let e=k(()=>ol(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(o,()=>Xv,(a,o)=>{o(a,K({"data-slot":`dropdown-menu-item`,get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var Pge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function S1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Pge);var i=R(),a=N(i);{let e=k(()=>ol(`bg-border -mx-1 my-1 h-px`,t.class));U(a,()=>dy,(t,i)=>{i(t,K({"data-slot":`dropdown-menu-separator`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Fge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function C1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Fge);var i=R();U(N(i),()=>Yy,(e,t)=>{t(e,K({"data-slot":`dropdown-menu-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),z(e,i),O()}var Ige=L(`<!> <!>`,1),Lge=L(`<div class="inline-flex" role="group"><!> <!></div>`);function Rge(e,t){D(t,!0);let n=q(t,`variant`,3,`default`),r=q(t,`size`,3,`sm`),i=q(t,`disabled`,3,!1),a=q(t,`menuAlign`,3,`end`),o=k(()=>n()==="default"||n()===`success`?`border-l-primary-foreground/25`:`border-l-border/70`);var s=Lge(),c=M(s);Ol(c,{get variant(){return n()},get size(){return r()},get disabled(){return i()},get onclick(){return t.onclick},class:`rounded-r-none`,children:(e,n)=>{var r=R();H(N(r),()=>t.children),z(e,r)},$$slots:{default:!0}}),U(P(c,2),()=>v1,(e,s)=>{s(e,{children:(e,s)=>{var c=Ige(),l=N(c);{let e=k(()=>ol(wl({variant:n(),size:r()}),`-ml-px rounded-l-none border-l px-1.5`,I(o)));U(l,()=>C1,(n,r)=>{r(n,{get class(){return I(e)},get disabled(){return i()},get"aria-label"(){return t.triggerLabel},children:(e,t)=>{Iw(e,{class:`size-3.5`,strokeWidth:2.3})},$$slots:{default:!0}})})}U(P(l,2),()=>b1,(e,n)=>{n(e,{get align(){return a()},get class(){return t.menuClass},children:(e,n)=>{var r=R();H(N(r),()=>t.menu),z(e,r)},$$slots:{default:!0}})}),z(e,c)},$$slots:{default:!0}})}),T(s),z(e,s),O()}var zge=L(`<!> <!>`,1),Bge=L(`<p class="m-0 rounded-md border border-dashed border-border bg-muted p-3 text-sm text-muted-foreground">No models available. Configure a provider or adjust Scoped Models in Settings.</p>`),Vge=L(`<button type="button" role="option"><span class="min-w-0 truncate font-medium"> </span> <!></button>`),Hge=L(`<div class="grid gap-1" role="listbox" aria-label="Implementation model"></div>`),Uge=L(`<button type="button"> </button>`),Wge=L(`<section class="grid gap-2 border-t border-border pt-4"><p class="m-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Thinking level</p> <div class="flex flex-wrap gap-2" role="group" aria-label="Implementation thinking level"></div></section>`),Gge=L(`<div class="grid gap-4 px-3.5 py-4"><section class="grid gap-2"><p class="m-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Model</p> <!></section> <!></div>`);function w1(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=A(``),i=A(`off`),a=A(!1),o=k(()=>t.models.find(e=>YT(e)===I(r))),s=k(()=>pZ(I(o))),c=k(()=>!I(o)||I(a)),l={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Maximum reasoning`};function u(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}function d(){let e=t.models.find(e=>YT(e)===t.initialModelKey)??t.models[0];j(r,e?YT(e):``,!0),j(i,mZ(t.initialThinkingLevel,e),!0)}function f(e){n(e),t.onOpenChange?.(e)}function p(e){j(r,YT(e),!0),j(i,mZ(I(i),e),!0)}function m(e){j(i,mZ(e,I(o)),!0)}async function h(){if(!I(o)||I(a))return;let e=XT(I(r));if(e){j(a,!0);try{await t.onConfirm?.({implementationModel:e,implementationThinkingLevel:I(i)}),f(!1)}finally{j(a,!1)}}}rr(()=>{n()&&d()}),ZX(e,{get open(){return n()},get title(){return t.title},get description(){return t.description},onOpenChange:f,class:`max-w-xl`,footer:e=>{var n=zge(),r=N(n);Ol(r,{variant:`secondary`,onclick:()=>f(!1),get disabled(){return I(a)},children:(e,t)=>{E(),z(e,wi(`Cancel`))},$$slots:{default:!0}}),Ol(P(r,2),{onclick:h,get disabled(){return I(c)},children:(e,n)=>{E();var r=wi();F(()=>B(r,t.confirmLabel)),z(e,r)},$$slots:{default:!0}}),z(e,n)},children:(e,n)=>{var a=Gge(),c=M(a),d=P(M(c),2),f=e=>{z(e,Bge())},h=e=>{var n=Hge();Ni(n,21,()=>t.models,e=>YT(e),(e,n)=>{let i=k(()=>YT(I(n))),a=k(()=>I(i)===I(r));var o=Vge(),s=M(o),c=M(s,!0);T(s);var l=P(s,2),u=e=>{ZQ(e,{class:`size-4`,strokeWidth:2.4})};V(l,e=>{I(a)&&e(u)}),T(o),F(e=>{Qi(o,1,`flex w-full items-center justify-between gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors ${I(a)?`border-primary/40 bg-primary/10 text-primary`:`border-transparent text-foreground hover:bg-accent`}`),W(o,`aria-selected`,I(a)),B(c,e)},[()=>iE(I(n),t.models)]),_i(`click`,o,()=>p(I(n))),z(e,o)}),T(n),z(e,n)};V(d,e=>{t.models.length===0?e(f):e(h,-1)}),T(c);var g=P(c,2),_=e=>{var t=Wge(),n=P(M(t),2);Ni(n,20,()=>I(s),e=>e,(e,t)=>{let n=k(()=>t===I(i));var r=Uge(),a=M(r,!0);T(r),F(e=>{Qi(r,1,`rounded-full border px-3 py-1 text-xs font-medium transition-colors ${I(n)?`border-primary bg-primary/10 text-primary`:`border-border bg-input text-muted-foreground hover:border-primary/40 hover:text-foreground`}`),W(r,`aria-pressed`,I(n)),W(r,`title`,l[t]),B(a,e)},[()=>u(t)]),_i(`click`,r,()=>m(t)),z(e,r)}),T(n),T(t),z(e,t)};V(g,e=>{I(o)&&e(_)}),T(a),z(e,a)},$$slots:{footer:!0,default:!0}}),O()}vi([`click`]);var Kge=L(`<pre class="m-0 whitespace-pre-wrap rounded-sm border bg-sidebar p-2.5 font-mono text-xs leading-normal text-foreground"> </pre>`),qge=L(`<!> <!> <!> <!> <!>`,1),Jge=L(`<!> Accept & Implement`,1),Yge=L(`<!> Reject Plan`,1),Xge=L(`<div class="grid gap-2" aria-label="Plan review"><!> <div class="flex flex-wrap justify-end gap-2"><!> <!></div> <!> <!></div>`),Zge=L(`<p class="m-0 text-sm text-muted-foreground"> </p>`);function Qge(e,t){D(t,!0);let n=q(t,`planReviewModels`,19,()=>[]),r=q(t,`planReviewModelKey`,3,``),i=q(t,`planReviewThinkingLevel`,3,`off`),a=A(void 0),o=A(void 0);function s(e){return e&&typeof e==`object`?e:{}}function c(e){return typeof e==`string`?e:void 0}function l(e){let t=s(s(e).review);return typeof t.id==`string`||typeof t.content==`string`?t:void 0}let u=k(()=>l(t.toolCall.result)),d=k(()=>t.planReview??I(u)),f=k(()=>t.toolCall.toolName===`plan_mode_present`&&t.toolCall.status===`waiting_for_user`&&t.planReview?.status===`pending`),p=k(()=>I(d)?.status??c(s(t.toolCall.result).outcome)),m=k(()=>I(p)===`accepted`),h=k(()=>I(p)===`accepted_in_new_chat`),g=k(()=>I(p)===`changes_requested`||I(p)===`discarded`),_=k(()=>H$(I(d)?.content??``,{headLines:8,tailLines:0,maxChars:1800,marker:()=>`… open the plan file to read the rest …`}).text),v=k(()=>t.toolCall.toolName===`plan_mode_present`&&!!I(d)),y=k(()=>!I(f)||!!I(o)),b=k(()=>I(m)||I(h)?`success`:`default`);async function x(e){if(!(!t.planReview||!I(f)||I(o)||!t.onAcceptPlanReview)){j(o,`same`);try{await t.onAcceptPlanReview(t.planReview.id,e)}finally{j(o,void 0)}}}async function S(e){if(!(!t.planReview||!I(f)||I(o)||!t.onAcceptPlanReviewInNewChat)){j(o,`new-chat`);try{await t.onAcceptPlanReviewInNewChat(t.planReview.id,e)}finally{j(o,void 0)}}}function ee(){!I(f)||I(o)||j(a,`same`)}function C(){!I(f)||I(o)||j(a,`new-chat`)}function te(){!t.planReview||!I(f)||I(o)||t.onRejectPlanReview?.(t.planReview.id)}var ne=R(),re=N(ne),ie=e=>{var t=Xge(),o=M(t),s=e=>{var t=Kge(),n=M(t,!0);T(t),F(()=>B(n,I(_))),z(e,t)},c=k(()=>I(_).trim());V(o,e=>{I(c)&&e(s)});var l=P(o,2),u=M(l);Rge(u,{get variant(){return I(b)},size:`sm`,get disabled(){return I(y)},menuAlign:`end`,menuClass:`w-60`,triggerLabel:`Accept options`,onclick:()=>void x(),menu:e=>{var t=qge(),n=N(t);U(n,()=>x1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:()=>void x(),children:(e,t)=>{E(),z(e,wi(`Accept & implement`))},$$slots:{default:!0}})});var r=P(n,2);U(r,()=>x1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:()=>void S(),children:(e,t)=>{E(),z(e,wi(`Accept in new chat`))},$$slots:{default:!0}})});var i=P(r,2);U(i,()=>S1,(e,t)=>{t(e,{})});var a=P(i,2);U(a,()=>x1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:ee,children:(e,t)=>{E(),z(e,wi(`Choose model & implement`))},$$slots:{default:!0}})}),U(P(a,2),()=>x1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:C,children:(e,t)=>{E(),z(e,wi(`Choose model & start new chat`))},$$slots:{default:!0}})}),z(e,t)},children:(e,t)=>{var n=Jge(),r=N(n),i=e=>{ZQ(e,{class:`size-3.5`,strokeWidth:2.4})};V(r,e=>{(I(m)||I(h))&&e(i)}),E(),z(e,n)},$$slots:{menu:!0,default:!0}}),Ol(P(u,2),{size:`sm`,variant:`secondary`,get disabled(){return I(y)},onclick:te,children:(e,t)=>{var n=Yge(),r=N(n),i=e=>{ZQ(e,{class:`size-3.5`,strokeWidth:2.4})};V(r,e=>{I(g)&&e(i)}),E(),z(e,n)},$$slots:{default:!0}}),T(l);var d=P(l,2);{let e=k(()=>I(a)===`same`);w1(d,{get open(){return I(e)},title:`Choose implementation model`,description:`The selected model will be used when implementation continues in this conversation.`,confirmLabel:`Accept and implement`,get models(){return n()},get initialModelKey(){return r()},get initialThinkingLevel(){return i()},onOpenChange:e=>{j(a,e?`same`:void 0,!0)},onConfirm:x})}var f=P(d,2);{let e=k(()=>I(a)===`new-chat`);w1(f,{get open(){return I(e)},title:`Choose implementation model`,description:`The selected model will be used by the new implementation chat.`,confirmLabel:`Accept in new chat`,get models(){return n()},get initialModelKey(){return r()},get initialThinkingLevel(){return i()},onOpenChange:e=>{j(a,e?`new-chat`:void 0,!0)},onConfirm:S})}T(t),z(e,t)},ae=e=>{var n=Zge(),r=M(n,!0);T(n),F(()=>B(r,t.view.summary)),z(e,n)};V(re,e=>{I(v)&&I(d)?e(ie):t.view.summary&&e(ae,1)}),z(e,ne),O()}var $ge=L(`<p class="m-0 text-xs text-muted-foreground">Python script file: <code class="font-mono text-foreground"> </code></p>`),e_e=L(`<section class="grid gap-1" aria-label="Python script"><!></section>`),t_e=L(`<section class="grid gap-1" aria-label="Python output"><!></section>`),n_e=L(`<p class="m-0 text-xs text-muted-foreground">Waiting for Python output…</p>`),r_e=L(`<section class="grid gap-1" aria-label="Python output"><p class="m-0 text-xs text-muted-foreground">No Python output.</p></section>`),i_e=L(`<p class="m-0 text-xs text-muted-foreground">Streaming live output…</p>`),a_e=L(`<div class="grid gap-1.5"><!> <!> <!></div>`);function o_e(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);var r=a_e(),i=M(r),a=e=>{var n=$ge(),r=P(M(n)),i=M(r,!0);T(r),T(n),F(()=>B(i,t.view.relScriptPath)),z(e,n)},o=e=>{var r=e_e();m1(M(r),{get text(){return t.view.code},language:`python`,get expanded(){return n()}}),T(r),z(e,r)};V(i,e=>{t.view.inputMode===`file`&&t.view.relScriptPath?e(a):t.view.code&&t.view.code.length>0&&e(o,1)});var s=P(i,2),c=e=>{var r=t_e();m1(M(r),{get text(){return t.view.output},direction:`tail`,get expanded(){return n()}}),T(r),z(e,r)},l=e=>{z(e,n_e())},u=e=>{z(e,r_e())};V(s,e=>{t.view.output.length>0?e(c):t.toolCall.status===`running`?e(l,1):t.toolCall.status===`completed`&&(t.view.inputMode===`file`||t.view.code&&t.view.code.length>0)&&e(u,2)});var d=P(s,2),f=e=>{z(e,i_e())};V(d,e=>{t.view.live&&e(f)}),T(r),z(e,r),O()}var s_e={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`jsonc`,css:`css`,html:`html`,svelte:`svelte`,md:`markdown`,markdown:`markdown`,py:`python`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,zsh:`shellscript`};function T1(e){if(!e)return;let t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(`.`);if(!(n<=0))return s_e[t.slice(n+1).toLowerCase()]}var c_e=L(`<button class="cursor-pointer border-0 bg-transparent p-0" type="button" title="Open image pane"><img class="max-h-60 max-w-80 rounded-sm border object-contain"/></button>`);function l_e(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>T1(t.view.relPath));var i=R(),a=N(i),o=e=>{var n=c_e(),r=M(n);T(n),F(()=>{W(r,`src`,t.view.image.dataUrl),W(r,`alt`,t.view.relPath??`image`)}),_i(`click`,n,()=>t.view.path&&t.onOpenFile?.(t.view.path)),z(e,n)},s=e=>{m1(e,{get text(){return t.view.content},get language(){return I(r)},get expanded(){return n()}})};V(a,e=>{t.view.image?e(o):t.view.content!==void 0&&t.view.content.length>0&&e(s,1)}),z(e,i),O()}vi([`click`]);var u_e=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function E1(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,u_e);var i=R();U(N(i),()=>zS,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var d_e=new Set([`$$slots`,`$$events`,`$$legacy`]);function f_e(e,t){let n=G(t,d_e);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var p_e=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`side`,`children`,`arrowClasses`,`portalProps`]),m_e=L(`<div></div>`),h_e=L(`<!> <!>`,1);function D1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,0),i=q(t,`side`,3,`top`),a=G(t,p_e);f_e(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ol(`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm border bg-popover text-popover-foreground shadow-md z-50 w-fit max-w-xs origin-(--bits-tooltip-content-transform-origin)`,t.class));U(c,()=>HS,(o,s)=>{s(o,K({"data-slot":`tooltip-content`,get sideOffset(){return r()},get side(){return i()},get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=h_e(),i=N(r);H(i,()=>t.children??w);var a=P(i,2);{let e=(e,n)=>{let r=()=>n?.().props;var i=m_e();_a(i,e=>({class:e,...r()}),[()=>ol(`size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border-r border-b border-border bg-popover fill-popover z-50`,`data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%+2px)]`,`data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%+1px)]`,`data-[side=right]:translate-x-[calc(50%+2px)] data-[side=right]:translate-y-1/2`,`data-[side=left]:-translate-y-[calc(50%-3px)]`,t.arrowClasses)]),z(e,i)};U(a,()=>qS,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}z(e,r)},$$slots:{default:!0}}))})}z(e,s)},$$slots:{default:!0}})),O()}var g_e=new Set([`$$slots`,`$$events`,`$$legacy`,`delayDuration`]);function O1(e,t){let n=q(t,`delayDuration`,3,0),r=G(t,g_e);var i=R();U(N(i),()=>JS,(e,t)=>{t(e,K({get delayDuration(){return n()}},()=>r))}),z(e,i)}var __e=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function k1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,__e);var i=R();U(N(i),()=>GS,(e,t)=>{t(e,K({"data-slot":`tooltip-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),z(e,i),O()}function A1(e){try{return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}catch{return e}}function j1(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Date.now()-t,r=Math.round(n/1e3);if(r<45)return`now`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);if(a<24)return`${a}h`;let o=Math.round(a/24);if(o<7)return`${o}d`;let s=Math.round(o/7);if(s<5)return`${s}w`;let c=Math.round(o/30);return c<12?`${c}mo`:`${Math.round(o/365)}y`}function M1(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}var v_e=/https?:\/\/[^\s)'"]+/i;function y_e(e){if(e.readiness.readyUrl)return e.readiness.readyUrl;if(!e.readiness.readyOnUrl)return;let t=e.readiness.matched;return t&&v_e.test(t)?t:void 0}var b_e=L(`<a class="inline-flex min-w-0 items-center gap-1 truncate font-mono text-xs text-info hover:underline" target="_blank" rel="noreferrer noopener"><!> </a>`),x_e=L(`<div><div> </div> <!> <!> <!> <!></div>`),S_e=L(`<span class="tt-row"><span class="tt-key">env</span> </span> <span class="tt-row tt-env-keys"><span class="tt-key">keys</span> </span>`,1),C_e=L(`<span class="tt-row"><span class="tt-key">group</span> </span>`),w_e=L(`<span class="tt-row"><span class="tt-key">pid</span> </span>`),T_e=L(`<span class="tt-row"><span class="tt-key">pgid</span> </span>`),E_e=L(`<span class="tt-row"><span class="tt-key">platform</span> </span>`),D_e=L(`<span class="tt-row"><span class="tt-key">spawned</span> </span>`),O_e=L(`<span class="tt-row"><span class="tt-key">finished</span> </span>`),k_e=L(`<span class="tt-row"><span class="tt-key">exit</span> </span>`),A_e=L(`<span class="tt-row"><span class="tt-key">signal</span> </span>`),j_e=L(`<span class="tt-row"><span class="tt-key">error</span> </span>`),M_e=L(`<span class="tt-title"> </span> <span class="tt-row"><span class="tt-key">command</span> </span> <span class="tt-row"><span class="tt-key">cwd</span> </span> <span class="tt-row"><span class="tt-key">status</span> </span> <!> <span class="tt-row"><span class="tt-key">started</span> </span> <!> <!> <!> <!> <!> <!> <!> <!> <span class="tt-id"> </span>`,1),N1=L(`<!> <!>`,1),N_e=L(`<p class="m-0 break-words text-xs text-destructive"> </p>`);function P1(e,t){D(t,!0);let n=q(t,`dense`,3,!1),r=k(()=>y_e(t.task)),i=k(()=>Jw(t.task.status)),a=k(()=>t.task.envInfo?.keys.length??0),o=k(()=>t.task.envInfo?.keys.join(`, `)),s=k(()=>I(a)===0?void 0:`${I(a)} redacted ${I(a)===1?`var`:`vars`}`),c=k(()=>t.task.exitCode!==void 0&&t.task.exitCode!==null);var l=N1(),u=N(l);U(u,()=>O1,(e,l)=>{l(e,{delayDuration:300,disableHoverableContent:!0,children:(e,l)=>{var u=R();U(N(u),()=>E1,(e,l)=>{l(e,{children:(e,l)=>{var u=N1(),d=N(u);{let e=(e,s)=>{let l=()=>s?.().props;var u=x_e();_a(u,()=>({...l(),class:`flex min-w-0 items-center gap-2.5 rounded-md border bg-card px-2.5 py-2`}));var d=M(u),f=M(d,!0);T(d);var p=P(d,2),m=e=>{var t=b_e(),n=M(t);yQ(n,{size:12,strokeWidth:2});var i=P(n,1,!0);T(t),F(()=>{W(t,`href`,I(r)),B(i,I(r))}),z(e,t)};V(p,e=>{I(r)&&e(m)});var h=P(p,2),g=e=>{of(e,{tone:`neutral`,size:`xs`,get title(){return I(o)},children:(e,t)=>{E(),z(e,wi(`env`))},$$slots:{default:!0}})};V(h,e=>{I(a)>0&&e(g)});var _=P(h,2),v=e=>{{let n=k(()=>t.task.exitCode===0?`neutral`:`danger`);of(e,{get tone(){return I(n)},size:`xs`,children:(e,n)=>{E();var r=wi();F(()=>B(r,`exit ${t.task.exitCode??``}`)),z(e,r)},$$slots:{default:!0}})}},y=e=>{of(e,{tone:`warn`,size:`xs`,children:(e,n)=>{E();var r=wi();F(()=>B(r,`signal ${t.task.signal??``}`)),z(e,r)},$$slots:{default:!0}})};V(_,e=>{I(c)?e(v):t.task.signal&&e(y,1)});var b=P(_,2);{let e=k(()=>I(i)===`neutral`?`border-border bg-muted text-muted-foreground`:``);of(b,{get tone(){return I(i)},size:`xs`,get class(){return I(e)},children:(e,n)=>{E();var r=wi();F(()=>B(r,t.task.status)),z(e,r)},$$slots:{default:!0}})}T(u),F(()=>{Qi(d,1,`min-w-0 flex-1 ${n()?`truncate`:`whitespace-pre-wrap break-words`} font-mono text-xs text-foreground`),B(f,t.task.command)}),z(e,u)};U(d,()=>k1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(d,2),()=>D1,(e,n)=>{n(e,{side:`left`,sideOffset:6,class:`nav-tooltip task-tooltip`,children:(e,n)=>{var r=M_e(),i=N(r),l=M(i,!0);T(i);var u=P(i,2),d=P(M(u),1,!0);T(u);var f=P(u,2),p=P(M(f),1,!0);T(f);var m=P(f,2),h=P(M(m),1,!0);T(m);var g=P(m,2),_=e=>{var t=S_e(),n=N(t),r=P(M(n),1,!0);T(n);var i=P(n,2),a=P(M(i),1,!0);T(i),F(()=>{B(r,I(s)),B(a,I(o))}),z(e,t)};V(g,e=>{I(a)>0&&e(_)});var v=P(g,2),y=P(M(v),1,!0);T(v);var b=P(v,2),x=e=>{var n=C_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.groupId)),z(e,n)};V(b,e=>{t.task.groupId&&e(x)});var S=P(b,2),ee=e=>{var n=w_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.childPid)),z(e,n)};V(S,e=>{t.task.runtime?.childPid&&e(ee)});var C=P(S,2),te=e=>{var n=T_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.processGroupId)),z(e,n)};V(C,e=>{t.task.runtime?.processGroupId&&e(te)});var ne=P(C,2),re=e=>{var n=E_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.platform)),z(e,n)};V(ne,e=>{t.task.runtime?.platform&&e(re)});var ie=P(ne,2),ae=e=>{var n=D_e(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>M1(t.task.runtime.spawnedAt)]),z(e,n)};V(ie,e=>{t.task.runtime?.spawnedAt&&e(ae)});var oe=P(ie,2),w=e=>{var n=O_e(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>M1(t.task.finishedAt)]),z(e,n)};V(oe,e=>{t.task.finishedAt&&e(w)});var se=P(oe,2),ce=e=>{var n=k_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.exitCode)),z(e,n)},le=e=>{var n=A_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.signal)),z(e,n)};V(se,e=>{I(c)?e(ce):t.task.signal&&e(le,1)});var ue=P(se,2),de=e=>{var n=j_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.error)),z(e,n)};V(ue,e=>{t.task.error&&e(de)});var fe=P(ue,2),pe=M(fe,!0);T(fe),F(e=>{B(l,t.task.name??t.task.command),B(d,t.task.command),B(p,t.task.cwd),B(h,t.task.status),B(y,e),B(pe,t.task.id)},[()=>M1(t.task.startedAt)]),z(e,r)},$$slots:{default:!0}})}),z(e,u)},$$slots:{default:!0}})}),z(e,u)},$$slots:{default:!0}})});var d=P(u,2),f=e=>{var n=N_e(),r=M(n,!0);T(n),F(()=>B(r,t.task.error)),z(e,n)};V(d,e=>{t.task.error&&e(f)}),z(e,l),O()}var P_e=L(`<p class="m-0 text-xs text-muted-foreground">No tasks.</p>`),F_e=L(`<div class="grid gap-1"></div>`);function I_e(e,t){D(t,!0);var n=R(),r=N(n),i=e=>{z(e,P_e())},a=e=>{var n=F_e();Ni(n,21,()=>t.view.tasks,e=>e.id,(e,t)=>{P1(e,{get task(){return I(t)},dense:!0})}),T(n),z(e,n)};V(r,e=>{t.view.tasks.length===0?e(i):e(a,-1)}),z(e,n),O()}var L_e=L(`<div> </div>`),R_e=L(`<div class="log-list-wrap svelte-8cwn38"><!></div>`);function z_e(e,t){D(t,!0);let n=q(t,`maxHeight`,3,`16rem`),r=q(t,`followOutput`,3,!1),i=k(()=>t.events?t.events.map(e=>({key:e.seq,text:e.line,level:e.level,stream:e.stream})):(t.lines??[]).map((e,t)=>({key:`line:${t}`,text:e})));var a=R_e();let o;var s=M(a);{let e=(e,t)=>{let n=()=>t?.().item;var r=L_e(),i=M(r,!0);T(r),F(()=>{Qi(r,1,`log-line${n().level?` level-${n().level}`:``}${n().stream===`stderr`?` stderr`:``}`,`svelte-8cwn38`),B(i,n().text||`\xA0`)}),z(e,r)},t=k(()=>r()?`end`:`start`);M$(s,{get items(){return I(i)},getKey:e=>e.key,estimateSize:()=>18,get anchor(){return I(t)},get followOutput(){return r()},viewportClass:`log-list`,row:e,$$slots:{row:!0}})}T(a),F(()=>o=ea(a,``,o,{"--log-max-height":n()})),z(e,a),O()}var B_e=L(`<p class="m-0 text-xs text-muted-foreground">No log events.</p>`);function V_e(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>n()?t.view.events:X$(t.view.events,10));var i=R(),a=N(i),o=e=>{z(e,B_e())},s=e=>{z_e(e,{get events(){return I(r)}})};V(a,e=>{t.view.events.length===0?e(o):e(s,-1)}),z(e,i),O()}var H_e=L(`<div class="grid gap-1"></div>`);function U_e(e,t){D(t,!0);let n=k(()=>t.view.tasks??(t.view.task?[t.view.task]:[]));var r=R(),i=N(r),a=e=>{var t=H_e();Ni(t,21,()=>I(n),e=>e.id,(e,t)=>{P1(e,{get task(){return I(t)}})}),T(t),z(e,t)};V(i,e=>{I(n).length>0&&e(a)}),z(e,r),O()}var W_e=new Set([`$$slots`,`$$events`,`$$legacy`]);function F1(e,t){let n=G(t,W_e),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}]];ic(e,K({name:`circle`},()=>n,{get iconNode(){return r}}))}var G_e=L(`<p class="m-0 text-sm text-muted-foreground">No todos set.</p>`),K_e=L(`<li><!> <span> </span></li>`),q_e=L(`<ul class="m-0 grid list-none gap-1.5 p-0" aria-label="Todo list"></ul>`);function J_e(e,t){D(t,!0);var n=R(),r=N(n),i=e=>{z(e,G_e())},a=e=>{var n=q_e();Ni(n,21,()=>t.view.items,Ai,(e,t)=>{var n=K_e(),r=M(n),i=e=>{t$(e,{size:15,strokeWidth:2.2,"aria-hidden":`true`,class:`mt-0.5 text-success`})},a=e=>{F1(e,{size:15,strokeWidth:2.2,"aria-hidden":`true`,class:`mt-0.5 text-muted-foreground`})};V(r,e=>{I(t).done?e(i):e(a,-1)});var o=P(r,2);let s;var c=M(o,!0);T(o),T(n),F(()=>{Qi(n,1,`grid grid-cols-[auto_1fr] items-start gap-2 text-sm leading-normal ${I(t).done?`text-muted-foreground`:`text-foreground`}`),s=Qi(o,1,``,null,s,{"line-through":I(t).done}),B(c,I(t).todo)}),z(e,n)}),T(n),z(e,n)};V(r,e=>{t.view.items.length===0?e(i):e(a,-1)}),z(e,n),O()}function Y_e(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>t.view.converted?`markdown`:void 0);var i=R(),a=N(i),o=e=>{m1(e,{get text(){return t.view.content},get language(){return I(r)},get expanded(){return n()}})};V(a,e=>{t.view.content!==void 0&&t.view.content.length>0&&e(o)}),z(e,i),O()}var X_e=L(`<div class="rounded-sm border bg-sidebar px-2.5 py-2 text-xs leading-normal text-sidebar-foreground"> </div>`),Z_e=L(`<a class="group grid gap-0.5 rounded-sm border bg-sidebar px-2.5 py-2 text-inherit no-underline" target="_blank" rel="noreferrer"><span class="text-xs font-semibold leading-snug text-foreground group-hover:underline"> </span> <span class="break-words font-mono text-xs text-muted-foreground"> </span></a>`),Q_e=L(`<div class="grid gap-2"></div>`),$_e=L(`<p class="m-0 text-xs text-muted-foreground">No results.</p>`),eve=L(`<!> <!>`,1);function tve(e,t){D(t,!0);var n=eve(),r=N(n),i=e=>{var n=X_e(),r=M(n,!0);T(n),F(()=>B(r,t.view.answer)),z(e,n)};V(r,e=>{t.view.answer&&e(i)});var a=P(r,2),o=e=>{var n=Q_e();Ni(n,21,()=>t.view.results,e=>e.url,(e,t)=>{var n=Z_e(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(n),F(()=>{W(n,`href`,I(t).url),B(i,I(t).title),B(o,I(t).url)}),z(e,n)}),T(n),z(e,n)},s=e=>{z(e,$_e())};V(a,e=>{t.view.results.length>0?e(o):t.view.answer||e(s,1)}),z(e,n),O()}function nve(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>T1(t.view.relPath));var i=R(),a=N(i),o=e=>{m1(e,{get text(){return t.view.content},get language(){return I(r)},get expanded(){return n()}})};V(a,e=>{t.view.content!==void 0&&t.view.content.length>0&&e(o)}),z(e,i),O()}var rve={read:l_e,bash:Lhe,python:o_e,edit:Rhe,write:nve,grep:yge,find:mge,ls:Dge,ask_user:whe,todos:J_e,task_action:U_e,task_list:I_e,task_logs:V_e,explore:uge,plan_mode:Qge,web_search:tve,web_fetch:Y_e,generic:_1};function ive(e){return rve[e]??_1}var ave=L(`<button class="arg link svelte-1ldx31s" type="button"> </button>`),ove=L(`<a class="arg link svelte-1ldx31s" target="_blank" rel="noreferrer noopener"> </a>`),sve=L(`<span class="arg svelte-1ldx31s"> </span>`),cve=L(`<pre class="tool-error svelte-1ldx31s"> </pre>`),lve=L(`<div class="tool-body svelte-1ldx31s"><!></div>`),uve=L(`<span> </span>`),dve=L(`<div class="chips svelte-1ldx31s"></div>`),fve=L(`<button class="more svelte-1ldx31s" type="button"> </button>`),pve=L(`<div class="tool-footer svelte-1ldx31s"><!> <!></div>`),mve=L(`<article><div class="tool-header svelte-1ldx31s"><!> <span class="badge svelte-1ldx31s"> </span> <!></div> <!> <!> <!></article>`);function I1(e,t){D(t,!0);let n=q(t,`dotPulse`,3,!1),r=q(t,`meta`,19,()=>[]),i=q(t,`expanded`,15,!1),a=k(()=>r().length>0||!!t.collapse);var o=mve(),s=M(o),c=M(s);$S(c,{get tone(){return t.dotTone},get pulse(){return n()},size:`xs`,class:`mr-1.5 align-middle`});var l=P(c,2),u=M(l,!0);T(l);var d=P(l,2),f=e=>{var n=R(),r=N(n),i=e=>{var n=ave(),r=M(n,!0);T(n),F(()=>{W(n,`title`,t.arg.text),B(r,t.arg.text)}),_i(`click`,n,()=>t.onOpenFile?.(t.arg.openPath,t.arg.line)),z(e,n)},a=e=>{var n=ove(),r=M(n,!0);T(n),F(()=>{W(n,`href`,t.arg.href),W(n,`title`,t.arg.text),B(r,t.arg.text)}),z(e,n)},o=e=>{var n=sve(),r=M(n,!0);T(n),F(()=>{W(n,`title`,t.arg.text),B(r,t.arg.text)}),z(e,n)};V(r,e=>{t.arg.openPath?e(i):t.arg.href?e(a,1):e(o,-1)}),z(e,n)};V(d,e=>{t.arg&&e(f)}),T(s);var p=P(s,2),m=e=>{var n=cve(),r=M(n,!0);T(n),F(()=>B(r,t.error)),z(e,n)};V(p,e=>{t.error&&e(m)});var h=P(p,2),g=e=>{var n=lve();H(M(n),()=>t.children),T(n),z(e,n)};V(h,e=>{t.children&&e(g)});var _=P(h,2),v=e=>{var n=pve(),a=M(n),o=e=>{var t=dve();Ni(t,21,r,Ai,(e,t)=>{var n=uve();let r;var i=M(n,!0);T(n),F(()=>{r=Qi(n,1,`chip tone-${I(t).tone??`default`}`,`svelte-1ldx31s`,r,{mono:I(t).mono}),B(i,I(t).text)}),z(e,n)}),T(t),z(e,t)};V(a,e=>{r().length>0&&e(o)});var s=P(a,2),c=e=>{var n=fve(),r=M(n,!0);T(n),F(()=>B(r,i()?t.collapse.collapseLabel:t.collapse.expandLabel)),_i(`click`,n,()=>i(!i())),z(e,n)};V(s,e=>{t.collapse&&e(c)}),T(n),z(e,n)};V(_,e=>{I(a)&&e(v)}),T(o),F(()=>{Qi(o,1,`tool-card${t.status?` status-${t.status}`:``}`,`svelte-1ldx31s`),B(u,t.badge)}),z(e,o),O()}vi([`click`]);function hve(e,t){D(t,!0);let n=q(t,`bodyMode`,3,`output`),r=q(t,`expanded`,15,!1),i=k(()=>n()===`output`?t.presentation.collapse:void 0),a=k(()=>t.toolCall.error?H$(t.toolCall.error,{headLines:18,tailLines:6,maxChars:6e3}).text:void 0);{let n=k(()=>I(i)?{expandLabel:I(i).expandLabel,collapseLabel:I(i).collapseLabel}:void 0);I1(e,{get status(){return t.toolCall.status},get dotTone(){return t.presentation.dotTone},get dotPulse(){return t.presentation.dotPulse},get badge(){return t.presentation.badge},get arg(){return t.presentation.primaryArg},get error(){return I(a)},get meta(){return t.presentation.meta},get collapse(){return I(n)},get onOpenFile(){return t.onOpenFile},get expanded(){return r()},set expanded(e){r(e)},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.children),z(e,n)};V(i,e=>{t.children&&e(a)}),z(e,r)},$$slots:{default:!0}})}O()}function gve(e,t){D(t,!0);let n=q(t,`hydrateBody`,3,!0),r=q(t,`planReviewModels`,19,()=>[]),i=q(t,`planReviewModelKey`,3,``),a=q(t,`planReviewThinkingLevel`,3,`off`),o=A(!1),s=A(!1),c=k(()=>n()||I(s)),l=k(()=>ohe(t.toolCall,t.liveOutput)),u=k(()=>dhe(I(l),t.toolCall)),d=k(()=>ive(I(l).kind)),f=k(()=>I(l).kind===`ask_user`||I(l).kind===`plan_mode`&&I(l).action===`present`?`interactive`:`output`),p=k(()=>t.toolCall.status!==`error`&&t.toolCall.status!==`denied`),m=k(()=>t.pendingUserQuestion?.toolCallId===t.toolCall.id?t.pendingUserQuestion:void 0),h=k(()=>t.pendingPlanReview?.toolCallId===t.toolCall.id?t.pendingPlanReview:void 0);rr(()=>{n()&&j(s,!0)}),hve(e,{get toolCall(){return t.toolCall},get presentation(){return I(u)},get bodyMode(){return I(f)},get onOpenFile(){return t.onOpenFile},get expanded(){return I(o)},set expanded(e){j(o,e,!0)},children:(e,n)=>{var s=R(),u=N(s),f=e=>{var n=R();U(N(n),()=>I(d),(e,n)=>{n(e,{get toolCall(){return t.toolCall},get view(){return I(l)},get expanded(){return I(o)},get onOpenFile(){return t.onOpenFile},get questionRecord(){return I(m)},get planReview(){return I(h)},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get planReviewModels(){return r()},get planReviewModelKey(){return i()},get planReviewThinkingLevel(){return a()},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})}),z(e,n)};V(u,e=>{I(p)&&I(c)&&e(f)}),z(e,s)},$$slots:{default:!0}}),O()}function L1(e){return e&&typeof e==`object`?e:{}}function R1(e){return typeof e==`string`?e:void 0}function z1(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function B1(e){if(e!==void 0)return e.length===0?0:e.split(`
|
|
94
|
-
`).length}function _ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function V1(e){return RegExp(`"${_ve(e)}"\\s*:\\s*"`,`g`)}function H1(e,t,n={}){let r=[],i=V1(t),a=i.exec(e);for(;a;){let t=n.maxChars??1/0,o=``,s=a.index+a[0].length;for(;s<e.length;){let n=e[s];if(n===`\\`){if(s+1>=e.length)break;let n=e[s+1];o.length<t&&(n===`n`?o+=`
|
|
95
|
-
`:n===`r`?o+=`\r`:n===`t`?o+=` `:o+=n),s+=2;continue}if(n===`"`)break;o.length<t&&(o+=n),s+=1}r.push(o),a=i.exec(e)}return r}function U1(e,t){let n=[],r=V1(t),i=r.exec(e);for(;i;){let t=0,a=!1,o=i.index+i[0].length;for(;o<e.length;){let n=e[o];if(n===`\\`){if(o+1>=e.length)break;let n=e[o+1];n===`n`?(t=Math.max(t,1)+1,a=!0):n!==`r`&&(a=!0),o+=2;continue}if(n===`"`)break;n===`
|
|
96
|
-
`?t=Math.max(t,1)+1:n!==`\r`&&(a=!0),o+=1}n.push(Math.max(t,+!!a)),i=r.exec(e)}return n}function W1(e,t){let n=R1(L1(e.args).path)??e.progress?.path??H1(e.argsText,`path`,{maxChars:240})[0];return n&&t?z$(n,t)??n:n}function vve(e,t){let n=R1(L1(e.args).content),r=e.argsText?U1(e.argsText,`content`)[0]:void 0,i=e.progress?.lineCount??e.progress?.generatedLineCount,a=B1(n)??r??i,o=n===void 0&&!!e.progress?.estimated,s=[];return a!==void 0&&a>0&&s.push({text:`+${a}`,tone:`success`}),{kind:`write`,toolName:`write`,path:W1(e,t),statusText:e.done?`Submitting`:`Generating`,meta:s,lineCount:a,generatedLineCount:a,estimated:o,done:!!e.done}}function G1(e){let t=0,n=0;for(let r of e.split(/\r?\n/))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,deletions:n}}function K1(e){return Array.isArray(e)?e:[]}function yve(e){if(!Array.isArray(e.replacements)&&!Array.isArray(e.insertions)&&!Array.isArray(e.lineReplacements)&&!Array.isArray(e.lineInsertions)&&typeof e.patch!=`string`)return;let t=0,n=0,r=0,i=K1(e.replacements);t+=i.length;for(let e of i){let t=L1(e);n+=B1(R1(t.newText))??0,r+=B1(R1(t.oldText))??0}let a=K1(e.insertions);t+=a.length;for(let e of a)n+=B1(R1(L1(e).text))??0;let o=K1(e.lineReplacements);t+=o.length;for(let e of o)n+=B1(R1(L1(e).newText))??0;let s=K1(e.lineInsertions);t+=s.length;for(let e of s)n+=B1(R1(L1(e).text))??0;let c=R1(e.patch);if(c){t+=1;let e=G1(c);n+=e.additions,r+=e.deletions}return{operations:t,generatedLines:n,estimatedAdditions:n,estimatedDeletions:r,estimated:!1}}function bve(e){let t=e.progress;if(t)return{operations:t.operationCount??0,generatedLines:t.generatedLineCount??0,estimatedAdditions:t.estimatedAdditions,estimatedDeletions:t.estimatedDeletions,estimated:t.estimated}}function xve(e){let t=U1(e,`oldText`),n=U1(e,`newText`),r=U1(e,`text`),i=H1(e,`patch`,{maxChars:24e3}),a=i.reduce((e,t)=>{let n=G1(t);return{additions:e.additions+n.additions,deletions:e.deletions+n.deletions}},{additions:0,deletions:0}),o=n.reduce((e,t)=>e+t,0)+r.reduce((e,t)=>e+t,0)+a.additions,s=t.reduce((e,t)=>e+t,0)+a.deletions;return{operations:Math.max(t.length,n.length)+r.length+i.length,generatedLines:o,estimatedAdditions:o,estimatedDeletions:s,estimated:!0}}function Sve(e,t){let n=yve(L1(e.args)),r=e.argsText?xve(e.argsText):void 0,i=bve(e),a=n??r??i??{operations:0,generatedLines:0,estimated:!1},o=[];a.operations>0&&o.push({text:z1(a.operations,`operation`)});let s=a.estimatedAdditions??a.generatedLines;return s>0&&o.push({text:`+${s}`,tone:`success`}),a.estimatedDeletions!==void 0&&a.estimatedDeletions>0&&o.push({text:`-${a.estimatedDeletions}`,tone:`error`}),{kind:`edit`,toolName:`edit`,path:W1(e,t),statusText:e.done?`Submitting`:`Generating`,meta:o,operationCount:a.operations,generatedLineCount:a.generatedLines,estimatedAdditions:a.estimatedAdditions,estimatedDeletions:a.estimatedDeletions,estimated:a.estimated,done:!!e.done}}function Cve(e,t){let n=L1(e.args),r=W1(e,t),i=R1(n.code),a=H1(e.argsText,`code`,{maxChars:24e3})[0],o=i??a,s=B1(o),c=o!==void 0&&o.length>0,l=r!==void 0&&r.length>0,u=[];return s!==void 0&&s>0&&u.push({text:z1(s,`code line`),tone:`info`}),l&&u.push({text:`file`,tone:`info`}),e.done&&u.push({text:`submitted`,tone:`success`}),{kind:`python`,toolName:`python`,path:r,statusText:l?e.done?`Submitting Python file…`:`Preparing Python file…`:c?e.done?`Submitting Python code…`:`Generating Python code…`:`Waiting for Python code or path…`,meta:u,code:o,codeLineCount:s,language:`python`,done:!!e.done}}function wve(e,t){if(e.toolName===`write`)return vve(e,t);if(e.toolName===`edit`)return Sve(e,t);if(e.toolName===`python`)return Cve(e,t);let n=e.toolName??`tool`;return{kind:`generic`,toolName:n,statusText:e.done?`${n} arguments prepared.`:`Preparing ${n} arguments…`,meta:e.done?[{text:`submitted`,tone:`success`}]:[],done:!!e.done}}var Tve=L(`<span class="arg svelte-17ve1ll"> </span>`),Eve=L(`<span class="arg svelte-17ve1ll">inline</span>`),Dve=L(`<span class="arg svelte-17ve1ll">Preparing arguments…</span>`),Ove=L(`<div class="draft-progress svelte-17ve1ll" aria-live="polite"><span> </span> <span class="progress-spinner svelte-17ve1ll" aria-hidden="true"></span></div>`),kve=L(`<span class="progress-caret svelte-17ve1ll" aria-hidden="true"></span>`),Ave=L(`<div class="draft-progress svelte-17ve1ll" aria-live="polite"><span> </span> <!></div>`),jve=L(`<pre class="svelte-17ve1ll"> </pre>`),Mve=L(`<span> </span>`),Nve=L(`<div class="chips svelte-17ve1ll"></div>`),Pve=L(`<article><div class="tool-header svelte-17ve1ll"><!> <span class="badge svelte-17ve1ll"> </span> <!></div> <!> <!></article>`);function Fve(e,t){D(t,!0);let n=k(()=>wve(t.draft,t.cwd)),r=k(()=>H$(t.draft.args?JSON.stringify(t.draft.args,null,2):t.draft.argsText.trim()||`Waiting for arguments…`,{headLines:18,tailLines:6,maxChars:6e3}).text);var i=Pve(),a=M(i),o=M(a);{let e=k(()=>I(n).done?`good`:`running`),t=k(()=>!I(n).done);$S(o,{get tone(){return I(e)},get pulse(){return I(t)},size:`xs`,class:`mr-1.5 align-middle`})}var s=P(o,2),c=M(s,!0);T(s);var l=P(s,2),u=e=>{var t=Tve(),r=M(t,!0);T(t),F(()=>{W(t,`title`,I(n).path),B(r,I(n).path)}),z(e,t)},d=e=>{z(e,Eve())},f=e=>{z(e,Dve())};V(l,e=>{I(n).path?e(u):I(n).kind===`python`?e(d,1):I(n).kind===`generic`&&e(f,2)}),T(a);var p=P(a,2),m=e=>{var t=Ove(),r=M(t),i=M(r,!0);T(r),E(2),T(t),F(()=>B(i,I(n).statusText)),z(e,t)},h=e=>{var t=R(),r=N(t),i=e=>{{let t=k(()=>H$(I(n).code,{headLines:12,tailLines:0}).text);p1(e,{get code(){return I(t)},get language(){return I(n).language},trim:!1})}},a=e=>{var t=Ave(),r=M(t),i=M(r,!0);T(r);var a=P(r,2),o=e=>{z(e,kve())};V(a,e=>{I(n).done||e(o)}),T(t),F(()=>B(i,I(n).statusText)),z(e,t)};V(r,e=>{I(n).code!==void 0&&I(n).code.length>0?e(i):e(a,-1)}),z(e,t)},g=e=>{var t=jve(),n=M(t,!0);T(t),F(()=>B(n,I(r))),z(e,t)};V(p,e=>{I(n).kind===`write`||I(n).kind===`edit`?e(m):I(n).kind===`python`?e(h,1):e(g,-1)});var _=P(p,2),v=e=>{var t=Nve();Ni(t,21,()=>I(n).meta,Ai,(e,t)=>{var n=Mve();let r;var i=M(n,!0);T(n),F(()=>{r=Qi(n,1,`chip tone-${I(t).tone??`default`}`,`svelte-17ve1ll`,r,{mono:I(t).mono}),B(i,I(t).text)}),z(e,n)}),T(t),z(e,t)};V(_,e=>{I(n).meta.length>0&&e(v)}),T(i),F(()=>{Qi(i,1,`tool-draft-card draft-${I(n).kind}`,`svelte-17ve1ll`),B(c,I(n).toolName)}),z(e,i),O()}var Ive=L(`<article class="tool-result-error-card svelte-jrln7b"><div class="tool-header svelte-jrln7b"><!> <span class="badge svelte-jrln7b"> </span></div> <pre class="tool-error svelte-jrln7b"> </pre></article>`);function Lve(e,t){D(t,!0);let n=k(()=>H$(t.error,{headLines:18,tailLines:6,maxChars:6e3}).text);var r=Ive(),i=M(r),a=M(i);$S(a,{tone:`danger`,size:`xs`,class:`mr-1.5 align-middle`});var o=P(a,2),s=M(o,!0);T(o),T(i);var c=P(i,2),l=M(c,!0);T(c),T(r),F(()=>{B(s,t.toolName),B(l,I(n))}),z(e,r),O()}var Rve=typeof self==`object`?self:globalThis,q1=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Rve[e](t)},zve=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(q1(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(q1(a,o),i)};return r},J1=e=>zve(new Map,e)(0),Y1=``,{toString:Bve}={},{keys:Vve}=Object,X1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Bve.call(e).slice(8,-1);switch(n){case`Array`:return[1,Y1];case`Object`:return[2,Y1];case`Date`:return[3,Y1];case`RegExp`:return[4,Y1];case`Map`:return[5,Y1];case`Set`:return[6,Y1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Z1=([e,t])=>e===0&&(t===`function`||t===`symbol`),Hve=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=X1(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Vve(r))(e||!Z1(X1(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Z1(X1(n))||Z1(X1(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Z1(X1(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Q1=(e,{json:t,lossy:n}={})=>{let r=[];return Hve(!(t||n),!!t,new Map,r)(e),r},$1=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?J1(Q1(e,t)):structuredClone(e):(e,t)=>J1(Q1(e,t)),e0=n0(`end`),t0=n0(`start`);function n0(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function r0(e){let t=t0(e),n=e0(e);if(t&&n)return{start:t,end:n}}var i0=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],a0={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...i0,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...i0],h2:[[`className`,`sr-only`]],img:[...i0,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...i0,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...i0],table:[...i0],ul:[...i0,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},o0={}.hasOwnProperty;function Uve(e,t){let n={type:`root`,children:[]},r=s0({schema:t?{...a0,...t}:a0,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function s0(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Wve(e,n);case`doctype`:return Gve(e,n);case`element`:return Kve(e,n);case`root`:return qve(e,n);case`text`:return Jve(e,n);default:}}}function Wve(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return d0(r,t),r}}function Gve(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return d0(e,t),e}}function Kve(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=c0(e,t.children),i=Yve(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&o0.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return d0(o,t),o}function qve(e,t){let n={type:`root`,children:c0(e,t.children)};return d0(n,t),n}function Jve(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return d0(n,t),n}function c0(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=s0(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Yve(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&o0.call(r,n)?r[n]:void 0,o=r&&o0.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(o0.call(s,l)){let t=s[l],n=l0(e,f0(a,l),l,t);n??=l0(e,f0(o,l),l,t),n!=null&&(c[l]=n)}if(i&&o0.call(i,n)){let e=i[n];for(l in e)o0.call(e,l)&&!o0.call(c,l)&&(c[l]=e[l])}return c}function l0(e,t,n,r){return t?Array.isArray(r)?Xve(e,t,n,r):u0(e,t,n,r):void 0}function Xve(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=u0(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function u0(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&Zve(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Zve(e,t,n){let r=e.schema.protocols&&o0.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function d0(e,t){let n=r0(t);t.data&&(e.data=$1(t.data)),n&&(e.position=n)}function f0(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Qve(e){return function(t){return Uve(t,e)}}var $ve=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],p0=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};p0.prototype.normal={},p0.prototype.property={},p0.prototype.space=void 0;function m0(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new p0(n,r,t)}function h0(e){return e.toLowerCase()}var g0=class{constructor(e,t){this.attribute=t,this.property=e}};g0.prototype.attribute=``,g0.prototype.booleanish=!1,g0.prototype.boolean=!1,g0.prototype.commaOrSpaceSeparated=!1,g0.prototype.commaSeparated=!1,g0.prototype.defined=!1,g0.prototype.mustUseProperty=!1,g0.prototype.number=!1,g0.prototype.overloadedBoolean=!1,g0.prototype.property=``,g0.prototype.spaceSeparated=!1,g0.prototype.space=void 0;var _0=s({boolean:()=>v0,booleanish:()=>y0,commaOrSpaceSeparated:()=>w0,commaSeparated:()=>C0,number:()=>x0,overloadedBoolean:()=>b0,spaceSeparated:()=>S0}),eye=0,v0=T0(),y0=T0(),b0=T0(),x0=T0(),S0=T0(),C0=T0(),w0=T0();function T0(){return 2**++eye}var E0=Object.keys(_0),D0=class extends g0{constructor(e,t,n,r){let i=-1;if(super(e,t),O0(this,`space`,r),typeof n==`number`)for(;++i<E0.length;){let e=E0[i];O0(this,E0[i],(n&_0[e])===_0[e])}}};D0.prototype.defined=!0;function O0(e,t,n){n&&(e[t]=n)}function k0(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new D0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[h0(r)]=r,n[h0(a.attribute)]=r}return new p0(t,n,e.space)}var A0=k0({properties:{ariaActiveDescendant:null,ariaAtomic:y0,ariaAutoComplete:null,ariaBusy:y0,ariaChecked:y0,ariaColCount:x0,ariaColIndex:x0,ariaColSpan:x0,ariaControls:S0,ariaCurrent:null,ariaDescribedBy:S0,ariaDetails:null,ariaDisabled:y0,ariaDropEffect:S0,ariaErrorMessage:null,ariaExpanded:y0,ariaFlowTo:S0,ariaGrabbed:y0,ariaHasPopup:null,ariaHidden:y0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:S0,ariaLevel:x0,ariaLive:null,ariaModal:y0,ariaMultiLine:y0,ariaMultiSelectable:y0,ariaOrientation:null,ariaOwns:S0,ariaPlaceholder:null,ariaPosInSet:x0,ariaPressed:y0,ariaReadOnly:y0,ariaRelevant:null,ariaRequired:y0,ariaRoleDescription:S0,ariaRowCount:x0,ariaRowIndex:x0,ariaRowSpan:x0,ariaSelected:y0,ariaSetSize:x0,ariaSort:null,ariaValueMax:x0,ariaValueMin:x0,ariaValueNow:x0,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function j0(e,t){return t in e?e[t]:t}function M0(e,t){return j0(e,t.toLowerCase())}var tye=k0({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:C0,acceptCharset:S0,accessKey:S0,action:null,allow:null,allowFullScreen:v0,allowPaymentRequest:v0,allowUserMedia:v0,alt:null,as:null,async:v0,autoCapitalize:null,autoComplete:S0,autoFocus:v0,autoPlay:v0,blocking:S0,capture:null,charSet:null,checked:v0,cite:null,className:S0,cols:x0,colSpan:null,content:null,contentEditable:y0,controls:v0,controlsList:S0,coords:x0|C0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:v0,defer:v0,dir:null,dirName:null,disabled:v0,download:b0,draggable:y0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:v0,formTarget:null,headers:S0,height:x0,hidden:b0,high:x0,href:null,hrefLang:null,htmlFor:S0,httpEquiv:S0,id:null,imageSizes:null,imageSrcSet:null,inert:v0,inputMode:null,integrity:null,is:null,isMap:v0,itemId:null,itemProp:S0,itemRef:S0,itemScope:v0,itemType:S0,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:v0,low:x0,manifest:null,max:null,maxLength:x0,media:null,method:null,min:null,minLength:x0,multiple:v0,muted:v0,name:null,nonce:null,noModule:v0,noValidate:v0,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:v0,optimum:x0,pattern:null,ping:S0,placeholder:null,playsInline:v0,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:v0,referrerPolicy:null,rel:S0,required:v0,reversed:v0,rows:x0,rowSpan:x0,sandbox:S0,scope:null,scoped:v0,seamless:v0,selected:v0,shadowRootClonable:v0,shadowRootDelegatesFocus:v0,shadowRootMode:null,shape:null,size:x0,sizes:null,slot:null,span:x0,spellCheck:y0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x0,step:null,style:null,tabIndex:x0,target:null,title:null,translate:null,type:null,typeMustMatch:v0,useMap:null,value:y0,width:x0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:S0,axis:null,background:null,bgColor:null,border:x0,borderColor:null,bottomMargin:x0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:v0,declare:v0,event:null,face:null,frame:null,frameBorder:null,hSpace:x0,leftMargin:x0,link:null,longDesc:null,lowSrc:null,marginHeight:x0,marginWidth:x0,noResize:v0,noHref:v0,noShade:v0,noWrap:v0,object:null,profile:null,prompt:null,rev:null,rightMargin:x0,rules:null,scheme:null,scrolling:y0,standby:null,summary:null,text:null,topMargin:x0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:v0,disableRemotePlayback:v0,prefix:null,property:null,results:x0,security:null,unselectable:null},space:`html`,transform:M0}),nye=k0({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:w0,accentHeight:x0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x0,amplitude:x0,arabicForm:null,ascent:x0,attributeName:null,attributeType:null,azimuth:x0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x0,by:null,calcMode:null,capHeight:x0,className:S0,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x0,diffuseConstant:x0,direction:null,display:null,dur:null,divisor:x0,dominantBaseline:null,download:v0,dx:null,dy:null,edgeMode:null,editable:null,elevation:x0,enableBackground:null,end:null,event:null,exponent:x0,externalResourcesRequired:null,fill:null,fillOpacity:x0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:C0,g2:C0,glyphName:C0,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x0,horizOriginX:x0,horizOriginY:x0,id:null,ideographic:x0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x0,k:x0,k1:x0,k2:x0,k3:x0,k4:x0,kernelMatrix:w0,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x0,overlineThickness:x0,paintOrder:null,panose1:null,path:null,pathLength:x0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:S0,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x0,pointsAtY:x0,pointsAtZ:x0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:w0,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:w0,rev:w0,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:w0,requiredFeatures:w0,requiredFonts:w0,requiredFormats:w0,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x0,specularExponent:x0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x0,strikethroughThickness:x0,string:null,stroke:null,strokeDashArray:w0,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x0,strokeOpacity:x0,strokeWidth:null,style:null,surfaceScale:x0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:w0,tabIndex:x0,tableValues:null,target:null,targetX:x0,targetY:x0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:w0,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x0,underlineThickness:x0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x0,values:null,vAlphabetic:x0,vMathematical:x0,vectorEffect:null,vHanging:x0,vIdeographic:x0,version:null,vertAdvY:x0,vertOriginX:x0,vertOriginY:x0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:j0}),N0=k0({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),P0=k0({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:M0}),F0=k0({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),rye=/[A-Z]/g,I0=/-[a-z]/g,iye=/^data[-\w.:]+$/i;function aye(e,t){let n=h0(t),r=t,i=g0;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&iye.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(I0,sye);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!I0.test(e)){let n=e.replace(rye,oye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=D0}return new i(r,t)}function oye(e){return`-`+e.toLowerCase()}function sye(e){return e.charAt(1).toUpperCase()}var cye=m0([A0,tye,N0,P0,F0],`html`),L0=m0([A0,nye,N0,P0,F0],`svg`),R0={}.hasOwnProperty;function lye(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&R0.call(t,e)){let n=String(t[e]);i=R0.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var uye=/["&'<>`]/g,dye=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,fye=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,pye=/[|\\{}()[\]^$+*?.]/g,z0=new WeakMap;function mye(e,t){if(e=e.replace(t.subset?hye(t.subset):uye,r),t.subset||t.escapeOnly)return e;return e.replace(dye,n).replace(fye,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function hye(e){let t=z0.get(e);return t||(t=gye(e),z0.set(e,t)),t}function gye(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(pye,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var _ye=/[\dA-Fa-f]/;function vye(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!_ye.test(String.fromCharCode(t))?r:r+`;`}var yye=/\d/;function bye(e,t,n){let r=`&#`+String(e);return n&&t&&!yye.test(String.fromCharCode(t))?r:r+`;`}var xye=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),B0={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Sye=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],V0={}.hasOwnProperty,H0={},U0;for(U0 in B0)V0.call(B0,U0)&&(H0[B0[U0]]=U0);var Cye=/[^\dA-Za-z]/;function wye(e,t,n,r){let i=String.fromCharCode(e);if(V0.call(H0,i)){let e=H0[i],a=`&`+e;return n&&xye.includes(e)&&!Sye.includes(e)&&(!r||t&&t!==61&&Cye.test(String.fromCharCode(t)))?a:a+`;`}return``}function Tye(e,t,n){let r=vye(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=wye(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=bye(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function W0(e,t){return mye(e,Object.assign({format:Tye},t))}var Eye=/^>|^->|<!--|-->|--!>|<!-$/g,Dye=[`>`],Oye=[`<`,`>`];function kye(e,t,n,r){return r.settings.bogusComments?`<?`+W0(e.value,Object.assign({},r.settings.characterReferences,{subset:Dye}))+`>`:`<!--`+e.value.replace(Eye,i)+`-->`;function i(e){return W0(e,Object.assign({},r.settings.characterReferences,{subset:Oye}))}}function Aye(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function G0(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jye(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Mye(e){return e.join(` `).trim()}var Nye=/[ \t\n\f\r]/g;function K0(e){return typeof e==`object`?e.type===`text`?q0(e.value):!1:q0(e)}function q0(e){return e.replace(Nye,``)===``}var J0=X0(1),Y0=X0(-1),Pye=[];function X0(e){return t;function t(t,n,r){let i=t?t.children:Pye,a=(n||0)+e,o=i[a];if(!r)for(;o&&K0(o);)a+=e,o=i[a];return o}}var Fye={}.hasOwnProperty;function Z0(e){return t;function t(t,n,r){return Fye.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Q0=Z0({body:Lye,caption:$0,colgroup:$0,dd:Vye,dt:Bye,head:$0,html:Iye,li:zye,optgroup:Hye,option:Uye,p:Rye,rp:e2,rt:e2,tbody:Gye,td:t2,tfoot:Kye,th:t2,thead:Wye,tr:qye});function $0(e,t,n){let r=J0(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&K0(r.value.charAt(0)))}function Iye(e,t,n){let r=J0(n,t);return!r||r.type!==`comment`}function Lye(e,t,n){let r=J0(n,t);return!r||r.type!==`comment`}function Rye(e,t,n){let r=J0(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function zye(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Bye(e,t,n){let r=J0(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Vye(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function e2(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Hye(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Uye(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Wye(e,t,n){let r=J0(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Gye(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Kye(e,t,n){return!J0(n,t)}function qye(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function t2(e,t,n){let r=J0(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Jye=Z0({body:Zye,colgroup:Qye,head:Xye,html:Yye,tbody:$ye});function Yye(e){let t=J0(e,-1);return!t||t.type!==`comment`}function Xye(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Zye(e){let t=J0(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&K0(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Qye(e,t,n){let r=Y0(n,t),i=J0(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Q0(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function $ye(e,t,n){let r=Y0(n,t),i=J0(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Q0(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var n2={name:[[`
|
|
97
|
-
\f\r &/=>`.split(``),`
|
|
98
|
-
\f\r "&'/=>\``.split(``)],[`\0
|
|
99
|
-
\f\r "&'/<=>`.split(``),`\0
|
|
100
|
-
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
101
|
-
\f\r &>`.split(``),`\0
|
|
102
|
-
\f\r "&'<=>\``.split(``)],[`\0
|
|
103
|
-
\f\r "&'<=>\``.split(``),`\0
|
|
104
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function ebe(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=L0);let l=tbe(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Jye(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!Q0(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function tbe(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=nbe(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function nbe(e,t,n){let r=aye(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=W0(r.attribute,Object.assign({},e.settings.characterReferences,{subset:n2.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?jye:Mye)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=W0(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:n2.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&G0(n,o)>G0(n,e.alternative)&&(o=e.alternative),s=o+W0(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?n2.single:n2.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var rbe=[`<`,`&`];function r2(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:W0(e.value,Object.assign({},r.settings.characterReferences,{subset:rbe}))}function ibe(e,t,n,r){return r.settings.allowDangerousHtml?e.value:r2(e,t,n,r)}function abe(e,t,n,r){return r.all(e)}var obe=lye(`type`,{invalid:sbe,unknown:cbe,handlers:{comment:kye,doctype:Aye,element:ebe,raw:ibe,root:abe,text:r2}});function sbe(e){throw Error("Expected node, not `"+e+"`")}function cbe(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var lbe={},ube={},dbe=[];function i2(e,t){let n=t||lbe,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:fbe,all:pbe,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||$ve,characterReferences:n.characterReferences||ube,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?L0:cye,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function fbe(e,t,n){return obe(e,t,n,this)}function pbe(e){let t=[],n=e&&e.children||dbe,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function mbe(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return i2(e,n)}}var a2=m2(/[A-Za-z]/),o2=m2(/[\dA-Za-z]/),hbe=m2(/[#-'*+\--9=?A-Z^-~]/);function s2(e){return e!==null&&(e<32||e===127)}var c2=m2(/\d/),gbe=m2(/[\dA-Fa-f]/),_be=m2(/[!-/:-@[-`{-~]/);function l2(e){return e!==null&&e<-2}function u2(e){return e!==null&&(e<0||e===32)}function d2(e){return e===-2||e===-1||e===32}var f2=m2(/\p{P}|\p{S}/u),p2=m2(/\s/);function m2(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function vbe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var h2=(function(e){if(e==null)return Sbe;if(typeof e==`function`)return g2(e);if(typeof e==`object`)return Array.isArray(e)?ybe(e):bbe(e);if(typeof e==`string`)return xbe(e);throw Error(`Expected function, string, or object as test`)});function ybe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=h2(e[n]);return g2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function bbe(e){let t=e;return g2(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function xbe(e){return g2(t);function t(t){return t&&t.type===e}}function g2(e){return t;function t(t,n,r){return!!(Cbe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Sbe(){return!0}function Cbe(e){return typeof e==`object`&&!!e&&`type`in e}function wbe(e){return e}var _2=[];function v2(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=h2(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+wbe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=_2,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Tbe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Tbe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?_2:[e]}function Ebe(e,t,n){let r=h2((n||{}).ignore||[]),i=Dbe(t),a=-1;for(;++a<i.length;)v2(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Dbe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Obe(e[0]),kbe(e[1])])}return t}function Obe(e){return typeof e==`string`?new RegExp(vbe(e),`g`):e}function kbe(e){return typeof e==`function`?e:function(){return e}}var y2=`phrasing`,b2=[`autolink`,`link`,`image`,`label`];function Abe(){return{transforms:[Lbe],enter:{literalAutolink:Mbe,literalAutolinkEmail:x2,literalAutolinkHttp:x2,literalAutolinkWww:x2},exit:{literalAutolink:Ibe,literalAutolinkEmail:Fbe,literalAutolinkHttp:Nbe,literalAutolinkWww:Pbe}}}function jbe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:y2,notInConstruct:b2},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:y2,notInConstruct:b2},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:y2,notInConstruct:b2}]}}function Mbe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function x2(e){this.config.enter.autolinkProtocol.call(this,e)}function Nbe(e){this.config.exit.autolinkProtocol.call(this,e)}function Pbe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Fbe(e){this.config.exit.autolinkEmail.call(this,e)}function Ibe(e){this.exit(e)}function Lbe(e){Ebe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Rbe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,zbe]],{ignore:[`link`,`linkReference`]})}function Rbe(e,t,n,r,i){let a=``;if(!S2(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Bbe(n)))return!1;let o=Vbe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function zbe(e,t,n,r){return!S2(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Bbe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Vbe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=G0(e,`(`),a=G0(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function S2(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||p2(n)||f2(n))&&(!t||n!==47)}function C2(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}w2.peek=Xbe;function Hbe(){this.buffer()}function Ube(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Wbe(){this.buffer()}function Gbe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Kbe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=C2(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qbe(e){this.exit(e)}function Jbe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=C2(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ybe(e){this.exit(e)}function Xbe(){return`[`}function w2(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Zbe(){return{enter:{gfmFootnoteCallString:Hbe,gfmFootnoteCall:Ube,gfmFootnoteDefinitionLabelString:Wbe,gfmFootnoteDefinition:Gbe},exit:{gfmFootnoteCallString:Kbe,gfmFootnoteCall:qbe,gfmFootnoteDefinitionLabelString:Jbe,gfmFootnoteDefinition:Ybe}}}function Qbe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:w2},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
105
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?T2:$be))),s(),o}}function $be(e,t,n){return t===0?e:T2(e,t,n)}function T2(e,t,n){return(n?``:` `)+e}var exe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];E2.peek=axe;function txe(){return{canContainEols:[`delete`],enter:{strikethrough:rxe},exit:{strikethrough:ixe}}}function nxe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:exe}],handlers:{delete:E2}}}function rxe(e){this.enter({type:`delete`,children:[]},e)}function ixe(e){this.exit(e)}function E2(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function axe(){return`~`}function oxe(e){return e.length}function sxe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||oxe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=cxe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=D2(r[d]);else{let e=D2(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
106
|
-
`)}function cxe(e){return e==null?``:String(e)}function D2(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function lxe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),uxe);return i(),o}function uxe(e,t,n){return`>`+(n?``:` `)+e}function dxe(e,t){return O2(e,t.inConstruct,!0)&&!O2(e,t.notInConstruct,!1)}function O2(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function k2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
107
|
-
`&&dxe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
108
|
-
`}function fxe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function pxe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function mxe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hxe(e,t,n,r){let i=mxe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(pxe(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,gxe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(fxe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
109
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
110
|
-
`),a&&(u+=s.move(a+`
|
|
111
|
-
`)),u+=s.move(c),l(),u}function gxe(e,t,n){return(n?``:` `)+e}function A2(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function _xe(e,t,n,r){let i=A2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
112
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function vxe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function j2(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function M2(e){if(e===null||u2(e)||p2(e))return 1;if(f2(e))return 2}function N2(e,t,n){let r=M2(e),i=M2(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}P2.peek=yxe;function P2(e,t,n,r){let i=vxe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=N2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=j2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=N2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+j2(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function yxe(e,t,n){return n.options.emphasis||`*`}function F2(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),v2(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var bxe={};function I2(e,t){let n=t||bxe;return L2(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function L2(e,t,n){if(xxe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return R2(e.children,t,n)}return Array.isArray(e)?R2(e,t,n):``}function R2(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=L2(e[i],t,n);return r.join(``)}function xxe(e){return!!(e&&typeof e==`object`)}function Sxe(e,t){let n=!1;return F2(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&I2(e)&&(t.options.setext||n))}function Cxe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Sxe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
113
|
-
`,after:`
|
|
114
|
-
`});return r(),t(),o+`
|
|
115
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
116
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
117
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=j2(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}z2.peek=wxe;function z2(e){return e.value||``}function wxe(){return`<`}B2.peek=Txe;function B2(e,t,n,r){let i=A2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Txe(){return`!`}V2.peek=Exe;function V2(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Exe(){return`!`}H2.peek=Dxe;function H2(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Dxe(){return"`"}function U2(e,t){let n=I2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}W2.peek=Oxe;function W2(e,t,n,r){let i=A2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(U2(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Oxe(e,t,n){return U2(e,n)?`<`:`[`}G2.peek=kxe;function G2(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function kxe(){return`[`}function K2(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Axe(e){let t=K2(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function jxe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function q2(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Mxe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?jxe(n):K2(n),s=e.ordered?o===`.`?`)`:`.`:Axe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),q2(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Nxe(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Pxe(e,t,n,r){let i=Nxe(n),a=n.bulletCurrent||K2(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Fxe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Ixe=h2([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Lxe(e,t,n,r){return(e.children.some(function(e){return Ixe(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Rxe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}J2.peek=zxe;function J2(e,t,n,r){let i=Rxe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=N2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=j2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=N2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+j2(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function zxe(e,t,n){return n.options.strong||`*`}function Bxe(e,t,n,r){return n.safe(e.value,r)}function Vxe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Hxe(e,t,n){let r=(q2(n)+(n.options.ruleSpaces?` `:``)).repeat(Vxe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Y2={blockquote:lxe,break:k2,code:hxe,definition:_xe,emphasis:P2,hardBreak:k2,heading:Cxe,html:z2,image:B2,imageReference:V2,inlineCode:H2,link:W2,linkReference:G2,list:Mxe,listItem:Pxe,paragraph:Fxe,root:Lxe,strong:J2,text:Bxe,thematicBreak:Hxe},X2=document.createElement(`i`);function Z2(e){let t=`&`+e+`;`;X2.innerHTML=t;let n=X2.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Q2(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var Uxe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Wxe(e){return e.replace(Uxe,Gxe)}function Gxe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Q2(n.slice(t?2:1),t?16:10)}return Z2(n)||e}function Kxe(){return{enter:{table:qxe,tableData:e4,tableHeader:e4,tableRow:Yxe},exit:{codeText:Xxe,table:Jxe,tableData:$2,tableHeader:$2,tableRow:$2}}}function qxe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Jxe(e){this.exit(e),this.data.inTable=void 0}function Yxe(e){this.enter({type:`tableRow`,children:[]},e)}function $2(e){this.exit(e)}function e4(e){this.enter({type:`tableCell`,children:[]},e)}function Xxe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Zxe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Zxe(e,t){return t===`|`?t:e}function Qxe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
118
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
119
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return sxe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Y2.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function $xe(){return{exit:{taskListCheckValueChecked:t4,taskListCheckValueUnchecked:t4,paragraph:tSe}}}function eSe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:nSe}}}function t4(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function tSe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function nSe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Y2.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function rSe(){return[Abe(),Zbe(),txe(),Kxe(),$xe()]}function iSe(e){return{extensions:[jbe(),Qbe(e),nxe(),Qxe(e),eSe()]}}function n4(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function r4(e,t){return e.length>0?(n4(e,e.length,0,t),e):t}var i4={}.hasOwnProperty;function a4(e){let t={},n=-1;for(;++n<e.length;)aSe(t,e[n]);return t}function aSe(e,t){let n;for(n in t){let r=(i4.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){i4.call(r,a)||(r[a]=[]);let e=i[a];oSe(r[a],Array.isArray(e)?e:e?[e]:[])}}}function oSe(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);n4(e,0,0,r)}var sSe={tokenize:pSe,partial:!0},o4={tokenize:mSe,partial:!0},s4={tokenize:hSe,partial:!0},c4={tokenize:gSe,partial:!0},cSe={tokenize:_Se,partial:!0},l4={name:`wwwAutolink`,tokenize:dSe,previous:m4},u4={name:`protocolAutolink`,tokenize:fSe,previous:h4},d4={name:`emailAutolink`,tokenize:uSe,previous:g4},f4={};function lSe(){return{text:f4}}for(var p4=48;p4<123;)f4[p4]=d4,p4++,p4===58?p4=65:p4===91&&(p4=97);f4[43]=d4,f4[45]=d4,f4[46]=d4,f4[95]=d4,f4[72]=[d4,u4],f4[104]=[d4,u4],f4[87]=[d4,l4],f4[119]=[d4,l4];function uSe(e,t,n){let r=this,i,a;return o;function o(t){return!_4(t)||!g4.call(r,r.previous)||v4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return _4(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(cSe,u,l)(t):t===45||t===95||o2(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&a2(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function dSe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!m4.call(r,r.previous)||v4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(sSe,e.attempt(o4,e.attempt(s4,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function fSe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&h4.call(r,r.previous)&&!v4(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(a2(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||s2(t)||u2(t)||p2(t)||f2(t)?n(t):e.attempt(o4,e.attempt(s4,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function pSe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function mSe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(c4,c,s)(t):t===null||u2(t)||p2(t)||t!==45&&f2(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function hSe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(c4,t,a)(o):o===null||u2(o)||p2(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function gSe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||u2(o)||p2(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||u2(e)||p2(e)?t(e):r(e)}function a(e){return a2(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):a2(t)?(e.consume(t),o):n(t)}}function _Se(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return o2(e)?n(e):t(e)}}function m4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||u2(e)}function h4(e){return!a2(e)}function g4(e){return!(e===47||_4(e))}function _4(e){return e===43||e===45||e===46||e===95||o2(e)}function v4(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function y4(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&o2(e.charCodeAt(n+1))&&o2(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function b4(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var x4={name:`attention`,resolveAll:vSe,tokenize:ySe};function vSe(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};S4(d,-c),S4(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=r4(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=r4(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=r4(l,b4(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=r4(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=r4(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,n4(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ySe(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=M2(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=M2(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function S4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var bSe={name:`autolink`,tokenize:xSe};function xSe(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return a2(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||o2(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||o2(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||s2(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):hbe(t)?(e.consume(t),l):n(t)}function u(e){return o2(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||o2(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function C4(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return d2(r)?(e.enter(n),s(r)):t(r)}function s(r){return d2(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var w4={partial:!0,tokenize:SSe};function SSe(e,t,n){return r;function r(t){return d2(t)?C4(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||l2(e)?t(e):n(e)}}var T4={continuation:{tokenize:wSe},exit:TSe,name:`blockQuote`,tokenize:CSe};function CSe(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return d2(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function wSe(e,t,n){let r=this;return i;function i(t){return d2(t)?C4(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(T4,t,n)(r)}}function TSe(e){e.exit(`blockQuote`)}var E4={name:`characterEscape`,tokenize:ESe};function ESe(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return _be(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var D4={name:`characterReference`,tokenize:DSe};function DSe(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=o2,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=gbe,u):(e.enter(`characterReferenceValue`),a=7,o=c2,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===o2&&!Z2(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var O4={partial:!0,tokenize:kSe},k4={concrete:!0,name:`codeFenced`,tokenize:OSe};function OSe(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),d2(t)?C4(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||l2(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(O4,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||l2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):d2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),C4(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||l2(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||l2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&d2(t)?C4(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||l2(t)?e.check(O4,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||l2(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),d2(t)?C4(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),d2(t)?C4(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||l2(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function kSe(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var A4={name:`codeIndented`,tokenize:jSe},ASe={partial:!0,tokenize:MSe};function jSe(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),C4(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):l2(t)?e.attempt(ASe,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||l2(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function MSe(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):l2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):C4(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):l2(e)?i(e):n(e)}}var NSe={name:`codeText`,previous:FSe,resolve:PSe,tokenize:ISe};function PSe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function FSe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ISe(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):l2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||l2(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var LSe=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&j4(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),j4(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),j4(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);j4(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);j4(this.left,t.reverse())}}};function j4(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function M4(e){let t={},n=-1,r,i,a,o,s,c,l,u=new LSe(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,RSe(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return n4(e,0,1/0,u.slice(0)),!l}function RSe(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var zSe={resolve:VSe,tokenize:HSe},BSe={partial:!0,tokenize:USe};function VSe(e){return M4(e),e}function HSe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):l2(t)?e.check(BSe,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function USe(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),C4(e,a,`linePrefix`)}function a(i){if(i===null||l2(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function N4(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||s2(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||l2(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||u2(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||s2(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function P4(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):l2(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||l2(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!d2(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function F4(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):l2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),C4(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||l2(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function I4(e,t){let n;return r;function r(i){return l2(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):d2(i)?C4(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var WSe={name:`definition`,tokenize:KSe},GSe={partial:!0,tokenize:qSe};function KSe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return P4.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=C2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return u2(t)?I4(e,l)(t):l(t)}function l(t){return N4(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(GSe,d,d)(t)}function d(t){return d2(t)?C4(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||l2(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qSe(e,t,n){return r;function r(t){return u2(t)?I4(e,i)(t):n(t)}function i(t){return F4(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return d2(t)?C4(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||l2(e)?t(e):n(e)}}var JSe={name:`hardBreakEscape`,tokenize:YSe};function YSe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return l2(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var XSe={name:`headingAtx`,resolve:ZSe,tokenize:QSe};function ZSe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},n4(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function QSe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||u2(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||l2(n)?(e.exit(`atxHeading`),t(n)):d2(n)?C4(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||u2(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $Se=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),L4=[`pre`,`script`,`style`,`textarea`],eCe={concrete:!0,name:`htmlFlow`,resolveTo:rCe,tokenize:iCe},tCe={partial:!0,tokenize:oCe},nCe={partial:!0,tokenize:aCe};function rCe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function iCe(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:de):a2(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):a2(a)?(e.consume(a),i=4,r.interrupt?t:de):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:de):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:ie:m):n(i)}function h(t){return a2(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||u2(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&L4.includes(l)?(i=1,r.interrupt?t(s):ie(s)):$Se.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):ie(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||o2(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:ie):n(i)}function v(t){return d2(t)?(e.consume(t),v):ne(t)}function y(t){return t===47?(e.consume(t),ne):t===58||t===95||a2(t)?(e.consume(t),b):d2(t)?(e.consume(t),y):ne(t)}function b(t){return t===45||t===46||t===58||t===95||o2(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):d2(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,ee):d2(t)?(e.consume(t),S):C(t)}function ee(t){return t===c?(e.consume(t),c=null,te):t===null||l2(t)?n(t):(e.consume(t),ee)}function C(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||u2(t)?x(t):(e.consume(t),C)}function te(e){return e===47||e===62||d2(e)?y(e):n(e)}function ne(t){return t===62?(e.consume(t),re):n(t)}function re(t){return t===null||l2(t)?ie(t):d2(t)?(e.consume(t),re):n(t)}function ie(t){return t===45&&i===2?(e.consume(t),se):t===60&&i===1?(e.consume(t),ce):t===62&&i===4?(e.consume(t),fe):t===63&&i===3?(e.consume(t),de):t===93&&i===5?(e.consume(t),ue):l2(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(tCe,pe,ae)(t)):t===null||l2(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(t){return e.check(nCe,oe,pe)(t)}function oe(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),w}function w(t){return t===null||l2(t)?ae(t):(e.enter(`htmlFlowData`),ie(t))}function se(t){return t===45?(e.consume(t),de):ie(t)}function ce(t){return t===47?(e.consume(t),o=``,le):ie(t)}function le(t){if(t===62){let n=o.toLowerCase();return L4.includes(n)?(e.consume(t),fe):ie(t)}return a2(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),le):ie(t)}function ue(t){return t===93?(e.consume(t),de):ie(t)}function de(t){return t===62?(e.consume(t),fe):t===45&&i===2?(e.consume(t),de):ie(t)}function fe(t){return t===null||l2(t)?(e.exit(`htmlFlowData`),pe(t)):(e.consume(t),fe)}function pe(n){return e.exit(`htmlFlow`),t(n)}}function aCe(e,t,n){let r=this;return i;function i(t){return l2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function oCe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(w4,t,n)}}var sCe={name:`htmlText`,tokenize:cCe};function cCe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):a2(t)?(e.consume(t),C):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):a2(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):l2(t)?(o=d,ce(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?se(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):l2(t)?(o=h,ce(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?se(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?se(t):l2(t)?(o=v,ce(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):l2(t)?(o=y,ce(t)):(e.consume(t),y)}function b(e){return e===62?se(e):y(e)}function x(t){return a2(t)?(e.consume(t),S):n(t)}function S(t){return t===45||o2(t)?(e.consume(t),S):ee(t)}function ee(t){return l2(t)?(o=ee,ce(t)):d2(t)?(e.consume(t),ee):se(t)}function C(t){return t===45||o2(t)?(e.consume(t),C):t===47||t===62||u2(t)?te(t):n(t)}function te(t){return t===47?(e.consume(t),se):t===58||t===95||a2(t)?(e.consume(t),ne):l2(t)?(o=te,ce(t)):d2(t)?(e.consume(t),te):se(t)}function ne(t){return t===45||t===46||t===58||t===95||o2(t)?(e.consume(t),ne):re(t)}function re(t){return t===61?(e.consume(t),ie):l2(t)?(o=re,ce(t)):d2(t)?(e.consume(t),re):te(t)}function ie(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ae):l2(t)?(o=ie,ce(t)):d2(t)?(e.consume(t),ie):(e.consume(t),oe)}function ae(t){return t===i?(e.consume(t),i=void 0,w):t===null?n(t):l2(t)?(o=ae,ce(t)):(e.consume(t),ae)}function oe(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||u2(t)?te(t):(e.consume(t),oe)}function w(e){return e===47||e===62||u2(e)?te(e):n(e)}function se(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ce(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),le}function le(t){return d2(t)?C4(e,ue,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ue(t)}function ue(t){return e.enter(`htmlTextData`),o(t)}}var R4={name:`labelEnd`,resolveAll:fCe,resolveTo:pCe,tokenize:mCe},lCe={tokenize:hCe},uCe={tokenize:gCe},dCe={tokenize:_Ce};function fCe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&n4(e,0,e.length,n),e}function pCe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=r4(s,e.slice(a+1,a+r+3)),s=r4(s,[[`enter`,u,t]]),s=r4(s,b4(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=r4(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=r4(s,e.slice(o+1)),s=r4(s,[[`exit`,c,t]]),n4(e,a,e.length,s),e}function mCe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(C2(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(lCe,u,o?u:d)(t):t===91?e.attempt(uCe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(dCe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function hCe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return u2(t)?I4(e,a)(t):a(t)}function a(t){return t===41?u(t):N4(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return u2(t)?I4(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?F4(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return u2(t)?I4(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function gCe(e,t,n){let r=this;return i;function i(t){return P4.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(C2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function _Ce(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var vCe={name:`labelStartImage`,resolveAll:R4.resolveAll,tokenize:yCe};function yCe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var bCe={name:`labelStartLink`,resolveAll:R4.resolveAll,tokenize:xCe};function xCe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var z4={name:`lineEnding`,tokenize:SCe};function SCe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),C4(e,t,`linePrefix`)}}var B4={name:`thematicBreak`,tokenize:CCe};function CCe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||l2(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),d2(t)?C4(e,s,`whitespace`)(t):s(t))}}var V4={continuation:{tokenize:DCe},exit:kCe,name:`list`,tokenize:ECe},wCe={partial:!0,tokenize:ACe},TCe={partial:!0,tokenize:OCe};function ECe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:c2(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(B4,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return c2(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(w4,r.interrupt?n:u,e.attempt(wCe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return d2(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function DCe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(w4,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,C4(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!d2(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TCe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,C4(e,e.attempt(V4,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function OCe(e,t,n){let r=this;return C4(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function kCe(e){e.exit(this.containerState.type)}function ACe(e,t,n){let r=this;return C4(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!d2(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var H4={name:`setextUnderline`,resolveTo:jCe,tokenize:MCe};function jCe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function MCe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),d2(t)?C4(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||l2(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var NCe={tokenize:VCe,partial:!0};function PCe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:RCe,continuation:{tokenize:zCe},exit:BCe}},text:{91:{name:`gfmFootnoteCall`,tokenize:LCe},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:FCe,resolveTo:ICe}}}}function FCe(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=C2(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function ICe(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function LCe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||u2(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(C2(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return u2(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function RCe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||u2(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=C2(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return u2(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),C4(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function zCe(e,t,n){return e.check(w4,t,e.attempt(NCe,t,n))}function BCe(e){e.exit(`gfmFootnoteDefinition`)}function VCe(e,t,n){let r=this;return C4(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function HCe(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&n4(o,o.length,0,b4(s,e.slice(r+1,n),t)),n4(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),n4(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=M2(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=M2(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var UCe=class{constructor(){this.map=[]}add(e,t,n){WCe(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function WCe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function GCe(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function KCe(){return{flow:{null:{name:`table`,tokenize:qCe,resolveAll:JCe}}}}function qCe(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):l2(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):d2(t)?C4(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||u2(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,d2(t)?C4(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return d2(t)?C4(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||l2(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return d2(t)?C4(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||l2(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),ee(t)}function ee(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),ee):n===null||l2(n)?(e.exit(`tableRow`),t(n)):d2(n)?C4(e,ee,`whitespace`)(n):(e.enter(`data`),C(n))}function C(t){return t===null||t===124||u2(t)?(e.exit(`data`),ee(t)):(e.consume(t),t===92?te:C)}function te(t){return t===92||t===124?(e.consume(t),C):C(t)}}function JCe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new UCe;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(W4(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=U4(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=U4(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=U4(f,t,o,i,n,d)):(o[0]=o[1],d=U4(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&W4(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=GCe(t.events,n))}return e}function U4(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},G4(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=G4(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=G4(t.events,n[2]),a=G4(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},G4(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function W4(e,t,n,r,i){let a=[],o=G4(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function G4(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var YCe={name:`tasklistCheck`,tokenize:ZCe};function XCe(){return{text:{91:YCe}}}function ZCe(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return u2(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return l2(r)?t(r):d2(r)?e.check({tokenize:QCe},t,n)(r):n(r)}}function QCe(e,t,n){return C4(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function $Ce(e){return a4([lSe(),PCe(),HCe(e),KCe(),XCe()])}var ewe={};function twe(e){let t=this,n=e||ewe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push($Ce(n)),a.push(rSe()),o.push(iSe(n))}var nwe={tokenize:rwe};function rwe(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),C4(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return l2(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var iwe={tokenize:awe},K4={tokenize:owe};function awe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return n4(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(K4,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(K4,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return l2(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;n4(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function owe(e,t,n){return C4(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var swe={tokenize:cwe};function cwe(e){let t=this,n=e.attempt(w4,r,e.attempt(this.parser.constructs.flowInitial,i,C4(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zSe,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var lwe={resolveAll:J4()},uwe=q4(`string`),dwe=q4(`text`);function q4(e){return{resolveAll:J4(e===`text`?fwe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function J4(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function fwe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var pwe=s({attentionMarkers:()=>xwe,contentInitial:()=>hwe,disable:()=>Swe,document:()=>mwe,flow:()=>_we,flowInitial:()=>gwe,insideSpan:()=>bwe,string:()=>vwe,text:()=>ywe}),mwe={42:V4,43:V4,45:V4,48:V4,49:V4,50:V4,51:V4,52:V4,53:V4,54:V4,55:V4,56:V4,57:V4,62:T4},hwe={91:WSe},gwe={[-2]:A4,[-1]:A4,32:A4},_we={35:XSe,42:B4,45:[H4,B4],60:eCe,61:H4,95:B4,96:k4,126:k4},vwe={38:D4,92:E4},ywe={[-5]:z4,[-4]:z4,[-3]:z4,33:vCe,38:D4,42:x4,60:[bSe,sCe],91:bCe,92:[JSe,E4],93:R4,95:x4,96:NSe},bwe={null:[x4,lwe]},xwe={null:[42,95]},Swe={null:[]};function Cwe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:ee(x),check:ee(S),consume:v,enter:y,exit:b,interrupt:ee(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=r4(o,e),g(),o[o.length-1]===null?(C(t,0),l.events=b4(a,l.events,l),l.events):[]}function f(e,t){return Twe(p(e),t)}function p(e){return wwe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,ne()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){l2(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,ne()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){C(e,t.from)}function S(e,t){t.restore()}function ee(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=te(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function C(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&n4(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function te(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,ne()}}function ne(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function wwe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Twe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
120
|
-
`;break;case-3:o=`\r
|
|
121
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Ewe(e){let t={constructs:a4([pwe,...(e||{}).extensions||[]]),content:n(nwe),defined:[],document:n(iwe),flow:n(swe),lazy:{},string:n(uwe),text:n(dwe)};return t;function n(e){return n;function n(n){return Cwe(t,e,n)}}}function Dwe(e){for(;!M4(e););return e}var Y4=/[\0\t\n\r]/g;function Owe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Y4.lastIndex=u,c=Y4.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function X4(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Q4(e.position):`start`in e||`end`in e?Q4(e):`line`in e||`column`in e?Z4(e):``}function Z4(e){return $4(e&&e.line)+`:`+$4(e&&e.column)}function Q4(e){return Z4(e&&e.start)+`-`+Z4(e&&e.end)}function $4(e){return e&&typeof e==`number`?e:1}var e3={}.hasOwnProperty;function kwe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Awe(n)(Dwe(Ewe(n).document().write(Owe()(e,t,!0))))}function Awe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ae),autolinkProtocol:te,autolinkEmail:te,atxHeading:a(Ee),blockQuote:a(xe),characterEscape:te,characterReference:te,codeFenced:a(Se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Se,o),codeText:a(Ce,o),codeTextData:te,data:te,codeFlowValue:te,definition:a(we),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Te),hardBreakEscape:a(De),hardBreakTrailing:a(De),htmlFlow:a(Oe,o),htmlFlowData:te,htmlText:a(Oe,o),htmlTextData:te,image:a(ke),label:o,link:a(Ae),listItem:a(Me),listItemValue:f,listOrdered:a(je,d),listUnordered:a(je),paragraph:a(Ne),reference:me,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ee),strong:a(Pe),thematicBreak:a(Ie)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:be,autolinkProtocol:ye,blockQuote:c(),characterEscapeValue:ne,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:_e,characterReference:ve,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:ne,codeIndented:c(_),codeText:c(w),codeTextData:ne,data:ne,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(ie),hardBreakTrailing:c(ie),htmlFlow:c(ae),htmlFlowData:ne,htmlText:c(oe),htmlTextData:ne,image:c(ce),label:ue,labelText:le,lineEnding:re,link:c(se),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:he,resourceDestinationString:de,resourceTitleString:fe,resource:pe,setextHeading:c(C),setextHeadingLineSequence:ee,setextHeadingText:S,strong:c(),thematicBreak:c()}};n3(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];e3.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||r3).call(a,void 0,e[0])}for(r.position={start:t3(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:t3(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:t3(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||r3).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+X4({start:e.start,end:e.end})+`): it’s not open`);n.position.end=t3(e.end)}function u(){return I2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=C2(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function ee(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function te(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Fe(),n.position={start:t3(e.start),end:void 0},t.push(n)),this.stack.push(n)}function ne(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=t3(e.end)}function re(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=t3(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(te.call(this,e),ne.call(this,e))}function ie(){this.data.atHardBreak=!0}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function w(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function se(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ce(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function le(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Wxe(t),n.identifier=C2(t).toLowerCase()}function ue(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function de(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function fe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function pe(){this.data.inReference=void 0}function me(){this.data.referenceType=`collapsed`}function he(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=C2(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ge(e){this.data.characterReferenceType=e.type}function _e(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Q2(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Z2(t);let i=this.stack[this.stack.length-1];i.value+=r}function ve(e){let t=this.stack.pop();t.position.end=t3(e.end)}function ye(e){ne.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function be(e){ne.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function xe(){return{type:`blockquote`,children:[]}}function Se(){return{type:`code`,lang:null,meta:null,value:``}}function Ce(){return{type:`inlineCode`,value:``}}function we(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function Te(){return{type:`emphasis`,children:[]}}function Ee(){return{type:`heading`,depth:0,children:[]}}function De(){return{type:`break`}}function Oe(){return{type:`html`,value:``}}function ke(){return{type:`image`,title:null,url:``,alt:null}}function Ae(){return{type:`link`,title:null,url:``,children:[]}}function je(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ne(){return{type:`paragraph`,children:[]}}function Pe(){return{type:`strong`,children:[]}}function Fe(){return{type:`text`,value:``}}function Ie(){return{type:`thematicBreak`}}}function t3(e){return{line:e.line,column:e.column,offset:e.offset}}function n3(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?n3(e,r):jwe(e,r)}}function jwe(e,t){let n;for(n in t)if(e3.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function r3(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+X4({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+X4({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+X4({start:t.start,end:t.end})+`) is still open`)}function Mwe(e){let t=this;t.parser=n;function n(n){return kwe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Nwe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Pwe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
122
|
-
`}]}function Fwe(e,t){let n=t.value?t.value+`
|
|
123
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Iwe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lwe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rwe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=y4(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function zwe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bwe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function i3(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Vwe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return i3(e,t);let i={src:y4(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Hwe(e,t){let n={src:y4(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Uwe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Wwe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return i3(e,t);let i={href:y4(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Gwe(e,t){let n={href:y4(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Kwe(e,t,n){let r=e.all(t),i=n?qwe(n):a3(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
124
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
125
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function qwe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=a3(n[r])}return t}function a3(e){return e.spread??e.children.length>1}function Jwe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Ywe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xwe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Zwe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qwe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=t0(t.children[1]),o=e0(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function $we(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function eTe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var o3=9,s3=32;function tTe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(c3(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(c3(t.slice(i),i>0,!1)),a.join(``)}function c3(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===o3||t===s3;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===o3||t===s3;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function nTe(e,t){let n={type:`text`,value:tTe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function rTe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var iTe={blockquote:Nwe,break:Pwe,code:Fwe,delete:Iwe,emphasis:Lwe,footnoteReference:Rwe,heading:zwe,html:Bwe,imageReference:Vwe,image:Hwe,inlineCode:Uwe,linkReference:Wwe,link:Gwe,listItem:Kwe,list:Jwe,paragraph:Ywe,root:Xwe,strong:Zwe,table:Qwe,tableCell:eTe,tableRow:$we,text:nTe,thematicBreak:rTe,toml:l3,yaml:l3,definition:l3,footnoteDefinition:l3};function l3(){}function aTe(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function oTe(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function sTe(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||aTe,r=e.options.footnoteBackLabel||oTe,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=y4(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...$1(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
126
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
127
|
-
`}]}}var u3={}.hasOwnProperty,cTe={};function lTe(e,t){let n=t||cTe,r=new Map,i=new Map,a={all:s,applyData:dTe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...iTe,...n.handlers},one:o,options:n,patch:uTe,wrap:pTe};return F2(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(u3.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=$1(n);return r.children=a.all(e),r}return $1(e)}return(a.options.unknownHandler||fTe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=d3(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=d3(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function uTe(e,t){e.position&&(t.position=r0(e))}function dTe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,$1(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function fTe(e,t){let n=t.data||{},r=`value`in t&&!(u3.call(n,`hProperties`)||u3.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pTe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
128
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
129
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
130
|
-
`}),n}function d3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function f3(e,t){let n=lTe(e,t),r=n.one(e,void 0),i=sTe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
131
|
-
`},i)),a}function mTe(e,t){return e&&`run`in e?async function(n,r){let i=f3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return f3(n,{file:r,...e||t})}}function p3(e){if(e)throw e}var hTe=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function m3(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function gTe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?_Te(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function _Te(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var h3=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=X4(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};h3.prototype.file=``,h3.prototype.name=``,h3.prototype.reason=``,h3.prototype.message=``,h3.prototype.stack=``,h3.prototype.column=void 0,h3.prototype.line=void 0,h3.prototype.ancestors=void 0,h3.prototype.cause=void 0,h3.prototype.fatal=void 0,h3.prototype.place=void 0,h3.prototype.ruleId=void 0,h3.prototype.source=void 0;var g3={basename:vTe,dirname:yTe,extname:bTe,join:xTe,sep:`/`};function vTe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);_3(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function yTe(e){if(_3(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function bTe(e){_3(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function xTe(...e){let t=-1,n;for(;++t<e.length;)_3(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:STe(n)}function STe(e){_3(e);let t=e.codePointAt(0)===47,n=CTe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function CTe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function _3(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var wTe={cwd:TTe};function TTe(){return`/`}function v3(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ETe(e){if(typeof e==`string`)e=new URL(e);else if(!v3(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return DTe(e)}function DTe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var y3=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],OTe=class{constructor(e){let t;t=e?v3(e)?{path:e}:typeof e==`string`||kTe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:wTe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<y3.length;){let e=y3[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)y3.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?g3.basename(this.path):void 0}set basename(e){x3(e,`basename`),b3(e,`basename`),this.path=g3.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?g3.dirname(this.path):void 0}set dirname(e){S3(this.basename,`dirname`),this.path=g3.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?g3.extname(this.path):void 0}set extname(e){if(b3(e,`extname`),S3(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=g3.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){v3(e)&&(e=ETe(e)),x3(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?g3.basename(this.path,this.extname):void 0}set stem(e){x3(e,`stem`),b3(e,`stem`),this.path=g3.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new h3(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function b3(e,t){if(e&&e.includes(g3.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+g3.sep+"`")}function x3(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function S3(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function kTe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ATe=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),C3=l(hTe(),1),jTe={}.hasOwnProperty,MTe=new class e extends ATe{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=gTe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,C3.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(E3(`data`,this.frozen),this.namespace[e]=t,this):jTe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(E3(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=k3(e),n=this.parser||this.Parser;return w3(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),w3(`process`,this.parser||this.Parser),T3(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=k3(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);PTe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),w3(`processSync`,this.parser||this.Parser),T3(`processSync`,this.compiler||this.Compiler),this.process(e,r),O3(`processSync`,`process`,t),n;function r(e,r){t=!0,p3(e),n=r}}run(e,t,n){D3(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=k3(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),O3(`runSync`,`run`,n),r;function i(e,t){p3(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=k3(t),r=this.compiler||this.Compiler;return T3(`stringify`,r),D3(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(E3(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,C3.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];m3(o)&&m3(r)&&(r=(0,C3.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function w3(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function T3(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function E3(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function D3(e){if(!m3(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function O3(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function k3(e){return NTe(e)?e:new OTe(e)}function NTe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function PTe(e){return typeof e==`string`||FTe(e)}function FTe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ITe=MTe().use(Mwe).use(twe).use(mTe).use(Qve).use(mbe),A3=400,j3=new A$(A3),M3=new A$(A3),N3=new A$(A3),P3=new Map;function F3(e,t){return`${t?`t`:`f`}\0${e}`}function LTe(e){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`)}function I3(e,t={}){let n=t.cache??!0;if(n){let t=j3.get(e);if(t!==void 0)return t}let r;try{r=String(ITe.processSync(e))}catch{r=LTe(e)}return n&&j3.set(e,r),r}function RTe(e){return e.match(/language-([\w-]+)/)?.[1]??`text`}function L3(e,t){let n=e.textContent??``;return t?H$(n).text:n}function R3(e,t){let n=e.cloneNode(!0),r=n.querySelector(`code`);return r?r.textContent=t:n.textContent=t,n}function z3(e){let t=document.createElement(`div`);t.className=`code-block`;let n=document.createElement(`button`);return n.type=`button`,n.className=`code-copy`,n.dataset.copyCode=``,n.textContent=`Copy`,t.append(n,e),t}function zTe(e,t){if(typeof document>`u`||!e.includes(`<pre`))return e;let n=document.createElement(`div`);n.innerHTML=e;for(let e of Array.from(n.querySelectorAll(`pre > code`))){let n=e.parentElement;n&&n.replaceWith(z3(R3(n,L3(e,t))))}return n.innerHTML}function B3(e){if(typeof document>`u`||!e.includes(`<table`))return e;let t=document.createElement(`div`);t.innerHTML=e;for(let e of Array.from(t.querySelectorAll(`table`))){if(e.parentElement?.classList.contains(`table-scroll`))continue;let t=document.createElement(`div`);t.className=`table-scroll`,e.replaceWith(t),t.append(e)}return t.innerHTML}async function BTe(e,t){if(typeof document>`u`||!e.includes(`<pre`))return e;let n=document.createElement(`div`);n.innerHTML=e;let r=Array.from(n.querySelectorAll(`pre > code`));return await Promise.all(r.map(async e=>{let n=RTe(e.getAttribute(`class`)??``);try{let r=await f1(L3(e,t),n);if(r){let t=document.createElement(`div`);t.innerHTML=r;let n=t.firstElementChild;n&&e.parentElement?.replaceWith(z3(n));return}}catch{}let r=e.parentElement;r&&r.replaceWith(z3(R3(r,L3(e,t))))})),n.innerHTML}function V3(e,t){return B3(zTe(e,t))}async function VTe(e,t){return B3(await BTe(e,t))}function H3(e,t){let n=F3(e,t),r=M3.get(n);if(r!==void 0)return r;let i=V3(I3(e),t);return M3.set(n,i),i}function HTe(e,t){return N3.get(F3(e,t))}function UTe(e,t){let n=F3(e,t),r=N3.get(n);if(r!==void 0)return Promise.resolve(r);let i=P3.get(n);if(i)return i;let a=VTe(I3(e),t).then(e=>(N3.set(n,e),P3.delete(n),e)).catch(e=>{throw P3.delete(n),e});return P3.set(n,a),a}var WTe=L(`<div class="markdown svelte-1mr3h8f"></div>`);function U3(e,t){D(t,!0);let n=q(t,`trimCodeBlocks`,3,!0),r=q(t,`streaming`,3,!1),i=A(``);async function a(e){let n=e.target;if(!(n instanceof Element))return;let r=n.closest(`button[data-copy-code]`);if(r){let e=r.closest(`.code-block`)?.querySelector(`pre code`)?.textContent??``;if(!e)return;try{await uE(e),t.onCopy?.(!0)}catch{t.onCopy?.(!1)}return}if(!t.onOpenFile)return;let i=n.closest(`a[href]`)?.getAttribute(`href`);if(!i)return;let a=Vme(i);if(!a)return;let o=Hme(a),s=t.linkBasePath?B$(o.path,t.linkBasePath)??o.path:o.path;e.preventDefault(),t.onOpenFile(s,o.line)}function o(e){return e.addEventListener(`click`,a),{destroy(){e.removeEventListener(`click`,a)}}}let s,c,l=0;function u(e,t){return`${t?`trim`:`full`}\0${e}`}function d(){c!==void 0&&(cancelAnimationFrame(c),c=void 0)}function f(e,t){let n=u(e,t);s!==n&&(j(i,V3(I3(e,{cache:!1}),t),!0),s=n,l+=1)}function p(e,t){let n=u(e,t),r=HTe(e,t);if(r!==void 0){j(i,r,!0),s=n,l+=1;return}j(i,H3(e,t),!0),s=n;let a=l+=1;UTe(e,t).then(e=>{a===l&&(j(i,e,!0),s=n)}).catch(()=>{a===l&&(j(i,H3(e,t),!0),s=n)})}rr(()=>{let e=t.text,i=n();if(!r()){d(),p(e,i);return}c===void 0&&(c=requestAnimationFrame(()=>{c=void 0,f(t.text,n())}))}),rr(()=>()=>d());var m=WTe();zi(m,()=>I(i),!0),T(m),Hi(m,e=>o?.(e)),z(e,m),O()}var GTe=L(`<p class="lead svelte-dzmv4a">Summarizing recent work…</p>`),KTe=L(`<p class="lead svelte-dzmv4a"> </p>`),qTe=L(`<div class="compaction-block svelte-dzmv4a"><!></div>`);function JTe(e,t){D(t,!0);function n(e){return e&&typeof e==`object`?e:void 0}let r=k(()=>n(t.notice.details)),i=k(()=>typeof I(r)?.compactedMessages==`number`?I(r).compactedMessages:void 0),a=k(()=>t.notice.reason===`threshold`?`auto compact`:t.notice.reason===`overflow`?`overflow recovery`:`manual`),o=k(()=>t.notice.state===`failed`?`danger`:t.notice.state===`running`?`running`:`good`),s=k(()=>{let e=t.notice.contextTokens??t.notice.tokensBefore;if(!(!e||!t.notice.contextWindow))return Math.round(e/t.notice.contextWindow*100)}),c=k(()=>{let e=(t.notice.summary??t.notice.text??``).trim();if(!e)return``;let n=[];for(let t of e.split(`
|
|
132
|
-
`)){let e=t.trim();if(!e||e.startsWith(`#`)||e.startsWith(`---`)||/^generated locally/i.test(e)||/^treat this as a context checkpoint/i.test(e))continue;let r=e.replace(/^[-*]\s+/,``).replace(/^\d+\.\s+/,``).replace(/^\[[ xX]\]\s+/,``).replace(/\*\*/g,``).trim();if(r&&(n.push(r),n.length>=2))break}let r=n.join(` `);return r.length>180?`${r.slice(0,180).trim()}…`:r}),l=k(()=>{let e=[];return typeof t.notice.tokensBefore==`number`&&e.push({text:`${Zd(t.notice.tokensBefore)} before`}),typeof t.notice.tokensAfter==`number`&&e.push({text:`≈${Zd(t.notice.tokensAfter)} after`}),typeof t.notice.freedTokens==`number`&&t.notice.freedTokens>0&&e.push({text:`${Zd(t.notice.freedTokens)} freed`,tone:`success`}),typeof I(i)==`number`&&e.push({text:`${I(i)} messages`}),typeof I(s)==`number`&&e.push({text:`${I(s)}% context`}),e}),u=k(()=>t.notice.errorMessage?.trim()||`Could not compact this conversation.`);var d=qTe(),f=M(d);{let e=k(()=>t.notice.state===`completed`?void 0:t.notice.state),n=k(()=>t.notice.state===`running`),r=k(()=>({text:I(a)})),i=k(()=>t.notice.state===`failed`?I(u):void 0),s=k(()=>t.notice.state===`completed`?I(l):[]);I1(f,{get status(){return I(e)},get dotTone(){return I(o)},get dotPulse(){return I(n)},badge:`compact`,get arg(){return I(r)},get error(){return I(i)},get meta(){return I(s)},children:(e,n)=>{var r=R(),i=N(r),a=e=>{z(e,GTe())},o=e=>{var t=KTe(),n=M(t,!0);T(t),F(()=>B(n,I(c))),z(e,t)};V(i,e=>{t.notice.state===`running`?e(a):t.notice.state===`completed`&&I(c)&&e(o,1)}),z(e,r)},$$slots:{default:!0}})}T(d),z(e,d),O()}var YTe=L(`<span class="arg svelte-1fs3xlu"> </span>`),XTe=L(`<div class="flex min-w-0 items-center gap-2.5 rounded-md border bg-card px-2.5 py-2"><div class="min-w-0 flex-1 truncate font-mono text-xs text-foreground"> </div> <!> <!></div>`),ZTe=L(`<article class="task-event svelte-1fs3xlu"><div class="task-event-header svelte-1fs3xlu"><!> <span class="badge svelte-1fs3xlu"> </span> <!></div> <!></article>`);function QTe(e,t){D(t,!0);let n=k(()=>Jw(t.notice.status)),r=k(()=>t.notice.exitCode!==void 0&&t.notice.exitCode!==null),i=k(()=>t.notice.event?`task ${t.notice.event}`:`task update`);var a=ZTe(),o=M(a),s=M(o);{let e=k(()=>Yw(t.notice.status));$S(s,{get tone(){return I(n)},get pulse(){return I(e)},size:`xs`,class:`mr-1.5 align-middle`})}var c=P(s,2),l=M(c,!0);T(c);var u=P(c,2),d=e=>{var n=YTe(),r=M(n,!0);T(n),F(()=>B(r,t.notice.taskName)),z(e,n)};V(u,e=>{t.notice.taskName&&e(d)}),T(o);var f=P(o,2),p=e=>{var i=XTe(),a=M(i),o=M(a,!0);T(a);var s=P(a,2),c=e=>{{let n=k(()=>t.notice.exitCode===0?`neutral`:`danger`);of(e,{get tone(){return I(n)},size:`xs`,children:(e,n)=>{E();var r=wi();F(()=>B(r,`exit ${t.notice.exitCode??``}`)),z(e,r)},$$slots:{default:!0}})}},l=e=>{of(e,{tone:`warn`,size:`xs`,children:(e,n)=>{E();var r=wi();F(()=>B(r,`signal ${t.notice.signal??``}`)),z(e,r)},$$slots:{default:!0}})};V(s,e=>{I(r)?e(c):t.notice.signal&&e(l,1)});var u=P(s,2),d=e=>{{let r=k(()=>I(n)===`neutral`?`border-border bg-muted text-muted-foreground`:``);of(e,{get tone(){return I(n)},size:`xs`,get class(){return I(r)},children:(e,n)=>{E();var r=wi();F(()=>B(r,t.notice.status)),z(e,r)},$$slots:{default:!0}})}};V(u,e=>{t.notice.status&&e(d)}),T(i),F(()=>B(o,t.notice.commandPreview??``)),z(e,i)};V(f,e=>{(t.notice.commandPreview||I(r)||t.notice.signal||t.notice.status)&&e(p)}),T(a),F(()=>B(l,I(i))),z(e,a),O()}var $Te=L(`<div class="status-actions svelte-h4d716"><!></div>`),eEe=L(`<article aria-live="polite"><div class="run-status-header svelte-h4d716"><!> <span class="badge svelte-h4d716"> </span> <span class="arg svelte-h4d716"> </span></div> <p class="status-summary svelte-h4d716"> </p> <!></article>`);function tEe(e,t){D(t,!0);let n=A(Mn(Date.now()));rr(()=>{if(t.notice.state!==`retrying`||!t.notice.retryAt)return;j(n,Date.now(),!0);let e=setInterval(()=>{j(n,Date.now(),!0)},250);return()=>clearInterval(e)});let r=k(()=>t.notice.state!==`retrying`&&t.isLast&&!t.sending&&t.notice.retryable===!0&&!!t.notice.entryId&&!!t.onContinueFromFailure),i=k(()=>t.notice.state===`retrying`?`running`:`warn`),a=k(()=>t.notice.state===`retrying`?`retrying`:`run`),o=k(()=>{switch(t.notice.state){case`retrying`:return`model request`;case`interrupted`:return`interrupted`;default:return`failed`}}),s=k(()=>{let e=t.notice.retryAt?Date.parse(t.notice.retryAt):NaN;if(Number.isFinite(e))return Math.max(0,Math.ceil((e-I(n))/1e3));if(typeof t.notice.delayMs==`number`&&t.notice.delayMs>0)return Math.ceil(t.notice.delayMs/1e3)}),c=k(()=>t.notice.errorMessage?.trim()?t.notice.errorMessage.trim():void 0),l=k(()=>typeof t.notice.attempt==`number`&&typeof t.notice.maxRetries==`number`?`attempt ${t.notice.attempt}/${t.notice.maxRetries}`:typeof t.notice.attempt==`number`?`attempt ${t.notice.attempt}`:void 0),u=k(()=>t.notice.state===`retrying`?`${I(c)?`Request failed with ${I(c)}`:`Request failed`}, ${typeof I(s)==`number`?I(s)>0?`retry in ${I(s)}s`:`retrying now`:`retrying soon`}${I(l)?` (${I(l)})`:``}`:t.notice.state===`interrupted`?`${I(c)??`The run was interrupted.`} Click Continue to resume.`:`${I(c)?`Request failed with ${I(c)}`:`Request failed`}. Click Continue to retry.`);function d(){!t.notice.entryId||!I(r)||t.onContinueFromFailure?.(t.notice.entryId)}var f=eEe(),p=M(f),m=M(p);{let e=k(()=>t.notice.state===`retrying`);$S(m,{get tone(){return I(i)},get pulse(){return I(e)},size:`xs`,class:`mr-1.5 align-middle`})}var h=P(m,2),g=M(h,!0);T(h);var _=P(h,2),v=M(_,!0);T(_),T(p);var y=P(p,2),b=M(y,!0);T(y);var x=P(y,2),S=e=>{var t=$Te();Ol(M(t),{size:`sm`,variant:`default`,onclick:d,children:(e,t)=>{E(),z(e,wi(`Continue`))},$$slots:{default:!0}}),T(t),z(e,t)};V(x,e=>{I(r)&&e(S)}),T(f),F(()=>{Qi(f,1,`run-status-line state-${t.notice.state}`,`svelte-h4d716`),B(g,I(a)),B(v,I(o)),B(b,I(u))}),z(e,f),O()}var nEe=L(`<p class="redacted svelte-1ibxuqi">Provider returned redacted thinking.</p>`),rEe=L(`<span class="stream-caret svelte-1ibxuqi" aria-hidden="true"></span>`),iEe=L(`<!> <!>`,1),aEe=L(`<div><!></div>`);function oEe(e,t){D(t,!0);let n=q(t,`live`,3,!1);var r=aEe(),i=M(r),a=e=>{z(e,nEe())},o=e=>{var r=iEe(),i=N(r);U3(i,{get text(){return t.block.text},get onCopy(){return ad}});var a=P(i,2),o=e=>{z(e,rEe())};V(a,e=>{n()&&!t.block.text&&e(o)}),z(e,r)};V(i,e=>{t.block.redacted&&!t.block.text?e(a):e(o,-1)}),T(r),F(()=>Qi(r,1,`thinking-block ${n()?`live`:``}`,`svelte-1ibxuqi`)),z(e,r),O()}var sEe=L(`<span class="stream-caret svelte-9q15cr" aria-hidden="true"></span>`),cEe=L(`<div class="message-content svelte-9q15cr"><!> <!></div>`),lEe=L(`<article><div class="message-body svelte-9q15cr"><!></div></article>`);function uEe(e,t){D(t,!0);let n=q(t,`hydrateToolBodies`,3,!0),r=q(t,`planReviewModels`,19,()=>[]),i=q(t,`planReviewModelKey`,3,``),a=q(t,`planReviewThinkingLevel`,3,`off`);var o=R(),s=N(o),c=e=>{{let o=k(()=>t.toolMenu(t.node.anchorEntryId,t.node.toolCall));F$(e,{get items(){return I(o)},triggerClass:`block min-w-0`,children:(e,o)=>{gve(e,{get toolCall(){return t.node.toolCall},get liveOutput(){return t.node.liveOutput},get pendingUserQuestion(){return t.pendingUserQuestion},get hydrateBody(){return n()},get pendingPlanReview(){return t.pendingPlanReview},get onOpenFile(){return t.onOpenFile},get planReviewModels(){return r()},get planReviewModelKey(){return i()},get planReviewThinkingLevel(){return a()},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})},$$slots:{default:!0}})}},l=e=>{{let n=k(()=>t.activeProject?.dir);Fve(e,{get draft(){return t.node.draft},get cwd(){return I(n)}})}},u=e=>{Lve(e,{get toolName(){return t.node.toolName},get error(){return t.node.error}})},d=e=>{{let n=k(()=>t.node.key===t.lastTimelineKey);tEe(e,{get notice(){return t.node.notice},get isLast(){return I(n)},get sending(){return t.sending},get onContinueFromFailure(){return t.onContinueFromFailure}})}},f=e=>{JTe(e,{get notice(){return t.node.notice}})},p=e=>{QTe(e,{get notice(){return t.node.notice}})},m=e=>{{let n=k(()=>t.messageMenu(t.node.item)),r=k(()=>`select-text ${t.node.item.role===`user`?`user-msg-trigger`:``}`);F$(e,{get items(){return I(n)},get triggerClass(){return I(r)},children:(e,n)=>{var r=lEe(),i=M(r),a=M(i),o=e=>{{let n=k(()=>({text:t.node.item.text,redacted:t.node.item.redacted})),r=k(()=>t.node.item.live&&!t.node.item.done);oEe(e,{get block(){return I(n)},get live(){return I(r)}})}},s=e=>{var n=cEe(),r=M(n);{let e=k(()=>t.node.item.role!==`assistant`),n=k(()=>!!(t.node.item.live&&!t.node.item.done)),i=k(()=>t.activeProject?.dir);U3(r,{get text(){return t.node.item.text},get trimCodeBlocks(){return I(e)},get streaming(){return I(n)},get linkBasePath(){return I(i)},get onOpenFile(){return t.onOpenFile},get onCopy(){return ad}})}var i=P(r,2),a=e=>{z(e,sEe())};V(i,e=>{t.node.item.live&&!t.node.item.done&&e(a)}),T(n),z(e,n)};V(a,e=>{t.node.item.displayKind===`thinking`?e(o):t.node.item.text&&e(s,1)}),T(i),T(r),F(()=>Qi(r,1,`transcript-entry ${t.node.item.role} ${t.node.item.displayKind===`thinking`?`thinking-entry`:``} ${t.node.item.live?`streaming`:``}`,`svelte-9q15cr`)),z(e,r)},$$slots:{default:!0}})}};V(s,e=>{t.node.kind===`tool`?e(c):t.node.kind===`tool_draft`?e(l,1):t.node.kind===`tool_result_error`?e(u,2):t.node.kind===`run_status`?e(d,3):t.node.kind===`compaction`?e(f,4):t.node.kind===`task_event`?e(p,5):e(m,-1)}),z(e,o),O()}var dEe=L(`<div class="prompt-project svelte-phh39z"><!> <span class="prompt-project-label svelte-phh39z">Project:</span> <span class="prompt-project-path svelte-phh39z"> </span></div>`),fEe=L(`<div class="empty-run-wrap svelte-phh39z"><div class="empty-run svelte-phh39z"><div class="prompt-line svelte-phh39z"><span class="prompt-sigil svelte-phh39z">nerve</span> <span class="prompt-arrow svelte-phh39z">❯</span> <span class="prompt-caret svelte-phh39z" aria-hidden="true"></span></div> <span class="prompt-hint svelte-phh39z">Type below to wake the agent.</span> <!></div></div>`),pEe=L(`<article class="transcript-entry assistant streaming waiting-entry svelte-phh39z"><div class="message-body svelte-phh39z"><div class="message-content streaming-content svelte-phh39z"><span class="stream-caret svelte-phh39z" aria-hidden="true"></span></div></div></article>`),mEe=L(`<div class="queued-prompt svelte-phh39z"><!> <span class="queued-label svelte-phh39z">Queued</span> <span class="queued-text svelte-phh39z"> </span></div>`);function hEe(e,t){D(t,!0);let n=q(t,`controller`,15),r=q(t,`atEnd`,15,!0),i=q(t,`paddingEnd`,3,0),a=q(t,`followBottom`,3,!0),o=q(t,`active`,3,!0),s=q(t,`planReviewModels`,19,()=>[]),c=q(t,`planReviewModelKey`,3,``),l=q(t,`planReviewThinkingLevel`,3,`off`),u=k(()=>{let e=t.timeline.map(e=>({kind:`timeline`,key:e.key,node:e}));t.sending&&!t.hasLiveTimelineNodes&&e.push({kind:`waiting`,key:`__waiting__`});for(let n of t.queuedPrompts)e.push({kind:`queued`,key:`__queued__:${n.id}`,prompt:n});return e}),d=k(()=>t.timeline.length===0&&!t.streamingText&&!t.sending);var f=R(),p=N(f),m=e=>{var n=fEe(),r=M(n),i=P(M(r),4),a=e=>{var n=dEe(),r=M(n);S$(r,{size:13,strokeWidth:2.2,"aria-hidden":`true`});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>{W(n,`title`,t.activeProject?.dir),W(n,`aria-label`,`Conversation will be created in project ${t.activeProject?.dir}`),B(a,t.activeProjectLabel)}),z(e,n)};V(i,e=>{t.activeProjectLabel&&e(a)}),T(r),T(n),z(e,n)},h=e=>{M$(e,{get items(){return I(u)},getKey:e=>e.key,get heightCacheKey(){return t.heightCacheKey},contentVisibility:!0,estimateSize:()=>120,overscan:10,anchor:`end`,get followOutput(){return a()},scrollEndThreshold:32,paddingStart:12,get paddingEnd(){return i()},gap:2,viewportClass:`transcript-viewport`,get controller(){return n()},set controller(e){n(e)},get atEnd(){return r()},set atEnd(e){r(e)},row:(e,n)=>{let r=()=>n?.().item;var i=R(),a=N(i),u=e=>{uEe(e,{get node(){return r().node},get sending(){return t.sending},get hydrateToolBodies(){return o()},get activeProject(){return t.activeProject},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get lastTimelineKey(){return t.lastTimelineKey},get planReviewModels(){return s()},get planReviewModelKey(){return c()},get planReviewThinkingLevel(){return l()},get onOpenFile(){return t.onOpenFile},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview},get onContinueFromFailure(){return t.onContinueFromFailure},get messageMenu(){return t.messageMenu},get toolMenu(){return t.toolMenu}})},d=e=>{z(e,pEe())},f=e=>{var t=mEe(),n=M(t);Vpe(n,{size:14,strokeWidth:2.2});var i=P(n,4),a=M(i,!0);T(i),T(t),F(()=>B(a,r().prompt.text)),z(e,t)};V(a,e=>{r().kind===`timeline`?e(u):r().kind===`waiting`?e(d,1):e(f,-1)}),z(e,i)},$$slots:{row:!0}})};V(p,e=>{I(d)?e(m):e(h,-1)}),z(e,f),O()}var gEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function W3(e,t){let n=G(t,gEe),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`m12 5 7 7-7 7`}]];ic(e,K({name:`arrow-right`},()=>n,{get iconNode(){return r}}))}var _Ee=new Set([`$$slots`,`$$events`,`$$legacy`]);function vEe(e,t){let n=G(t,_Ee),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}]];ic(e,K({name:`clipboard`},()=>n,{get iconNode(){return r}}))}var yEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function G3(e,t){let n=G(t,yEe),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];ic(e,K({name:`copy`},()=>n,{get iconNode(){return r}}))}var bEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function xEe(e,t){let n=G(t,bEe),r=[[`path`,{d:`M17 5H3`}],[`path`,{d:`M21 12H8`}],[`path`,{d:`M21 19H8`}],[`path`,{d:`M3 12v7`}]];ic(e,K({name:`text-quote`},()=>n,{get iconNode(){return r}}))}function K3(e){if(e)return e.split(`:thinking:`)[0]}function SEe(e,t){let n=K3(e);return n?t.get(n):void 0}function CEe(e,t){let n=K3(e.id);return n?t.get(n):void 0}function wEe(e,t){let n=K3(e.id),r=!!(n&&t.treeEntriesById.has(n)),i=CEe(e,t.treeEntriesById),a=[];return r&&(a.push({label:`Continue from here`,icon:W3,onSelect:()=>t.onNavigateToEntry?.(n)},{label:`Fork from before this message`,icon:Td,onSelect:()=>t.onNavigateToEntry?.(SEe(e.id,t.parentEntryIdById))}),i?.role===`user`&&a.push({label:`Edit & resend`,icon:JQ,onSelect:()=>t.onEditEntry?.(i)}),a.push({type:`separator`})),a.push({label:`Copy text`,icon:vEe,onSelect:()=>void t.copyText(e.text)},{label:`Quote in composer`,icon:xEe,onSelect:()=>t.quoteInComposer(e.text)}),e.id&&(a.push({type:`separator`}),a.push({label:`Copy message id`,icon:G3,onSelect:()=>void t.copyText(e.id??``,`message id`)})),t.onOpenHistory&&(a.push({type:`separator`}),a.push({label:`Show branch history`,icon:Td,onSelect:t.onOpenHistory})),a}function TEe(e,t,n){let r=[];return e&&(r.push({label:`Continue after this tool result`,icon:W3,onSelect:()=>n.onNavigateToEntry?.(e)}),r.push({type:`separator`})),r.push({label:`Copy tool id`,icon:G3,onSelect:()=>void n.copyText(t.id,`tool id`)}),n.onOpenHistory&&(r.push({type:`separator`}),r.push({label:`Show branch history`,icon:Td,onSelect:n.onOpenHistory})),r}function EEe({atEnd:e,scrollDelta:t,userScrollAwayIntent:n,scrollbarPointerActive:r,epsilon:i=1}){return e?!1:r?!0:n&&t<-i}var q3=30,DEe=2400,J3=32,Y3=100,OEe=350,kEe=120,AEe=1,jEe=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),MEe=new Set([`ArrowUp`,`Home`,`PageUp`]);function X3(e){return Math.max(e.scrollHeight-e.clientHeight-e.scrollTop,0)}function Z3(e,t=J3){return X3(e)<=t}function NEe(e,t){if(t.scrollHeight<=t.clientHeight)return!1;let n=t.offsetWidth-t.clientWidth;if(n<=0)return!1;let r=t.getBoundingClientRect();return e.clientX>=r.right-n&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom}function PEe(e){let t=A(void 0),n=A(0),r=A(void 0),i=A(!0),a=A(!0),o,s=!1,c=!1,l,u=!1,d,f=!1,p;function m(){d!==void 0&&(clearTimeout(d),d=void 0)}function h(){p!==void 0&&(clearTimeout(p),p=void 0)}function g(){f=!0,h(),p=setTimeout(()=>{f=!1,p=void 0},kEe)}function _(){l!==void 0&&(cancelAnimationFrame(l),l=void 0)}function v(e){g(),I(r)?.scrollToEnd(e)}function y(e){let t=I(r);if(e){if(Z3(e,J3)){j(a,!0);return}u&&X3(e)>Y3&&(j(a,!1),_());return}if(t?.isAtEnd(J3)){j(a,!0);return}u&&(t?.getDistanceFromEnd()??0)>Y3&&(j(a,!1),_())}function b(){j(a,!1),_()}function x(e){f||(u=e?.scrollAwayIntent??!!e?.disableFollowImmediately,e?.disableFollowImmediately&&b(),m(),d=setTimeout(()=>{u=!1,d=void 0},OEe),requestAnimationFrame(()=>y(e?.viewport)))}function S(){let e=I(r);e&&(j(a,!0),e.getDistanceFromEnd()<=DEe?v({behavior:`smooth`}):ee())}function ee(){_(),j(a,!0);let e=0,t=()=>{l=void 0,e+=1;let n=I(r);if(!n){e<q3&&(l=requestAnimationFrame(t));return}v({behavior:`instant`}),!n.isAtEnd(J3)&&e<q3&&(l=requestAnimationFrame(t))};l=requestAnimationFrame(t)}return rr(()=>{if(!I(i))return;let e=I(r)?.getViewportElement();e&&!Z3(e,J3)||j(a,!0)}),rr(()=>{let t=e.active?.()??!0,n=e.conversationId(),r=e.contentReady(),i=t&&!s;if(s=t,n!==o&&(o=n,c=!1,j(a,!0),_()),!t){_();return}if(!(!e.conversationOpen()||!n||!r)){if(!c){c=!0,Jr().then(ee);return}i&&I(a)&&Jr().then(ee)}}),rr(()=>{let r=I(t),i=e.active?.()??!0;if(!r||typeof ResizeObserver>`u`)return;let a=()=>{j(n,i?r.offsetHeight:0,!0)};a();let o=new ResizeObserver(a);return o.observe(r),()=>o.disconnect()}),rr(()=>{let e=I(r)?.getViewportElement();if(!e)return;let t=e.scrollTop,n=!1,i=()=>{let r=e.scrollTop,i=r-t;if(t=r,f)return;let o=Z3(e,J3);if(o){j(a,!0);return}EEe({atEnd:o,scrollDelta:i,userScrollAwayIntent:u,scrollbarPointerActive:n,epsilon:AEe})&&b()},o=t=>{n=NEe(t,e),n&&x({disableFollowImmediately:!0,viewport:e})},s=()=>{n&&x({disableFollowImmediately:!0,viewport:e})},c=()=>{n&&Z3(e,J3)&&j(a,!0),n=!1},l=t=>{let n=t.deltaY<0;x({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})},d=()=>{x({disableFollowImmediately:!0,viewport:e})},p=t=>{if(!jEe.has(t.key))return;let n=MEe.has(t.key)||t.key===` `&&t.shiftKey;x({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})};return e.addEventListener(`scroll`,i,{passive:!0}),e.addEventListener(`wheel`,l,{passive:!0}),e.addEventListener(`touchmove`,d,{passive:!0}),e.addEventListener(`pointerdown`,o,{passive:!0}),e.addEventListener(`pointermove`,s,{passive:!0}),e.addEventListener(`pointerup`,c,{passive:!0}),e.addEventListener(`pointerleave`,c,{passive:!0}),e.addEventListener(`keydown`,p),()=>{e.removeEventListener(`scroll`,i),e.removeEventListener(`wheel`,l),e.removeEventListener(`touchmove`,d),e.removeEventListener(`pointerdown`,o),e.removeEventListener(`pointermove`,s),e.removeEventListener(`pointerup`,c),e.removeEventListener(`pointerleave`,c),e.removeEventListener(`keydown`,p)}}),rr(()=>()=>{_(),m(),h(),u=!1,f=!1}),{get composerWrapEl(){return I(t)},set composerWrapEl(e){j(t,e,!0)},get composerHeight(){return I(n)},get controller(){return I(r)},set controller(e){j(r,e,!0)},get atEnd(){return I(i)},set atEnd(e){j(i,e,!0)},get followBottom(){return I(a)},scrollToEnd:v,jumpToBottom:S}}var FEe=L(`<div class="scroll-bottom-button-wrap svelte-x6qg8k"><!></div>`),IEe=L(`<div class="transcript svelte-x6qg8k" role="log" aria-label="Conversation transcript" aria-live="polite"><!></div> <!> <div class="composer-wrap svelte-x6qg8k"><!></div>`,1),LEe=L(`<div class="empty-center svelte-x6qg8k"><div class="prompt-line svelte-x6qg8k" aria-label="Nerve prompt"><span class="prompt-sigil svelte-x6qg8k">nerve</span> <span class="prompt-arrow svelte-x6qg8k">❯</span> <span class="prompt-caret svelte-x6qg8k" aria-hidden="true"></span></div> <span class="prompt-hint svelte-x6qg8k">Open a conversation or start a new one.</span> <!></div>`),REe=L(`<section class="conversation-pane svelte-x6qg8k"><!></section>`);function zEe(e,t){D(t,!0);let n=q(t,`pendingConversationActive`,3,!1),r=q(t,`approvals`,19,()=>[]),i=q(t,`active`,3,!0),a=q(t,`transcript`,19,()=>[]),o=q(t,`toolCalls`,19,()=>[]),s=q(t,`treeNodes`,19,()=>[]),c=q(t,`streamingText`,3,``),l=q(t,`queuedPrompts`,19,()=>[]),u=q(t,`live`,3,!1),d=q(t,`sending`,3,!1),f=q(t,`composerText`,3,``),p=q(t,`models`,19,()=>[]),m=q(t,`selectedModelKey`,3,``),h=q(t,`planReviewModels`,19,()=>[]),g=q(t,`planReviewModelKey`,3,``),_=q(t,`planReviewThinkingLevel`,3,`off`),v=q(t,`contextWindow`,3,0),y=q(t,`composerFocusToken`,3,0),b=q(t,`composerEscapeToken`,3,0),x=q(t,`micShortcutToken`,3,0),S=q(t,`thinkingLevel`,3,`off`),ee=q(t,`mode`,3,`coding`),C=q(t,`permissionLevel`,3,`autonomous`),te=q(t,`slashCompletions`,19,()=>[]),ne=q(t,`gitSuggestions`,19,()=>[]),re=k(()=>!!(t.activeConversation||n())),ie=k(()=>t.activeProject?pE(t.activeProject.dir,t.homeDir):void 0),ae=k(()=>BE(a(),o())),oe=k(()=>UE(t.liveState,I(ae).context)),w=k(()=>HE(I(ae).items,t.liveState)),se=k(()=>[...I(w),...I(oe)]),ce=k(()=>t.liveState?.compaction?.state===`running`),le=k(()=>new Map(s().map(e=>[e.entry.id,e.entry]))),ue=k(()=>new Map(s().map(e=>[e.entry.id,e.entry.parentEntryId]))),de=k(()=>I(se).at(-1)?.key),fe=k(()=>I(oe).length>0||o().some(e=>e.status===`running`)),pe=k(()=>t.activeConversation?.id??(n()?t.activePendingConversation?.id??`pending`:void 0)),me=PEe({active:()=>i(),conversationOpen:()=>I(re),conversationId:()=>I(pe),contentReady:()=>I(se).length>0});async function he(e,t=`message`){try{await uE(e),id.success(`Copied ${t}`)}catch{id.error(`Could not copy to clipboard`)}}function ge(e){let n=e.split(`
|
|
133
|
-
`).map(e=>`> ${e}`).join(`
|
|
134
|
-
`),r=f()?`${f()}\n\n`:``;t.onComposerChange?.(`${r}${n}\n\n`)}function _e(e){return wEe(e,{treeEntriesById:I(le),parentEntryIdById:I(ue),copyText:he,quoteInComposer:ge,onNavigateToEntry:t.onNavigateToEntry,onEditEntry:t.onEditEntry,onOpenHistory:t.onOpenHistory})}function ve(e,n){return TEe(e,n,{copyText:he,quoteInComposer:ge,onNavigateToEntry:t.onNavigateToEntry,onEditEntry:t.onEditEntry,onOpenHistory:t.onOpenHistory})}var ye=REe(),be=M(ye),xe=e=>{var a=IEe(),o=N(a),s=M(o);{let e=k(()=>i()?me.followBottom:!1);hEe(s,{paddingEnd:18,get heightCacheKey(){return I(pe)},get timeline(){return I(se)},get streamingText(){return c()},get sending(){return d()},get hasLiveTimelineNodes(){return I(fe)},get queuedPrompts(){return l()},get followBottom(){return I(e)},get activeProject(){return t.activeProject},get activeProjectLabel(){return I(ie)},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get active(){return i()},get planReviewModels(){return h()},get planReviewModelKey(){return g()},get planReviewThinkingLevel(){return _()},get lastTimelineKey(){return I(de)},get onOpenFile(){return t.onOpenFile},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview},get onContinueFromFailure(){return t.onContinueFromFailure},messageMenu:_e,toolMenu:ve,get controller(){return me.controller},set controller(e){me.controller=e},get atEnd(){return me.atEnd},set atEnd(e){me.atEnd=e}})}T(o);var re=P(o,2),ae=e=>{var t=FEe();Ol(M(t),{class:`rounded-full`,variant:`secondary`,size:`icon-sm`,ariaLabel:`Scroll to latest`,title:`Scroll to latest`,onclick:()=>me.jumpToBottom(),children:(e,t)=>{lE(e,{size:16,strokeWidth:2.4})},$$slots:{default:!0}}),T(t),F(()=>ea(t,`bottom: ${me.composerHeight+8}px;`)),z(e,t)};V(re,e=>{i()&&!me.atEnd&&me.composerHeight>0&&e(ae)});var oe=P(re,2);Rpe(M(oe),{get text(){return f()},get activeProject(){return t.activeProject},get activeConversation(){return t.activeConversation},get activePendingConversation(){return t.activePendingConversation},get pendingConversationActive(){return n()},get approvals(){return r()},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get interactive(){return i()},get live(){return u()},get sending(){return d()},get compacting(){return I(ce)},get models(){return p()},get selectedModelKey(){return m()},get contextUsage(){return t.contextUsage},get contextWindow(){return v()},get focusToken(){return y()},get composerEscapeToken(){return b()},get micShortcutToken(){return x()},get thinkingLevel(){return S()},get mode(){return ee()},get permissionLevel(){return C()},get slashCompletions(){return te()},get fileCompletions(){return t.fileCompletions},get gitSuggestions(){return ne()},get onSendGitSuggestion(){return t.onSendGitSuggestion},get onDraftGitSuggestion(){return t.onDraftGitSuggestion},get onChange(){return t.onComposerChange},get onSubmit(){return t.onSubmit},get onAbort(){return t.onAbort},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get onModeChange(){return t.onModeChange},get onPermissionChange(){return t.onPermissionChange},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval}}),T(oe),Ta(oe,e=>me.composerWrapEl=e,()=>me?.composerWrapEl),z(e,a)},Se=e=>{var n=LEe();Ol(P(M(n),4),{class:`empty-action`,variant:`ghost`,size:`sm`,get onclick(){return t.onOpenProject},children:(e,t)=>{E(),z(e,wi(`New chat`))},$$slots:{default:!0}}),T(n),z(e,n)};V(be,e=>{I(re)?e(xe):e(Se,-1)}),T(ye),z(e,ye),O()}var Q3=Mn({focusToken:0,escapeToken:0,micToken:0,historyDialogOpen:!1});function $3(){Q3.focusToken+=1}function BEe(){Q3.escapeToken+=1}function VEe(){Q3.micToken+=1}function HEe(){Q3.historyDialogOpen=!0}var e6=new yo({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}),t6={clientConfig:[`client-config`],workspace:[`workspace`],slashCompletions:[`completions`,`slash`],fileCompletions:(e,t)=>[`completions`,`files`,e??`none`,t]};function UEe(e,t={}){if(!e)return{messages:[],toolDrafts:[],toolOutputByToolCallId:{}};let n=new Set(t.excludeLiveMessageIds??[]),r=e.turns.map(e=>({...e,messages:e.messages.filter(e=>!n.has(e.liveMessageId))})),i=r.flatMap(e=>e.messages.flatMap(e=>e.blocks.flatMap(t=>t.kind===`tool_call_draft`?[]:[{id:`live:${e.liveMessageId}:${t.kind}:${t.contentIndex}`,role:`assistant`,displayKind:t.kind===`thinking`?`thinking`:`message`,text:t.text,createdAt:e.startedAt,contentIndex:t.contentIndex,live:!t.done,done:t.done,redacted:t.redacted}]))),a=r.flatMap(t=>t.messages.flatMap(t=>t.blocks.flatMap(n=>n.kind===`tool_call_draft`?[{kind:`tool_call_draft`,key:`live:${t.liveMessageId}:tool-draft:${n.contentIndex}`,runId:e.runId,conversationId:e.conversationId,contentIndex:n.contentIndex,providerToolCallId:n.providerToolCallId,toolName:n.toolName,argsText:n.argsText,args:n.args,progress:n.progress,done:n.done,createdAt:t.startedAt,updatedAt:t.startedAt}]:[])));return{runId:e.runId,messages:i,toolDrafts:a,toolOutputByToolCallId:e.toolOutputsByToolCallId,runStatus:e.retry?{conversationId:e.conversationId,agentId:e.agentId,runId:e.runId,state:`retrying`,...e.retry}:void 0,hiddenEntryIds:e.retry?.failedEntryId?[e.retry.failedEntryId]:void 0}}function n6(e){return e.messages.filter(e=>e.displayKind!==`thinking`).sort((e,t)=>(e.contentIndex??0)-(t.contentIndex??0)).map(e=>e.text).join(`
|
|
135
|
-
`)}var WEe=/^\[Tool call:[\s\S]*\]$/;function r6(e){return typeof e==`string`&&e.length>0?e:void 0}function i6(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function GEe(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.text==`string`?t.text:``,r=t.redacted===!0;return n.length>0||r?[{text:n,redacted:r}]:[]}):[]}function a6(e){return e.details&&typeof e.details==`object`?e.details:void 0}function o6(e){let t=a6(e),n=t?.details&&typeof t.details==`object`?t.details:void 0,r=n?.toolCall&&typeof n.toolCall==`object`?n.toolCall:void 0;return{toolCallId:r6(t?.toolCallId),toolRecordId:i6(t?.toolRecordId)??i6(r?.id),toolName:r6(t?.toolName),isToolError:t?.isError===!0}}function s6(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function KEe(e){return e===`manual`||e===`threshold`||e===`overflow`?e:void 0}function qEe(e){if(e.kind!==`compaction`)return;let t=a6(e),n=t?.policy&&typeof t.policy==`object`?t.policy:void 0,r=s6(t?.tokensAfter),i=s6(t?.freedTokens)??(typeof e.tokensBefore==`number`&&typeof r==`number`?Math.max(0,e.tokensBefore-r):void 0);return{id:e.id,state:`completed`,reason:KEe(t?.reason),entryId:e.id,conversationId:e.conversationId,agentId:r6(e.agentId),runId:r6(e.runId),text:e.text,summary:e.summary??e.text,tokensBefore:e.tokensBefore,tokensAfter:r,freedTokens:i,contextWindow:s6(n?.contextWindow),thresholdTokens:s6(n?.thresholdTokens),triggerReserveTokens:s6(n?.triggerReserveTokens),keepRecentTokens:s6(n?.keepRecentTokens),firstKeptEntryId:r6(e.firstKeptEntryId),details:e.details,createdAt:e.createdAt,completedAt:e.createdAt}}function JEe(e){if(e.kind!==`run_status`)return;let t=a6(e);if(t?.type!==`agent_run_retry_status`)return;let n=t.state;if(!(n!==`retrying`&&n!==`retry_exhausted`&&n!==`failed`&&n!==`interrupted`))return{entryId:e.id,conversationId:e.conversationId,agentId:r6(e.agentId),runId:r6(t.runId)??e.runId,state:n,failedEntryId:r6(t.failedEntryId),attempt:typeof t.attempt==`number`?t.attempt:void 0,maxRetries:typeof t.maxRetries==`number`?t.maxRetries:void 0,delayMs:typeof t.delayMs==`number`?t.delayMs:void 0,retryAt:r6(t.retryAt),errorMessage:r6(t.errorMessage),retryable:t.retryable===!0,createdAt:e.createdAt}}function YEe(e){if(e.kind!==`task_event`)return;let t=a6(e);if(t?.type===`task_event`)return{entryId:e.id,conversationId:e.conversationId,agentId:r6(e.agentId),runId:r6(e.runId),taskId:r6(t.taskId),taskName:r6(t.taskName),groupId:r6(t.groupId),groupName:r6(t.groupName),event:r6(t.event),status:r6(t.status),exitCode:s6(t.exitCode),signal:r6(t.signal),commandPreview:r6(t.commandPreview),nextCursor:s6(t.nextCursor),createdAt:e.createdAt}}function c6(e){let t=qEe(e);if(t)return[{id:e.id,runId:e.runId,role:`system`,kind:e.kind,displayKind:`message`,text:e.summary??e.text,createdAt:e.createdAt,compaction:t}];let n=JEe(e);if(n)return[{id:e.id,role:`system`,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,runStatus:n}];let r=YEe(e);if(r)return[{id:e.id,runId:e.runId,role:`system`,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,taskEvent:r}];let i=a6(e),a=o6(e),o=i?.stopReason===`error`||i?.stopReason===`aborted`?i.stopReason:void 0,s=r6(i?.errorMessage),c=[],l=GEe(i?.thinkingBlocks);for(let[t,n]of l.entries())c.push({id:`${e.id}:thinking:${t}`,runId:e.runId,role:`assistant`,kind:e.kind,displayKind:`thinking`,text:n.text,redacted:n.redacted,createdAt:e.createdAt,stopReason:o,errorMessage:s});return(!(e.role===`assistant`&&WEe.test(e.text.trim()))||e.role!==`assistant`)&&c.push({id:e.id,runId:e.runId,role:e.role,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,usage:e.usage,stopReason:o,errorMessage:s,...a}),c}function XEe(e){if(e.role===`user`||e.role===`assistant`||e.kind!==`message`)return!0;let t=o6(e);return!!(t.toolCallId||t.toolRecordId)}function ZEe(e){return e.filter(XEe).flatMap(c6)}function QEe(e){return Y.agents.find(t=>t.id===e.activeAgentId||t.conversationId===e.id)}async function $Ee(e){return Y.projects.find(t=>t.id===e.projectId)??(await xw(`/api/projects/${_w(e.projectId)}`)).project}async function eDe(e){hT.conversationId=e.id,hT.projectId=e.projectId;let t=QEe(e);hT.agentId=e.activeAgentId??t?.id,hT.entryId=e.activeEntryId,gT.projectDir=(await $Ee(e)).dir,t?.model&&(yT.selectedModelKey=YT(t.model)),yT.selectedThinkingLevel=t?.thinkingLevel??`off`,yT.selectedMode=t?.mode??e.mode,yT.selectedPermissionLevel=t?.permissionLevel??e.permissionLevel}async function l6(e){let t=kD(e);t.loading=!0;try{let n=await kw(e);t.activeEntryId=n.tree.activeEntryId,t.activeEntryIds=n.activeEntryIds,t.transcript=ZEe(n.entries),t.toolCalls=n.toolCalls,t.treeNodes=n.tree.nodes,t.activeRun=n.activeRun,t.queuedPrompts=n.activeRun?.queuedPrompts??[],t.contextUsage=n.contextUsage,t.cursorSeq=n.cursorSeq,Y.conversations=Y.conversations.map(t=>t.id===e?n.conversation:t);let r=new Set(n.entries.flatMap(e=>e.role===`assistant`&&e.liveMessageId?[e.liveMessageId]:[]));t.live=UEe(n.activeRun,{excludeLiveMessageIds:r}),t.streamingText=n6(t.live),t.sending=!!n.activeRun,hT.conversationId===e&&(hT.entryId=n.tree.activeEntryId)}finally{t.loading=!1}}function tDe(e){Y.conversations=[e,...Y.conversations.filter(t=>t.id!==e.id)]}function nDe(e){Y.agents=[e,...Y.agents.filter(t=>t.id!==e.id)]}async function u6(e){let t=Y.conversations.find(t=>t.id===e)??(await xw(`/api/conversations/${_w(e)}`)).conversation;Oie(t.id),yT.activeConversationTabId=t.id,RT({kind:`conversation`,id:t.id}),AD(),await eDe(t),await l6(t.id),Y.error=kD(t.id).error}async function rDe(){let e=Eie(),t=Die(e.tabIds,Y.conversations);NT(t.map(e=>({kind:`conversation`,id:e})));for(let e of t)kD(e);let n=e.activeId&&t.includes(e.activeId)?e.activeId:t[0];yT.activeConversationTabId=n,AD(),n&&await u6(n)}async function iDe(e){let t=yT.openConversationTabIds,n=t.indexOf(e);if(n===-1)return;let r={kind:`conversation`,id:e},i=IT(r),a=t.filter(t=>t!==e),o=a[n]??a[n-1];await bA.cancelIfTarget({kind:`conversation`,id:e}),LT(r),delete yT.conversationViews[UT(e)];let s=Y.activeCenterTab?.kind===`conversation`&&Y.activeCenterTab.id===e;yT.activeConversationTabId===e&&(yT.activeConversationTabId=o),hT.conversationId===e&&!o&&PD(),AD(),s&&await BT(i)}async function aDe(e){if(!yT.pendingConversations[WT(e)])return;let t={kind:`pending-conversation`,id:e},n=IT(t),r=Y.activeCenterTab?.kind===`pending-conversation`&&Y.activeCenterTab.id===e;await bA.cancelIfTarget({kind:`pending-conversation`,id:e}),LT(t),delete yT.pendingConversations[WT(e)],r&&(PD(),await BT(n)),AD()}async function d6(e){let t=new Set(e),n=hT.conversationId?t.has(hT.conversationId):!1;await bA.cancelIfTargets(e.map(e=>({kind:`conversation`,id:e}))),NT(Y.openCenterTabs.filter(e=>e.kind!==`conversation`||!t.has(e.id)));for(let e of t)delete yT.conversationViews[UT(e)];if(!n){AD();return}let r=yT.openConversationTabIds[0];if(r){yT.activeConversationTabId=r,AD(),await u6(r);return}PD(),await BT(Y.openCenterTabs[0]),AD()}async function oDe(e){await Sw(`/api/approvals/${_w(e)}/grant`,{}),Y.approvals=await xD(),id.success(`Approval granted`)}async function sDe(e){await Sw(`/api/approvals/${_w(e)}/deny`,{note:`Denied from UI.`}),Y.approvals=await xD(),id.message(`Approval denied`)}async function cDe(e,t={}){await _ie(e,t),Y.planReviews=await CD(),await E6(),hT.conversationId&&await l6(hT.conversationId),id.success(`Plan accepted`)}async function lDe(e,t={}){let{conversation:n}=await vie(e,t);Y.planReviews=await CD(),await E6(),await u6(n.id),id.success(`Plan accepted in new chat`)}async function uDe(e){await yie(e,`Rejected from UI.`),Y.planReviews=await CD(),await E6(),hT.conversationId&&await l6(hT.conversationId),id.message(`Plan rejected`)}async function dDe(e,t){let n=t.trim();n&&(await bie(e,n),Y.userQuestions=await SD(),id.success(`Reply sent`))}async function fDe(e){await xie(e,`Dismissed from UI.`),Y.userQuestions=await SD(),id.message(`Question dismissed`)}function pDe(e){let t=kie(),n=CT.settingsDraft?gZ(CT.settingsDraft,CT.models,CT.authProviders):{selectedModelKey:yT.selectedModelKey,selectedThinkingLevel:yT.selectedThinkingLevel,selectedMode:yT.selectedMode,selectedPermissionLevel:yT.selectedPermissionLevel};yT.pendingConversations[WT(t)]={id:t,projectId:e.id,projectDir:e.dir,title:`New Conversation`,composerText:``,selectedModelKey:n.selectedModelKey,thinkingLevel:n.selectedThinkingLevel,mode:n.selectedMode,permissionLevel:n.selectedPermissionLevel,sending:!1,createdAt:new Date().toISOString()},PT({kind:`pending-conversation`,id:t}),f6(t)}function f6(e){let t=yT.pendingConversations[WT(e)];t&&(RT({kind:`pending-conversation`,id:t.id}),yT.activeConversationTabId=void 0,_T(),hT.projectId=t.projectId,gT.projectDir=t.projectDir,yT.selectedModelKey=t.selectedModelKey,yT.selectedThinkingLevel=t.thinkingLevel,yT.selectedMode=t.mode,yT.selectedPermissionLevel=t.permissionLevel,ND(),Y.error=t.error)}function mDe(){return Y.agents.find(e=>e.id===hT.agentId)}function p6(){return XT(yT.selectedModelKey)}function m6(){return CT.models.find(e=>YT(e)===yT.selectedModelKey)}function h6(e){let t=CT.settingsDraft;t?.rememberLastAgentSelection&&(t.lastAgentSelection={...t.lastAgentSelection,...e},FZ({lastAgentSelection:e},{immediate:!0}))}function g6(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return yT.pendingConversations[WT(e.id)]}function _6(){return mZ(yT.selectedThinkingLevel,m6())}async function hDe(e){yT.selectedModelKey=e;let t=mZ(yT.selectedThinkingLevel,m6());yT.selectedThinkingLevel=t;let n=g6();n&&(n.selectedModelKey=e,n.thinkingLevel=t);let r=p6();if(h6({...r?{model:r}:{},thinkingLevel:t}),!hT.agentId)return;let i=await QE(hT.agentId,{model:r??null,thinkingLevel:t});if(yT.selectedThinkingLevel=i.thinkingLevel,Y.agents=Y.agents.map(e=>e.id===i.id?i:e),hT.conversationId){let e=await Aw(hT.conversationId).catch(()=>void 0),t=yT.conversationViews[UT(hT.conversationId)];e&&t&&(t.contextUsage=e)}}async function v6(e){let t=mZ(e,m6());yT.selectedThinkingLevel=t;let n=g6();if(n&&(n.thinkingLevel=t),h6({thinkingLevel:t}),!hT.agentId)return;let r=await QE(hT.agentId,{thinkingLevel:t});yT.selectedThinkingLevel=r.thinkingLevel,Y.agents=Y.agents.map(e=>e.id===r.id?r:e)}async function y6(e){yT.selectedMode=e;let t=g6();if(t&&(t.mode=e),h6({mode:e}),!hT.agentId)return;let n=await QE(hT.agentId,{mode:e});Y.agents=Y.agents.map(e=>e.id===n.id?n:e)}async function b6(e){yT.selectedPermissionLevel=e;let t=g6();if(t&&(t.permissionLevel=e),h6({permissionLevel:e}),!hT.agentId)return;let n=await QE(hT.agentId,{permissionLevel:e});Y.agents=Y.agents.map(e=>e.id===n.id?n:e)}function gDe(e){let t=p6(),n=_6();return{desired:t,thinkingLevel:n,needsModel:t&&YT(e?.model??{provider:``,modelId:``})!==YT(t),needsMode:e?.mode!==yT.selectedMode,needsPermission:e?.permissionLevel!==yT.selectedPermissionLevel,needsThinking:e?.thinkingLevel!==n}}function x6(e){let t=MD();if(t){t.composerText=e;return}if(!hT.conversationId){gT.text=e;return}kD(hT.conversationId).composerText=e}async function _De(){if(hT.agentId){let{desired:e,thinkingLevel:t,needsModel:n,needsMode:r,needsPermission:i,needsThinking:a}=gDe(mDe());if(n||r||i||a){let n=await QE(hT.agentId,{model:e??null,thinkingLevel:t,mode:yT.selectedMode,permissionLevel:yT.selectedPermissionLevel}).catch(()=>void 0);n&&(yT.selectedThinkingLevel=n.thinkingLevel,Y.agents=Y.agents.map(e=>e.id===n.id?n:e))}return hT.agentId}if(hT.projectId&&hT.conversationId){let{agent:e}=await Sw(`/api/agents`,{projectId:hT.projectId,conversationId:hT.conversationId,model:p6(),thinkingLevel:_6(),mode:yT.selectedMode,permissionLevel:yT.selectedPermissionLevel});return hT.agentId=e.id,await e6.invalidateQueries({queryKey:t6.workspace}),await E6(),e.id}throw Y.projectPickerOpen=!0,Error(`Select a project directory before starting a conversation.`)}function S6(){return oE(CT.models,CT.authProviders,CT.settingsDraft?.scopedModels).length>0}function C6(e,t){id.error(e,{description:t})}async function vDe(e,t,n={}){let r=n.clearComposer??!0;if(!S6()){wZ();let t=`Configure a model provider or adjust Scoped Models in Settings before prompting.`;e.error=t,Y.error=t,C6(`No usable model configured`,t);return}e.selectedModelKey=yT.selectedModelKey,e.thinkingLevel=_6(),e.mode=yT.selectedMode,e.permissionLevel=yT.selectedPermissionLevel,e.sending=!0,e.error=void 0,Y.error=void 0;let i,a;try{let{conversation:n}=await Sw(`/api/conversations`,{projectId:e.projectId,title:wle(t),mode:e.mode,permissionLevel:e.permissionLevel});a=n.id;let{agent:o}=await Sw(`/api/agents`,{projectId:e.projectId,conversationId:n.id,model:p6(),thinkingLevel:e.thinkingLevel,mode:e.mode,permissionLevel:e.permissionLevel});tDe(n),nDe(o),FT({kind:`pending-conversation`,id:e.id},{kind:`conversation`,id:n.id}),yT.activeConversationTabId=n.id,hT.projectId=n.projectId,hT.conversationId=n.id,hT.entryId=n.activeEntryId,hT.agentId=o.id,gT.projectDir=e.projectDir;let s=r?``:e.composerText;delete yT.pendingConversations[WT(e.id)],i=kD(n.id),i.sending=!0,i.error=void 0,i.streamingText=``,i.live={messages:[],toolDrafts:[],toolOutputByToolCallId:{}},i.transcript=[{role:`user`,text:t,optimistic:!0}],i.composerText=s,Y.error=void 0,r&&(gT.text=``),AD(),await e6.invalidateQueries({queryKey:t6.workspace}),await E6(),await Sw(`/api/agents/${_w(o.id)}/prompt`,{text:t})}catch(t){let n=t instanceof Error?t.message:String(t);i?(i.error=n,i.sending=!1):(a&&await Mw(a).catch(()=>void 0),e.error=n,e.sending=!1),Y.error=n,C6(`Prompt failed`,n)}}async function w6(e,t={}){let n=t.clearComposer??!0,r=MD(),i=hT.conversationId?kD(hT.conversationId):void 0,a=e.trim();if(!a||r?.sending)return;if(r){await vDe(r,a,{clearComposer:n});return}if(!hT.projectId||!hT.conversationId||!i){Y.projectPickerOpen=!0;let e=`Select a project directory before starting a conversation.`;Y.error=e,C6(`Select a project directory`,e);return}if(!S6()){wZ();let e=`Configure a model provider or adjust Scoped Models in Settings before prompting.`;i.error=e,Y.error=e,C6(`No usable model configured`,e);return}if(i.live.compaction?.state===`running`){C6(`Compaction in progress`,`Wait for context compaction to finish before sending another prompt.`);return}let o=!!i.sending;i.error=void 0,Y.error=void 0,o||(i.sending=!0,i.streamingText=``,i.live={messages:[],toolDrafts:[],toolOutputByToolCallId:{}});try{let e=await _De();if(n&&(i.composerText=``,gT.text=``),o){await Sw(`/api/agents/${_w(e)}/prompt`,{text:a,behavior:`steer`});return}i.transcript=[...i.transcript,{role:`user`,text:a,optimistic:!0}],await Sw(`/api/agents/${_w(e)}/prompt`,{text:a})}catch(e){let t=e instanceof Error?e.message:String(e);i.error=t,Y.error=t,o||(i.sending=!1),C6(`Prompt failed`,t)}}async function yDe(){let e=MD(),t=hT.conversationId?kD(hT.conversationId):void 0,n=(e?.composerText??t?.composerText??gT.text).trim();if(!(!n||e?.sending)){if(n===`/abort`){e&&(e.composerText=``),t&&(t.composerText=``),gT.text=``,await M6();return}await w6(n,{clearComposer:!0})}}function T6(e,t){return!t||e.updatedAt>=t.updatedAt}function bDe(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return!t||T6(e,t)?e:t})}function xDe(e,t){let n=t.findIndex(t=>t.id===e.id);if(n===-1)return[...t,e];let r=t[n];return T6(e,r)?t.map(t=>t.id===e.id?e:t):t}async function E6(){let e=await e6.fetchQuery({queryKey:t6.workspace,queryFn:Sie}),t=bDe(e.agents,Y.agents);Y.projects=e.projects,Y.conversations=e.conversations,Y.agents=t,wT.tasks=e.tasks,SDe(t,e.conversations);let n=new Set(e.conversations.map(e=>e.id)),r=yT.openConversationTabIds.filter(e=>!n.has(e));r.length&&await d6(r),wT.selectedTaskId=wT.selectedTaskId??wT.tasks[0]?.id;let[i,a,o]=await Promise.all([xD(),SD(),CD()]);Y.approvals=i,Y.userQuestions=a,Y.planReviews=o,wT.selectedTaskId&&(wT.taskLogs=await bD(wT.selectedTaskId))}function SDe(e,t){let n=hT.agentId?e.find(e=>e.id===hT.agentId):void 0;if(n){n.model&&(yT.selectedModelKey=YT(n.model)),yT.selectedThinkingLevel=n.thinkingLevel,yT.selectedMode=n.mode,yT.selectedPermissionLevel=n.permissionLevel;return}let r=hT.conversationId?t.find(e=>e.id===hT.conversationId):void 0;r&&(yT.selectedMode=r.mode,yT.selectedPermissionLevel=r.permissionLevel)}async function CDe(){yT.slashCompletions=await e6.fetchQuery({queryKey:t6.slashCompletions,queryFn:Bre})}function wDe(e){if(!hT.conversationId)return;let t=e===`json`?`export`:`export.${e}`;return`/api/conversations/${_w(hT.conversationId)}/${t}`}function TDe(){if(hT.agentId)return`/api/agents/${_w(hT.agentId)}/system-prompt`}async function EDe(e){return e6.fetchQuery({queryKey:t6.fileCompletions(hT.projectId,e),queryFn:()=>Vre(hT.projectId,e),staleTime:2e3})}function D6(){let e=Y.projects.find(e=>e.id===hT.projectId);if(!e){Y.projectPickerOpen=!0;return}A6(e.dir)}function O6(e){A6(e)}async function k6(e){try{let t=Y.conversations.filter(t=>t.projectId===e).map(e=>e.id);await aie(e),await d6(t),await e6.invalidateQueries({queryKey:t6.workspace}),await E6(),id.success(`Project removed`)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,id.error(`Could not remove project`,{description:t})}}async function DDe(e){try{await Mw(e),await d6([e]),await e6.invalidateQueries({queryKey:t6.workspace}),await E6(),id.success(`Conversation removed`)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,id.error(`Could not remove conversation`,{description:t})}}async function ODe(e,t){try{await sie(e,t),id.success(t===`vscode`?`Opening project in VS Code`:`Opening project in Zed`)}catch(e){let n=e instanceof Error?e.message:String(e);Y.error=n,id.error(t===`vscode`?`Could not open VS Code`:`Could not open Zed`,{description:n})}}async function kDe(e,t){try{let n=await oie(e,t);await d6(n.prunedConversationIds),await e6.invalidateQueries({queryKey:t6.workspace}),await E6();let r=n.prunedConversationIds.length,i=n.skipped.length;id.success(r===1?`Cleaned up 1 conversation`:`Cleaned up ${r} conversations`,i>0?{description:i===1?`Skipped 1 active conversation`:`Skipped ${i} active conversations`}:{})}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,id.error(`Could not clean up conversations`,{description:t})}}async function A6(e){Y.error=void 0;try{let{project:t}=await Sw(`/api/projects`,{dir:e});Y.projects=[t,...Y.projects.filter(e=>e.id!==t.id)],Y.projectPickerOpen=!1,pDe(t)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,id.error(`Could not open project`,{description:t})}}async function j6(e,t=!1){if(!hT.conversationId)return;let n=hT.conversationId;await Sw(`/api/conversations/${_w(n)}/navigate`,{activeEntryId:e??null,summarize:t}),await e6.invalidateQueries({queryKey:t6.workspace}),await E6(),await u6(n)}async function ADe(){if(!hT.conversationId)return;let e=hT.conversationId,t=kD(e),n={id:`local:compaction:${e}:${Date.now()}`,state:`running`,reason:`manual`,conversationId:e,createdAt:new Date().toISOString()};t.live={...t.live,compaction:n},t.error=void 0;try{await jw(e),t.live={...t.live,compaction:void 0},await e6.invalidateQueries({queryKey:t6.workspace}),await E6(),await u6(e)}catch(e){let r=e instanceof Error?e.message:String(e);t.live={...t.live,compaction:{...n,state:`failed`,errorMessage:r}},id.error(`Compaction failed`,{description:r})}}async function jDe(e){if(!hT.agentId||!hT.conversationId)return;let t=kD(hT.conversationId);t.sending=!0,t.error=void 0,Y.error=void 0;try{await Sw(`/api/agents/${_w(hT.agentId)}/continue-from-failure`,{statusEntryId:e})}catch(e){let n=e instanceof Error?e.message:String(e);t.sending=!1,t.error=n,Y.error=n,id.error(`Continue failed`,{description:n})}}async function M6(){if(!hT.agentId)return;let e=hT.conversationId?kD(hT.conversationId):void 0;await Sw(`/api/agents/${_w(hT.agentId)}/abort`,{}),e&&(e.sending=!1,e.streamingText=``,e.live={messages:[],toolDrafts:[],toolOutputByToolCallId:{}},e.queuedPrompts=[])}var MDe=new Set([`.md`,`.markdown`,`.mdown`,`.mkd`]);function N6(e){if(!e)return!1;let t=e.split(/[?#]/,1)[0]?.toLowerCase()??``,n=t.lastIndexOf(`.`);return n===-1?!1:MDe.has(t.slice(n))}function P6(e){return N6(e)?`rendered`:`raw`}function NDe(e,t){return`${e}:${encodeURIComponent(t)}`}function F6(e){PT({kind:`file`,id:e})}async function I6(e){let t=bT.fileViews[GT(e)];if(t){t.loading=!0,t.error=void 0;try{t.content=await Wre(t.projectId,t.path,t.line),t.path=t.content.path}catch(e){let n=e instanceof Error?e.message:String(e);t.error=n,id.error(`Could not open file`,{description:n})}finally{t.loading=!1}}}async function PDe(e){let t=NDe(e.projectId,e.path),n=GT(t);F6(t),bT.fileViews[n]??={id:t,projectId:e.projectId,path:e.path,line:e.line,loading:!1},bT.fileViews[n].line=e.line,RT({kind:`file`,id:t}),await I6(t)}async function FDe(e){let t=bT.fileViews[GT(e)];t&&(F6(e),RT({kind:`file`,id:e}),!t.content&&!t.loading&&await I6(e))}async function L6(e){await I6(e)}function IDe(e){let t=bT.fileViews[GT(e)];t&&(t.displayMode=(t.displayMode??P6(t.content?.relativePath??t.path))===`raw`?`rendered`:`raw`)}function LDe(e){let t=bT.fileViews[GT(e)];t&&(t.wrapLines=!t.wrapLines)}function RDe(e){let t={kind:`file`,id:e},n=Y.activeCenterTab?.kind===`file`&&Y.activeCenterTab.id===e,r=IT(t);LT(t),delete bT.fileViews[GT(e)],n&&BT(r)}var R6={tone:`neutral`,pulse:!1,busy:!1,needsUser:!1,source:`none`};function zDe(e,t){return t.find(t=>t.id===e.activeAgentId)??t.find(t=>t.conversationId===e.id)}function BDe(e,t,n,r){return t.some(t=>t.conversationId===e&&t.status===`pending`)||n.some(t=>t.conversationId===e&&t.status===`pending`)||r.some(t=>t.conversationId===e&&t.status===`pending`)}function z6(e){let t=!!e.hasPendingHumanInput;return t||e.agent?.status===`awaiting_user`?{tone:`warn`,pulse:!1,label:`Needs user action`,busy:!1,needsUser:!0,source:t?`pending-input`:`agent`}:e.view?.live.compaction?.state===`running`?{tone:`running`,pulse:!0,label:`Compacting context`,busy:!0,needsUser:!1,source:`live-view`}:e.agent?.status===`running`||e.view?.sending||e.view?.activeRun?{tone:Gw(e.agent?.mode??e.mode),pulse:!0,label:`Agent running`,busy:!0,needsUser:!1,source:e.agent?.status===`running`?`agent`:`live-view`}:e.agent?.status===`error`?{tone:`danger`,pulse:!1,label:`Agent error`,busy:!1,needsUser:!1,source:`agent`}:R6}function VDe(e){let t=Object.create(null);for(let n of e.conversations){let r=zDe(n,e.agents);t[n.id]=z6({conversationId:n.id,agent:r,mode:r?.mode??n.mode,view:e.views[UT(n.id)],hasPendingHumanInput:BDe(n.id,e.approvals,e.userQuestions,e.planReviews)})}return t}function B6(e,t){return Y.activeCenterTab?.kind===e&&Y.activeCenterTab.id===t}function V6(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return yT.pendingConversations[WT(e.id)]}function HDe(e){return[`starting`,`running`,`ready`,`stopping`].includes(e)}var H6={get status(){return Y.status},get connection(){return Y.connection},get error(){let e=hT.conversationId??yT.activeConversationTabId,t=e?yT.conversationViews[UT(e)]:void 0;return V6()?.error??t?.error??Y.error},get projects(){return Y.projects},get conversations(){return Y.conversations},get agents(){return Y.agents},get approvals(){return Y.approvals},get userQuestions(){return Y.userQuestions},get planReviews(){return Y.planReviews},get activeProject(){let e=V6()?.projectId??hT.projectId;return Y.projects.find(t=>t.id===e)},get activeConversation(){return Y.conversations.find(e=>e.id===hT.conversationId)},get activeAgent(){return Y.agents.find(e=>e.id===hT.agentId)},get conversationActivityById(){return VDe({conversations:Y.conversations,agents:Y.agents,views:yT.conversationViews,approvals:Y.approvals,userQuestions:Y.userQuestions,planReviews:Y.planReviews})},get openConversationTabs(){let e=[];for(let t of yT.openConversationTabIds){let n=Y.conversations.find(e=>e.id===t);if(!n)continue;let r=Y.projects.find(e=>e.id===n.projectId),i=Y.agents.find(e=>e.id===n.activeAgentId||e.conversationId===n.id),a=yT.conversationViews[UT(n.id)],o=this.conversationActivityById[n.id]??R6;e.push({kind:`conversation`,id:n.id,conversation:n,project:r,agent:i,active:B6(`conversation`,n.id),hasDraft:!!a?.composerText.trim(),sending:o.busy,activity:o,error:a?.error??(i?.status===`error`?`Agent error`:void 0)})}return e},get openPendingConversationTabs(){let e=[];for(let t of Y.openCenterTabs){if(t.kind!==`pending-conversation`)continue;let n=yT.pendingConversations[WT(t.id)];n&&e.push({kind:`pending-conversation`,id:n.id,title:n.title,project:Y.projects.find(e=>e.id===n.projectId),projectDir:n.projectDir,active:B6(`pending-conversation`,n.id),hasDraft:!!n.composerText.trim(),sending:n.sending,activity:n.sending?{tone:Gw(n.mode),pulse:!0,label:`Agent running`,busy:!0,needsUser:!1,source:`live-view`}:R6,error:n.error})}return e},get openTaskTabs(){let e=[];for(let t of wT.openTaskTabIds){let n=wT.tasks.find(e=>e.id===t);e.push({kind:`task`,id:t,task:n,active:B6(`task`,t),sending:n?HDe(n.status):!1,error:n?n.status===`failed`?n.error??`Task failed`:void 0:`Task not found`})}return e},get openFileTabs(){return bT.openFileTabIds.map(e=>{let t=bT.fileViews[GT(e)],n=t?.content?.relativePath??t?.path;return{kind:`file`,id:e,file:t?.content,path:t?.path,relativePath:t?.content?.relativePath,displayMode:t?.displayMode??P6(n),wrapLines:!!t?.wrapLines,markdown:N6(n),active:B6(`file`,e),sending:!!t?.loading,error:t?.error}})},get openPrTabs(){return xT.openPrTabIds.map(e=>{let t=xT.prViews[KT(e)];return{kind:`pr`,id:e,number:t?.number??0,title:t?.detail?.title,checksStatus:t?.detail?.checks.status,isDraft:t?.detail?.isDraft,active:B6(`pr`,e),sending:!!t?.loading,error:t?.error}})},get openSettingsTabs(){return CT.settingsTabOpen?[{kind:`settings`,id:`settings`,active:B6(`settings`,`settings`),sending:!1,error:CT.settingsMessage}]:[]},get openAuthTabs(){return vT.authTabOpen?[{kind:`auth`,id:`auth`,active:B6(`auth`,`auth`),sending:!1}]:[]},get openLogsTabs(){return ST.logsTabOpen?[{kind:`logs`,id:`logs`,active:B6(`logs`,`logs`),sending:!1}]:[]},get openConversationTabIds(){let e=new Set;for(let t of Y.openCenterTabs)t.kind===`conversation`&&e.add(t.id);return e},get centerTabs(){let e=[];for(let t of Y.openCenterTabs)if(t.kind===`conversation`){let n=this.openConversationTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`pending-conversation`){let n=this.openPendingConversationTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`task`){let n=this.openTaskTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`file`){let n=this.openFileTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`pr`){let n=this.openPrTabs.find(e=>e.id===t.id);n&&e.push(n)}else t.kind===`settings`?e.push(...this.openSettingsTabs):t.kind===`auth`?e.push(...this.openAuthTabs):e.push(...this.openLogsTabs);return e},get activeCenterTab(){return Y.activeCenterTab}};function U6(e){return JSON.stringify({projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos.map(e=>({relativePath:e.relativePath,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})),github:e.github?{available:e.github.available,authenticated:e.github.authenticated}:void 0})}function UDe(e,t,n,r){return t?!e||e.projectId!==t?!0:n-e.loadedAt>=r:!1}function W6(e){return JSON.stringify({relativePath:e.relativePath,absDir:e.absDir,name:e.name,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})}function WDe(e){return{files:e.files,stagedCount:e.stagedCount,unstagedCount:e.unstagedCount,untrackedCount:e.untrackedCount,insertions:e.insertions,deletions:e.deletions}}function GDe(e){return JSON.stringify({counts:{staged:e.stagedCount,unstaged:e.unstagedCount,untracked:e.untrackedCount,insertions:e.insertions,deletions:e.deletions},files:e.files.map(e=>({path:e.path,renamedFrom:e.renamedFrom,index:e.index,worktree:e.worktree,staged:e.staged,untracked:e.untracked}))})}function KDe(e){return JSON.stringify(e.map(e=>({hash:e.hash,subject:e.subject,relativeDate:e.relativeDate})))}function qDe(e){return JSON.stringify(e.map(e=>({name:e.name,current:e.current,remote:e.remote,upstream:e.upstream})))}function JDe(e){if(e)return JSON.stringify({available:e.available,authenticated:e.authenticated,login:e.login,reason:e.reason})}function G6(e){return JSON.stringify(e)}function YDe(e){return JSON.stringify(e.map(e=>W6(e)))}var K6=Mn({projects:{}}),XDe=8;function ZDe(){return{fetching:!1,syncing:!1,switchingBranch:void 0,creatingBranch:!1,fileMutation:void 0,bulkMutation:void 0}}function q6(){return{repoSummary:void 0,changes:void 0,recentCommits:[],github:void 0,prs:[],branches:[],operations:ZDe(),loadingOverview:!1,loadingPrs:!1,loadingBranches:!1,prsRequestInFlight:!1,overviewRequestInFlight:!1,lastRepoSummaryFingerprint:void 0,lastChangesFingerprint:void 0,lastRecentCommitsFingerprint:void 0,lastBranchesFingerprint:void 0,lastPrsFingerprint:void 0,lastGithubFingerprint:void 0,loaded:!1,loadedAt:void 0,requestSeq:0}}function QDe(e){return{projectId:e.id,projectDir:e.dir,projectIsRepo:!1,repos:[],selectedRepo:`.`,repoStates:{},discoverError:void 0,loadingRepos:!1,refreshingRepos:!1,reposRequestInFlight:!1,lastReposFingerprint:void 0,loaded:!1,loadedAt:void 0,requestSeq:0,touchedAt:Date.now()}}function J6(e){return`nerve.git.repo.${e}`}function $De(e){let t=K6.projects[qT(e)];t&&(t.touchedAt=Date.now(),eOe())}function eOe(){let e=Object.values(K6.projects).sort((e,t)=>t.touchedAt-e.touchedAt);for(let t of e.slice(XDe))delete K6.projects[qT(t.projectId)]}function Y6(e){let t=qT(e.id);K6.projects[t]??=QDe(e);let n=K6.projects[t];return n.projectDir!==e.dir&&(n.projectDir=e.dir),$De(e.id),n}function X6(e,t){let n=K6.projects[qT(e)];if(!n)return q6();let r=JT(t);return n.repoStates[r]??=q6(),n.repoStates[r]}function Z6(e){if(e instanceof Error){try{let t=JSON.parse(e.message);if(t?.error?.message)return String(t.error.message)}catch{}return e.message}return String(e)}function Q6(e){let t=e?.operations;return!!(t&&(t.fetching||t.syncing||t.creatingBranch||t.switchingBranch||t.fileMutation||t.bulkMutation))}function $6(e,t){let n=W6(t);return e.lastRepoSummaryFingerprint===n&&e.repoSummary?!1:(e.repoSummary=t,e.lastRepoSummaryFingerprint=n,!0)}function tOe(e,t){let n=GDe(t);return e.lastChangesFingerprint===n&&e.changes?!1:(e.changes=t,e.lastChangesFingerprint=n,!0)}function nOe(e,t){let n=KDe(t);return e.lastRecentCommitsFingerprint===n?!1:(e.recentCommits=t,e.lastRecentCommitsFingerprint=n,!0)}function rOe(e,t){let n=$6(e,t.repo),r=tOe(e,WDe(t)),i=nOe(e,t.recentCommits),a=n||r||i;return e.loaded||=!0,(a||e.loadedAt===void 0)&&(e.loadedAt=Date.now()),{changed:a,repoChanged:n,changesChanged:r,recentCommitsChanged:i}}function e8(e,t){let n=YDe(t);return e.lastReposFingerprint===n?!1:(e.repos=t,e.lastReposFingerprint=n,!0)}function t8(e,t){let n=qDe(t);return e.lastBranchesFingerprint===n?!1:(e.branches=t,e.lastBranchesFingerprint=n,!0)}function n8(e,t){let n=JDe(t);return e.lastGithubFingerprint===n?!1:(e.github=t,e.lastGithubFingerprint=n,!0)}function r8(e,t){let n=G6(t);return e.lastPrsFingerprint===n?!1:(e.prs=t,e.lastPrsFingerprint=n,!0)}function i8(e,t){let n=K6.projects[qT(e)];if(!n)return;let r=n.repos.find(e=>e.relativePath===t.relativePath);r?W6(r)!==W6(t)&&e8(n,n.repos.map(e=>e.relativePath===t.relativePath?t:e)):e8(n,[...n.repos,t]);let i=n.repoStates[JT(t.relativePath)];i&&$6(i,t),i&&(!t.hasRemote||!t.hasGithubRemote)&&o8(e,i),s8(e)}function iOe(e,t){let n=K6.projects[qT(e)];if(n)return n.repoStates[JT(t)]?.repoSummary??n.repos.find(e=>e.relativePath===t)}function a8(e,t){let n=iOe(e,t);return!!(n?.hasRemote&&n.hasGithubRemote)}function o8(e,t){let n=!1;(t.github!==void 0||t.lastGithubFingerprint!==void 0)&&(t.github=void 0,t.lastGithubFingerprint=void 0,n=!0);let r=G6([]);(t.prs.length>0||t.lastPrsFingerprint!==void 0&&t.lastPrsFingerprint!==r)&&(t.prs=[],t.lastPrsFingerprint=r,n=!0),t.loadingPrs&&(t.loadingPrs=!1,n=!0),t.prsRequestInFlight&&(t.prsRequestInFlight=!1,n=!0),n&&s8(e)}function aOe(e){if(!(typeof localStorage>`u`))return localStorage.getItem(J6(e))??void 0}function oOe(e,t){typeof localStorage>`u`||localStorage.setItem(J6(e),t)}function sOe(e){if(!e.loaded&&e.repos.length===0)return;let t=e.repoStates[JT(e.selectedRepo)];return{projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos,github:t?.github?{available:t.github.available,authenticated:t.github.authenticated}:void 0,loadedAt:e.loadedAt??Date.now()}}function s8(e){let t=K6.projects[qT(e)];if(!t)return;let n=sOe(t);if(!n)return;let r=xT.gitContext;(!r||r.projectId!==n.projectId||U6(r)!==U6(n))&&(xT.gitContext=n)}async function c8(e,t={}){let n=Y6(e);if(n.reposRequestInFlight&&!t.force)return;let r=n.requestSeq+1;n.requestSeq=r,n.reposRequestInFlight=!0,n.discoverError=void 0;let i=!n.loaded&&!t.silent;n.loadingRepos=i,n.refreshingRepos=!i&&!t.silent;try{let t=await Gre(e.id);if(n.requestSeq!==r)return;let i=!1;n.projectIsRepo!==t.projectIsRepo&&(n.projectIsRepo=t.projectIsRepo,i=!0),i=e8(n,t.repos)||i;for(let n of t.repos)X6(e.id,n.relativePath);let a=aOe(e.id),o=t.repos.some(e=>e.relativePath===n.selectedRepo),s=t.repos[0]?.relativePath??`.`,c=n.selectedRepo;if(a&&t.repos.some(e=>e.relativePath===a)?c=a:o||(c=s),n.selectedRepo!==c&&(n.selectedRepo=c,i=!0),n.loaded||(n.loaded=!0,i=!0),(i||n.loadedAt===void 0)&&(n.loadedAt=Date.now()),s8(e.id),t.repos.length>0){let t=X6(e.id,n.selectedRepo).loaded?{silent:!0,onlyIfChanged:!0}:{};await Promise.all([l8(e.id,n.selectedRepo,t),u8(e.id,n.selectedRepo)])}}catch(e){if(n.requestSeq!==r)return;n.discoverError=Z6(e),n.loaded||e8(n,[])}finally{n.requestSeq===r&&(n.loadingRepos=!1,n.refreshingRepos=!1,n.reposRequestInFlight=!1)}}async function l8(e,t,n={}){let r=X6(e,t);if(r.overviewRequestInFlight&&!n.force)return;let i=r.requestSeq+1;r.requestSeq=i,r.overviewRequestInFlight=!0,n.silent||(r.loadingOverview=!0);try{let n=await Kre(e,t);if(r.requestSeq!==i)return;i8(e,n.repo),rOe(r,n)}catch(e){n.silent||id.error(`Git overview failed: ${Z6(e)}`)}finally{r.requestSeq===i&&(n.silent||(r.loadingOverview=!1),r.overviewRequestInFlight=!1)}}async function cOe(e,t){let n=X6(e,t);n.loadingBranches=!0;try{t8(n,(await qre(e,t)).branches)}catch(e){id.error(`Could not list branches: ${Z6(e)}`)}finally{n.loadingBranches=!1}}async function u8(e,t){let n=X6(e,t);if(!a8(e,t)){o8(e,n);return}try{let r=await $re(e,t);n8(n,r),s8(e),r.authenticated?await d8(e,t,!0):r8(n,[])}catch(t){n8(n,{available:!1,authenticated:!1,login:null,reason:Z6(t)}),r8(n,[]),s8(e)}}async function d8(e,t,n=!1){let r=X6(e,t);if(!a8(e,t)){o8(e,r);return}if(!r.prsRequestInFlight){r.prsRequestInFlight=!0,n||(r.loadingPrs=!0);try{r8(r,(await eie(e,t)).prs)}catch(e){n||id.error(`Could not list PRs: ${Z6(e)}`)}finally{n||(r.loadingPrs=!1),r.prsRequestInFlight=!1}}}function lOe(e,t){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let n=K6.projects[qT(e)]?.repoStates[JT(t)];!n||n.overviewRequestInFlight||Q6(n)||l8(e,t,{silent:!0,onlyIfChanged:!0})}function uOe(e){let t=Y6(e);if(!t.loaded&&!t.reposRequestInFlight){c8(e);return}t.reposRequestInFlight||c8(e,{silent:!0,onlyIfChanged:!0})}function dOe(e,t){let n=K6.projects[qT(e)];if(!n||t===n.selectedRepo)return;n.selectedRepo=t,oOe(e,t);let r=X6(e,t);r.loaded?Q6(r)||(l8(e,t,{silent:!0,onlyIfChanged:!0}),r.github?.authenticated&&d8(e,t,!0)):(l8(e,t),u8(e,t)),s8(e)}function fOe(e,t){let n=e?[K6.projects[qT(e)]].filter(e=>!!e):Object.values(K6.projects);for(let e of n){let n=e.projectId;t?(l8(n,t,{force:!0}),u8(n,t)):c8({id:n,dir:e.projectDir,name:e.projectDir,createdAt:``,updatedAt:``},{force:!0,silent:e.loaded})}}async function pOe(e,t){let n=X6(e,t);n.operations.fetching=!0;try{i8(e,(await Zre(e,t)).repo),id.success(`Fetched from remote`),await l8(e,t),n.github?.authenticated&&await d8(e,t,!0)}catch(e){id.error(`Fetch failed: ${Z6(e)}`)}finally{n.operations.fetching=!1}}async function mOe(e,t){let n=X6(e,t);n.operations.syncing=!0;try{i8(e,(await Xre(e,t)).repo),id.success(`Branch synced`),await l8(e,t),n.github?.authenticated&&await d8(e,t,!0)}catch(e){id.error(`Sync failed: ${Z6(e)}`)}finally{n.operations.syncing=!1}}async function hOe(e,t,n){if(n.current)return!1;let r=X6(e,t);r.operations.switchingBranch=n.name;try{let i=await Yre(e,t,n.name);return i8(e,i.repo),t8(r,[]),id.success(`Switched to ${i.repo.currentBranch??n.name}`),await Promise.all([l8(e,t),u8(e,t)]),!0}catch(e){return id.error(`Switch branch failed: ${Z6(e)}`),!1}finally{r.operations.switchingBranch=void 0}}async function gOe(e,t,n){if(n.trim().length===0)return!1;let r=X6(e,t);r.operations.creatingBranch=!0;try{return i8(e,(await Jre(e,t,n.trim())).repo),t8(r,[]),id.success(`Created branch ${n.trim()}`),await Promise.all([l8(e,t),u8(e,t)]),!0}catch(e){return id.error(`Create branch failed: ${Z6(e)}`),!1}finally{r.operations.creatingBranch=!1}}async function _Oe(e,t,n,r){let i=X6(e,t);i.operations.fileMutation={path:n.path,action:r};try{i8(e,(await(r===`stage`?_D:r===`unstage`?vD:Qre)(e,t,n.path)).repo),await l8(e,t)}catch(e){id.error(`${r[0].toUpperCase()}${r.slice(1)} failed: ${Z6(e)}`)}finally{i.operations.fileMutation=void 0}}async function vOe(e,t,n){let r=X6(e,t),i=r.changes?.files??[],a=n===`stage-all`?i.filter(e=>e.untracked||e.worktree!==` `):i.filter(e=>e.staged);if(a.length===0)return;let o=n===`stage-all`?_D:vD;r.operations.bulkMutation=n;try{for(let n of a)await o(e,t,n.path);await l8(e,t)}catch(e){id.error(`${n===`stage-all`?`Stage all`:`Unstage all`} failed: ${Z6(e)}`)}finally{r.operations.bulkMutation=void 0}}function f8(e){return e.length>1?` for these repositories: ${e.map(e=>e.relativePath).join(`, `)}`:``}function yOe(e){let t=new Set,n=[];for(let r of e)t.has(r.relativePath)||(t.add(r.relativePath),n.push(r));return n}function bOe(e){let t=e.repos,n=t.filter(e=>e.dirty),r=n.filter(e=>e.onBaseBranch),i=t.filter(e=>e.hasRemote&&e.hasGithubRemote),a=n.filter(e=>e.hasRemote&&e.hasGithubRemote),o=i.filter(e=>!e.detached&&e.currentBranch!==null&&!e.onBaseBranch&&!e.mergedToBase),s=yOe([...a,...o]),c=!!(e.github?.available&&e.github?.authenticated),l=[];if(n.length>0&&l.push({id:`commit`,label:`Commit changes`,prompt:n.length>1?`For each repository with uncommitted changes, stage and commit its changes with a clear, conventional commit message derived from that repo's own diff${f8(n)}.`:`Stage and commit the current changes with a clear, conventional commit message summarizing what changed.`}),r.length>0&&l.push({id:`commit-branch`,label:`Commit on a feature branch`,prompt:r.length>1?`Create a feature branch (reuse one descriptive branch name across repos) and commit the changes in each repository currently on its base branch${f8(r)}. Use a clear commit message per repo based on its diff.`:`Create a new feature branch with a descriptive name, then stage and commit the current changes to it with a clear commit message.`}),c&&s.length>0){let e=s.length>1?` Do this for each of these repositories, reusing a shared feature branch name where it makes sense: ${s.map(e=>e.relativePath).join(`, `)}.`:``;l.push({id:`open-pr`,label:s.length>1?`Create PRs`:`Create a PR`,prompt:`Open a pull request for the current work:
|
|
136
|
-
1. If on the base branch, create a new feature branch.
|
|
137
|
-
2. Stage and commit any uncommitted changes with a clear message.
|
|
138
|
-
3. Push the branch to origin (set upstream if needed).
|
|
139
|
-
4. Create a pull request with a concise title and a summary of the changes.${e}`})}return l}function xOe(){let e=hT.conversationId??yT.activeConversationTabId;if(e)return yT.conversationViews[UT(e)]}var p8={get activeCenterPrView(){let e=Y.activeCenterTab;if(e?.kind===`pr`)return xT.prViews[KT(e.id)]},get gitStatus(){let e=H6.activeProject?.id,t=e?K6.projects[qT(e)]:void 0;if(!t||t.repos.length===0)return;let n=t.repoStates[JT(t.selectedRepo)]?.repoSummary??t.repos.find(e=>e.relativePath===t.selectedRepo)??t.repos[0];return{branch:n.currentBranch??`detached`,dirty:n.dirty}},get gitSuggestions(){let e=xT.gitContext,t=H6.activeProject?.id;return!e||!t||e.projectId!==t?[]:bOe(e)},get branchDepth(){return xOe()?.treeNodes.length??0}};function m8(e,t){D(t,!0);let n=q(t,`active`,3,!0),r=k(()=>t.tab??Y.activeCenterTab),i=k(()=>I(r)?.kind===`conversation`?I(r).id:void 0),a=k(()=>I(r)?.kind===`pending-conversation`?I(r).id:void 0),o=k(()=>I(i)?yT.conversationViews[UT(I(i))]:void 0),s=k(()=>I(a)?yT.pendingConversations[WT(I(a))]:void 0),c=k(()=>I(i)?Y.conversations.find(e=>e.id===I(i)):void 0),l=k(()=>I(c)?Y.agents.find(e=>e.id===I(c).activeAgentId||e.conversationId===I(c).id):void 0),u=k(()=>{let e=I(s)?.projectId??I(c)?.projectId;return e?Y.projects.find(t=>t.id===e):void 0}),d=k(()=>!!I(s)),f=k(()=>{let e=I(l)?.id;return Y.userQuestions.find(t=>I(i)&&t.conversationId===I(i)?!0:!!(e&&t.agentId===e))}),p=k(()=>{let e=I(l)?.id;return Y.planReviews.find(t=>I(i)&&t.conversationId===I(i)?!0:!!(e&&t.agentId===e))}),m=k(()=>I(p)?Y.agents.find(e=>e.id===I(p).agentId):void 0),h=k(()=>I(s)?.selectedModelKey??(I(l)?.model?YT(I(l).model):yT.selectedModelKey)),g=k(()=>CT.models.find(e=>YT(e)===I(h))),_=k(()=>I(l)?.model),v=k(()=>I(_)?CT.models.find(e=>YT(e)===YT(I(_))):void 0),y=k(()=>I(s)?.thinkingLevel??I(l)?.thinkingLevel??`off`),b=k(()=>I(s)?.mode??I(l)?.mode??I(c)?.mode??yT.selectedMode),x=k(()=>I(s)?.permissionLevel??I(l)?.permissionLevel??I(c)?.permissionLevel??yT.selectedPermissionLevel),S=k(()=>I(s)?.composerText??I(o)?.composerText??``),ee=k(()=>oE(CT.models,CT.authProviders,CT.settingsDraft?.scopedModels)),C=k(()=>I(m)?.model?YT(I(m).model):I(h)),te=k(()=>I(m)?.thinkingLevel??I(y)),ne=k(()=>I(g)?.contextWindow??I(v)?.contextWindow??I(o)?.contextUsage?.contextWindow??0),re=k(()=>n()?p8.gitSuggestions:[]),ie=k(()=>n()?yT.slashCompletions:[]);function ae(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}async function oe(){let e=I(r);!e||ae(Y.activeCenterTab,e)||await BT(e)}function w(e){let t=I(s);if(t){t.composerText=e;return}if(I(i)){kD(I(i)).composerText=e;return}if(n()&&ae(Y.activeCenterTab,I(r))){x6(e);return}gT.text=e}async function se(e){await oe(),await e()}async function ce(e,t=!1){await se(()=>j6(e,t)),$3()}async function le(e){await se(()=>j6(e.parentEntryId)),w(e.text),$3()}function ue(){Y.projectPickerOpen=!0}function de(e,t){I(u)&&PDe({projectId:I(u).id,path:e,line:t})}function fe(e){w(I(S).trim()?`${I(S)}\n\n${e.prompt}`:e.prompt)}function pe(e){se(()=>w6(e.prompt,{clearComposer:!1}))}{let t=k(()=>Y.status?.storage.home),r=k(()=>I(o)?.transcript??[]),i=k(()=>I(o)?.toolCalls??[]),a=k(()=>I(o)?.treeNodes??[]),m=k(()=>I(o)?.streamingText??``),g=k(()=>I(o)?.live),_=k(()=>I(o)?.queuedPrompts??[]),v=k(()=>Y.connection===`live`),ae=k(()=>I(s)?.sending??I(o)?.sending??!1),oe=k(()=>I(o)?.contextUsage),me=k(()=>n()?EDe:void 0);zEe(e,{get active(){return n()},get activeProject(){return I(u)},get activeConversation(){return I(c)},get activeAgent(){return I(l)},get activePendingConversation(){return I(s)},get pendingConversationActive(){return I(d)},get projects(){return Y.projects},get conversations(){return Y.conversations},get agents(){return Y.agents},get homeDir(){return I(t)},get approvals(){return Y.approvals},get pendingUserQuestion(){return I(f)},get pendingPlanReview(){return I(p)},get transcript(){return I(r)},get toolCalls(){return I(i)},get treeNodes(){return I(a)},get streamingText(){return I(m)},get liveState(){return I(g)},get queuedPrompts(){return I(_)},get live(){return I(v)},get sending(){return I(ae)},get composerText(){return I(S)},get gitSuggestions(){return I(re)},onSendGitSuggestion:pe,onDraftGitSuggestion:fe,get models(){return I(ee)},get selectedModelKey(){return I(h)},get thinkingLevel(){return I(y)},get planReviewModels(){return I(ee)},get planReviewModelKey(){return I(C)},get planReviewThinkingLevel(){return I(te)},get mode(){return I(b)},get permissionLevel(){return I(x)},get slashCompletions(){return I(ie)},get contextUsage(){return I(oe)},get contextWindow(){return I(ne)},get composerFocusToken(){return Q3.focusToken},get composerEscapeToken(){return Q3.escapeToken},get micShortcutToken(){return Q3.micToken},get fileCompletions(){return I(me)},onComposerChange:w,onSubmit:()=>{se(yDe)},get onAnswerUserQuestion(){return dDe},get onDismissUserQuestion(){return fDe},onAbort:()=>{se(M6)},onOpenProject:ue,get onNewConversationInProject(){return O6},onOpenFile:de,onModelChange:e=>{se(()=>hDe(e))},onThinkingLevelChange:e=>{se(()=>v6(e))},onModeChange:e=>{se(()=>y6(e))},onPermissionChange:e=>{se(()=>b6(e))},onGrantApproval:e=>void oDe(e),onDenyApproval:e=>void sDe(e),onAcceptPlanReview:(e,t)=>cDe(e,t),onAcceptPlanReviewInNewChat:(e,t)=>lDe(e,t),onRejectPlanReview:e=>void uDe(e),onContinueFromFailure:e=>{se(()=>jDe(e))},onNavigateToEntry:(e,t)=>{ce(e,t)},onEditEntry:e=>{le(e)},onOpenHistory:()=>{se(HEe)}})}O()}function h8(){let e=hT.conversationId??yT.activeConversationTabId;if(e)return yT.conversationViews[UT(e)]}function g8(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return yT.pendingConversations[WT(e.id)]}var _8={get activeProject(){return H6.activeProject},get activeConversation(){return H6.activeConversation},get activeAgent(){return H6.activeAgent},get activePendingConversation(){return g8()},get pendingConversationActive(){return!!g8()},get activeUserQuestion(){let e=hT.conversationId,t=hT.agentId;return Y.userQuestions.find(n=>e&&n.conversationId===e?!0:!!(t&&n.agentId===t))},get activePlanReview(){let e=hT.conversationId,t=hT.agentId;return Y.planReviews.find(n=>e&&n.conversationId===e?!0:!!(t&&n.agentId===t))},get conversationActivityById(){return H6.conversationActivityById},get conversationAgents(){return Y.agents.filter(e=>e.conversationId===hT.conversationId)},get pendingApprovalCount(){return Y.approvals.length},get conversationLiveState(){return h8()?.live},get transcript(){return h8()?.transcript??[]},get toolCalls(){return h8()?.toolCalls??[]},get treeNodes(){return h8()?.treeNodes??[]},get streamingText(){return h8()?.streamingText??``},get queuedPrompts(){return h8()?.queuedPrompts??[]},get activeComposerText(){return g8()?.composerText??h8()?.composerText??``},get gitSuggestions(){return p8.gitSuggestions},get slashCompletions(){return yT.slashCompletions},get selectedModelKey(){return yT.selectedModelKey},get selectedThinkingLevel(){return yT.selectedThinkingLevel},get selectedMode(){return yT.selectedMode},get selectedPermissionLevel(){return yT.selectedPermissionLevel},get activeContextUsage(){return h8()?.contextUsage},get activeModelInfo(){let e=Y.agents.find(e=>e.id===hT.agentId)?.model;if(e)return CT.models.find(t=>t.provider===e.provider&&t.modelId===e.modelId)},get activeContextWindow(){let e=CT.models.find(e=>YT(e)===yT.selectedModelKey);return e?.contextWindow?e.contextWindow:this.activeModelInfo?.contextWindow?this.activeModelInfo.contextWindow:h8()?.contextUsage?.contextWindow??0},get activeConversationUsage(){let e={input:0,output:0,cacheRead:0,cacheWrite:0,cost:0};for(let t of h8()?.transcript??[])t.usage&&(e.input+=t.usage.input,e.output+=t.usage.output,e.cacheRead+=t.usage.cacheRead,e.cacheWrite+=t.usage.cacheWrite,e.cost+=t.usage.cost);return e},get usableModels(){return oE(CT.models,CT.authProviders,CT.settingsDraft?.scopedModels)},get live(){return Y.connection===`live`},get sending(){return g8()?.sending??h8()?.sending??!1},get activeSubscriptionProvider(){return Y.agents.find(e=>e.id===hT.agentId)?.model?.provider??XT(yT.selectedModelKey)?.provider},get activeSubscriptionUsage(){let e=this.activeSubscriptionProvider;if(e)return _Z.subscriptionUsage[e]}},SOe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`size`]),COe=L(`<div><!></div>`);function v8(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`size`,3,`default`),i=G(t,SOe);var a=COe();_a(a,e=>({"data-slot":`card`,"data-size":r(),class:e,...i}),[()=>ol(`ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-xl py-6 text-sm shadow-xs ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col`,t.class)]),H(M(a),()=>t.children??w),T(a),Ta(a,e=>n(e),()=>n()),z(e,a),O()}function y8(e){return e?.status===`pending`}function wOe(e){return e.some(e=>y8(e.checks))}function TOe(e,t,n){return`${e}:${encodeURIComponent(t)}:${n}`}function b8(e){PT({kind:`pr`,id:e})}async function x8(e){let t=xT.prViews[KT(e)];if(!(!t||t.loading)){t.loading=!0,t.error=void 0;try{t.detail=await tie(t.projectId,t.repo,t.number)}catch(e){let n=e instanceof Error?e.message:String(e);t.error=n,id.error(`Could not open pull request`,{description:n})}finally{t.loading=!1}}}async function EOe(e){let t=TOe(e.projectId,e.repo,e.number),n=KT(t);b8(t),xT.prViews[n]??={id:t,projectId:e.projectId,repo:e.repo,number:e.number,loading:!1},RT({kind:`pr`,id:t}),await x8(t)}async function DOe(e){let t=xT.prViews[KT(e)];t&&(b8(e),RT({kind:`pr`,id:e}),!t.detail&&!t.loading&&await x8(e))}async function S8(e){await x8(e)}function OOe(e){let t={kind:`pr`,id:e},n=Y.activeCenterTab?.kind===`pr`&&Y.activeCenterTab.id===e,r=IT(t);LT(t),delete xT.prViews[KT(e)],n&&BT(r)}var kOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function C8(e,t){let n=G(t,kOe),r=[[`path`,{d:`M12 17V3`}],[`path`,{d:`m6 11 6 6 6-6`}],[`path`,{d:`M19 21H5`}]];ic(e,K({name:`arrow-down-to-line`},()=>n,{get iconNode(){return r}}))}var AOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function w8(e,t){let n=G(t,AOe),r=[[`path`,{d:`m18 9-6-6-6 6`}],[`path`,{d:`M12 3v14`}],[`path`,{d:`M5 21h14`}]];ic(e,K({name:`arrow-up-from-line`},()=>n,{get iconNode(){return r}}))}var jOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function T8(e,t){let n=G(t,jOe),r=[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`}]];ic(e,K({name:`file-pen`},()=>n,{get iconNode(){return r}}))}var E8=48;function MOe(e){return e.relativePath===`.`?`project root`:e.relativePath}function NOe(e){return e.untracked?`text-muted-foreground`:e.index===`A`?`text-success`:e.index===`D`||e.worktree===`D`?`text-destructive`:`text-info`}function POe(e,t){if(e.untracked)return`?`;let n=t===`staged`?e.index:e.worktree;return n===` `?e.index===` `?`M`:e.index:n}function FOe(e,t){let n=t===`staged`?e.index:e.worktree;if(e.untracked)return`untracked`;switch(n){case`A`:return`added`;case`D`:return`deleted`;case`R`:return`renamed`;case`M`:return`modified`;case`U`:return`conflict`;default:return t}}function IOe(e){if(e.length<=E8)return e;let t=e.split(`/`);if(t.length<=2){let t=Math.ceil(Math.max(8,E8-3)/2);return`${e.slice(0,t)}...${e.slice(-22)}`}let n=t[0],r=[t.at(-1)??``];for(let e=t.length-2;e>0;--e){let i=`${n}/.../${[t[e],...r].join(`/`)}`;if(i.length>E8&&r.length>1||(r.unshift(t[e]),i.length>=E8))break}return`${n}/.../${r.join(`/`)}`}function LOe(e){let t=e.lastIndexOf(`/`);return t===-1?{dir:``,base:e}:{dir:e.slice(0,t+1),base:e.slice(t+1)}}function ROe(e){switch(e.status){case`passing`:return`good`;case`failing`:return`danger`;case`pending`:return`warn`;default:return`neutral`}}var zOe=L(`<span class="text-muted-foreground"> </span>`),BOe=L(`<div class="group flex min-h-0 items-center gap-1 px-1 text-xs leading-tight"><span> </span> <div class="min-w-0 flex-1 truncate font-mono"><!><span class="text-foreground"> </span></div> <div class="flex w-9 shrink-0 items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100"><!> <!></div></div>`),VOe=L(`<span> </span> <span class="text-muted-foreground/50">·</span> <span> </span>`,1),D8=L(`<div class="py-1 text-xs text-muted-foreground">Loading…</div>`),HOe=L(`<p class="py-1 text-xs text-muted-foreground">Working tree clean.</p>`),UOe=L(`<div class="flex flex-col gap-0.5"><div class="flex h-5 items-center gap-1 px-1 text-xs font-medium text-muted-foreground"><span>Staged</span> <!> <span class="ml-auto"> </span></div> <!></div>`),WOe=L(`<div class="flex flex-col gap-0.5"><div class="flex h-5 items-center gap-1 px-1 text-xs font-medium text-muted-foreground"><span>Unstaged</span> <!> <span class="ml-auto"> </span></div> <!></div>`),GOe=L(`<div class="flex flex-col gap-1"><!> <!></div>`);function KOe(e,t){D(t,!0);let n=(e,n=w,r=w)=>{let i=k(()=>LOe(IOe(n().path))),a=k(()=>t.fileMutation?.path===n().path);var o=BOe(),s=M(o),c=M(s,!0);T(s);var l=P(s,2),u=M(l),d=e=>{var t=zOe(),n=M(t,!0);T(t),F(()=>B(n,I(i).dir)),z(e,t)};V(u,e=>{I(i).dir&&e(d)});var f=P(u),p=M(f,!0);T(f),T(l);var m=P(l,2),h=M(m),g=e=>{{let r=k(()=>`Unstage ${n().path}`);Ol(e,{size:`icon-xs`,class:`size-4`,variant:`ghost`,get ariaLabel(){return I(r)},title:`Unstage`,get disabled(){return I(a)},onclick:()=>t.onMutateFile(t.selectedRepo,n(),`unstage`),children:(e,n)=>{var r=R(),i=N(r),o=e=>{GE(e,{class:`animate-spin`})},s=e=>{C8(e,{})};V(i,e=>{I(a)&&t.fileMutation?.action===`unstage`?e(o):e(s,-1)}),z(e,r)},$$slots:{default:!0}})}},_=e=>{{let r=k(()=>`Stage ${n().path}`);Ol(e,{size:`icon-xs`,class:`size-4`,variant:`ghost`,get ariaLabel(){return I(r)},title:`Stage`,get disabled(){return I(a)},onclick:()=>t.onMutateFile(t.selectedRepo,n(),`stage`),children:(e,n)=>{var r=R(),i=N(r),o=e=>{GE(e,{class:`animate-spin`})},s=e=>{w8(e,{})};V(i,e=>{I(a)&&t.fileMutation?.action===`stage`?e(o):e(s,-1)}),z(e,r)},$$slots:{default:!0}})}};V(h,e=>{r()===`staged`?e(g):e(_,-1)});var v=P(h,2);{let e=k(()=>`Discard ${n().path}`);Ol(v,{size:`icon-xs`,class:`size-4`,variant:`ghost`,get ariaLabel(){return I(e)},title:`Discard`,get disabled(){return I(a)},onclick:()=>t.onRequestDiscard(n()),children:(e,n)=>{var r=R(),i=N(r),o=e=>{GE(e,{class:`animate-spin`})},s=e=>{KX(e,{})};V(i,e=>{I(a)&&t.fileMutation?.action===`discard`?e(o):e(s,-1)}),z(e,r)},$$slots:{default:!0}})}T(m),T(o),F((e,t,r)=>{Qi(s,1,e),W(s,`title`,t),B(c,r),W(l,`title`,n().path),B(p,I(i).base)},[()=>Ki(ol(`w-3 shrink-0 text-center font-mono font-semibold`,NOe(n()))),()=>FOe(n(),r()),()=>POe(n(),r())]),z(e,o)},r=q(t,`open`,15,!0);tT(e,{title:`Changes`,get icon(){return T8},contentClass:`px-2 py-1.5`,get open(){return r()},set open(e){r(e)},meta:e=>{var n=R(),r=N(n),i=e=>{var n=VOe(),r=N(n),i=M(r);T(r);var a=P(r,4),o=M(a);T(a),F(()=>{B(i,`${t.changes.stagedCount??``} staged`),B(o,`${t.changes.unstagedCount+t.changes.untrackedCount} unstaged`)}),z(e,n)};V(r,e=>{t.changes&&e(i)}),z(e,n)},children:(e,r)=>{var i=R(),a=N(i),o=e=>{z(e,D8())},s=e=>{var r=R(),i=N(r),a=e=>{z(e,HOe())},o=e=>{var r=GOe(),i=M(r),a=e=>{var r=UOe(),i=M(r),a=P(M(i),2);{let e=k(()=>!!t.bulkMutation||!!t.fileMutation);Ol(a,{size:`icon-xs`,class:`size-5`,variant:`ghost`,ariaLabel:`Unstage all`,title:`Unstage all`,get disabled(){return I(e)},onclick:()=>t.onBulkStage(t.selectedRepo,`unstage-all`),children:(e,n)=>{var r=R(),i=N(r),a=e=>{GE(e,{class:`animate-spin`})},o=e=>{C8(e,{})};V(i,e=>{t.bulkMutation===`unstage-all`?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}var o=P(a,2),s=M(o,!0);T(o),T(i),Ni(P(i,2),17,()=>t.stagedFiles,e=>e.path,(e,t)=>{n(e,()=>I(t),()=>`staged`)}),T(r),F(()=>B(s,t.stagedFiles.length)),z(e,r)};V(i,e=>{t.stagedFiles.length>0&&e(a)});var o=P(i,2),s=e=>{var r=WOe(),i=M(r),a=P(M(i),2);{let e=k(()=>!!t.bulkMutation||!!t.fileMutation);Ol(a,{size:`icon-xs`,class:`size-5`,variant:`ghost`,ariaLabel:`Stage all`,title:`Stage all`,get disabled(){return I(e)},onclick:()=>t.onBulkStage(t.selectedRepo,`stage-all`),children:(e,n)=>{var r=R(),i=N(r),a=e=>{GE(e,{class:`animate-spin`})},o=e=>{w8(e,{})};V(i,e=>{t.bulkMutation===`stage-all`?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}var o=P(a,2),s=M(o,!0);T(o),T(i),Ni(P(i,2),17,()=>t.unstagedFiles,e=>e.path,(e,t)=>{n(e,()=>I(t),()=>`unstaged`)}),T(r),F(()=>B(s,t.unstagedFiles.length)),z(e,r)};V(o,e=>{t.unstagedFiles.length>0&&e(s)}),T(r),z(e,r)};V(i,e=>{t.changes.files.length===0?e(a):e(o,-1)}),z(e,r)},c=e=>{z(e,D8())};V(a,e=>{t.loadingOverview&&!t.changes?e(o):t.changes?e(s,1):e(c,-1)}),z(e,i)},$$slots:{meta:!0,default:!0}}),O()}var qOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function O8(e,t){let n=G(t,qOe),r=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{d:`M8 16H3v5`}]];ic(e,K({name:`refresh-cw`},()=>n,{get iconNode(){return r}}))}var JOe=L(`<div class="py-1 text-xs text-muted-foreground">No remote configured for this repository.</div>`),YOe=L(`<div class="py-1 text-xs text-muted-foreground">PRs are only available for GitHub remotes.</div>`),XOe=L(`<div class="py-1 text-xs text-muted-foreground">Checking GitHub CLI…</div>`),ZOe=L(`<div class="py-1 text-xs text-muted-foreground"> </div>`),QOe=L(`<div class="py-1 text-xs text-muted-foreground">Not authenticated. Run <code class="font-mono">gh auth login</code>.</div>`),$Oe=L(`<div class="py-1 text-xs text-muted-foreground">Loading…</div>`),eke=L(`<div class="py-1 text-xs text-muted-foreground">No open PRs for this repository.</div>`),tke=L(`<!> `,1),nke=L(`<div class="flex items-center gap-1.5 text-xs"><span class="font-mono text-muted-foreground"> </span> <span class="truncate text-foreground"> </span></div>`),rke=L(`<div class="mt-1.5 flex flex-col gap-1 rounded-md border bg-background px-2 py-1.5"></div>`),ike=L(`<div><div class="flex items-center gap-1.5"><button type="button" class="flex min-w-0 flex-1 items-center gap-1.5 text-left text-xs text-foreground hover:underline"><span class="font-mono text-muted-foreground"> </span> <span class="truncate"> </span></button> <a target="_blank" rel="noreferrer" class="shrink-0 text-muted-foreground hover:text-foreground" title="Open in browser" aria-label="Open in browser"><!></a></div> <div class="mt-1 flex flex-wrap items-center gap-1.5"><!> <!> <button type="button" title="Toggle check details"><!></button> <span class="truncate font-mono text-xs text-muted-foreground"> </span></div> <!></div>`),ake=L(`<div class="flex flex-col gap-1.5"></div>`);function oke(e,t){D(t,!0);let n=q(t,`expandedPr`,15,void 0),r=q(t,`open`,15,!0);tT(e,{title:`PRs (GitHub)`,get icon(){return m$},get open(){return r()},set open(e){r(e)},actions:e=>{var n=R(),r=N(n),i=e=>{{let n=k(()=>`Refresh PRs · signed in as ${t.github.login??`unknown`}`);Ol(e,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Refresh PRs`,get title(){return I(n)},get disabled(){return t.loadingPrs},onclick:()=>t.onRefreshPrs(),children:(e,n)=>{{let n=k(()=>t.loadingPrs?`animate-spin`:``);O8(e,{get class(){return I(n)}})}},$$slots:{default:!0}})}};V(r,e=>{t.selectedRepoHasGithubRemote&&t.github?.authenticated&&e(i)}),z(e,n)},children:(e,r)=>{var i=R(),a=N(i),o=e=>{z(e,JOe())},s=e=>{z(e,YOe())},c=e=>{z(e,XOe())},l=e=>{var n=ZOe(),r=M(n,!0);T(n),F(()=>B(r,t.github.reason??`GitHub CLI (gh) is not installed.`)),z(e,n)},u=e=>{z(e,QOe())},d=e=>{z(e,$Oe())},f=e=>{z(e,eke())},p=e=>{var r=ake();Ni(r,21,()=>t.sortedPrs,e=>e.number,(e,r)=>{let i=k(()=>t.currentBranchName!==null&&I(r).headRefName===t.currentBranchName);var a=ike(),o=M(a),s=M(o),c=M(s),l=M(c);T(c);var u=P(c,2),d=M(u,!0);T(u),T(s);var f=P(s,2);yQ(M(f),{size:12}),T(f),T(o);var p=P(o,2),m=M(p),h=e=>{of(e,{tone:`accent`,size:`xs`,children:(e,t)=>{E(),z(e,wi(`current`))},$$slots:{default:!0}})};V(m,e=>{I(i)&&e(h)});var g=P(m,2),_=e=>{of(e,{tone:`neutral`,size:`xs`,children:(e,t)=>{E(),z(e,wi(`draft`))},$$slots:{default:!0}})};V(g,e=>{I(r).isDraft&&e(_)});var v=P(g,2),y=M(v);{let e=k(()=>ROe(I(r).checks));of(y,{get tone(){return I(e)},size:`xs`,children:(e,t)=>{var n=tke(),i=N(n),a=e=>{ZQ(e,{size:11})},o=e=>{KX(e,{size:11})},s=e=>{GE(e,{size:11,class:`animate-spin`})};V(i,e=>{I(r).checks.status===`passing`?e(a):I(r).checks.status===`failing`?e(o,1):I(r).checks.status===`pending`&&e(s,2)});var c=P(i);F(()=>B(c,` ${I(r).checks.status===`none`?`no checks`:`${I(r).checks.passed}/${I(r).checks.total}`}`)),z(e,n)},$$slots:{default:!0}})}T(v);var b=P(v,2),x=M(b);T(b),T(p);var S=P(p,2),ee=e=>{var t=rke();Ni(t,21,()=>I(r).checks.runs,Ai,(e,t)=>{var n=nke(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(n),F(()=>{B(i,I(t).status),B(o,I(t).name)}),z(e,n)}),T(t),z(e,t)};V(S,e=>{n()===I(r).number&&I(r).checks.runs.length>0&&e(ee)}),T(a),F(e=>{Qi(a,1,e),B(l,`#${I(r).number??``}`),B(d,I(r).title),W(f,`href`,I(r).url),B(x,`${I(r).baseRefName??``} ← ${I(r).headRefName??``}`)},[()=>Ki(ol(`rounded-md border px-2 py-1.5`,I(i)&&`border-accent bg-muted/40`))]),_i(`click`,s,()=>t.onOpenPr(I(r).number)),_i(`click`,v,()=>n(n()===I(r).number?void 0:I(r).number)),z(e,a)}),T(r),z(e,r)};V(a,e=>{t.selectedRepoSummary&&!t.selectedRepoSummary.hasRemote?e(o):t.selectedRepoSummary&&!t.selectedRepoSummary.hasGithubRemote?e(s,1):t.github?t.github.available?t.github.authenticated?t.loadingPrs&&t.prs.length===0?e(d,5):t.sortedPrs.length===0?e(f,6):e(p,-1):e(u,4):e(l,3):e(c,2)}),z(e,i)},$$slots:{actions:!0,default:!0}}),O()}vi([`click`]);var ske=new Set([`$$slots`,`$$events`,`$$legacy`]);function cke(e,t){let n=G(t,ske),r=[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]];ic(e,K({name:`arrow-up`},()=>n,{get iconNode(){return r}}))}var lke=new Set([`$$slots`,`$$events`,`$$legacy`]);function uke(e,t){let n=G(t,lke),r=[[`path`,{d:`M12 13v8l-4-4`}],[`path`,{d:`m12 21 4-4`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`}]];ic(e,K({name:`cloud-download`},()=>n,{get iconNode(){return r}}))}var dke=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function k8(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,dke);var i=R();U(N(i),()=>ib,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var fke=new Set([`$$slots`,`$$events`,`$$legacy`]);function pke(e,t){let n=G(t,fke);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var mke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`align`,`portalProps`]);function A8(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,4),i=q(t,`align`,3,`center`),a=G(t,mke);pke(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ol(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-72 origin-(--transform-origin) outline-hidden`,t.class));U(c,()=>ky,(t,o)=>{o(t,K({"data-slot":`popover-content`,get sideOffset(){return r()},get align(){return i()},get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,s)},$$slots:{default:!0}})),O()}var hke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function j8(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,hke);var i=R(),a=N(i);{let e=k(()=>ol(``,t.class));U(a,()=>My,(t,i)=>{i(t,K({"data-slot":`popover-trigger`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var gke=Cl({base:`hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive gap-1 rounded-md text-sm font-medium transition-[color,box-shadow] [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-muted border bg-transparent shadow-xs`},size:{default:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function _ke(e){xt(`toggleGroup`,e)}function vke(){return bt(`toggleGroup`)}var yke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`spacing`,`orientation`,`variant`]);function bke(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15),i=q(t,`size`,3,`default`),a=q(t,`spacing`,3,0),o=q(t,`orientation`,3,`horizontal`),s=q(t,`variant`,3,`default`),c=G(t,yke);_ke({get variant(){return s()},get size(){return i()},get spacing(){return a()},get orientation(){return o()}});var l=R(),u=N(l);{let e=k(()=>`--gap: ${a()}`),l=k(()=>ol(`rounded-md data-[spacing=0]:data-[variant=outline]:shadow-xs group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-vertical:flex-col data-vertical:items-stretch`,t.class));U(u,()=>bS,(t,u)=>{u(t,K({get orientation(){return o()},"data-slot":`toggle-group`,get"data-variant"(){return s()},get"data-size"(){return i()},get"data-spacing"(){return a()},get style(){return I(e)},get class(){return I(l)}},()=>c,{get value(){return r()},set value(e){r(e)},get ref(){return n()},set ref(e){n(e)}}))})}z(e,l),O()}var xke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`variant`]);function Ske(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,xke),i=vke();var a=R(),o=N(a);{let e=k(()=>i.variant||t.variant),a=k(()=>i.size||t.size),s=k(()=>ol(`data-[state=on]:bg-muted group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,gke({variant:i.variant||t.variant,size:i.size||t.size}),t.class));U(o,()=>CS,(o,c)=>{c(o,K({"data-slot":`toggle-group-item`,get"data-variant"(){return I(e)},get"data-size"(){return I(a)},get"data-spacing"(){return i.spacing},get class(){return I(s)},get value(){return t.value}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var Cke=L(`<span class="inline-flex h-6 w-6 items-center justify-center text-muted-foreground" role="status" aria-label="Refreshing Git status" title="Refreshing Git status"><!></span>`),wke=L(`<!> <span class="truncate font-mono"> </span> <!>`,1),Tke=L(`<div class="flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground"><!> Loading branches…</div>`),Eke=L(`<div class="px-3 py-2 text-xs text-muted-foreground">No branches found.</div>`),Dke=L(`<button type="button" class="flex w-full items-center gap-2 border-b px-2.5 py-1.5 text-left text-xs last:border-b-0 hover:bg-muted/60 disabled:opacity-60"><!> <span class="min-w-0 flex-1 truncate font-mono text-foreground"> </span> <!></button>`),Oke=L(`<!> Create`,1),kke=L(`<div class="flex flex-col gap-0.5"><div class="text-xs font-medium text-foreground">Switch branch</div> <div class="text-xs text-muted-foreground">Current: <span class="font-mono text-foreground"> </span></div></div> <div class="relative"><!> <!></div> <div class="max-h-56 overflow-y-auto rounded-md border"><!></div> <div class="flex flex-col gap-1.5 border-t pt-3"><div class="text-xs font-medium text-foreground">Create from current</div> <div class="flex gap-1.5"><!> <!></div></div>`,1),M8=L(`<!> <!>`,1),Ake=L(`<span class="text-muted-foreground">local only</span>`),jke=L(`<span class="text-muted-foreground">no upstream</span>`),Mke=L(`<span class="flex items-center gap-0.5 text-muted-foreground"><!> up to date</span>`),N8=L(`<!> `,1),Nke=L(`<div class="flex flex-col gap-2"><!> <div class="flex items-center gap-2"><!> <!> <div class="flex min-w-0 items-center gap-1 text-xs"><!> <!></div></div></div>`),Pke=L(`<div class="py-1 text-xs text-muted-foreground">Loading…</div>`);function Fke(e,t){D(t,!0);let n=e=>{var n=R(),r=N(n),i=e=>{var t=Cke();GE(M(t),{size:12,class:`animate-spin`}),T(t),z(e,t)};V(r,e=>{t.refreshing&&e(i)}),z(e,n)},r=q(t,`branchFilter`,15,``),i=q(t,`newBranchName`,15,``),a=q(t,`branchPopoverOpen`,15,!1),o=q(t,`open`,15,!0);tT(e,{title:`Repo & Branch`,get icon(){return Td},get actions(){return n},get open(){return o()},set open(e){o(e)},children:(e,n)=>{var o=R(),s=N(o),c=e=>{let n=k(()=>t.repoSummary);var o=Nke(),s=M(o),c=e=>{bke(e,{type:`single`,get value(){return t.selectedRepo},variant:`outline`,size:`sm`,class:`flex-wrap`,onValueChange:e=>{e&&t.onSelectRepo(e)},children:(e,n)=>{var r=R();Ni(N(r),17,()=>t.repos,e=>e.relativePath,(e,t,n,r)=>{{let n=k(()=>`Switch to ${I(t).name}`),r=k(()=>MOe(I(t)));Ske(e,{get value(){return I(t).relativePath},get"aria-label"(){return I(n)},get title(){return I(r)},class:`font-mono text-xs`,children:(e,n)=>{E();var r=wi();F(()=>B(r,I(t).name)),z(e,r)},$$slots:{default:!0}})}}),z(e,r)},$$slots:{default:!0}})};V(s,e=>{t.repos.length>1&&e(c)});var l=P(s,2),u=M(l);U(u,()=>k8,(e,o)=>{o(e,{get open(){return a()},set open(e){a(e)},children:(e,a)=>{var o=M8(),s=N(o);{let e=k(()=>ol(`inline-flex min-w-0 items-center gap-1.5 rounded-md border bg-background px-2 py-1 text-xs font-medium text-foreground shadow-xs transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,I(n).detached&&`text-muted-foreground`));U(s,()=>j8,(t,r)=>{r(t,{get class(){return I(e)},children:(e,t)=>{var r=wke(),i=N(r);Td(i,{size:12,strokeWidth:2.2,class:`shrink-0`});var a=P(i,2),o=M(a,!0);T(a),Iw(P(a,2),{size:12,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`}),F(()=>B(o,I(n).currentBranch??`(detached)`)),z(e,r)},$$slots:{default:!0}})})}U(P(s,2),()=>A8,(e,a)=>{a(e,{align:`start`,collisionPadding:8,class:`w-[min(360px,calc(100vw-2rem))] gap-3 p-3`,children:(e,a)=>{var o=kke(),s=N(o),c=P(M(s),2),l=P(M(c)),u=M(l,!0);T(l),T(c),T(s);var d=P(s,2),f=M(d);rZ(f,{size:13,strokeWidth:2.1,class:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground`}),SQ(P(f,2),{placeholder:`Filter branches`,class:`h-8 pl-7 text-xs`,get value(){return r()},set value(e){r(e)}}),T(d);var p=P(d,2),m=M(p),h=e=>{var t=Tke();GE(M(t),{size:13,class:`animate-spin`}),E(),T(t),z(e,t)},g=e=>{z(e,Eke())},_=e=>{var n=R();Ni(N(n),17,()=>t.filteredBranches,e=>e.name,(e,n)=>{var r=Dke(),i=M(r),a=e=>{GE(e,{size:13,class:`animate-spin text-muted-foreground`})},o=e=>{ZQ(e,{size:13,class:`text-success`})},s=e=>{Td(e,{size:13,class:`text-muted-foreground`})};V(i,e=>{t.switchingBranch===I(n).name?e(a):I(n).current?e(o,1):e(s,-1)});var c=P(i,2),l=M(c,!0);T(c);var u=P(c,2),d=e=>{of(e,{tone:`neutral`,size:`xs`,children:(e,t)=>{E(),z(e,wi(`remote`))},$$slots:{default:!0}})};V(u,e=>{I(n).remote&&e(d)}),T(r),F(()=>{r.disabled=I(n).current||t.switchingBranch===I(n).name,B(l,I(n).name)}),_i(`click`,r,()=>void t.onSwitchBranch(t.selectedRepo,I(n))),z(e,r)}),z(e,n)};V(m,e=>{t.loadingBranches?e(h):t.filteredBranches.length===0?e(g,1):e(_,-1)}),T(p);var v=P(p,2),y=P(M(v),2),b=M(y);SQ(b,{placeholder:`feature/branch-name`,class:`h-8 font-mono text-xs`,get value(){return i()},set value(e){i(e)}});var x=P(b,2);{let e=k(()=>t.creatingBranch||i().trim().length===0);Ol(x,{size:`sm`,get disabled(){return I(e)},onclick:()=>void t.onCreateBranch(t.selectedRepo),children:(e,n)=>{var r=Oke(),i=N(r),a=e=>{GE(e,{class:`animate-spin`})},o=e=>{Td(e,{})};V(i,e=>{t.creatingBranch?e(a):e(o,-1)}),E(),z(e,r)},$$slots:{default:!0}})}T(y),T(v),F(()=>B(u,I(n).currentBranch??`detached`)),z(e,o)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})});var d=P(u,2),f=e=>{Ol(e,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Fetch`,title:`Fetch from remote`,get disabled(){return t.fetching},onclick:()=>void t.onFetch(t.selectedRepo),children:(e,n)=>{var r=R(),i=N(r),a=e=>{GE(e,{class:`animate-spin`})},o=e=>{uke(e,{})};V(i,e=>{t.fetching?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})};V(d,e=>{I(n).hasRemote&&e(f)});var p=P(d,2),m=M(p),h=e=>{z(e,Ake())},g=e=>{z(e,jke())},_=e=>{var t=Mke();ZQ(M(t),{size:12,strokeWidth:2.2}),E(),T(t),z(e,t)},v=e=>{var r=M8(),i=N(r),a=e=>{{let r=k(()=>`Sync branch (${I(n).ahead} commits to push)`),i=k(()=>t.syncing||I(n).detached);Ol(e,{size:`xs`,variant:`ghost`,class:`gap-0.5 px-1.5 font-mono text-info`,title:`Sync current branch with upstream`,get ariaLabel(){return I(r)},get disabled(){return I(i)},onclick:()=>void t.onSync(t.selectedRepo),children:(e,r)=>{var i=N8(),a=N(i),o=e=>{GE(e,{class:`animate-spin`})},s=e=>{cke(e,{strokeWidth:2.4})};V(a,e=>{t.syncing?e(o):e(s,-1)});var c=P(a);F(()=>B(c,` ${I(n).ahead??``}`)),z(e,i)},$$slots:{default:!0}})}};V(i,e=>{(I(n).ahead??0)>0&&e(a)});var o=P(i,2),s=e=>{{let r=k(()=>`Sync branch (${I(n).behind} commits to pull)`),i=k(()=>t.syncing||I(n).detached);Ol(e,{size:`xs`,variant:`ghost`,class:`gap-0.5 px-1.5 font-mono text-warning`,title:`Sync current branch with upstream`,get ariaLabel(){return I(r)},get disabled(){return I(i)},onclick:()=>void t.onSync(t.selectedRepo),children:(e,r)=>{var i=N8(),a=N(i),o=e=>{GE(e,{class:`animate-spin`})},s=e=>{lE(e,{strokeWidth:2.4})};V(a,e=>{t.syncing?e(o):e(s,-1)});var c=P(a);F(()=>B(c,` ${I(n).behind??``}`)),z(e,i)},$$slots:{default:!0}})}};V(o,e=>{(I(n).behind??0)>0&&e(s)}),z(e,r)};V(m,e=>{I(n).hasRemote?I(n).hasUpstream?(I(n).ahead??0)===0&&(I(n).behind??0)===0?e(_,2):e(v,-1):e(g,1):e(h)});var y=P(m,2),b=e=>{of(e,{tone:`warn`,size:`xs`,children:(e,t)=>{E(),z(e,wi(`detached`))},$$slots:{default:!0}})};V(y,e=>{I(n).detached&&e(b)}),T(p),T(l),T(o),z(e,o)},l=e=>{z(e,Pke())};V(s,e=>{t.repoSummary?e(c):e(l,-1)}),z(e,o)},$$slots:{default:!0}}),O()}vi([`click`]);var Ike=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">Select a project to inspect its git repositories.</p>`),Lke=L(`<div class="px-3 py-3 text-xs text-destructive"> </div>`),Rke=L(`<div class="flex items-center justify-center gap-2 px-1 py-6 text-xs text-muted-foreground"><!> Loading git repositories…</div>`),zke=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">No git repositories found in this directory (searched up to 2 levels deep).</p>`),Bke=L(`<div class="px-3 py-2 text-xs text-warning"> </div>`),Vke=L(`<div class="flex flex-col gap-2"><!> <!> <!> <!></div>`),Hke=L(`<div class="p-2"><!></div> <!>`,1);function Uke(e,t){D(t,!0);let n=A(!0),r=A(!0),i=A(!0),a=A(!1),o=A(``),s=A(``),c=A(void 0),l=A(void 0),u=A(!1),d=k(()=>t.activeProject?K6.projects[qT(t.activeProject.id)]:void 0),f=k(()=>I(d)?.repos??[]),p=k(()=>I(d)?.selectedRepo??`.`),m=k(()=>I(d)?.repoStates[JT(I(p))]),h=k(()=>I(m)?.repoSummary),g=k(()=>I(m)?.changes),_=k(()=>I(m)?.operations),v=k(()=>I(m)?.github),y=k(()=>I(m)?.prs??[]),b=k(()=>I(m)?.branches??[]),x=k(()=>I(h)??I(f).find(e=>e.relativePath===I(p))),S=k(()=>!!(I(x)?.hasRemote&&I(x).hasGithubRemote)),ee=k(()=>I(d)?.discoverError),C=k(()=>I(d)?.loadingRepos??!1),te=k(()=>!!(t.activeProject&&!I(d))||I(C)||!!(I(d)?.reposRequestInFlight&&!I(d).loaded&&I(f).length===0)),ne=k(()=>I(d)?.refreshingRepos??!1),re=k(()=>I(m)?.loadingOverview??!1),ie=k(()=>I(m)?.loadingPrs??!1),ae=k(()=>I(m)?.loadingBranches??!1),oe=k(()=>I(_)?.fetching??!1),w=k(()=>I(_)?.syncing??!1),se=k(()=>I(_)?.switchingBranch),ce=k(()=>I(_)?.creatingBranch??!1),le=k(()=>I(_)?.fileMutation),ue=k(()=>I(_)?.bulkMutation),de=k(()=>I(ne)||I(re)&&!!(I(h)||I(g))),fe=k(()=>I(g)?.files.filter(e=>e.staged)??[]),pe=k(()=>I(g)?.files.filter(e=>e.untracked||e.worktree!==` `)??[]),me=k(()=>I(h)?.currentBranch??null),he=k(()=>wOe(I(y))),ge=k(()=>I(b).filter(e=>e.name.toLowerCase().includes(I(o).trim().toLowerCase()))),_e=k(()=>[...I(y)].sort((e,t)=>{let n=I(me),r=n!==null&&e.headRefName===n;return r===(n!==null&&t.headRefName===n)?Date.parse(t.updatedAt)-Date.parse(e.updatedAt):r?-1:1}));function ve(e){!t.activeProject||e===I(p)||(dOe(t.activeProject.id,e),j(o,``),j(s,``),j(c,void 0))}async function ye(e){t.activeProject&&await pOe(t.activeProject.id,e)}async function be(e){t.activeProject&&await mOe(t.activeProject.id,e)}async function xe(e,n){t.activeProject&&await hOe(t.activeProject.id,e,n)&&(j(a,!1),j(o,``),j(s,``))}async function Se(e){!t.activeProject||I(s).trim().length===0||await gOe(t.activeProject.id,e,I(s))&&(j(a,!1),j(o,``),j(s,``))}async function Ce(e,n,r){t.activeProject&&await _Oe(t.activeProject.id,e,n,r)}async function we(e,n){t.activeProject&&await vOe(t.activeProject.id,e,n)}function Te(e){j(l,{repo:I(p),file:e},!0),j(u,!0)}function Ee(){let e=I(l);j(l,void 0),e&&Ce(e.repo,e.file,`discard`)}function De(){t.activeProject&&d8(t.activeProject.id,I(p))}function Oe(e){t.activeProject&&EOe({projectId:t.activeProject.id,repo:I(p),number:e})}let ke=A(void 0);rr(()=>{let e=t.activeProject,n=e?.id;n!==I(ke)&&(j(ke,n,!0),j(o,``),j(s,``),j(c,void 0),e&&queueMicrotask(()=>uOe(e)))}),rr(()=>{let e=t.activeProject?.id,n=I(p),r=I(f).length;if(!e||r===0||!n)return;let i=window.setInterval(()=>lOe(e,n),5e3);return()=>window.clearInterval(i)}),rr(()=>{!I(a)||!t.activeProject||I(f).length===0||cOe(t.activeProject.id,I(p))}),rr(()=>{let e=t.activeProject?.id,n=I(p),r=I(f).length,i=I(v)?.authenticated,a=I(he),o=I(S);if(!e||r===0||!n||!o||!i||!a)return;let s=()=>{typeof document<`u`&&document.visibilityState!==`visible`||d8(e,n,!0)};s();let c=window.setInterval(s,1e4);return()=>window.clearInterval(c)});var Ae=Hke(),je=N(Ae),Me=M(je),Ne=e=>{z(e,Ike())},Pe=e=>{v8(e,{class:`gap-0 overflow-hidden p-0`,children:(e,t)=>{var n=Lke(),r=M(n,!0);T(n),F(()=>B(r,I(ee))),z(e,n)},$$slots:{default:!0}})},Fe=e=>{var t=Rke();GE(M(t),{size:13,class:`animate-spin`}),E(),T(t),z(e,t)},Ie=e=>{z(e,zke())},Le=e=>{var t=Vke(),l=M(t),u=e=>{v8(e,{class:`gap-0 overflow-hidden p-0`,children:(e,t)=>{var n=Bke(),r=M(n);T(n),F(()=>B(r,`Using cached Git data. Refresh failed: ${I(ee)??``}`)),z(e,n)},$$slots:{default:!0}})};V(l,e=>{I(ee)&&e(u)});var d=P(l,2);Fke(d,{get repoSummary(){return I(h)},get repos(){return I(f)},get selectedRepo(){return I(p)},get filteredBranches(){return I(ge)},get loadingBranches(){return I(ae)},get switchingBranch(){return I(se)},get creatingBranch(){return I(ce)},get fetching(){return I(oe)},get syncing(){return I(w)},get refreshing(){return I(de)},onSelectRepo:ve,onSwitchBranch:xe,onCreateBranch:Se,onFetch:ye,onSync:be,get branchFilter(){return I(o)},set branchFilter(e){j(o,e,!0)},get newBranchName(){return I(s)},set newBranchName(e){j(s,e,!0)},get branchPopoverOpen(){return I(a)},set branchPopoverOpen(e){j(a,e,!0)},get open(){return I(n)},set open(e){j(n,e,!0)}});var m=P(d,2);KOe(m,{get changes(){return I(g)},get stagedFiles(){return I(fe)},get unstagedFiles(){return I(pe)},get fileMutation(){return I(le)},get bulkMutation(){return I(ue)},get selectedRepo(){return I(p)},get loadingOverview(){return I(re)},onMutateFile:Ce,onBulkStage:we,onRequestDiscard:Te,get open(){return I(r)},set open(e){j(r,e,!0)}}),oke(P(m,2),{get sortedPrs(){return I(_e)},get prs(){return I(y)},get selectedRepoSummary(){return I(x)},get github(){return I(v)},get selectedRepoHasGithubRemote(){return I(S)},get loadingPrs(){return I(ie)},get currentBranchName(){return I(me)},onRefreshPrs:De,onOpenPr:Oe,get expandedPr(){return I(c)},set expandedPr(e){j(c,e,!0)},get open(){return I(i)},set open(e){j(i,e,!0)}}),T(t),z(e,t)};V(Me,e=>{t.activeProject?I(ee)&&I(f).length===0?e(Pe,1):I(te)?e(Fe,2):I(f).length===0?e(Ie,3):e(Le,-1):e(Ne)}),T(je);var Re=P(je,2);{let e=k(()=>I(l)?`This will permanently discard all uncommitted changes for ${I(l).file.path}.`:`This will permanently discard this uncommitted change.`);_Q(Re,{title:`Discard change?`,get description(){return I(e)},confirmLabel:`Discard`,destructive:!0,onConfirm:Ee,onCancel:()=>j(l,void 0),get open(){return I(u)},set open(e){j(u,e,!0)}})}z(e,Ae),O()}var Wke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Gke(e,t){let n=G(t,Wke);Uke(e,K(()=>n))}function Kke(e){switch(e.status){case`passing`:return`good`;case`failing`:return`danger`;case`pending`:return`warn`;default:return`neutral`}}function qke(e){return!e||e.isDraft?`neutral`:e.state===`MERGED`?`accent`:e.state===`CLOSED`?`danger`:`good`}function Jke(e){return e?e.isDraft?`draft`:e.state.toLowerCase():``}function Yke(e){return e===`APPROVED`?`good`:e===`CHANGES_REQUESTED`?`danger`:`warn`}function Xke(e){let t=e.toLowerCase();return[`success`,`neutral`,`skipped`,`completed`].includes(t)?`good`:[`failure`,`error`,`cancelled`,`timed_out`,`action_required`].includes(t)?`danger`:`warn`}function Zke(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}var Qke=L(`<div class="pr-empty svelte-6fj9e1"><!> <strong class="svelte-6fj9e1">No pull request selected</strong> <p>Open a PR from the Git panel to view its details here.</p></div>`),$ke=L(`<div class="pr-empty svelte-6fj9e1"><!> <strong class="svelte-6fj9e1">Loading pull request</strong> <p> </p></div>`),eAe=L(`<div class="pr-empty danger svelte-6fj9e1"><!> <strong class="svelte-6fj9e1">Could not open pull request</strong> <p> </p></div>`),tAe=L(`<!> `,1),nAe=L(`<span>by <span class="mono svelte-6fj9e1"> </span></span>`),rAe=L(`<span> </span>`),iAe=L(`<!> Refresh`,1),aAe=L(`<!> Open in browser`,1),oAe=L(`<!> Checkout branch`,1),sAe=L(`<li class="pr-run svelte-6fj9e1"><!> <span class="truncate svelte-6fj9e1"> </span></li>`),cAe=L(`<section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1">Checks</h2> <ul class="pr-list svelte-6fj9e1"></ul></section>`),lAe=L(`<div class="pr-body svelte-6fj9e1"><!></div>`),uAe=L(`<p class="pr-muted svelte-6fj9e1">No description provided.</p>`),dAe=L(`<p class="pr-muted svelte-6fj9e1">No file data available.</p>`),fAe=L(`<li class="pr-file svelte-6fj9e1"><span class="mono truncate svelte-6fj9e1"> </span> <span class="mono diffstat svelte-6fj9e1"><span class="add svelte-6fj9e1"> </span> <span class="del svelte-6fj9e1"> </span></span></li>`),P8=L(`<ul class="pr-list svelte-6fj9e1"></ul>`),pAe=L(`<p class="pr-muted svelte-6fj9e1">No commit data available.</p>`),mAe=L(`<li class="pr-commit svelte-6fj9e1"><!> <span class="mono pr-hash svelte-6fj9e1"> </span> <span class="truncate svelte-6fj9e1"> </span></li>`),hAe=L(`<header class="pr-header svelte-6fj9e1"><div class="pr-title-row svelte-6fj9e1"><span class="pr-number svelte-6fj9e1"> </span> <h1 class="pr-title svelte-6fj9e1"> </h1></div> <div class="pr-meta svelte-6fj9e1"><!> <!> <!> <span class="pr-branches svelte-6fj9e1"><span class="mono svelte-6fj9e1"> </span> ← <span class="mono svelte-6fj9e1"> </span></span></div> <div class="pr-subline svelte-6fj9e1"><!> <!> <span class="mono diffstat svelte-6fj9e1"><span class="add svelte-6fj9e1"> </span> <span class="del svelte-6fj9e1"> </span> </span></div> <div class="pr-actions svelte-6fj9e1"><!> <!> <!></div></header> <!> <section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1">Description</h2> <!></section> <section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1"> </h2> <!></section> <section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1"> </h2> <!></section>`,1),gAe=L(`<section class="pr-pane svelte-6fj9e1"><!></section>`);function _Ae(e,t){D(t,!0);let n=k(()=>t.view?.detail),r=k(()=>y8(I(n)?.checks));function i(){I(n)&&window.confirm(`Check out PR #${I(n).number} (${I(n).headRefName}) in this repo?`)&&t.onCheckout?.()}rr(()=>{let e=t.view?.id,n=I(r);if(!e||!n||!t.onRefresh)return;let i=()=>{typeof document<`u`&&document.visibilityState!==`visible`||t.onRefresh()};i();let a=window.setInterval(i,1e4);return()=>window.clearInterval(a)});var a=gAe();cZ(M(a),{class:`pr-scroll`,viewportClass:`pr-viewport`,type:`auto`,children:(e,r)=>{var a=R(),o=N(a),s=e=>{var t=Qke();m$(M(t),{size:28,strokeWidth:1.7}),E(4),T(t),z(e,t)},c=e=>{var n=$ke(),r=M(n);O8(r,{class:`spin`,size:28,strokeWidth:1.7});var i=P(r,4),a=M(i);T(i),T(n),F(()=>B(a,`#${t.view.number??``}`)),z(e,n)},l=e=>{var n=eAe(),r=M(n);Ld(r,{size:28,strokeWidth:1.7});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>B(a,t.view.error)),z(e,n)},u=e=>{var r=hAe(),a=N(r),o=M(a),s=M(o),c=M(s);T(s);var l=P(s,2),u=M(l,!0);T(l),T(o);var d=P(o,2),f=M(d);{let e=k(()=>qke(I(n)));of(f,{get tone(){return I(e)},size:`sm`,children:(e,t)=>{E();var r=wi();F(e=>B(r,e),[()=>Jke(I(n))]),z(e,r)},$$slots:{default:!0}})}var p=P(f,2);{let e=k(()=>Kke(I(n).checks));of(p,{get tone(){return I(e)},size:`sm`,children:(e,t)=>{var r=tAe(),i=N(r),a=e=>{ZQ(e,{size:11})},o=e=>{KX(e,{size:11})},s=e=>{GE(e,{class:`spin`,size:11})};V(i,e=>{I(n).checks.status===`passing`?e(a):I(n).checks.status===`failing`?e(o,1):I(n).checks.status===`pending`&&e(s,2)});var c=P(i);F(()=>B(c,` ${I(n).checks.status===`none`?`no checks`:`${I(n).checks.passed}/${I(n).checks.total} checks`}`)),z(e,r)},$$slots:{default:!0}})}var m=P(p,2),h=e=>{{let t=k(()=>Yke(I(n).reviewDecision));of(e,{get tone(){return I(t)},size:`sm`,children:(e,t)=>{E();var r=wi();F(e=>B(r,e),[()=>I(n).reviewDecision.replace(`_`,` `).toLowerCase()]),z(e,r)},$$slots:{default:!0}})}};V(m,e=>{I(n).reviewDecision&&e(h)});var g=P(m,2),_=M(g),v=M(_,!0);T(_);var y=P(_,2),b=M(y,!0);T(y),T(g),T(d);var x=P(d,2),S=M(x),ee=e=>{var t=nAe(),r=P(M(t)),i=M(r,!0);T(r),T(t),F(()=>B(i,I(n).author)),z(e,t)};V(S,e=>{I(n).author&&e(ee)});var C=P(S,2),te=e=>{var t=rAe(),r=M(t);T(t),F(e=>B(r,`opened ${e??``}`),[()=>Zke(I(n).createdAt)]),z(e,t)};V(C,e=>{I(n).createdAt&&e(te)});var ne=P(C,2),re=M(ne),ie=M(re);T(re);var ae=P(re,2),oe=M(ae);T(ae);var w=P(ae);T(ne),T(x);var se=P(x,2),ce=M(se);Ol(ce,{size:`sm`,variant:`outline`,get disabled(){return t.view.loading},onclick:()=>t.onRefresh?.(),children:(e,n)=>{var r=iAe(),i=N(r);{let e=k(()=>t.view.loading?`spin`:``);O8(i,{get class(){return I(e)},size:14})}E(),z(e,r)},$$slots:{default:!0}});var le=P(ce,2);Ol(le,{size:`sm`,variant:`outline`,onclick:()=>t.onOpenExternal?.(),children:(e,t)=>{var n=aAe();yQ(N(n),{size:14}),E(),z(e,n)},$$slots:{default:!0}}),Ol(P(le,2),{size:`sm`,variant:`outline`,onclick:i,children:(e,t)=>{var n=oAe();C8(N(n),{size:14}),E(),z(e,n)},$$slots:{default:!0}}),T(se),T(a);var ue=P(a,2),de=e=>{var t=cAe(),r=P(M(t),2);Ni(r,21,()=>I(n).checks.runs,e=>e.name,(e,t)=>{var n=sAe(),r=M(n);{let e=k(()=>Xke(I(t).status));of(r,{get tone(){return I(e)},size:`xs`,children:(e,n)=>{E();var r=wi();F(()=>B(r,I(t).status)),z(e,r)},$$slots:{default:!0}})}var i=P(r,2),a=M(i,!0);T(i),T(n),F(()=>B(a,I(t).name)),z(e,n)}),T(r),T(t),z(e,t)};V(ue,e=>{I(n).checks.runs.length>0&&e(de)});var fe=P(ue,2),pe=P(M(fe),2),me=e=>{var t=lAe();U3(M(t),{get text(){return I(n).body},get onCopy(){return ad}}),T(t),z(e,t)},he=k(()=>I(n).body.trim()),ge=e=>{z(e,uAe())};V(pe,e=>{I(he)?e(me):e(ge,-1)}),T(fe);var _e=P(fe,2),ve=M(_e),ye=M(ve);T(ve);var be=P(ve,2),xe=e=>{z(e,dAe())},Se=e=>{var t=P8();Ni(t,21,()=>I(n).files,e=>e.path,(e,t)=>{var n=fAe(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a),s=M(o);T(o);var c=P(o,2),l=M(c);T(c),T(a),T(n),F(()=>{W(r,`title`,I(t).path),B(i,I(t).path),B(s,`+${I(t).additions??``}`),B(l,`−${I(t).deletions??``}`)}),z(e,n)}),T(t),z(e,t)};V(be,e=>{I(n).files.length===0?e(xe):e(Se,-1)}),T(_e);var Ce=P(_e,2),we=M(Ce),Te=M(we);T(we);var Ee=P(we,2),De=e=>{z(e,pAe())},Oe=e=>{var t=P8();Ni(t,21,()=>I(n).commits,e=>e.oid,(e,t)=>{var n=mAe(),r=M(n);p$(r,{size:13,strokeWidth:2.1});var i=P(r,2),a=M(i,!0);T(i);var o=P(i,2),s=M(o,!0);T(o),T(n),F(()=>{B(a,I(t).abbrev),B(s,I(t).messageHeadline)}),z(e,n)}),T(t),z(e,t)};V(Ee,e=>{I(n).commits.length===0?e(De):e(Oe,-1)}),T(Ce),F(()=>{B(c,`#${I(n).number??``}`),B(u,I(n).title),B(v,I(n).baseRefName),B(b,I(n).headRefName),B(ie,`+${I(n).additions??``}`),B(oe,`−${I(n).deletions??``}`),B(w,` · ${I(n).changedFiles??``} files`),B(ye,`Files changed (${I(n).changedFiles??``})`),B(Te,`Commits (${I(n).commits.length??``})`)}),z(e,r)};V(o,e=>{t.view?t.view.loading&&!I(n)?e(c,1):t.view.error&&!I(n)?e(l,2):I(n)&&e(u,3):e(s)}),z(e,a)},$$slots:{default:!0}}),T(a),z(e,a),O()}var vAe=1e4,yAe=5e3,F8=2e3,I8=new Set,L8,R8,z8=0;function bAe(e){return e===`poll`&&typeof document<`u`&&document.visibilityState!==`visible`}function B8(){R8===void 0||typeof window>`u`||(window.clearTimeout(R8),R8=void 0)}function V8(e,t,n){R8!==void 0||typeof window>`u`||(R8=window.setTimeout(()=>{R8=void 0,H8(e,{...t,force:!1})},n))}function xAe(e){let t=xT.gitContext;!t||t.projectId!==e.projectId||U6(t)!==U6(e)?xT.gitContext=e:xT.gitContext={...t,loadedAt:e.loadedAt}}async function SAe(e,t={}){let n=Y.projects.find(t=>t.id===e);if(!n)return;await c8(n,{force:t.force,silent:!0,onlyIfChanged:!t.force}),s8(e);let r=xT.gitContext;return r?.projectId===e?r:void 0}async function H8(e,t={}){let n=e??hT.projectId;if(!n||bAe(t.reason))return;t.force&&B8();let r=Date.now(),i=r-z8;if(!t.force&&z8>0&&i<F8){V8(n,t,F8-i);return}if(I8.has(n)){t.force&&V8(n,t,F8);return}z8=r,I8.add(n);try{let e=await SAe(n,t);e&&xAe(e)}catch{xT.gitContext?.projectId===n&&(xT.gitContext=void 0)}finally{I8.delete(n)}}function CAe(){B8(),xT.gitContext=void 0}function U8(){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let e=hT.projectId;UDe(xT.gitContext,e,Date.now(),yAe)&&H8(e,{reason:`focus`,force:xT.gitContext?.projectId!==e})}function wAe(){return typeof window>`u`||L8!==void 0?W8:(L8=window.setInterval(()=>{H8(hT.projectId,{reason:`poll`})},vAe),window.addEventListener(`focus`,U8),typeof document<`u`&&document.addEventListener(`visibilitychange`,U8),W8)}function W8(){typeof window>`u`||(L8!==void 0&&(window.clearInterval(L8),L8=void 0),B8(),window.removeEventListener(`focus`,U8),typeof document<`u`&&document.removeEventListener(`visibilitychange`,U8))}function G8(e){fOe(e),H8(e,{reason:`invalidate`,force:!0})}function TAe(e,t){D(t,!0);let n=k(()=>p8.activeCenterPrView);async function r(){let e=I(n);if(e)try{await nie(e.projectId,e.repo,e.number),G8(e.projectId),S8(e.id)}catch(e){Y.error=e instanceof Error?e.message:String(e)}}_Ae(e,{get view(){return I(n)},onRefresh:()=>I(n)&&void S8(I(n).id),onCheckout:()=>void r(),onOpenExternal:()=>I(n)?.detail&&window.open(I(n).detail.url,`_blank`,`noopener`)}),O()}var EAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function K8(e,t){let n=G(t,EAe),r=[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}]];ic(e,K({name:`rotate-cw`},()=>n,{get iconNode(){return r}}))}var DAe=L(`<code class="svelte-t34um8"><span class="seq svelte-t34um8">--</span><span class="time svelte-t34um8">--:--:--</span><span class="stream svelte-t34um8">--</span><span class="line svelte-t34um8">No logs captured.</span></code>`),OAe=L(`<code><span class="seq svelte-t34um8"> </span> <span class="time svelte-t34um8"> </span> <span class="stream svelte-t34um8"><!> </span> <span class="line svelte-t34um8"> </span></code>`),kAe=L(`<div class="log-terminal svelte-t34um8" role="log" aria-label="Task output" aria-live="polite"><!> <!></div>`);function AAe(e,t){D(t,!0);var n=kAe(),r=M(n),i=e=>{z(e,DAe())};V(r,e=>{(t.taskLogs?.events??[]).length===0&&e(i)}),Ni(P(r,2),17,()=>t.taskLogs?.events??[],Ai,(e,t)=>{var n=OAe(),r=M(n),i=M(r);T(r);var a=P(r,2),o=M(a,!0);T(a);var s=P(a,2),c=M(s);{let e=k(()=>Xw(I(t).level));$S(c,{size:`xs`,get tone(){return I(e)}})}var l=P(c,1,!0);T(s);var u=P(s,2),d=M(u,!0);T(u),T(n),F(e=>{Qi(n,1,Ki(I(t).level),`svelte-t34um8`),B(i,`#${I(t).seq??``}`),B(o,e),B(l,I(t).stream),B(d,I(t).line)},[()=>A1(I(t).ts)]),z(e,n)}),T(n),z(e,n),O()}var jAe=L(`<!>Refresh`,1),MAe=L(`<!>Restart`,1),NAe=L(`<!> `,1),PAe=L(`<!> <footer class="flex items-center gap-2 border-t bg-card px-3 py-1.5"><!> <!> <div class="flex min-w-0 flex-1 items-baseline gap-2"><strong class="truncate text-sm font-semibold text-foreground"> </strong> <span class="truncate font-mono text-xs text-muted-foreground"> <!><!></span></div> <!> <div class="flex shrink-0 items-center gap-0.5"><!> <!> <!></div></footer>`,1),FAe=L(`<div class="empty-center svelte-kzg5qd"><!> <p class="svelte-kzg5qd">Task not found.</p> <span>The task may have been removed or is no longer available.</span></div>`),IAe=L(`<section class="task-output-pane svelte-kzg5qd"><!></section>`);function LAe(e,t){D(t,!0);let n=k(()=>t.task?.name??t.task?.command??`Task output`),r=k(()=>t.task?.readiness.matched??t.task?.readiness.outcome),i=k(()=>Jw(t.task?.status)),a=k(()=>c(t.task)),o=k(()=>l(t.task)),s=k(()=>t.task?[`starting`,`running`,`ready`,`stopping`,`orphaned`].includes(t.task.status):!1);function c(e){let t=[];return e?.runtime?.childPid&&t.push(`pid ${e.runtime.childPid}`),e?.runtime?.platform&&t.push(e.runtime.platform),t.length>0?t.join(` · `):void 0}function l(e){let t=e?.envInfo?.keys.length??0;return t>0?`env ${t} redacted`:void 0}var u=IAe(),d=M(u),f=e=>{var c=PAe(),l=N(c);AAe(l,{get taskLogs(){return t.taskLogs}});var u=P(l,2),d=M(u);{let e=k(()=>Yw(t.task.status));$S(d,{get tone(){return I(i)},get pulse(){return I(e)}})}var f=P(d,2);Fd(f,{class:`size-3.5 shrink-0 text-muted-foreground`,strokeWidth:2.2});var p=P(f,2),m=M(p),h=M(m,!0);T(m);var g=P(m,2),_=M(g),v=P(_),y=e=>{var t=wi();F(()=>B(t,`· ${I(a)??``}`)),z(e,t)};V(v,e=>{I(a)&&e(y)});var b=P(v),x=e=>{var t=wi();F(()=>B(t,`· ${I(o)??``}`)),z(e,t)};V(b,e=>{I(o)&&e(x)}),T(g),T(p);var S=P(p,2);{let e=k(()=>I(i)===`neutral`?`border-border bg-muted text-muted-foreground`:``);of(S,{size:`xs`,get tone(){return I(i)},get class(){return I(e)},children:(e,n)=>{E();var r=wi();F(()=>B(r,t.task.status)),z(e,r)},$$slots:{default:!0}})}var ee=P(S,2),C=M(ee);Ol(C,{size:`sm`,variant:`ghost`,class:`h-7`,onclick:()=>t.onRefresh?.(),children:(e,t)=>{var n=jAe();O8(N(n),{size:13,strokeWidth:2.3}),E(),z(e,n)},$$slots:{default:!0}});var te=P(C,2);Ol(te,{size:`sm`,variant:`ghost`,class:`h-7`,onclick:()=>t.onRestart?.(t.task.id),children:(e,t)=>{var n=MAe();K8(N(n),{size:13,strokeWidth:2.3}),E(),z(e,n)},$$slots:{default:!0}});var ne=P(te,2),re=e=>{Ol(e,{size:`sm`,variant:`ghost`,class:`h-7 text-muted-foreground hover:text-destructive`,onclick:()=>t.onCancel?.(t.task.id),children:(e,n)=>{var r=NAe(),i=N(r);ZE(i,{size:13,strokeWidth:2.3});var a=P(i,1,!0);F(()=>B(a,t.task.status===`orphaned`?`Clean up`:`Cancel`)),z(e,r)},$$slots:{default:!0}})};V(ne,e=>{I(s)&&e(re)}),T(ee),T(u),F(e=>{W(m,`title`,t.task.command),B(h,I(n)),W(g,`title`,t.task.cwd),B(_,`${e??``} · ${I(r)??``}`)},[()=>Rd(t.task.cwd,t.homeDir)]),z(e,c)},p=e=>{var t=FAe();Fd(M(t),{size:30,strokeWidth:1.7}),E(4),T(t),z(e,t)};V(d,e=>{t.task?e(f):e(p,-1)}),T(u),z(e,u),O()}var q8={get tasks(){return wT.tasks},get scopedTasks(){let e=H6.activeProject?.dir;return e?wT.tasks.filter(t=>Ud(t.cwd,e)):[]},get selectedTask(){return wT.tasks.find(e=>e.id===wT.selectedTaskId)},get activeCenterTask(){let e=Y.activeCenterTab;if(e?.kind===`task`)return wT.tasks.find(t=>t.id===e.id)},get taskLogs(){return wT.taskLogs}};async function RAe(e){wT.selectedTaskId=e,wT.taskLogs=await bD(e)}async function J8(e){let t=wT.tasks.find(t=>t.id===e)?.status===`orphaned`;await pie(e),await E6(),wT.selectedTaskId&&(wT.taskLogs=await bD(wT.selectedTaskId)),id.success(t?`Orphaned task cleanup completed`:`Task cancelled`)}async function Y8(e){let t=await mie(e);FT({kind:`task`,id:e},{kind:`task`,id:t.id}),wT.selectedTaskId=t.id,await E6(),wT.taskLogs=await bD(t.id),id.success(`Task restarted`,{description:t.name??t.id})}function X8(e){LT({kind:`task`,id:e}),Y.activeCenterTab?.kind===`task`&&Y.activeCenterTab.id===e&&HT(),wT.selectedTaskId===e&&(wT.selectedTaskId=void 0,wT.taskLogs=void 0)}async function zAe(e){await hie(e),X8(e),await E6(),id.success(`Task removed`)}async function BAe(){let{removed:e}=await gie();for(let t of e)X8(t);await E6(),id.success(e.length===1?`Removed 1 finished task`:`Removed ${e.length} finished tasks`)}async function VAe(e){let t=await fie(e);return await E6(),await RAe(t.id),id.success(`Command started`,{description:e.command}),t}async function HAe(){wT.selectedTaskId&&(wT.taskLogs=await bD(wT.selectedTaskId))}function UAe(e,t){D(t,!0);let n=k(()=>H6.status),r=k(()=>q8.taskLogs),i=k(()=>q8.activeCenterTask);{let t=k(()=>I(n)?.storage.home);LAe(e,{get task(){return I(i)},get taskLogs(){return I(r)},get homeDir(){return I(t)},onRefresh:()=>void HAe(),onRestart:e=>void Y8(e),onCancel:e=>void J8(e)})}O()}var WAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Z8(e,t){let n=G(t,WAe),r=[[`path`,{d:`M12 17v5`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}]];ic(e,K({name:`pin`},()=>n,{get iconNode(){return r}}))}var GAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Q8(e,t){let n=G(t,GAe),r=[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`}]];ic(e,K({name:`play`},()=>n,{get iconNode(){return r}}))}var KAe=L(`<span class="truncate text-xs font-medium text-foreground"> </span>`),qAe=L(`<button><!> <span class="truncate font-mono text-xs text-muted-foreground"> </span></button>`),JAe=L(`<span class="tt-title"> </span>`),YAe=L(`<!> <span class="tt-row"><span class="tt-key">command</span> </span> <span class="tt-row"><span class="tt-key">cwd</span> </span>`,1),XAe=L(`<!> <!>`,1),ZAe=L(`<div class="group/row flex items-center gap-1 rounded-md border bg-card pr-1.5 transition-colors hover:border-ring/40"><!> <div class="flex shrink-0 items-center gap-0.5"><!> <!></div></div>`);function QAe(e,t){D(t,!0);let n=q(t,`cwd`,3,``),r=q(t,`running`,3,!1);function i(e){e.stopPropagation()}var a=ZAe(),o=M(a);U(o,()=>E1,(e,r)=>{r(e,{children:(e,r)=>{var i=XAe(),a=N(i);{let e=(e,n)=>{let r=()=>n?.().props;var i=qAe(),a=()=>t.onRun?.(t.command);_a(i,()=>({...r(),class:`flex min-w-0 flex-1 flex-col gap-0.5 rounded-md px-2.5 py-2 text-left`,type:`button`,onclick:a}));var o=M(i),s=e=>{var n=KAe(),r=M(n,!0);T(n),F(()=>B(r,t.command.label)),z(e,n)};V(o,e=>{t.command.label&&e(s)});var c=P(o,2),l=M(c,!0);T(c),T(i),F(()=>B(l,t.command.command)),z(e,i)};U(a,()=>k1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(a,2),()=>D1,(e,r)=>{r(e,{side:`left`,sideOffset:6,class:`nav-tooltip task-tooltip`,children:(e,r)=>{var i=YAe(),a=N(i),o=e=>{var n=JAe(),r=M(n,!0);T(n),F(()=>B(r,t.command.label)),z(e,n)};V(a,e=>{t.command.label&&e(o)});var s=P(a,2),c=P(M(s),1,!0);T(s);var l=P(s,2),u=P(M(l),1,!0);T(l),F(()=>{B(c,t.command.command),B(u,t.command.cwd??n())}),z(e,i)},$$slots:{default:!0}})}),z(e,i)},$$slots:{default:!0}})});var s=P(o,2),c=M(s);Ol(c,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Run command`,title:`Run command`,class:`text-muted-foreground hover:text-foreground`,get disabled(){return r()},onclick:e=>{i(e),t.onRun?.(t.command)},children:(e,t)=>{Q8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ol(P(c,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Remove pinned command`,title:`Remove pinned command`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{i(e),t.onRemove?.(t.command)},children:(e,t)=>{YQ(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),T(s),T(a),z(e,a),O()}var $Ae=L(`<button><!> <div class="min-w-0 flex-1 truncate font-mono text-xs text-foreground"> </div> <!> <!></button>`),eje=L(`<span class="tt-row"><span class="tt-key">env</span> </span> <span class="tt-row tt-env-keys"><span class="tt-key">keys</span> </span>`,1),tje=L(`<span class="tt-row"><span class="tt-key">pid</span> </span>`),nje=L(`<span class="tt-row"><span class="tt-key">pgid</span> </span>`),rje=L(`<span class="tt-row"><span class="tt-key">pid</span>No PID metadata captured</span>`),ije=L(`<span class="tt-row"><span class="tt-key">platform</span> </span>`),aje=L(`<span class="tt-row"><span class="tt-key">spawned</span> </span>`),oje=L(`<span class="tt-row"><span class="tt-key">finished</span> </span>`),sje=L(`<span class="tt-row"><span class="tt-key">exit</span> </span>`),cje=L(`<span class="tt-row"><span class="tt-key">signal</span> </span>`),lje=L(`<span class="tt-row"><span class="tt-key">error</span> </span>`),uje=L(`<span class="tt-title"> </span> <span class="tt-row"><span class="tt-key">command</span> </span> <span class="tt-row"><span class="tt-key">cwd</span> </span> <span class="tt-row"><span class="tt-key">status</span> </span> <!> <span class="tt-row"><span class="tt-key">started</span> </span> <!> <!> <!> <!> <!> <!> <!> <!> <span class="tt-id"> </span>`,1),$8=L(`<!> <!>`,1),dje=L(`<!> <!> <!>`,1),fje=L(`<div class="group/row flex items-center gap-1 rounded-md border bg-card pr-1.5 transition-colors hover:border-ring/40 data-[active=true]:border-primary/60 data-[active=true]:bg-muted/40"><!> <div class="flex shrink-0 items-center gap-0.5"><!></div></div>`);function e5(e,t){D(t,!0);let n=q(t,`selected`,3,!1),r=new Set([`starting`,`running`,`ready`,`stopping`]),i=k(()=>r.has(t.task.status)),a=k(()=>t.task.envInfo?.keys.length??0),o=k(()=>I(a)===0?void 0:`${I(a)} redacted ${I(a)===1?`var`:`vars`}`),s=k(()=>t.task.envInfo?.keys.join(`, `));function c(){return I(i)?[{label:`Restart task`,icon:K8,onSelect:()=>t.onRestartTask?.(t.task.id)},{label:`Cancel task`,icon:ZE,destructive:!0,onSelect:()=>t.onCancelTask?.(t.task.id)}]:t.task.status===`orphaned`?[{label:`Clean up orphan`,icon:Ld,destructive:!0,onSelect:()=>t.onCancelTask?.(t.task.id)},{label:`Restart task`,icon:K8,onSelect:()=>t.onRestartTask?.(t.task.id)},{label:`Forget record`,icon:YQ,destructive:!0,onSelect:()=>t.onRemoveTask?.(t.task.id)}]:[{label:`Restart task`,icon:K8,onSelect:()=>t.onRestartTask?.(t.task.id)},{label:`Remove task`,icon:YQ,destructive:!0,onSelect:()=>t.onRemoveTask?.(t.task.id)}]}function l(){return[{label:`Open output`,icon:Fd,onSelect:()=>t.onOpenTaskOutput?.(t.task.id)},{label:`Pin command`,icon:Z8,onSelect:()=>t.onPinTask?.(t.task)},{label:`Copy command`,icon:G3,onSelect:()=>t.onCopyCommand?.(t.task.command)},{type:`separator`},...c()]}function u(e){e.stopPropagation()}{let r=k(l);F$(e,{get items(){return I(r)},triggerClass:`task-context-trigger`,children:(e,r)=>{var c=fje(),l=M(c);U(l,()=>E1,(e,n)=>{n(e,{children:(e,n)=>{var r=$8(),i=N(r);{let e=(e,n)=>{let r=()=>n?.().props;var i=$Ae(),o=()=>t.onOpenTaskOutput?.(t.task.id);_a(i,()=>({...r(),class:`flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left`,type:`button`,onclick:o}));var c=M(i);{let e=k(()=>Jw(t.task.status)),n=k(()=>Yw(t.task.status));$S(c,{get tone(){return I(e)},get pulse(){return I(n)}})}var l=P(c,2),u=M(l,!0);T(l);var d=P(l,2),f=e=>{of(e,{tone:`neutral`,size:`xs`,get title(){return I(s)},children:(e,t)=>{E(),z(e,wi(`env`))},$$slots:{default:!0}})};V(d,e=>{I(a)>0&&e(f)});var p=P(d,2);{let e=k(()=>Jw(t.task.status)),n=k(()=>Jw(t.task.status)===`neutral`?`border-border bg-muted text-muted-foreground`:``);of(p,{get tone(){return I(e)},size:`xs`,get class(){return I(n)},children:(e,n)=>{E();var r=wi();F(()=>B(r,t.task.status)),z(e,r)},$$slots:{default:!0}})}T(i),F(()=>B(u,t.task.command)),z(e,i)};U(i,()=>k1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(i,2),()=>D1,(e,n)=>{n(e,{side:`left`,sideOffset:6,class:`nav-tooltip task-tooltip`,children:(e,n)=>{var r=uje(),i=N(r),c=M(i,!0);T(i);var l=P(i,2),u=P(M(l),1,!0);T(l);var d=P(l,2),f=P(M(d),1,!0);T(d);var p=P(d,2),m=P(M(p),1,!0);T(p);var h=P(p,2),g=e=>{var t=eje(),n=N(t),r=P(M(n),1,!0);T(n);var i=P(n,2),a=P(M(i),1,!0);T(i),F(()=>{B(r,I(o)),B(a,I(s))}),z(e,t)};V(h,e=>{I(a)>0&&e(g)});var _=P(h,2),v=P(M(_),1,!0);T(_);var y=P(_,2),b=e=>{var n=tje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.childPid)),z(e,n)};V(y,e=>{t.task.runtime?.childPid&&e(b)});var x=P(y,2),S=e=>{var n=nje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.processGroupId)),z(e,n)};V(x,e=>{t.task.runtime?.processGroupId&&e(S)});var ee=P(x,2),C=e=>{z(e,rje())};V(ee,e=>{t.task.status===`orphaned`&&!t.task.runtime?.childPid&&!t.task.runtime?.processGroupId&&e(C)});var te=P(ee,2),ne=e=>{var n=ije(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.platform)),z(e,n)};V(te,e=>{t.task.runtime?.platform&&e(ne)});var re=P(te,2),ie=e=>{var n=aje(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>M1(t.task.runtime.spawnedAt)]),z(e,n)};V(re,e=>{t.task.runtime?.spawnedAt&&e(ie)});var ae=P(re,2),oe=e=>{var n=oje(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>M1(t.task.finishedAt)]),z(e,n)};V(ae,e=>{t.task.finishedAt&&e(oe)});var w=P(ae,2),se=e=>{var n=sje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.exitCode)),z(e,n)},ce=e=>{var n=cje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.signal)),z(e,n)};V(w,e=>{t.task.exitCode!==void 0&&t.task.exitCode!==null?e(se):t.task.signal&&e(ce,1)});var le=P(w,2),ue=e=>{var n=lje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.error)),z(e,n)};V(le,e=>{t.task.error&&e(ue)});var de=P(le,2),fe=M(de,!0);T(de),F(e=>{B(c,t.task.name??t.task.command),B(u,t.task.command),B(f,t.task.cwd),B(m,t.task.status),B(v,e),B(fe,t.task.id)},[()=>M1(t.task.startedAt)]),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})});var d=P(l,2),f=M(d),p=e=>{var n=$8(),r=N(n);Ol(r,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Restart task`,title:`Restart task`,class:`text-muted-foreground hover:text-foreground`,onclick:e=>{u(e),t.onRestartTask?.(t.task.id)},children:(e,t)=>{K8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ol(P(r,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Cancel task`,title:`Cancel task`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onCancelTask?.(t.task.id)},children:(e,t)=>{ZE(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),z(e,n)},m=e=>{var n=dje(),r=N(n);Ol(r,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Clean up orphaned task`,title:`Clean up orphan`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onCancelTask?.(t.task.id)},children:(e,t)=>{Ld(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}});var i=P(r,2);Ol(i,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Restart task`,title:`Restart task`,class:`text-muted-foreground hover:text-foreground`,onclick:e=>{u(e),t.onRestartTask?.(t.task.id)},children:(e,t)=>{K8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ol(P(i,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Forget task record`,title:`Forget record`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onRemoveTask?.(t.task.id)},children:(e,t)=>{YQ(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),z(e,n)},h=e=>{var n=$8(),r=N(n);Ol(r,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Restart task`,title:`Restart task`,class:`text-muted-foreground hover:text-foreground`,onclick:e=>{u(e),t.onRestartTask?.(t.task.id)},children:(e,t)=>{K8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ol(P(r,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Remove task`,title:`Remove task`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onRemoveTask?.(t.task.id)},children:(e,t)=>{YQ(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),z(e,n)};V(f,e=>{I(i)?e(p):t.task.status===`orphaned`?e(m,1):e(h,-1)}),T(d),T(c),F(()=>W(c,`data-active`,n())),z(e,c)},$$slots:{default:!0}})}O()}var pje=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">Select a project to manage its tasks.</p>`),t5=L(`<span class="font-mono"> </span>`),mje=L(`<!> Pin`,1),hje=L(`<div class="text-xs font-medium text-foreground">Pin a command</div> <div class="flex flex-col gap-1.5"><!> <!> <div class="flex justify-end"><!></div></div>`,1),n5=L(`<!> <!>`,1),gje=L(`<p class="px-1 py-1 text-xs text-muted-foreground">Loading…</p>`),_je=L(`<p class="px-1 py-1 text-xs text-muted-foreground">No pinned commands. Add one to run it anytime.</p>`),vje=L(`<div class="flex flex-col gap-1.5"><!></div>`),r5=L(`<div class="flex flex-col gap-1.5"></div>`),yje=L(`<!>Prune`,1),bje=L(`<!> <!> <!> <!>`,1),xje=L(`<div class="flex flex-col gap-2 p-2"><!></div>`);function Sje(e,t){D(t,!0);let n=q(t,`tasks`,19,()=>[]),r=new Set([`starting`,`running`,`ready`,`stopping`]),i=e=>r.has(e.status),a=k(()=>n().filter(i)),o=k(()=>n().filter(e=>e.status===`orphaned`)),s=k(()=>n().filter(e=>!i(e)&&e.status!==`orphaned`)),c=A(!0),l=A(!0),u=A(!0),d=A(!1),f=A(!1),p=A(Mn([])),m=A(!1),h=A(!1),g=A(!1),_=A(``),v=A(``),y=A(void 0),b=A(void 0);rr(()=>{let e=t.activeProject?.id;e!==I(b)&&(j(b,e,!0),j(p,[],!0),e&&(j(m,!0),cie(e).then(n=>{t.activeProject?.id===e&&j(p,n,!0)}).catch(e=>id.error(`Could not load pinned commands: ${x(e)}`)).finally(()=>{t.activeProject?.id===e&&j(m,!1)})))});function x(e){return e instanceof Error?e.message:String(e)}async function S(e,t){try{await uE(e),id.success(`Copied ${t}`)}catch{id.error(`Could not copy to clipboard`)}}async function ee(e){if(t.activeProject)try{let n=await yD(t.activeProject.id,{command:e.command,label:e.name,cwd:e.cwd===t.activeProject.dir?void 0:e.cwd});j(p,[...I(p),n],!0),j(c,!0),id.success(`Command pinned`)}catch(e){id.error(`Could not pin command: ${x(e)}`)}}async function C(){if(!t.activeProject)return;let e=I(_).trim();if(e.length===0)return;let n=I(v).trim();j(g,!0);try{let r=await yD(t.activeProject.id,{command:e,label:n.length>0?n:void 0});j(p,[...I(p),r],!0),j(_,``),j(v,``),j(h,!1)}catch(e){id.error(`Could not pin command: ${x(e)}`)}finally{j(g,!1)}}async function te(e){if(t.activeProject)try{await lie(t.activeProject.id,e.id),j(p,I(p).filter(t=>t.id!==e.id),!0)}catch(e){id.error(`Could not remove pinned command: ${x(e)}`)}}function ne(e){t.activeProject&&(j(y,e.id,!0),t.onRunCommand?.({projectId:t.activeProject.id,cwd:e.cwd??t.activeProject.dir,command:e.command,name:e.label??e.command}),window.setTimeout(()=>{I(y)===e.id&&j(y,void 0)},1200))}var re=n5(),ie=N(re);U(ie,()=>O1,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=xje(),i=M(r),b=e=>{z(e,pje())},x=e=>{var n=bje(),r=N(n);tT(r,{title:`Pinned`,get icon(){return Z8},get open(){return I(c)},set open(e){j(c,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(p).length)),z(e,t)},actions:e=>{var t=R();U(N(t),()=>k8,(e,t)=>{t(e,{get open(){return I(h)},set open(e){j(h,e,!0)},children:(e,t)=>{var n=n5(),r=N(n);U(r,()=>j8,(e,t)=>{t(e,{class:`inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,title:`Pin a command`,"aria-label":`Pin a command`,children:(e,t)=>{KZ(e,{size:13,strokeWidth:2.3})},$$slots:{default:!0}})}),U(P(r,2),()=>A8,(e,t)=>{t(e,{align:`end`,collisionPadding:8,class:`w-[min(340px,calc(100vw-2rem))] gap-3 p-3`,children:(e,t)=>{var n=hje(),r=P(N(n),2),i=M(r);SQ(i,{placeholder:`pnpm dev`,class:`h-8 font-mono text-xs`,get value(){return I(_)},set value(e){j(_,e,!0)}});var a=P(i,2);SQ(a,{placeholder:`Label (optional)`,class:`h-8 text-xs`,get value(){return I(v)},set value(e){j(v,e,!0)}});var o=P(a,2),s=M(o);{let e=k(()=>I(g)||I(_).trim().length===0);Ol(s,{size:`sm`,get disabled(){return I(e)},onclick:()=>void C(),children:(e,t)=>{var n=mje();Z8(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})}T(o),T(r),z(e,n)},$$slots:{default:!0}})}),z(e,n)},$$slots:{default:!0}})}),z(e,t)},children:(e,n)=>{var r=vje(),i=M(r),a=e=>{z(e,gje())},o=e=>{z(e,_je())},s=e=>{var n=R();Ni(N(n),17,()=>I(p),e=>e.id,(e,n)=>{{let r=k(()=>I(y)===I(n).id);QAe(e,{get command(){return I(n)},get cwd(){return t.activeProject.dir},get running(){return I(r)},onRun:ne,onRemove:e=>void te(e)})}}),z(e,n)};V(i,e=>{I(m)&&I(p).length===0?e(a):I(p).length===0?e(o,1):e(s,-1)}),T(r),z(e,r)},$$slots:{meta:!0,actions:!0,default:!0}});var i=P(r,2),b=e=>{tT(e,{title:`Running`,get icon(){return Q8},get open(){return I(l)},set open(e){j(l,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(a).length)),z(e,t)},children:(e,n)=>{var r=r5();Ni(r,21,()=>I(a),e=>e.id,(e,n)=>{{let r=k(()=>I(n).id===t.selectedTask?.id);e5(e,{get task(){return I(n)},get selected(){return I(r)},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},onPinTask:e=>void ee(e),onCopyCommand:e=>void S(e,`command`)})}}),T(r),z(e,r)},$$slots:{meta:!0,default:!0}})};V(i,e=>{I(a).length>0&&e(b)});var x=P(i,2),re=e=>{tT(e,{title:`Needs cleanup`,get icon(){return Ld},get open(){return I(u)},set open(e){j(u,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(o).length)),z(e,t)},children:(e,n)=>{var r=r5();Ni(r,21,()=>I(o),e=>e.id,(e,n)=>{{let r=k(()=>I(n).id===t.selectedTask?.id);e5(e,{get task(){return I(n)},get selected(){return I(r)},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},onPinTask:e=>void ee(e),onCopyCommand:e=>void S(e,`command`)})}}),T(r),z(e,r)},$$slots:{meta:!0,default:!0}})};V(x,e=>{I(o).length>0&&e(re)});var ie=P(x,2),ae=e=>{tT(e,{title:`Finished`,get icon(){return ZE},get open(){return I(d)},set open(e){j(d,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(s).length)),z(e,t)},actions:e=>{Ol(e,{size:`xs`,variant:`ghost`,class:`h-6 gap-1 text-muted-foreground hover:text-destructive`,onclick:()=>j(f,!0),children:(e,t)=>{var n=yje();YQ(N(n),{size:12,strokeWidth:2.3}),E(),z(e,n)},$$slots:{default:!0}})},children:(e,n)=>{var r=r5();Ni(r,21,()=>I(s),e=>e.id,(e,n)=>{{let r=k(()=>I(n).id===t.selectedTask?.id);e5(e,{get task(){return I(n)},get selected(){return I(r)},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},onPinTask:e=>void ee(e),onCopyCommand:e=>void S(e,`command`)})}}),T(r),z(e,r)},$$slots:{meta:!0,actions:!0,default:!0}})};V(ie,e=>{I(s).length>0&&e(ae)}),z(e,n)};V(i,e=>{t.activeProject?e(x,-1):e(b)}),T(r),z(e,r)},$$slots:{default:!0}})});var ae=P(ie,2);{let e=k(()=>`This removes ${I(s).length} finished ${I(s).length===1?`task`:`tasks`} and their captured logs. This can't be undone.`);_Q(ae,{destructive:!0,title:`Prune finished tasks`,get description(){return I(e)},confirmLabel:`Prune`,onConfirm:()=>t.onPruneTasks?.(),get open(){return I(f)},set open(e){j(f,e,!0)}})}z(e,re),O()}function i5(e){PT({kind:`task`,id:e})}async function a5(e){i5(e),await o5(e)}async function o5(e){i5(e),wT.selectedTaskId=e,RT({kind:`task`,id:e}),wT.taskLogs=await bD(e)}async function Cje(e){let t={kind:`task`,id:e},n=Y.activeCenterTab?.kind===`task`&&Y.activeCenterTab.id===e,r=IT(t);LT(t),wT.selectedTaskId===e&&(wT.selectedTaskId=void 0,wT.taskLogs=void 0),n&&await BT(r)}var wje=new Set([`$$slots`,`$$events`,`$$legacy`]);function s5(e,t){let n=G(t,wje),r=[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`}]];ic(e,K({name:`monitor`},()=>n,{get iconNode(){return r}}))}var Tje=new Set([`$$slots`,`$$events`,`$$legacy`]);function c5(e,t){let n=G(t,Tje),r=[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`}]];ic(e,K({name:`server`},()=>n,{get iconNode(){return r}}))}var Eje=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`]);function Dje(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15,``),i=G(t,Eje);var a=R(),o=N(a);{let e=k(()=>ol(`grid gap-3 w-full`,t.class));U(o,()=>bb,(t,a)=>{a(t,K({"data-slot":`radio-group`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},get value(){return r()},set value(e){r(e)}}))})}z(e,a),O()}var Oje=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]),kje=L(`<div data-slot="radio-group-indicator" class="flex size-4 items-center justify-center"><!></div>`);function Aje(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Oje);var i=R(),a=N(i);{let e=(e,t)=>{let n=()=>t?.().checked;var r=kje(),i=M(r),a=e=>{F1(e,{class:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})};V(i,e=>{n()&&e(a)}),T(r),z(e,r)},i=k(()=>ol(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,t.class));U(a,()=>Cb,(t,a)=>{a(t,K({"data-slot":`radio-group-item`,get class(){return I(i)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:e,$$slots:{default:!0}}))})}z(e,i),O()}var jje=L(`<span class="text-xs leading-snug text-muted-foreground"> </span>`),Mje=L(`<!> <span class="grid min-w-0 gap-0.5"><span class="text-sm font-medium leading-tight"> </span> <!></span>`,1);function l5(e,t){D(t,!0);let n=q(t,`items`,19,()=>[]),r=q(t,`value`,15,``),i=q(t,`orientation`,3,`vertical`),a=q(t,`disabled`,3,!1);var o=R(),s=N(o);{let e=k(()=>ol(`grid gap-2`,i()===`horizontal`&&`grid-cols-[repeat(auto-fit,minmax(9rem,1fr))]`,t.class));U(s,()=>Dje,(o,s)=>{s(o,{get orientation(){return i()},get disabled(){return a()},get"aria-label"(){return t.ariaLabel},get onValueChange(){return t.onValueChange},get class(){return I(e)},get value(){return r()},set value(e){r(e)},children:(e,t)=>{var r=R();Ni(N(r),17,n,e=>e.value,(e,t)=>{XQ(e,{class:`flex cursor-pointer items-start gap-2.5 rounded-md border border-border bg-input/30 p-3 transition-colors hover:bg-accent/50 has-data-[state=checked]:border-primary has-data-[state=checked]:bg-accent`,children:(e,n)=>{var r=Mje(),i=N(r);U(i,()=>Aje,(e,n)=>{n(e,{get value(){return I(t).value},get disabled(){return I(t).disabled},class:`mt-0.5`})});var a=P(i,2),o=M(a),s=M(o,!0);T(o);var c=P(o,2),l=e=>{var n=jje(),r=M(n,!0);T(n),F(()=>B(r,I(t).detail)),z(e,n)};V(c,e=>{I(t).detail&&e(l)}),T(a),F(()=>B(s,I(t).label)),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})})}z(e,o),O()}var Nje=[{value:`system`,label:`System`,detail:`Follow the operating system`},{value:`dark`,label:`Dark`,detail:`Dark workbench surfaces`},{value:`light`,label:`Light`,detail:`Light workbench surfaces`}],Pje=[{value:`coding`,label:`Coding`,detail:`Implement, edit files, and run checks`},{value:`planning`,label:`Planning`,detail:`Inspect, reason, and prepare before edits`}],Fje=[{value:`read_only`,label:`Read only`,detail:`No writes or mutating commands`},{value:`supervised`,label:`Supervised`,detail:`Ask before non-read tool calls`},{value:`autonomous`,label:`Autonomous`,detail:`Allow tool calls without approval`}],Ije=L(`<section id="settings-appearance" class="settings-section" data-section="appearance"><header class="settings-section-header"><div class="settings-section-kicker"><!> Appearance</div> <h2>Theme</h2> <p>Choose how Nerve renders the workbench. Theme changes apply immediately.</p></header> <div class="settings-section-body"><div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Color theme</strong> <span>Dark is the primary theme; light remains a compatibility fallback.</span></div> <!></div></div></section>`);function Lje(e,t){D(t,!0);let n=q(t,`settingsDraft`,7);function r(e){let r=e;n().ui.theme=r,t.onThemeChange?.(r),t.onSettingsChange?.({ui:{theme:r}},{immediate:!0})}var i=Ije(),a=M(i),o=M(a);s5(M(o),{size:14,strokeWidth:2.1}),E(),T(o),E(4),T(a);var s=P(a,2),c=M(s);l5(P(M(c),2),{get items(){return Nje},get value(){return n().ui.theme},orientation:`horizontal`,ariaLabel:`Theme preference`,onValueChange:r}),T(c),T(s),T(i),z(e,i),O()}var Rje=L(`<section id="settings-agents" class="settings-section" data-section="agents"><header class="settings-section-header"><div class="settings-section-kicker"><!> Agents</div> <h2>Default behavior and policy</h2> <p>Choose how new top-level agents pick their mode, permission, model, and thinking budget.</p></header> <div class="settings-section-body"><!> <!> <div class="settings-control-grid"><div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Root mode</strong> <span>The fixed starting workflow when last selections are disabled.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Root permission</strong> <span>The fixed approval policy when last selections are disabled.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Root model</strong> <span>The fixed model for new top-level agents when last selections are disabled.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Thinking level</strong> <span>The fixed reasoning budget when last selections are disabled.</span></div> <!></div></div> <div class="permission-table" role="table" aria-label="Default agent permissions"><div role="row"><span role="columnheader">Capability</span><span role="columnheader">New-agent policy</span></div> <div role="row"><span>File system read</span><strong>Allowed</strong></div> <div role="row"><span>File system write</span><strong> </strong></div> <div role="row"><span>Terminal command execution</span><strong> </strong></div> <div role="row"><span>Network access</span><strong>Tool-dependent</strong></div></div></div></section>`);function zje(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=k(()=>oE(r(),i(),n().scopedModels)),o=k(()=>{let e=n().defaultModel;return e?I(a).find(t=>YT(t)===YT(e)):void 0}),s=k(()=>I(o)?YT(I(o)):`auto`),c=k(()=>I(o)??I(a)[0]),l=k(()=>n().rememberLastAgentSelection?n().lastAgentSelection.permissionLevel:n().defaultPermissionLevel),u=k(()=>[{value:`auto`,label:`First available scoped model`,detail:`Use the first configured model allowed by Scoped Models`},...I(a).map(e=>({value:YT(e),label:iE(e,I(a)),detail:`${eE(e.provider)} · ${e.modelId}`}))]),d=k(()=>(I(c)?.supportedThinkingLevels?.length?I(c).supportedThinkingLevels:[`off`]).map(e=>({value:e,label:e}))),f=k(()=>mZ(n().defaultThinkingLevel,I(c)));function p(e){return e===`read_only`?`Denied`:e===`supervised`?`Approval required`:e===`autonomous`?`Allowed`:`Policy-managed`}function m(e){return e===`read_only`?`Denied`:e===`supervised`?`Approval required`:e===`autonomous`?`Allowed`:`Policy-managed`}function h(e){n().defaultThinkingLevel=e,t.onSettingsChange?.({defaultThinkingLevel:e},{immediate:!0})}function g(e){let r=e===`auto`?void 0:XT(e),i=r?I(a).find(e=>YT(e)===YT(r)):I(a)[0],o=mZ(n().defaultThinkingLevel,i);n().defaultModel=r,n().defaultThinkingLevel=o,t.onSettingsChange?.({defaultModel:r??null,defaultThinkingLevel:o},{immediate:!0})}function _(e){n().compaction.auto=e,t.onSettingsChange?.({compaction:{auto:e}},{immediate:!0})}function v(e){if(n().rememberLastAgentSelection=e,!e){t.onSettingsChange?.({rememberLastAgentSelection:!1},{immediate:!0});return}let r=XT(yT.selectedModelKey),i={mode:yT.selectedMode,permissionLevel:yT.selectedPermissionLevel,...r?{model:r}:{},thinkingLevel:yT.selectedThinkingLevel};n().lastAgentSelection=i,t.onSettingsChange?.({rememberLastAgentSelection:!0,lastAgentSelection:{...i,model:r??null}},{immediate:!0})}var y=Rje(),b=M(y),x=M(b);Pw(M(x),{size:14,strokeWidth:2.1}),E(),T(x),E(4),T(b);var S=P(b,2),ee=M(S);n$(ee,{class:`settings-full-switch`,get checked(){return n().rememberLastAgentSelection},label:`Use last selections for new agents`,description:`When enabled, new conversations reuse the last mode, permission, model, and thinking level you selected in the composer.`,onCheckedChange:v});var C=P(ee,2);n$(C,{class:`settings-full-switch`,get checked(){return n().compaction.auto},label:`Auto-compact long conversations`,description:`Automatically summarize older context when the selected model approaches its context window.`,onCheckedChange:_});var te=P(C,2),ne=M(te);l5(P(M(ne),2),{get items(){return Pje},get value(){return n().defaultMode},ariaLabel:`Default root mode`,onValueChange:e=>{let r=e;n().defaultMode=r,t.onSettingsChange?.({defaultMode:r},{immediate:!0})}}),T(ne);var re=P(ne,2);l5(P(M(re),2),{get items(){return Fje},get value(){return n().defaultPermissionLevel},ariaLabel:`Default root permission`,onValueChange:e=>{let r=e;n().defaultPermissionLevel=r,t.onSettingsChange?.({defaultPermissionLevel:r},{immediate:!0})}}),T(re);var ie=P(re,2);QQ(P(M(ie),2),{get items(){return I(u)},get value(){return I(s)},ariaLabel:`Default root model`,onValueChange:g}),T(ie);var ae=P(ie,2);QQ(P(M(ae),2),{get items(){return I(d)},get value(){return I(f)},ariaLabel:`Default root thinking level`,onValueChange:e=>h(e)}),T(ae),T(te);var oe=P(te,2),w=P(M(oe),4),se=P(M(w)),ce=M(se,!0);T(se),T(w);var le=P(w,2),ue=P(M(le)),de=M(ue,!0);T(ue),T(le),E(2),T(oe),T(S),T(y),F((e,t)=>{B(ce,e),B(de,t)},[()=>p(I(l)),()=>m(I(l))]),z(e,y),O()}var Bje=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vje(e,t){let n=G(t,Bje),r=[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}],[`path`,{d:`M10 4v4`}],[`path`,{d:`M2 8h20`}],[`path`,{d:`M6 4v4`}]];ic(e,K({name:`app-window`},()=>n,{get iconNode(){return r}}))}var Hje=L(`<section id="settings-desktop" class="settings-section" data-section="desktop"><header class="settings-section-header"><div class="settings-section-kicker"><!> Desktop</div> <h2>Window close behavior</h2> <p>Choose whether the desktop app keeps running in the tray after the window is closed.</p></header> <div class="settings-section-body"><div class="settings-row"><!></div></div></section>`);function Uje(e,t){D(t,!0);let n=q(t,`settingsDraft`,7);var r=Hje(),i=M(r),a=M(i);Vje(M(a),{size:14,strokeWidth:2.1}),E(),T(a),E(4),T(i);var o=P(i,2),s=M(o);n$(M(s),{class:`settings-full-switch`,label:`Close to system tray`,description:`When enabled, the Close button hides Nerve to the tray. When disabled, Close quits the desktop app.`,onCheckedChange:e=>{n().desktop.closeToTray=e,t.onSettingsChange?.({desktop:{closeToTray:e}},{immediate:!0})},get checked(){return n().desktop.closeToTray},set checked(e){n().desktop.closeToTray=e}}),T(s),T(o),T(r),z(e,r),O()}var Wje=L(`<section id="settings-explore" class="settings-section" data-section="explore"><header class="settings-section-header"><div class="settings-section-kicker"><!> Explore agent</div> <h2>Codebase exploration delegate</h2> <p>Configure the specialized read-only agent used by the explore tool.</p></header> <div class="settings-section-body"><div class="settings-control-grid"><div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Explore model</strong> <span>The model used when parent agents delegate codebase exploration.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Thinking level</strong> <span>Reasoning budget for explore reports.</span></div> <!></div></div> <div class="permission-table" role="table" aria-label="Explore agent fixed policy"><div role="row"><span role="columnheader">Capability</span><span role="columnheader">Explore policy</span></div> <div role="row"><span>Permission</span><strong>Read only</strong></div> <div role="row"><span>Mode</span><strong>Coding</strong></div> <div role="row"><span>Working directory</span><strong>Same as parent</strong></div> <div role="row"><span>Conversation history</span><strong>Fresh</strong></div></div></div></section>`);function Gje(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=k(()=>aE(r(),i())),o=k(()=>n().exploreAgent.model?YT(n().exploreAgent.model):`default`),s=k(()=>n().exploreAgent.model?I(a).find(e=>YT(e)===YT(n().exploreAgent.model)):void 0),c=k(()=>[{value:`default`,label:`Default model`,detail:`Use the platform fallback model`},...I(a).map(e=>({value:YT(e),label:iE(e,I(a)),detail:`${eE(e.provider)} · ${e.modelId}`}))]),l=k(()=>(I(s)?.supportedThinkingLevels?.length?I(s).supportedThinkingLevels:[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]).map(e=>({value:e,label:e})));function u(e){n().exploreAgent={...n().exploreAgent,...e},t.onSettingsChange?.({exploreAgent:e},{immediate:!0})}function d(e){if(e==="default"){n().exploreAgent={...n().exploreAgent,model:void 0},t.onSettingsChange?.({exploreAgent:{model:null}},{immediate:!0});return}let r=XT(e);r&&u({model:r})}var f=Wje(),p=M(f),m=M(p);g1(M(m),{size:14,strokeWidth:2.1}),E(),T(m),E(4),T(p);var h=P(p,2),g=M(h),_=M(g);QQ(P(M(_),2),{get items(){return I(c)},get value(){return I(o)},ariaLabel:`Explore agent model`,onValueChange:d}),T(_);var v=P(_,2);QQ(P(M(v),2),{get items(){return I(l)},get value(){return n().exploreAgent.thinkingLevel},ariaLabel:`Explore agent thinking level`,onValueChange:e=>u({thinkingLevel:e})}),T(v),T(g),E(2),T(h),T(f),z(e,f),O()}var Kje=new Set([`$$slots`,`$$events`,`$$legacy`]);function qje(e,t){let n=G(t,Kje),r=[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`}]];ic(e,K({name:`activity`},()=>n,{get iconNode(){return r}}))}var Jje=L(`<section id="settings-runtime" class="settings-section settings-section-muted" data-section="runtime"><header class="settings-section-header"><div class="settings-section-kicker"><!> Diagnostics</div> <h2>Daemon state</h2> <p>Read-only runtime metadata from the orchestrator.</p></header> <div class="settings-section-body"><div class="stat-grid"><section><span>Daemon</span><strong> </strong></section> <section><span>Version</span><strong> </strong></section> <section><span>Started</span><strong> </strong></section> <section><span>Index</span><strong> </strong></section> <section class="wide"><span>Data directory</span><strong> </strong></section> <section class="wide"><span>SQLite</span><strong> </strong></section></div></div></section>`);function Yje(e,t){D(t,!0);var n=Jje(),r=M(n),i=M(r);qje(M(i),{size:14,strokeWidth:2.1}),E(),T(i),E(4),T(r);var a=P(r,2),o=M(a),s=M(o),c=P(M(s)),l=M(c,!0);T(c),T(s);var u=P(s,2),d=P(M(u)),f=M(d,!0);T(d),T(u);var p=P(u,2),m=P(M(p)),h=M(m,!0);T(m),T(p);var g=P(p,2),_=P(M(g)),v=M(_,!0);T(_),T(g);var y=P(g,2),b=P(M(y)),x=M(b,!0);T(b),T(y);var S=P(y,2),ee=P(M(S)),C=M(ee,!0);T(ee),T(S),T(o),T(a),T(n),F(e=>{B(l,t.status?.daemonId??`not loaded`),B(f,t.status?.version??`—`),B(h,e),B(v,t.status?.storage.indexHealthy?`healthy`:`unknown`),W(b,`title`,t.status?.dataDir),B(x,t.status?.dataDir??`—`),W(ee,`title`,t.status?.storage.sqlitePath),B(C,t.status?.storage.sqlitePath??`—`)},[()=>t.status?.startedAt?new Date(t.status.startedAt).toLocaleString():`—`]),z(e,n),O()}var Xje=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zje(e,t){let n=G(t,Xje),r=[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`}]];ic(e,K({name:`braces`},()=>n,{get iconNode(){return r}}))}var Qje=L(`<section class="wide"><span>Validation</span> <strong> </strong></section>`),$je=L(`<section id="settings-python" class="settings-section" data-section="python"><header class="settings-section-header"><div class="settings-section-kicker"><!> Python</div> <h2>Python runtime</h2> <p>Configure the interpreter used by the native python tool. The tool is hidden when no runtime is available.</p></header> <div class="settings-section-body"><div class="stat-grid"><section><span>Status</span> <strong> </strong></section> <section><span>Source</span> <strong> </strong></section> <section><span>Version</span> <strong> </strong></section> <section class="wide"><span>Executable</span> <strong> </strong></section> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Manual executable path</strong> <span>Leave empty to auto-detect project virtualenvs or Python on PATH.</span></div> <div class="settings-field-grid"><label class="wide"><span>Python executable</span> <!></label></div> <div><!></div></div> <p class="settings-note">Planning-mode Python runs with file-write guardrails. This is not a hard security sandbox.</p></div></section>`);function eMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=k(()=>t.status?.runtime.python),i=k(()=>n().runtime.pythonExecutablePath??``),a=k(()=>(I(r)?.source??`unavailable`).replace(/_/g,` `));function o(e){let r=e.trim().length>0?e:void 0;n().runtime.pythonExecutablePath=r,t.onSettingsChange?.({runtime:{pythonExecutablePath:r??null}},{debounceMs:650})}function s(){n().runtime.pythonExecutablePath=void 0,t.onSettingsChange?.({runtime:{pythonExecutablePath:null}},{immediate:!0})}var c=$je(),l=M(c),u=M(l);Zje(M(u),{size:14,strokeWidth:2.1}),E(),T(u),E(4),T(l);var d=P(l,2),f=M(d),p=M(f),m=P(M(p),2),h=M(m,!0);T(m),T(p);var g=P(p,2),_=P(M(g),2),v=M(_,!0);T(_),T(g);var y=P(g,2),b=P(M(y),2),x=M(b,!0);T(b),T(y);var S=P(y,2),ee=P(M(S),2),C=M(ee,!0);T(ee),T(S);var te=P(S,2),ne=e=>{var t=Qje(),n=P(M(t),2),i=M(n,!0);T(n),T(t),F(()=>{W(n,`title`,I(r).error),B(i,I(r).error)}),z(e,t)};V(te,e=>{I(r)?.error&&e(ne)}),T(f);var re=P(f,2),ie=P(M(re),2),ae=M(ie);SQ(P(M(ae),2),{get value(){return I(i)},size:`sm`,placeholder:`Auto-detect`,ariaLabel:`Python executable path`,oninput:e=>o(e.currentTarget.value)}),T(ae),T(ie);var oe=P(ie,2);Ol(M(oe),{size:`sm`,variant:`outline`,onclick:s,children:(e,t)=>{E(),z(e,wi(`Reset to auto-detect`))},$$slots:{default:!0}}),T(oe),T(re),E(2),T(d),T(c),F(()=>{B(h,I(r)?.available?`available`:`unavailable`),B(v,I(a)),B(x,I(r)?.version??`—`),W(ee,`title`,I(r)?.executable),B(C,I(r)?.executable??`—`)}),z(e,c),O()}var tMe=new Set([`$$slots`,`$$events`,`$$legacy`]);function nMe(e,t){let n=G(t,tMe),r=[[`path`,{d:`M10 5H3`}],[`path`,{d:`M12 19H3`}],[`path`,{d:`M14 3v4`}],[`path`,{d:`M16 17v4`}],[`path`,{d:`M21 12h-9`}],[`path`,{d:`M21 19h-5`}],[`path`,{d:`M21 5h-7`}],[`path`,{d:`M8 10v4`}],[`path`,{d:`M8 12H3`}]];ic(e,K({name:`sliders-horizontal`},()=>n,{get iconNode(){return r}}))}var rMe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`checked`,`indeterminate`,`class`]),iMe=L(`<div data-slot="checkbox-indicator" class="[&>svg]:size-3.5 grid place-content-center text-current transition-none"><!></div>`);function u5(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`checked`,15,!1),i=q(t,`indeterminate`,15,!1),a=G(t,rMe);var o=R(),s=N(o);{let e=(e,t)=>{let n=()=>t?.().checked,r=()=>t?.().indeterminate;var i=iMe(),a=M(i),o=e=>{ZQ(e,{})},s=e=>{y1(e,{})};V(a,e=>{n()?e(o):r()&&e(s,1)}),T(i),z(e,i)},o=k(()=>ol(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,t.class));U(s,()=>Th,(t,s)=>{s(t,K({"data-slot":`checkbox`,get class(){return I(o)}},()=>a,{get ref(){return n()},set ref(e){n(e)},get checked(){return r()},set checked(e){r(e)},get indeterminate(){return i()},set indeterminate(e){i(e)},children:e,$$slots:{default:!0}}))})}z(e,o),O()}var aMe=L(`<span class="scoped-dialog-count svelte-19sy7aa"> </span> <!> <!>`,1),oMe=L(`<button type="button"> <span class="scoped-chip-count svelte-19sy7aa"> </span></button>`),sMe=L(`<div class="scoped-dialog-providers svelte-19sy7aa" role="group" aria-label="Filter by provider"></div>`),cMe=L(`<p class="scoped-dialog-empty svelte-19sy7aa">Authenticate a provider before choosing scoped models.</p>`),lMe=L(`<p class="scoped-dialog-empty svelte-19sy7aa">No models match the current filters.</p>`),uMe=L(`<li><label><!> <span class="scoped-dialog-row-text svelte-19sy7aa"><strong class="svelte-19sy7aa"> </strong> <span class="svelte-19sy7aa"> </span></span></label></li>`),dMe=L(`<ul class="scoped-dialog-list svelte-19sy7aa"></ul>`),fMe=L(`<div class="scoped-dialog-body svelte-19sy7aa"><div class="scoped-dialog-toolbar svelte-19sy7aa"><div class="scoped-dialog-search svelte-19sy7aa"><!> <!></div> <!></div> <div class="scoped-dialog-content svelte-19sy7aa"><!></div></div>`);function pMe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=q(t,`scopedModels`,19,()=>[]),o=A(Mn(new Set)),s=A(``),c=A(`all`),l=!1,u=k(()=>sE(r(),i()));rr(()=>{n()&&!l&&(j(o,new Set(a().map(YT)),!0),j(s,``),j(c,`all`)),l=n()});let d=k(()=>{let e=new Map;for(let t of I(u))e.set(t.provider,(e.get(t.provider)??0)+1);let t=[...e.entries()].map(([e,t])=>({id:e,label:eE(e),count:t})).sort((e,t)=>e.label.localeCompare(t.label));return[{id:`all`,label:`All`,count:I(u).length},...t]}),f=k(()=>{let e=I(s).trim().toLowerCase();return[...I(u)].filter(t=>I(c)!==`all`&&t.provider!==I(c)?!1:e?`${tE(t)} ${t.modelId} ${eE(t.provider)}`.toLowerCase().includes(e):!0).sort((e,t)=>eE(e.provider).localeCompare(eE(t.provider))||tE(e).localeCompare(tE(t)))}),p=k(()=>I(o).size);function m(e,t){let n=new Set(I(o)),r=YT(e);t?n.add(r):n.delete(r),j(o,n,!0)}function h(){let e=I(u).filter(e=>I(o).has(YT(e))).map(e=>({provider:e.provider,modelId:e.modelId}));t.onSave?.(e),n(!1)}ZX(e,{title:`Scope composer models`,description:`Pick the authenticated models to show in the composer. Leave everything unchecked to keep all models available.`,class:`scoped-models-dialog`,get open(){return n()},set open(e){n(e)},footer:e=>{var t=aMe(),r=N(t),i=M(r,!0);T(r);var a=P(r,2);Ol(a,{variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{E(),z(e,wi(`Cancel`))},$$slots:{default:!0}});var o=P(a,2);{let e=k(()=>I(u).length===0);Ol(o,{onclick:h,get disabled(){return I(e)},children:(e,t)=>{E(),z(e,wi(`Save selection`))},$$slots:{default:!0}})}F(()=>B(i,I(p)===0?`All models available`:`${I(p)} selected`)),z(e,t)},children:(e,t)=>{var n=fMe(),r=M(n),i=M(r),a=M(i);rZ(a,{size:15,strokeWidth:2,"aria-hidden":`true`}),SQ(P(a,2),{type:`search`,placeholder:`Search models`,"aria-label":`Search models`,class:`rounded-sm`,get value(){return I(s)},set value(e){j(s,e,!0)}}),T(i);var l=P(i,2),p=e=>{var t=sMe();Ni(t,21,()=>I(d),e=>e.id,(e,t)=>{var n=oMe();let r;var i=M(n),a=P(i),o=M(a,!0);T(a),T(n),F(()=>{r=Qi(n,1,`scoped-chip svelte-19sy7aa`,null,r,{active:I(c)===I(t).id}),W(n,`aria-pressed`,I(c)===I(t).id),B(i,`${I(t).label??``} `),B(o,I(t).count)}),_i(`click`,n,()=>j(c,I(t).id,!0)),z(e,n)}),T(t),z(e,t)};V(l,e=>{I(u).length>0&&e(p)}),T(r);var h=P(r,2),g=M(h),_=e=>{z(e,cMe())},v=e=>{z(e,lMe())},y=e=>{var t=dMe();Ni(t,21,()=>I(f),e=>YT(e),(e,t)=>{let n=k(()=>I(o).has(YT(I(t))));var r=uMe(),i=M(r);let a;var s=M(i);{let e=k(()=>tE(I(t)));u5(s,{get checked(){return I(n)},onCheckedChange:e=>m(I(t),e===!0),get"aria-label"(){return I(e)}})}var c=P(s,2),l=M(c),u=M(l,!0);T(l);var d=P(l,2),f=M(d);T(d),T(c),T(i),T(r),F((e,r)=>{a=Qi(i,1,`scoped-dialog-row svelte-19sy7aa`,null,a,{selected:I(n)}),B(u,e),B(f,`${r??``} · ${I(t).modelId??``}`)},[()=>tE(I(t)),()=>eE(I(t).provider)]),z(e,r)}),T(t),z(e,t)};V(g,e=>{I(u).length===0?e(_):I(f).length===0?e(v,1):e(y,-1)}),T(h),T(n),z(e,n)},$$slots:{footer:!0,default:!0}}),O()}vi([`click`]);var mMe=L(`<!> Add models`,1),hMe=L(`<p class="settings-note">Authenticate a provider before choosing scoped models.</p>`),gMe=L(`<div class="scoped-empty svelte-d6l02t"><strong class="svelte-d6l02t">No scope set</strong> <span class="svelte-d6l02t">Every authenticated model appears in the composer picker. Add models to narrow it down.</span></div>`),_Me=L(`<span class="scoped-list-stale svelte-d6l02t"><!> Unavailable</span>`),vMe=L(`<li><span class="scoped-list-text svelte-d6l02t"><strong class="svelte-d6l02t"> </strong> <span class="svelte-d6l02t"> </span></span> <!> <button type="button" class="scoped-list-remove svelte-d6l02t"><!></button></li>`),yMe=L(`<p class="settings-note"> </p>`),bMe=L(`<ul class="scoped-list svelte-d6l02t" aria-label="Scoped models"></ul> <!>`,1),xMe=L(`<section id="settings-models" class="settings-section" data-section="models"><header class="settings-section-header"><div class="settings-section-kicker"><!> Scoped Models</div> <h2>Composer model scope</h2> <p>Keep the model picker focused on the authenticated models you regularly use.</p></header> <div class="settings-section-body"><div class="settings-row scoped-models-summary svelte-d6l02t"><div class="settings-copy"><strong> </strong> <span> </span></div> <div class="scoped-models-actions svelte-d6l02t"><!> <!></div></div> <!></div></section> <!>`,1);function SMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=A(!1),o=k(()=>sE(r(),i())),s=k(()=>new Map(I(o).map(e=>[YT(e),e]))),c=k(()=>n().scopedModels.length>0),l=k(()=>n().scopedModels.map(e=>{let t=YT(e),n=I(s).get(t);return{key:t,selection:e,model:n,stale:!n}}).sort((e,t)=>{let n=eE(e.selection.provider).localeCompare(eE(t.selection.provider)),r=e.model?tE(e.model):e.selection.modelId,i=t.model?tE(t.model):t.selection.modelId;return n||r.localeCompare(i)})),u=k(()=>I(l).filter(e=>e.stale).length),d=k(()=>I(l).length-I(u)),f=k(()=>I(c)?`Showing ${I(d)} of ${I(o).length} authenticated models in the composer.`:`All authenticated models are shown in the composer.`);function p(e){n().scopedModels=e,t.onSettingsChange?.({scopedModels:e},{immediate:!0})}function m(e){p(n().scopedModels.filter(t=>YT(t)!==e))}function h(){p([])}var g=xMe(),_=N(g),v=M(_),y=M(v);nMe(M(y),{size:14,strokeWidth:2.1}),E(),T(y),E(4),T(v);var b=P(v,2),x=M(b),S=M(x),ee=M(S),C=M(ee,!0);T(ee);var te=P(ee,2),ne=M(te,!0);T(te),T(S);var re=P(S,2),ie=M(re),ae=e=>{Ol(e,{variant:`ghost`,size:`sm`,onclick:h,children:(e,t)=>{E(),z(e,wi(`Clear`))},$$slots:{default:!0}})};V(ie,e=>{I(c)&&e(ae)});var oe=P(ie,2);{let e=k(()=>I(o).length===0);Ol(oe,{size:`sm`,get disabled(){return I(e)},onclick:()=>j(a,!0),children:(e,t)=>{var n=mMe();KZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}})}T(re),T(x);var w=P(x,2),se=e=>{z(e,hMe())},ce=e=>{z(e,gMe())},le=e=>{var t=bMe(),n=N(t);Ni(n,21,()=>I(l),e=>e.key,(e,t)=>{var n=vMe();let r;var i=M(n),a=M(i),o=M(a,!0);T(a);var s=P(a,2),c=M(s);T(s),T(i);var l=P(i,2),u=e=>{var t=_Me();Ld(M(t),{size:13,strokeWidth:2}),E(),T(t),z(e,t)};V(l,e=>{I(t).stale&&e(u)});var d=P(l,2);KX(M(d),{size:14,strokeWidth:2.2}),T(d),T(n),F((e,i,a)=>{r=Qi(n,1,`scoped-list-item svelte-d6l02t`,null,r,{stale:I(t).stale}),B(o,e),B(c,`${i??``} · ${I(t).selection.modelId??``}`),W(d,`aria-label`,a)},[()=>I(t).model?tE(I(t).model):I(t).selection.modelId,()=>eE(I(t).selection.provider),()=>`Remove ${I(t).model?tE(I(t).model):I(t).selection.modelId}`]),_i(`click`,d,()=>m(I(t).key)),z(e,n)}),T(n);var r=P(n,2),i=e=>{var t=yMe(),n=M(t);T(t),F(()=>B(n,`${I(u)??``} scoped ${I(u)===1?`model is`:`models are`} no longer available and will be ignored by the picker.`)),z(e,t)};V(r,e=>{I(u)>0&&e(i)}),z(e,t)};V(w,e=>{I(o).length===0?e(se):I(c)?e(le,-1):e(ce,1)}),T(b),T(_),pMe(P(_,2),{get models(){return r()},get authProviders(){return i()},get scopedModels(){return n().scopedModels},onSave:p,get open(){return I(a)},set open(e){j(a,e,!0)}}),F(()=>{B(C,I(c)?`Scoped picker`:`All models`),B(ne,I(f))}),z(e,g),O()}vi([`click`]);var CMe=L(`<section id="settings-server" class="settings-section" data-section="server"><header class="settings-section-header"><div class="settings-section-kicker"><!> Server</div> <h2>Server binding</h2> <p>Host, port, and remote access settings are persisted immediately but apply after daemon restart.</p></header> <div class="settings-section-body"><div class="settings-field-grid"><label><span>Host</span> <!></label> <label><span>Port</span> <!></label></div> <div class="settings-row"><!></div> <p class="settings-note">Restart the daemon after changing host, port, or remote access.</p></div></section>`);function wMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7);function r(e){n().server.host=e,t.onSettingsChange?.({server:{host:e}},{debounceMs:650})}function i(e){let r=Number(e);if(Number.isFinite(r)&&r>0){let e=Math.floor(r);n().server.port=e,t.onSettingsChange?.({server:{port:e}},{debounceMs:650})}}var a=CMe(),o=M(a),s=M(o);c5(M(s),{size:14,strokeWidth:2.1}),E(),T(s),E(4),T(o);var c=P(o,2),l=M(c),u=M(l);SQ(P(M(u),2),{get value(){return n().server.host},size:`sm`,ariaLabel:`Server host`,oninput:e=>r(e.currentTarget.value)}),T(u);var d=P(u,2),f=P(M(d),2);{let e=k(()=>String(n().server.port));SQ(f,{get value(){return I(e)},type:`number`,size:`sm`,ariaLabel:`Server port`,oninput:e=>i(e.currentTarget.value)})}T(d),T(l);var p=P(l,2);n$(M(p),{class:`settings-full-switch`,label:`Allow remote connections`,description:`Keep local binding unless remote access is required.`,onCheckedChange:e=>{n().server.allowRemote=e,t.onSettingsChange?.({server:{allowRemote:e}},{immediate:!0})},get checked(){return n().server.allowRemote},set checked(e){n().server.allowRemote=e}}),T(p),E(2),T(c),T(a),z(e,a),O()}var TMe=new Set([`$$slots`,`$$events`,`$$legacy`]);function EMe(e,t){let n=G(t,TMe),r=[[`path`,{d:`M10 16h.01`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`}],[`path`,{d:`M21.946 12.013H2.054`}],[`path`,{d:`M6 16h.01`}]];ic(e,K({name:`hard-drive`},()=>n,{get iconNode(){return r}}))}var DMe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`max`,`value`]),OMe=L(`<div data-slot="progress-indicator" class="bg-primary size-full flex-1 transition-all"></div>`);function kMe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`max`,3,100),i=G(t,DMe);var a=R(),o=N(a);{let e=k(()=>ol(`bg-muted h-1.5 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class));U(o,()=>ub,(a,o)=>{o(a,K({"data-slot":`progress`,get class(){return I(e)},get value(){return t.value},get max(){return r()}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=OMe();F(()=>ea(i,`transform: translateX(-${100-100*(t.value??0)/(r()??1)}%)`)),z(e,i)},$$slots:{default:!0}}))})}z(e,a),O()}function AMe(){return xw(`/api/storage/usage`)}function jMe(e){return Sw(`/api/storage/cleanup`,e)}var MMe=L(`<!> Refresh`,1),NMe=L(`<p class="settings-note settings-note-error"> </p>`),PMe=L(`<p class="settings-note">Calculating storage usage…</p>`),FMe=L(`<li class="storage-row"><div class="storage-row-head"><span class="storage-row-label"> <!></span> <span class="storage-row-size"> </span></div> <!> <span class="storage-row-meta"> </span></li>`),IMe=L(`<li><span> </span> <span class="storage-row-size"> </span></li>`),LMe=L(`<div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Largest conversations</strong> <span>Prune old conversations below to reclaim this space.</span></div> <ul class="storage-largest"></ul></div>`),RMe=L(`<!> `,1),zMe=L(`<ul class="storage-breakdown"></ul> <div class="stat-grid storage-sqlite"><section><span>SQLite database</span><strong> </strong></section> <section><span>Write-ahead log</span><strong> </strong></section> <section><span>Conversations</span><strong> </strong></section></div> <!> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Free up space</strong> <span>Select what to remove. Conversation pruning skips active conversations and
|
|
140
|
-
keeps credentials and configuration intact.</span></div> <div class="storage-cleanup"><label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Old conversations</strong> <span>Delete conversations not updated recently.</span></span> <span class="storage-cleanup-control"><!> <span>days</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Old log files</strong> <span>Delete dated application and desktop logs.</span></span> <span class="storage-cleanup-control"><!> <span>days</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Tool-call log</strong> <span>Compact superseded tool-call history.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Rotated event log</strong> <span>Remove the archived events.jsonl.1 file.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Explore reports</strong> <span>Delete saved explore sub-agent output.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Cache</strong> <span>Remove disposable cached data.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Temporary files</strong> <span>Remove scratch files in the tmp directory.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Search index</strong> <span>Checkpoint and VACUUM the SQLite cache.</span></span></label></div> <div><!></div></div> <p class="settings-note">Deletions are permanent. The search index is rebuildable, but pruned
|
|
141
|
-
conversations and logs cannot be recovered.</p>`,1),BMe=L(`<section id="settings-storage" class="settings-section" data-section="storage"><header class="settings-section-header"><div class="settings-section-kicker"><!> Storage</div> <h2>Storage usage</h2> <p>Disk used by Nerve under its data directory, and tools to free up space.</p></header> <div class="settings-section-body"><div class="storage-summary"><div class="storage-summary-total"><span>Total</span> <strong> </strong></div> <!></div> <!></div></section> <!>`,1);function VMe(e,t){D(t,!0);let n=A(void 0),r=A(!0),i=A(void 0),a=A(!1),o=A(!1),s=A(!1),c=A(30),l=A(!1),u=A(14),d=A(!1),f=A(!1),p=A(!1),m=A(!1),h=A(!1),g=A(!1);function _(e){if(e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.min(t.length-1,Math.floor(Math.log(e)/Math.log(1024))),r=e/1024**n,i=r>=100||n===0?0:1;return`${r.toFixed(i)} ${t[n]}`}async function v(){j(r,!0),j(i,void 0);try{j(n,await AMe(),!0)}catch(e){j(i,e instanceof Error?e.message:`Could not load storage usage.`,!0)}finally{j(r,!1)}}Oa(v);let y=k(()=>I(n)?.totalBytes??0);function b(e){return I(y)?Math.min(100,Math.round(e/I(y)*100)):0}function x(){let e={};return I(s)&&I(c)>0&&(e.conversationsOlderThanDays=Math.floor(I(c))),I(l)&&I(u)>0&&(e.logsOlderThanDays=Math.floor(I(u))),I(d)&&(e.truncateEventLog=!0),I(f)&&(e.clearToolCallLog=!0),I(p)&&(e.clearExploreReports=!0),I(m)&&(e.clearCache=!0),I(h)&&(e.clearTmp=!0),I(g)&&(e.vacuumSqlite=!0),Object.keys(e).length>0?e:void 0}let S=k(x),ee=k(()=>I(S)!==void 0);function C(){let e=[];return I(s)&&e.push(`conversations older than ${I(c)} days`),I(l)&&e.push(`logs older than ${I(u)} days`),I(d)&&e.push(`rotated event log`),I(f)&&e.push(`tool-call log`),I(p)&&e.push(`explore reports`),I(m)&&e.push(`cache`),I(h)&&e.push(`temporary files`),I(g)&&e.push(`compact the search index`),e.join(`, `)}async function te(){let e=I(S);if(e){j(a,!0);try{let t=await jMe(e);j(n,t.usage,!0),id.success(`Freed ${_(t.freedBytes)}`,{description:t.results.filter(e=>e.freedBytes>0||e.note).map(e=>`${e.target}: ${_(e.freedBytes)}`).join(` · `)}),j(s,!1),j(l,!1),j(d,!1),j(f,!1),j(p,!1),j(m,!1),j(h,!1),j(g,!1)}catch(e){id.error(`Cleanup failed`,{description:e instanceof Error?e.message:`Could not free up space.`})}finally{j(a,!1)}}}var ne=BMe(),re=N(ne),ie=M(re),ae=M(ie);EMe(M(ae),{size:14,strokeWidth:2.1}),E(),T(ae),E(4),T(ie);var oe=P(ie,2),w=M(oe),se=M(w),ce=P(M(se),2),le=M(ce,!0);T(ce),T(se),Ol(P(se,2),{size:`sm`,variant:`outline`,get disabled(){return I(r)},onclick:v,"aria-label":`Refresh storage usage`,children:(e,t)=>{var n=MMe();O8(N(n),{size:14,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}}),T(w);var ue=P(w,2),de=e=>{var t=NMe(),n=M(t,!0);T(t),F(()=>B(n,I(i))),z(e,t)},fe=e=>{z(e,PMe())},pe=e=>{var t=zMe(),r=N(t);Ni(r,21,()=>I(n).categories,e=>e.key,(e,t)=>{var n=FMe(),r=M(n),i=M(r),a=M(i),o=P(a),s=e=>{of(e,{size:`sm`,variant:`secondary`,children:(e,t)=>{E(),z(e,wi(`Protected`))},$$slots:{default:!0}})};V(o,e=>{I(t).protected&&e(s)}),T(i);var c=P(i,2),l=M(c,!0);T(c),T(r);var u=P(r,2);{let e=k(()=>b(I(t).bytes));kMe(u,{get value(){return I(e)},max:100})}var d=P(u,2),f=M(d);T(d),T(n),F((e,n,r)=>{B(a,`${I(t).label??``} `),B(l,e),B(f,`${n??``} files · ${r??``}%`)},[()=>_(I(t).bytes),()=>I(t).fileCount.toLocaleString(),()=>b(I(t).bytes)]),z(e,n)}),T(r);var i=P(r,2),v=M(i),y=P(M(v)),x=M(y,!0);T(y),T(v);var S=P(v,2),C=P(M(S)),te=M(C,!0);T(C),T(S);var ne=P(S,2),re=P(M(ne)),ie=M(re,!0);T(re),T(ne),T(i);var ae=P(i,2),oe=e=>{var t=LMe(),r=P(M(t),2);Ni(r,21,()=>I(n).conversations.largest,e=>e.conversationId,(e,t)=>{var n=IMe(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(n),F(e=>{W(r,`title`,I(t).conversationId),B(i,I(t).title??I(t).conversationId),B(o,e)},[()=>_(I(t).bytes)]),z(e,n)}),T(r),T(t),z(e,t)};V(ae,e=>{I(n).conversations.largest.length>0&&e(oe)});var w=P(ae,2),se=P(M(w),2),ce=M(se),le=M(ce);u5(le,{"aria-label":`Prune old conversations`,get checked(){return I(s)},set checked(e){j(s,e,!0)}});var ue=P(le,4),de=M(ue);{let e=k(()=>!I(s));SQ(de,{type:`number`,size:`sm`,min:1,get value(){return I(c)},get disabled(){return I(e)},ariaLabel:`Conversation age in days`,oninput:e=>j(c,Number(e.currentTarget.value),!0)})}E(2),T(ue),T(ce);var fe=P(ce,2),pe=M(fe);u5(pe,{"aria-label":`Prune old logs`,get checked(){return I(l)},set checked(e){j(l,e,!0)}});var me=P(pe,4),he=M(me);{let e=k(()=>!I(l));SQ(he,{type:`number`,size:`sm`,min:1,get value(){return I(u)},get disabled(){return I(e)},ariaLabel:`Log age in days`,oninput:e=>j(u,Number(e.currentTarget.value),!0)})}E(2),T(me),T(fe);var ge=P(fe,2);u5(M(ge),{"aria-label":`Compact tool-call log`,get checked(){return I(f)},set checked(e){j(f,e,!0)}}),E(2),T(ge);var _e=P(ge,2);u5(M(_e),{"aria-label":`Remove rotated event log`,get checked(){return I(d)},set checked(e){j(d,e,!0)}}),E(2),T(_e);var ve=P(_e,2);u5(M(ve),{"aria-label":`Clear explore reports`,get checked(){return I(p)},set checked(e){j(p,e,!0)}}),E(2),T(ve);var ye=P(ve,2);u5(M(ye),{"aria-label":`Clear cache`,get checked(){return I(m)},set checked(e){j(m,e,!0)}}),E(2),T(ye);var be=P(ye,2);u5(M(be),{"aria-label":`Clear temporary files`,get checked(){return I(h)},set checked(e){j(h,e,!0)}}),E(2),T(be);var xe=P(be,2);u5(M(xe),{"aria-label":`Compact search index`,get checked(){return I(g)},set checked(e){j(g,e,!0)}}),E(2),T(xe),T(se);var Se=P(se,2),Ce=M(Se);{let e=k(()=>!I(ee)||I(a));Ol(Ce,{size:`sm`,variant:`destructive`,get disabled(){return I(e)},onclick:()=>j(o,!0),children:(e,t)=>{var n=RMe(),r=N(n);YQ(r,{size:14,strokeWidth:2});var i=P(r);F(()=>B(i,` ${I(a)?`Freeing space…`:`Free up space`}`)),z(e,n)},$$slots:{default:!0}})}T(Se),T(w),E(2),F((e,t,n)=>{B(x,e),B(te,t),B(ie,n)},[()=>_(I(n).sqlite.dbBytes),()=>_(I(n).sqlite.walBytes),()=>I(n).conversations.total.toLocaleString()]),z(e,t)};V(ue,e=>{I(i)?e(de):I(r)&&!I(n)?e(fe,1):I(n)&&e(pe,2)}),T(oe),T(re);var me=P(re,2);{let e=k(()=>`This permanently removes: ${C()}.`);_Q(me,{title:`Free up storage?`,get description(){return I(e)},confirmLabel:`Delete data`,onConfirm:te,get open(){return I(o)},set open(e){j(o,e,!0)}})}F(e=>B(le,e),[()=>_(I(y))]),z(e,ne),O()}var HMe=L(`<button type="button"><!> <span> </span></button>`),UMe=L(`<button type="button" role="tab"> </button>`),WMe=L(`<div class="settings-subnav" role="tablist"></div>`),d5=L(`<!> <!>`,1),GMe=L(`<!> <!> <!> <!>`,1),KMe=L(`<header class="settings-panel-header"><h2> </h2> <p> </p> <!></header> <!>`,1),qMe=L(`<section class="app-empty-state settings-loading"><!> <strong>Settings are loading</strong> <p>Use the tab refresh action if this takes longer than expected.</p></section>`),JMe=L(`<div class="settings-main"><!></div>`),YMe=L(`<section class="settings-page"><aside class="settings-sidebar" aria-label="Settings sections"><div class="settings-sidebar-title"><strong>Settings</strong> <span>Auto-saved</span></div> <nav class="settings-nav"></nav> <div class="settings-save-state"><span></span> <p> </p></div></aside> <!></section>`);function XMe(e,t){D(t,!0);let n=[{id:`workbench`,label:`Workbench`,description:`Appearance and desktop window behavior.`,icon:s5,sections:[{id:`appearance`,label:`Appearance`},{id:`desktop`,label:`Desktop`}]},{id:`agents`,label:`Agents`,description:`Defaults for new agents and the codebase explore delegate.`,icon:Pw,sections:[{id:`agents`,label:`Defaults`},{id:`explore`,label:`Explore agent`}]},{id:`models`,label:`Models`,description:`Choose which authenticated models appear in the composer.`,icon:WX,sections:[{id:`models`,label:`Scoped models`}]},{id:`system`,label:`System`,description:`Server binding, Python runtime, and daemon diagnostics.`,icon:c5,sections:[{id:`server`,label:`Server`},{id:`python`,label:`Python`},{id:`storage`,label:`Storage`},{id:`runtime`,label:`Diagnostics`}]}],r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=q(t,`settingsSaveStatus`,3,`idle`),o=A(`workbench`),s=A(`appearance`),c=k(()=>n.find(e=>e.id===I(o))??n[0]);function l(e){if(e===I(o))return;j(o,e,!0);let t=n.find(t=>t.id===e)?.sections[0];t&&j(s,t.id,!0),u()}async function u(){await Jr(),document.querySelector(`.settings-viewport`)?.scrollTo({top:0})}function d(e){j(s,e,!0),document.getElementById(`settings-${e}`)?.scrollIntoView({behavior:`smooth`,block:`start`})}rr(()=>{let e=I(c);if(!t.settingsDraft)return;let n,r=!1;return(async()=>{if(await Jr(),r)return;let t=document.querySelector(`.settings-viewport`),i=e.sections.map(e=>document.getElementById(`settings-${e.id}`)).filter(e=>e!==null);if(i.length!==0){n=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top)[0]?.target.getAttribute(`data-section`);t&&j(s,t,!0)},{root:t,rootMargin:`0px 0px -65% 0px`,threshold:0});for(let e of i)n.observe(e)}})(),()=>{r=!0,n?.disconnect()}});function f(){return t.settingsMessage?t.settingsMessage:a()===`saving`?`Saving…`:a()===`dirty`?`Unsaved changes`:a()===`saved`?`Saved`:a()===`error`?`Could not save settings`:`Auto save enabled`}var p=YMe(),m=M(p),h=P(M(m),2);Ni(h,21,()=>n,Ai,(e,t)=>{let n=k(()=>I(t).icon);var r=HMe();let i;var a=M(r);U(a,()=>I(n),(e,t)=>{t(e,{size:16,strokeWidth:2})});var s=P(a,2),c=M(s,!0);T(s),T(r),F(()=>{W(r,`aria-current`,I(o)===I(t).id?`page`:void 0),i=Qi(r,1,``,null,i,{active:I(o)===I(t).id}),B(c,I(t).label)}),_i(`click`,r,()=>l(I(t).id)),z(e,r)}),T(h);var g=P(h,2),_=P(M(g),2),v=M(_,!0);T(_),T(g),T(m),cZ(P(m,2),{class:`settings-scroll`,viewportClass:`settings-viewport`,type:`auto`,children:(e,n)=>{var a=JMe(),l=M(a),u=e=>{var n=KMe(),a=N(n),l=M(a),u=M(l,!0);T(l);var f=P(l,2),p=M(f,!0);T(f);var m=P(f,2),h=e=>{var t=WMe();Ni(t,21,()=>I(c).sections,Ai,(e,t)=>{var n=UMe();let r;var i=M(n,!0);T(n),F(()=>{W(n,`aria-selected`,I(s)===I(t).id),r=Qi(n,1,``,null,r,{active:I(s)===I(t).id}),B(i,I(t).label)}),_i(`click`,n,()=>d(I(t).id)),z(e,n)}),T(t),F(()=>W(t,`aria-label`,`${I(c).label??``} sections`)),z(e,t)};V(m,e=>{I(c).sections.length>1&&e(h)}),T(a);var g=P(a,2),_=e=>{var n=d5(),r=N(n);Lje(r,{get settingsDraft(){return t.settingsDraft},get onThemeChange(){return t.onThemeChange},get onSettingsChange(){return t.onSettingsChange}}),Uje(P(r,2),{get settingsDraft(){return t.settingsDraft},get onSettingsChange(){return t.onSettingsChange}}),z(e,n)},v=e=>{var n=d5(),a=N(n);zje(a,{get settingsDraft(){return t.settingsDraft},get models(){return r()},get authProviders(){return i()},get onSettingsChange(){return t.onSettingsChange}}),Gje(P(a,2),{get settingsDraft(){return t.settingsDraft},get models(){return r()},get authProviders(){return i()},get onSettingsChange(){return t.onSettingsChange}}),z(e,n)},y=e=>{SMe(e,{get settingsDraft(){return t.settingsDraft},get models(){return r()},get authProviders(){return i()},get onSettingsChange(){return t.onSettingsChange}})},b=e=>{var n=GMe(),r=N(n);wMe(r,{get settingsDraft(){return t.settingsDraft},get onSettingsChange(){return t.onSettingsChange}});var i=P(r,2);eMe(i,{get settingsDraft(){return t.settingsDraft},get status(){return t.status},get onSettingsChange(){return t.onSettingsChange}});var a=P(i,2);VMe(a,{}),Yje(P(a,2),{get status(){return t.status}}),z(e,n)};V(g,e=>{I(o)===`workbench`?e(_):I(o)===`agents`?e(v,1):I(o)===`models`?e(y,2):I(o)===`system`&&e(b,3)}),F(()=>{B(u,I(c).label),B(p,I(c).description)}),z(e,n)},f=e=>{var t=qMe();aZ(M(t),{size:28,strokeWidth:1.8}),E(4),T(t),z(e,t)};V(l,e=>{t.settingsDraft?e(u):e(f,-1)}),T(a),z(e,a)},$$slots:{default:!0}}),T(p),F(e=>{W(g,`data-status`,a()),B(v,e)},[()=>f()]),z(e,p),O()}vi([`click`]);var f5={get settingsDraft(){return CT.settingsDraft},get settingsSaveStatus(){return CT.settingsSaveStatus},get settingsMessage(){return CT.settingsMessage},get selectedModelKey(){return yT.selectedModelKey}};function ZMe(e,t){D(t,!0);let n=k(()=>H6.status),r=k(()=>f5.settingsSaveStatus),i=k(()=>f5.settingsMessage);XMe(e,{get status(){return I(n)},get models(){return CT.models},get authProviders(){return CT.authProviders},get settingsSaveStatus(){return I(r)},get settingsMessage(){return I(i)},get onSettingsChange(){return FZ},get onThemeChange(){return LZ},get settingsDraft(){return CT.settingsDraft},set settingsDraft(e){CT.settingsDraft=e}}),O()}var QMe=[`anthropic`,`openai-codex`],$Me={get activeSubscriptionProvider(){return _8.activeSubscriptionProvider},get activeSubscriptionUsage(){return _8.activeSubscriptionUsage},get subscriptionUsages(){let e=_8.activeSubscriptionProvider;return QMe.map(t=>({provider:t,usage:_Z.subscriptionUsage[t],active:t===e}))}},p5={kind:`logs`,id:`logs`};function eNe(){PT(p5),RT(p5)}function tNe(){PT(p5),RT(p5)}function nNe(){let e=Y.activeCenterTab?.kind===`logs`,t=IT(p5);LT(p5),e&&BT(t)}kT({select:{conversation:e=>u6(e.id),"pending-conversation":e=>f6(e.id),task:e=>o5(e.id),file:e=>FDe(e.id),pr:e=>DOe(e.id),settings:()=>TZ(),auth:()=>VZ(),logs:()=>tNe()},close:{conversation:e=>iDe(e.id),"pending-conversation":e=>aDe(e.id),task:e=>Cje(e.id),file:e=>RDe(e.id),pr:e=>OOe(e.id),settings:()=>EZ(),auth:()=>HZ(),logs:()=>nNe()}});function m5(e){return Y.openCenterTabs.findIndex(t=>ET(t,e))}function rNe(e,t){return!!(e&&t.some(t=>ET(t,e)))}function iNe(e){return new Set(e.map(TT))}function aNe(){_T(),Y.error=void 0,gT.text=``}function oNe(){OD(yT.openConversationTabIds,yT.activeConversationTabId)}function sNe(e,t,n){if(!t.length)return;let r=Math.min(...n);return e.slice(r).find(e=>t.some(t=>ET(t,e)))||e.slice(0,r).reverse().find(e=>t.some(t=>ET(t,e)))}function cNe(e){let t=m5(e);return t<=0?[]:Y.openCenterTabs.slice(0,t)}function lNe(e){let t=m5(e);return t===-1?[]:Y.openCenterTabs.slice(t+1)}function h5(e){return Y.openCenterTabs.filter(t=>!ET(t,e))}async function g5(e,t){let n=iNe(e);if(!n.size)return;let r=[...Y.openCenterTabs],i=r.map((e,t)=>n.has(TT(e))?t:-1).filter(e=>e!==-1);if(!i.length)return;let a=r.filter(e=>!n.has(TT(e))),o=!!(Y.activeCenterTab&&n.has(TT(Y.activeCenterTab))),s=!!(hT.conversationId&&n.has(TT({kind:`conversation`,id:hT.conversationId}))),c=!!(Y.activeCenterTab?.kind===`pending-conversation`&&n.has(TT(Y.activeCenterTab))),l=rNe(t,a)?t:sNe(r,a,i),u=[];for(let e of r)n.has(TT(e))&&(e.kind===`conversation`&&u.push({kind:`conversation`,id:e.id}),e.kind===`pending-conversation`&&u.push({kind:`pending-conversation`,id:e.id}));await bA.cancelIfTargets(u),NT(a);for(let e of r)n.has(TT(e))&&(e.kind===`file`&&delete bT.fileViews[GT(e.id)],e.kind===`conversation`&&delete yT.conversationViews[UT(e.id)],e.kind===`pending-conversation`&&delete yT.pendingConversations[WT(e.id)]);wT.selectedTaskId&&n.has(TT({kind:`task`,id:wT.selectedTaskId}))&&(wT.selectedTaskId=void 0,wT.taskLogs=void 0);let d=a.filter(e=>e.kind===`conversation`).map(e=>e.id);yT.activeConversationTabId&&n.has(TT({kind:`conversation`,id:yT.activeConversationTabId}))&&(yT.activeConversationTabId=l?.kind===`conversation`?l.id:d[0]),(s||c)&&l?.kind!==`conversation`&&l?.kind!==`pending-conversation`&&aNe(),oNe(),o&&(Y.activeCenterTab=void 0,l&&await BT(l))}function uNe(e,t){D(t,!0);let n=k(()=>H6.activeProject),r=k(()=>H6.connection),i=k(()=>_8.live),a=k(()=>_8.pendingApprovalCount),o=k(()=>q8.scopedTasks),s=k(()=>p8.gitStatus),c=k(()=>$Me.subscriptionUsages),l=k(()=>H6.status),u=k(()=>f5.settingsDraft),d=k(()=>I(u)?.ui.zoomLevel??CC.level),f=k(()=>QC.isCompact),p=k(()=>QC.isPhone),m=k(()=>I(f)?!bC.navDrawerOpen:bC.sidebarCollapsed),h=k(()=>I(f)?!bC.utilityDrawerOpen:bC.utilityCollapsed);function g(){I(f)?bC.navDrawerOpen?LC():FC():AC(!bC.sidebarCollapsed)}function _(){I(f)?bC.utilityDrawerOpen?LC():IC():MC(!bC.utilityCollapsed)}{let t=k(()=>I(l)?.storage.home);qC(e,{get activeProject(){return I(n)},get connection(){return I(r)},get live(){return I(i)},get pendingApprovals(){return I(a)},get tasks(){return I(o)},get gitStatus(){return I(s)},get subscriptionUsages(){return I(c)},get status(){return I(l)},get homeDir(){return I(t)},get zoomLevel(){return I(d)},get sidebarCollapsed(){return I(m)},get utilityCollapsed(){return I(h)},get phone(){return I(p)},get onZoomLevelChange(){return RZ},onToggleSidebar:g,onToggleUtility:_})}O()}var dNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function _5(e,t){let n=G(t,dNe),r=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3-3-3 3`}],[`path`,{d:`m15 5-3 3-3-3`}]];ic(e,K({name:`fold-vertical`},()=>n,{get iconNode(){return r}}))}var fNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function v5(e,t){let n=G(t,fNe),r=[[`circle`,{cx:`12`,cy:`12`,r:`1`}],[`circle`,{cx:`19`,cy:`12`,r:`1`}],[`circle`,{cx:`5`,cy:`12`,r:`1`}]];ic(e,K({name:`ellipsis`},()=>n,{get iconNode(){return r}}))}var pNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function y5(e,t){let n=G(t,pNe),r=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m15 5-3-3-3 3`}]];ic(e,K({name:`unfold-vertical`},()=>n,{get iconNode(){return r}}))}var mNe=/^\[Tool call:([\s\S]*)\]$/,b5=new Set([`ask_user`,`plan_mode_present`]),hNe={read:`file-text`,bash:`terminal`,python:`terminal`,edit:`file-pen`,write:`file-plus`,grep:`search`,find:`folder-search`,ls:`folder-tree`,web_search:`globe`,web_fetch:`download`,task_start:`cpu`,task_status:`cpu`,task_logs:`cpu`,task_cancel:`cpu`,task_restart:`cpu`,task_list:`cpu`,explore:`search`,ask_user:`message-circle-question`,plan_mode_enter:`clipboard-list`,plan_mode_present:`clipboard-check`,plan_mode_force_exit:`clipboard-list`,todos_set:`list-todo`,todos_get:`list-todo`};function x5(e){return e&&hNe[e]||`wrench`}function S5(e){return e&&typeof e==`object`?e:void 0}function gNe(e){return typeof e==`string`&&e.length>0?e:void 0}function C5(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function _Ne(e){let t=e?.thinkingBlocks;return Array.isArray(t)?t.some(e=>{let t=S5(e);return t?typeof t.text==`string`&&t.text.length>0||t.redacted===!0:!1}):!1}function w5(e,t){if(!e)return;let n=S5(S5(e.details)?.toolCall),r=C5(e.toolRecordId)??C5(n?.id);return r?t.get(r):void 0}function vNe(e,t){return w5(S5(e.details),t)}function T5(e){let t=e.trim().match(mNe);return t?[...t[1].matchAll(/([a-z_][a-z0-9_]*)\s*\(/gi)].map(e=>e[1]):[]}function E5(e){let t=e.replace(/\s+/g,` `).trim();return t.length>160?`${t.slice(0,160)}…`:t}function D5(e,t){let n=S5(e.details),r=[],i=e.usage?.totalTokens,a=()=>i&&i>0?{icon:`sparkles`,label:i>=1e3?`${Math.round(i/1e3)}k`:`${i}`,tone:`default`,title:`${i.toLocaleString()} tokens`}:void 0;if(e.kind===`compaction`)return{type:`compaction`,icon:`fold-vertical`,label:`Compacted`,preview:E5(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`branch_summary`)return{type:`branch_summary`,icon:`git-branch`,label:`Branch summary`,preview:E5(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`explore_report`)return{type:`explore_report`,icon:`search`,label:`Explore`,preview:E5(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.role===`user`)return{type:`user`,icon:`user`,label:`You`,preview:E5(e.text)||`empty message`,tone:`default`,mono:!1,badges:r};if(e.role===`assistant`){_Ne(n)&&r.push({icon:`brain`,tone:`info`,title:`Includes thinking`});let t=T5(e.text);if(t.length>0){let e=t[0],n=t.some(e=>b5.has(e)),i=t.length>1?` +${t.length-1}`:``;return{type:n?`human_loop`:`tool_call`,icon:x5(e),label:`${e}${i}`,preview:t.slice(0,4).join(`, `),tone:n?`warning`:`default`,mono:!0,badges:n?[{icon:`hand`,label:`input`,tone:`warning`},...r]:r}}let i=a();return i&&r.push(i),{type:`assistant`,icon:`sparkles`,label:`Assistant`,preview:E5(e.text)||`(thinking)`,tone:`default`,mono:!1,badges:r}}let o=gNe(n?.toolName);if(o){let i=w5(n,t),a=n?.isError===!0||i?.status===`error`||i?.status===`denied`,s=b5.has(o)||i?.risk===`interaction`||!!i?.approvalId;return s&&r.push({icon:`hand`,label:`human`,tone:`warning`}),a&&r.push({icon:`triangle-alert`,label:`error`,tone:`danger`}),{type:s?`human_loop`:`tool_result`,icon:x5(o),label:o,preview:E5(e.text),tone:a?`danger`:s?`warning`:`success`,mono:!0,badges:r}}return{type:`system`,icon:`info`,label:`System`,preview:E5(e.text)||`system entry`,tone:`default`,mono:!1,badges:r}}function yNe(e,t){let n=new Map(e.map(e=>[e.entry.id,e])),r=e=>e.entry.parentEntryId!==void 0&&n.has(e.entry.parentEntryId),i=e.filter(e=>!r(e)),a=new Set;if(t){let e=t;for(;e;){let t=n.get(e);if(!t)break;a.add(t.entry.id),e=t.entry.parentEntryId}}let o=[],s=new Set,c=0,l=0,u=e=>e.childEntryIds.map(e=>n.get(e)).filter(e=>!!e),d=(e,n,r)=>{if(s.has(e.entry.id))return;s.add(e.entry.id);let i=u(e);o.push({node:e,index:++l,lane:n,parentLane:r,isOnActivePath:a.has(e.entry.id),isActive:e.entry.id===t,isLeaf:i.length===0,isBranchPoint:i.length>1}),i.forEach((e,t)=>{d(e,t===0?n:c++,n)})};for(let e of i)d(e,c++,void 0);for(let t of e)s.has(t.entry.id)||d(t,c++,void 0);return{rows:o,laneCount:o.reduce((e,t)=>Math.max(e,t.lane+1),1)}}var bNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function xNe(e,t){let n=G(t,bNe),r=[[`path`,{d:`M12 18V5`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`}]];ic(e,K({name:`brain`},()=>n,{get iconNode(){return r}}))}var SNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function CNe(e,t){let n=G(t,SNe),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`m9 14 2 2 4-4`}]];ic(e,K({name:`clipboard-check`},()=>n,{get iconNode(){return r}}))}var wNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function TNe(e,t){let n=G(t,wNe),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`M12 11h4`}],[`path`,{d:`M12 16h4`}],[`path`,{d:`M8 11h.01`}],[`path`,{d:`M8 16h.01`}]];ic(e,K({name:`clipboard-list`},()=>n,{get iconNode(){return r}}))}var ENe=new Set([`$$slots`,`$$events`,`$$legacy`]);function DNe(e,t){let n=G(t,ENe),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}],[`path`,{d:`M12 18v-6`}]];ic(e,K({name:`file-plus`},()=>n,{get iconNode(){return r}}))}var ONe=new Set([`$$slots`,`$$events`,`$$legacy`]);function kNe(e,t){let n=G(t,ONe),r=[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`}],[`path`,{d:`m21 21-1.9-1.9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}]];ic(e,K({name:`folder-search`},()=>n,{get iconNode(){return r}}))}var ANe=new Set([`$$slots`,`$$events`,`$$legacy`]);function jNe(e,t){let n=G(t,ANe),r=[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`}]];ic(e,K({name:`folder-tree`},()=>n,{get iconNode(){return r}}))}var MNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function NNe(e,t){let n=G(t,MNe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}],[`path`,{d:`M2 12h20`}]];ic(e,K({name:`globe`},()=>n,{get iconNode(){return r}}))}var PNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function FNe(e,t){let n=G(t,PNe),r=[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`}]];ic(e,K({name:`hand`},()=>n,{get iconNode(){return r}}))}var INe=new Set([`$$slots`,`$$events`,`$$legacy`]);function O5(e,t){let n=G(t,INe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 16v-4`}],[`path`,{d:`M12 8h.01`}]];ic(e,K({name:`info`},()=>n,{get iconNode(){return r}}))}var LNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function RNe(e,t){let n=G(t,LNe),r=[[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}],[`path`,{d:`m3 17 2 2 4-4`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`}]];ic(e,K({name:`list-todo`},()=>n,{get iconNode(){return r}}))}var zNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function BNe(e,t){let n=G(t,zNe),r=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];ic(e,K({name:`message-circle-question-mark`},()=>n,{get iconNode(){return r}}))}var VNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function HNe(e,t){let n=G(t,VNe),r=[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`12`,cy:`7`,r:`4`}]];ic(e,K({name:`user`},()=>n,{get iconNode(){return r}}))}var UNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function WNe(e,t){let n=G(t,UNe),r=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`}]];ic(e,K({name:`wrench`},()=>n,{get iconNode(){return r}}))}var k5={user:HNe,sparkles:aZ,brain:xNe,wrench:WNe,"file-text":h1,terminal:Fd,"file-pen":T8,"file-plus":DNe,search:rZ,"folder-search":kNe,"folder-tree":jNe,globe:NNe,download:Bw,cpu:tZ,bot:Pw,"message-circle-question":BNe,"clipboard-list":TNe,"clipboard-check":CNe,"list-todo":RNe,"fold-vertical":_5,"git-branch":Td,info:O5,hand:FNe,"triangle-alert":Ld},A5={default:`text-muted-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,danger:`text-destructive`},j5=Ci(`<path fill="none"></path>`),M5=Ci(`<circle fill="none" stroke="var(--primary)"></circle>`),GNe=Ci(`<circle fill="var(--background)" stroke-dasharray="2 2"></circle><circle></circle>`,1),KNe=Ci(`<circle></circle>`),qNe=Ci(`<!><!>`,1),N5=L(`<span class="absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-primary" aria-hidden="true"></span>`),JNe=L(`<button type="button"><span class="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><!></span> <span class="shrink-0 text-xs font-medium text-foreground"> </span> <span class="min-w-0 flex-1 truncate text-xs text-muted-foreground"> </span> <span role="button" tabindex="0" class="flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground"><!></span></button>`),YNe=L(`<span><!></span>`),XNe=L(`<button type="button" title="Click to preview · double-click to jump"><!> <span><!></span> <span class="font-mono text-xs tabular-nums text-muted-foreground/50"> </span> <span class="min-w-0 flex-1 truncate text-xs font-medium text-foreground"> </span> <!> <span class="shrink-0 font-mono text-xs text-muted-foreground/50"> </span></button>`),ZNe=L(`<p class="px-1 py-4 text-center text-xs text-muted-foreground">No messages yet.</p>`),QNe=L(`<div class="relative"><svg class="pointer-events-none absolute left-0 top-0" aria-hidden="true"><!><!><!><circle></circle><!></svg> <div class="flex flex-col"><button class="relative flex w-full items-center gap-2 rounded-md pr-2 text-left transition-colors hover:bg-muted/60 data-[selected=true]:bg-muted data-[active=true]:bg-muted/70" type="button" title="Start a branch from the beginning"><!> <span><!></span> <span class="font-mono text-xs tabular-nums text-muted-foreground/50">00</span> <span class="truncate text-xs font-medium text-foreground">Start of conversation</span></button> <!></div></div>`),$Ne=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">No conversation history loaded.</p>`);function ePe(e,t){D(t,!0);let n=k(()=>+!!t.hasConversation),r=k(()=>(t.items.length+I(n))*36),i=k(()=>t.laneCount*18+8),a=k(()=>t.rootOnActivePath?`var(--primary)`:`var(--muted-foreground)`);function o(e){return 4+e*18+18/2}function s(e){return e*36+36/2}function c(e){return s(e+I(n))}let l=k(()=>t.items.map((e,t)=>e.type===`entry`?{visibleIndex:t,lane:e.row.lane,parentEntryId:e.row.node.entry.parentEntryId,parentLane:e.row.parentLane,isOnActivePath:e.row.isOnActivePath,isActive:e.row.isActive,isLeaf:e.row.isLeaf,isSegment:!1}:{visibleIndex:t,lane:e.segment.lane,parentEntryId:e.segment.headParentEntryId,parentLane:e.segment.headParentLane,isOnActivePath:e.segment.isOnActivePath,isActive:!1,isLeaf:!1,isSegment:!0})),u=k(()=>{let e=[];for(let n of I(l)){let r=n.parentEntryId;if(r===void 0||n.parentLane===void 0||!t.treeNodeIds.has(r))continue;let i=t.visibleIndexById.get(r);if(i===void 0)continue;let a=o(n.lane),s=c(n.visibleIndex),l=o(n.parentLane),u=c(i);if(n.lane===n.parentLane)e.push({d:`M ${l} ${u} L ${a} ${s}`,active:n.isOnActivePath});else{let t=u+36;e.push({d:`M ${l} ${u} C ${l} ${u+36*.6} ${a} ${u+36*.4} ${a} ${t} L ${a} ${s}`,active:n.isOnActivePath})}}return e}),d=k(()=>{if(!t.hasConversation)return[];let e=[],n=o(0),r=s(0);for(let i of I(l)){let a=i.parentEntryId;if(a!==void 0&&t.treeNodeIds.has(a))continue;let s=o(i.lane),l=c(i.visibleIndex);e.push({d:i.lane===0?`M ${n} ${r} L ${s} ${l}`:`M ${n} ${r} C ${n} ${r+36*.6} ${s} ${l-36*.6} ${s} ${l}`,active:i.isOnActivePath})}return e});function f(e){let t=e.parts.map(e=>`${e.count} ${e.label}`).join(`, `);return`${e.total} steps — ${t}`}function p(e){let n=[{label:`Jump here`,icon:W3,onSelect:()=>t.onNavigateToEntry?.(e.entry.id)},{label:`Jump + summarize from here`,icon:aZ,onSelect:()=>t.onNavigateToEntry?.(e.entry.id,!0)}];return e.entry.role===`user`&&n.push({label:`Edit & resend`,icon:JQ,onSelect:()=>t.onEditEntry?.(e.entry)}),n.push({type:`separator`},{label:`Copy entry id`,icon:G3,onSelect:async()=>{try{await uE(e.entry.id),id.success(`Copied entry id`)}catch{id.error(`Could not copy to clipboard`)}}}),n}var m=R(),h=N(m),g=e=>{var n=QNe(),m=M(n),h=M(m);Ni(h,17,()=>I(d),Ai,(e,t)=>{var n=j5();F(()=>{W(n,`d`,I(t).d),W(n,`stroke`,I(t).active?`var(--primary)`:`var(--border)`),W(n,`stroke-width`,I(t).active?2:1.5)}),z(e,n)});var g=P(h);Ni(g,17,()=>I(u),Ai,(e,t)=>{var n=j5();F(()=>{W(n,`d`,I(t).d),W(n,`stroke`,I(t).active?`var(--primary)`:`var(--border)`),W(n,`stroke-width`,I(t).active?2:1.5)}),z(e,n)});var _=P(g),v=e=>{var t=M5();W(t,`r`,6.5),W(t,`stroke-width`,1.5),W(t,`opacity`,.5),F((e,n)=>{W(t,`cx`,e),W(t,`cy`,n)},[()=>o(0),()=>s(0)]),z(e,t)};V(_,e=>{t.rootActive&&e(v)});var y=P(_);W(y,`stroke-width`,1.5),Ni(P(y),17,()=>I(l),e=>e.visibleIndex,(e,t)=>{let n=k(()=>o(I(t).lane)),r=k(()=>c(I(t).visibleIndex)),i=k(()=>I(t).isOnActivePath?`var(--primary)`:`var(--muted-foreground)`);var a=qNe(),s=N(a),l=e=>{var t=M5();W(t,`r`,6.5),W(t,`stroke-width`,1.5),W(t,`opacity`,.5),F(()=>{W(t,`cx`,I(n)),W(t,`cy`,I(r))}),z(e,t)};V(s,e=>{I(t).isActive&&e(l)});var u=P(s),d=e=>{var t=GNe(),a=N(t);W(a,`r`,6),W(a,`stroke-width`,1.5);var o=P(a);W(o,`r`,2),F(()=>{W(a,`cx`,I(n)),W(a,`cy`,I(r)),W(a,`stroke`,I(i)),W(o,`cx`,I(n)),W(o,`cy`,I(r)),W(o,`fill`,I(i))}),z(e,t)},f=e=>{var a=KNe();W(a,`stroke-width`,1.5),F(()=>{W(a,`cx`,I(n)),W(a,`cy`,I(r)),W(a,`r`,I(t).isLeaf?4.5:4),W(a,`fill`,I(t).isLeaf||I(t).isActive?I(i):`var(--background)`),W(a,`stroke`,I(i))}),z(e,a)};V(u,e=>{I(t).isSegment?e(d):e(f,-1)}),z(e,a)}),T(m);var b=P(m,2),x=M(b),S=M(x),ee=e=>{z(e,N5())};V(S,e=>{t.rootActive&&e(ee)});var C=P(S,2);let te;Td(M(C),{class:`size-4`,strokeWidth:2}),T(C),E(4),T(x);var ne=P(x,2),re=e=>{var n=R();Ni(N(n),17,()=>t.items,e=>e.type===`entry`?e.row.node.entry.id:`seg:${e.segment.id}`,(e,n)=>{var r=R(),a=N(r),o=e=>{let r=k(()=>t.expanded.has(I(n).segment.id));var a=JNe();let o;var s=M(a);Hw(M(s),{class:`size-4`,strokeWidth:2}),T(s);var c=P(s,2),l=M(c);T(c);var u=P(c,2),d=M(u,!0);T(u);var p=P(u,2),m=M(p),h=e=>{Iw(e,{class:`size-4`,strokeWidth:2})},g=e=>{Rw(e,{class:`size-4`,strokeWidth:2})};V(m,e=>{I(r)?e(h):e(g,-1)}),T(p),T(a),F((e,s)=>{o=Qi(a,1,`relative flex w-full items-center gap-2 rounded-md pr-2 text-left transition-colors hover:bg-muted/60 data-[selected=true]:bg-muted`,null,o,{"opacity-55":!I(n).segment.isOnActivePath}),W(a,`data-selected`,t.selectedKey===`s:${I(n).segment.id}`),ea(a,`height:36px; padding-left:${I(i)+4}px`),W(a,`title`,e),B(l,`${I(n).segment.total??``} steps`),B(d,s),W(p,`title`,I(r)?`Collapse steps`:`Expand steps`),W(p,`aria-label`,I(r)?`Collapse steps`:`Expand steps`)},[()=>f(I(n).segment),()=>I(n).segment.parts.map(e=>`${e.count} ${e.label}`).join(` · `)]),_i(`click`,a,()=>t.onSelect({kind:`segment`,segment:I(n).segment})),_i(`click`,p,e=>{e.stopPropagation(),t.onToggleSegment(I(n).segment.id)}),_i(`keydown`,p,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),t.onToggleSegment(I(n).segment.id))}),z(e,a)},s=e=>{let r=k(()=>I(n).row),a=k(()=>D5(I(r).node.entry,t.toolCallsById)),o=k(()=>k5[I(a).icon]);{let n=k(()=>p(I(r).node));F$(e,{get items(){return I(n)},triggerClass:`block w-full min-w-0`,children:(e,n)=>{var s=XNe();let c;var l=M(s),u=e=>{z(e,N5())};V(l,e=>{I(r).isActive&&e(u)});var d=P(l,2);U(M(d),()=>I(o),(e,t)=>{t(e,{class:`size-4`,strokeWidth:2})}),T(d);var f=P(d,2),p=M(f,!0);T(f);var m=P(f,2),h=M(m,!0);T(m);var g=P(m,2);Ni(g,17,()=>I(a).badges,Ai,(e,t)=>{let n=k(()=>k5[I(t).icon]);var r=YNe();U(M(r),()=>I(n),(e,t)=>{t(e,{class:`size-3`,strokeWidth:2})}),T(r),F(()=>{Qi(r,1,`flex shrink-0 items-center gap-0.5 ${A5[I(t).tone]}`),W(r,`title`,I(t).title??I(t).label)}),z(e,r)});var _=P(g,2),v=M(_,!0);T(_),T(s),F((e,n)=>{c=Qi(s,1,`relative flex w-full items-center gap-2 rounded-md pr-2 text-left transition-colors hover:bg-muted/60 data-[selected=true]:bg-muted data-[active=true]:bg-muted/70`,null,c,{"opacity-55":!I(r).isOnActivePath}),W(s,`data-active`,I(r).isActive),W(s,`data-selected`,t.selectedKey===`e:${I(r).node.entry.id}`),ea(s,`height:36px; padding-left:${I(i)+4}px`),Qi(d,1,`flex size-5 shrink-0 items-center justify-center ${A5[I(a).tone]}`),B(p,e),B(h,I(a).label),B(v,n)},[()=>String(I(r).index).padStart(2,`0`),()=>j1(I(r).node.entry.createdAt)]),_i(`click`,s,()=>t.onSelect({kind:`entry`,row:I(r)})),_i(`dblclick`,s,()=>t.onNavigateToEntry?.(I(r).node.entry.id)),z(e,s)},$$slots:{default:!0}})}};V(a,e=>{I(n).type===`segment`?e(o):e(s,-1)}),z(e,r)}),z(e,n)},ie=e=>{z(e,ZNe())};V(ne,e=>{t.items.length?e(re):e(ie,-1)}),T(b),T(n),F((e,o)=>{ea(n,`min-height:${I(r)}px`),W(m,`width`,I(i)),W(m,`height`,I(r)),W(y,`cx`,e),W(y,`cy`,o),W(y,`r`,t.rootActive?4.5:4),W(y,`fill`,t.rootActive?I(a):`var(--background)`),W(y,`stroke`,I(a)),W(x,`data-active`,t.rootActive),W(x,`data-selected`,t.selectedKey===`root`),ea(x,`height:36px; padding-left:${I(i)+4}px`),te=Qi(C,1,`flex size-5 shrink-0 items-center justify-center`,null,te,{"text-primary":t.rootOnActivePath,"text-muted-foreground":!t.rootOnActivePath})},[()=>o(0),()=>s(0)]),_i(`click`,x,()=>t.onSelect({kind:`root`})),_i(`dblclick`,x,()=>t.onNavigateToEntry?.(void 0)),z(e,n)},_=e=>{z(e,$Ne())};V(h,e=>{t.hasConversation?e(g):e(_,-1)}),z(e,m),O()}vi([`click`,`dblclick`,`keydown`]);var tPe=L(`<div class="flex h-full items-center justify-center p-6 text-center text-xs text-muted-foreground">Select an entry on the left to preview it here.</div>`),nPe=L(`<!> New branch from beginning`,1),rPe=L(`<div class="flex flex-col gap-4 p-5"><div class="flex items-center gap-2 text-primary"><!> <h3 class="text-sm font-semibold text-foreground">Start of conversation</h3></div> <p class="text-sm text-muted-foreground">Jump here to fork a brand-new branch from the very beginning. Your next message becomes the
|
|
142
|
-
first entry of that branch; the existing history stays available in the tree.</p> <div><!></div></div>`),iPe=L(`<span class="flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground"><!> <span class="font-medium text-foreground"> </span> </span>`),aPe=L(`<!> Expand in tree`,1),oPe=L(`<button class="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted/60" type="button"><span><!></span> <span class="shrink-0 text-xs font-medium text-foreground"> </span> <span> </span></button>`),sPe=L(`<div class="flex flex-col gap-4 p-5"><div class="flex flex-col gap-1"><h3 class="text-sm font-semibold text-foreground"> </h3> <p class="text-xs text-muted-foreground"> </p></div> <div class="flex flex-wrap gap-1.5"></div> <div class="flex"><!></div> <div class="flex flex-col gap-0.5 border-t pt-3"></div></div>`),cPe=L(`<span><!> <!></span>`),lPe=L(`<span class="flex items-center gap-1"><!> </span>`),uPe=L(`<!> Jump here`,1),dPe=L(`<!> Jump + summarize`,1),fPe=L(`<!> Edit & resend`,1),pPe=L(`<span class="rounded-full border px-1.5 py-0.5"> </span>`),mPe=L(`<div class="flex items-center gap-2 text-xs text-muted-foreground"><span class="font-medium text-foreground">Tool</span> <span class="font-mono"> </span> <!></div>`),hPe=L(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-muted-foreground">Arguments</span> <pre class="overflow-x-auto rounded-md border bg-muted/40 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),gPe=L(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-muted-foreground">Result</span> <pre class="overflow-x-auto rounded-md border bg-muted/40 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),_Pe=L(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-destructive">Error</span> <pre class="overflow-x-auto rounded-md border border-destructive/40 bg-destructive/10 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),vPe=L(`<p class="text-xs text-muted-foreground">No tool details available for this entry.</p>`),yPe=L(`<div class="flex flex-col gap-3"><!> <!> <!> <!> <!></div>`),bPe=L(`<div class="text-sm text-muted-foreground"><!></div>`),xPe=L(`<div class="mt-4 border-t pt-3 text-sm text-muted-foreground"><span class="mb-1 block text-xs font-medium">Thinking</span> <!></div>`),SPe=L(`<div class="text-sm text-foreground"><!></div> <!>`,1),CPe=L(`<p class="text-xs text-muted-foreground">This entry has no text content.</p>`),wPe=L(`<div class="flex h-full flex-col"><div class="flex flex-col gap-3 border-b p-5"><div class="flex items-center gap-2"><span><!></span> <h3 class="text-sm font-semibold text-foreground"> </h3> <!></div> <div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground"><span> </span> <!> <button class="flex items-center gap-1 font-mono hover:text-foreground" type="button" title="Copy entry id"><!> </button></div> <div class="flex flex-wrap gap-2"><!> <!> <!></div></div> <div class="min-h-0 flex-1 overflow-y-auto p-5"><!></div></div>`);function TPe(e,t){D(t,!0);let n=k(()=>t.selection?.kind===`entry`?t.selection.row.node.entry:void 0),r=k(()=>I(n)?D5(I(n),t.toolCallsById):void 0),i=k(()=>I(n)?vNe(I(n),t.toolCallsById):void 0);function a(e){let t=e.details?.thinkingBlocks;return Array.isArray(t)?t.map(e=>e?.text??``).filter(Boolean).join(`
|
|
143
|
-
|
|
144
|
-
`):``}function o(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}let s=k(()=>I(r)?.type===`tool_call`||I(r)?.type===`tool_result`||I(r)?.type===`human_loop`),c=k(()=>I(i)?.toolName??(I(n)?T5(I(n).text)[0]:void 0)??I(n)?.details?.toolName),l=k(()=>I(i)?.args!==void 0&&I(i)?.args!==null&&Object.keys(I(i).args).length>0),u=k(()=>I(n)?.role===`system`?I(n).text:typeof I(i)?.result==`string`?I(i).result:``);async function d(e){try{await uE(e),id.success(`Copied entry id`)}catch{id.error(`Could not copy to clipboard`)}}var f=R(),p=N(f),m=e=>{z(e,tPe())},h=e=>{var n=rPe(),r=M(n);Td(M(r),{class:`size-5`,strokeWidth:2}),E(2),T(r);var i=P(r,4);Ol(M(i),{size:`sm`,onclick:()=>t.onNavigateToEntry?.(void 0),children:(e,t)=>{var n=nPe();Td(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}}),T(i),T(n),z(e,n)},g=e=>{let n=k(()=>t.selection.segment);var r=sPe(),i=M(r),a=M(i),o=M(a);T(a);var s=P(a,2),c=M(s);T(s),T(i);var l=P(i,2);Ni(l,21,()=>I(n).parts,Ai,(e,t)=>{let n=k(()=>k5[I(t).icon]);var r=iPe(),i=M(r);U(i,()=>I(n),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})});var a=P(i,2),o=M(a,!0);T(a);var s=P(a);T(r),F(()=>{B(o,I(t).count),B(s,` ${I(t).label??``}`)}),z(e,r)}),T(l);var u=P(l,2);Ol(M(u),{variant:`outline`,size:`sm`,onclick:()=>t.onExpandSegment?.(I(n).id),children:(e,t)=>{var n=aPe();y5(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}}),T(u);var d=P(u,2);Ni(d,21,()=>I(n).rows,e=>e.node.entry.id,(e,n)=>{let r=k(()=>D5(I(n).node.entry,t.toolCallsById)),i=k(()=>k5[I(r).icon]);var a=oPe(),o=M(a);U(M(o),()=>I(i),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})}),T(o);var s=P(o,2),c=M(s,!0);T(s);var l=P(s,2);let u;var d=M(l,!0);T(l),T(a),F(()=>{Qi(o,1,`flex size-4 shrink-0 items-center justify-center ${A5[I(r).tone]}`),B(c,I(r).label),u=Qi(l,1,`min-w-0 flex-1 truncate text-xs text-muted-foreground`,null,u,{"font-mono":I(r).mono}),B(d,I(r).preview)}),_i(`click`,a,()=>t.onSelectRow?.(I(n))),z(e,a)}),T(d),T(r),F((e,t)=>{B(o,`${I(n).total??``} collapsed steps`),B(c,`${e??``} — ${t??``}`)},[()=>M1(I(n).startedAt),()=>M1(I(n).endedAt)]),z(e,r)},_=e=>{let f=k(()=>k5[I(r).icon]),p=k(()=>a(I(n)));var m=wPe(),h=M(m),g=M(h),_=M(g);U(M(_),()=>I(f),(e,t)=>{t(e,{class:`size-5`,strokeWidth:2})}),T(_);var v=P(_,2),y=M(v,!0);T(v),Ni(P(v,2),17,()=>I(r).badges,Ai,(e,t)=>{let n=k(()=>k5[I(t).icon]);var r=cPe(),i=M(r);U(i,()=>I(n),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})});var a=P(i,2),o=e=>{var n=wi();F(()=>B(n,I(t).label)),z(e,n)};V(a,e=>{I(t).label&&e(o)}),T(r),F(()=>{Qi(r,1,`flex items-center gap-0.5 text-xs ${A5[I(t).tone]}`),W(r,`title`,I(t).title??I(t).label)}),z(e,r)}),T(g);var b=P(g,2),x=M(b),S=M(x);T(x);var ee=P(x,2),C=e=>{var t=lPe(),r=M(t);aZ(r,{class:`size-3.5`,strokeWidth:2});var i=P(r);T(t),F(e=>B(i,` ${e??``} tokens`),[()=>I(n).usage.totalTokens.toLocaleString()]),z(e,t)};V(ee,e=>{I(n).usage?.totalTokens&&e(C)});var te=P(ee,2),ne=M(te);G3(ne,{class:`size-3`,strokeWidth:2});var re=P(ne);T(te),T(b);var ie=P(b,2),ae=M(ie);Ol(ae,{size:`sm`,onclick:()=>t.onNavigateToEntry?.(I(n).id),children:(e,t)=>{var n=uPe();W3(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var oe=P(ae,2);Ol(oe,{variant:`outline`,size:`sm`,onclick:()=>t.onNavigateToEntry?.(I(n).id,!0),children:(e,t)=>{var n=dPe();aZ(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var w=P(oe,2),se=e=>{Ol(e,{variant:`outline`,size:`sm`,onclick:()=>t.onEditEntry?.(I(n)),children:(e,t)=>{var n=fPe();JQ(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}})};V(w,e=>{I(n).role===`user`&&e(se)}),T(ie),T(h);var ce=P(h,2),le=M(ce),ue=e=>{var t=yPe(),n=M(t),r=e=>{var t=mPe(),n=P(M(t),2),r=M(n,!0);T(n);var a=P(n,2),o=e=>{var t=pPe(),n=M(t,!0);T(t),F(()=>B(n,I(i).status)),z(e,t)};V(a,e=>{I(i)?.status&&e(o)}),T(t),F(()=>B(r,I(c))),z(e,t)};V(n,e=>{I(c)&&e(r)});var a=P(n,2),s=e=>{var t=hPe(),n=P(M(t),2),r=M(n,!0);T(n),T(t),F(e=>B(r,e),[()=>o(I(i)?.args)]),z(e,t)};V(a,e=>{I(l)&&e(s)});var d=P(a,2),f=e=>{var t=gPe(),n=P(M(t),2),r=M(n,!0);T(n),T(t),F(()=>B(r,I(u))),z(e,t)};V(d,e=>{I(u)&&e(f)});var p=P(d,2),m=e=>{var t=_Pe(),n=P(M(t),2),r=M(n,!0);T(n),T(t),F(()=>B(r,I(i).error)),z(e,t)};V(p,e=>{I(i)?.error&&e(m)});var h=P(p,2),g=e=>{z(e,vPe())};V(h,e=>{!I(l)&&!I(u)&&!I(i)?.error&&e(g)}),T(t),z(e,t)},de=e=>{var t=bPe();U3(M(t),{get text(){return I(p)}}),T(t),z(e,t)},fe=e=>{var t=SPe(),r=N(t),i=M(r);{let e=k(()=>I(n).summary||I(n).text),t=k(()=>I(n).role!==`assistant`);U3(i,{get text(){return I(e)},get trimCodeBlocks(){return I(t)}})}T(r);var a=P(r,2),o=e=>{var t=xPe();U3(P(M(t),2),{get text(){return I(p)}}),T(t),z(e,t)};V(a,e=>{I(p)&&e(o)}),z(e,t)},pe=e=>{z(e,CPe())};V(le,e=>{I(s)?e(ue):I(p)&&!I(n).text?e(de,1):I(n).summary||I(n).text?e(fe,2):e(pe,-1)}),T(ce),T(m),F((e,t)=>{Qi(_,1,`flex size-5 shrink-0 items-center justify-center ${A5[I(r).tone]}`),B(y,I(r).label),W(x,`title`,e),B(S,`${t??``} ago`),B(re,` ${I(n).id??``}`)},[()=>M1(I(n).createdAt),()=>j1(I(n).createdAt)]),_i(`click`,te,()=>d(I(n).id)),z(e,m)};V(p,e=>{t.selection?t.selection.kind===`root`?e(h,1):t.selection.kind===`segment`?e(g,2):I(n)&&I(r)&&e(_,3):e(m)}),z(e,f),O()}vi([`click`]);var EPe=new Set([`assistant`,`tool_call`,`tool_result`,`system`]);function DPe(e,t,n){let r=t[e[0]],i=t[e[e.length-1]],a=new Map;for(let t of e){let e=n[t],r=a.get(e.label);r?r.count+=1:a.set(e.label,{icon:e.icon,label:e.label,count:1})}return{id:r.node.entry.id,lane:r.lane,headParentEntryId:r.node.entry.parentEntryId,headParentLane:r.parentLane,rows:e.map(e=>t[e]),isOnActivePath:e.some(e=>t[e].isOnActivePath),total:e.length,parts:[...a.values()].sort((e,t)=>t.count-e.count),startedAt:r.node.entry.createdAt,endedAt:i.node.entry.createdAt}}function OPe(e,t,n){let r=e.map(e=>D5(e.node.entry,t)),i=t=>{let n=e[t];return!n.isActive&&!n.isLeaf&&!n.isBranchPoint&&EPe.has(r[t].type)},a=[],o=[],s=()=>{o.length&&(a.push({kind:`run`,indices:o}),o=[])};for(let t=0;t<e.length;t++){if(!i(t)){s(),a.push({kind:`row`,index:t});continue}let n=o.at(-1),r=n===void 0?void 0:e[n],c=r!==void 0&&e[t].node.entry.parentEntryId===r.node.entry.id&&e[t].lane===r.lane;o.length&&!c&&s(),o.push(t)}s();let c=[],l=[],u=new Map,d=t=>{u.set(e[t].node.entry.id,c.length),c.push({type:`entry`,row:e[t]})};for(let t of a){if(t.kind===`row`){d(t.index);continue}if(t.indices.length<3){for(let e of t.indices)d(e);continue}let i=DPe(t.indices,e,r);if(l.push(i),n.has(i.id))for(let e of t.indices)d(e);else{let n=c.length;c.push({type:`segment`,segment:i});for(let r of t.indices)u.set(e[r].node.entry.id,n)}}return{items:c,visibleIndexById:u,segments:l}}function kPe(e){switch(e.kind){case`root`:return`root`;case`entry`:return`e:${e.row.node.entry.id}`;case`segment`:return`s:${e.segment.id}`}}var APe=L(`<!> Collapse all`,1),jPe=L(`<!> Expand all`,1),MPe=L(`<button type="button"><!></button>`),NPe=L(`<div class="flex h-full min-h-0"><div class="flex w-80 shrink-0 flex-col border-r"><div class="flex items-center justify-between gap-2 border-b px-3 py-2"><h2 class="text-xs font-medium text-muted-foreground">Branches</h2> <!></div> <div class="min-h-0 flex-1 overflow-y-auto p-2"><!></div></div> <div class="min-w-0 flex-1 overflow-y-auto bg-card"><!></div></div>`);function PPe(e,t){D(t,!0);let n=q(t,`treeNodes`,19,()=>[]),r=q(t,`toolCalls`,19,()=>[]),i=k(()=>new Map(r().map(e=>[e.id,e]))),a=k(()=>yNe(n(),t.activeConversation?.activeEntryId)),o=k(()=>new Set(n().map(e=>e.entry.id))),s=k(()=>!!t.activeConversation),c=k(()=>!!(t.activeConversation&&!t.activeConversation.activeEntryId)),l=k(()=>I(c)||I(a).rows.some(e=>e.isOnActivePath)),u=A(Mn(new Set)),d=A(void 0),f=k(()=>OPe(I(a).rows,I(i),I(u))),p=k(()=>I(d)?kPe(I(d)):``),m;rr(()=>{let e=t.activeConversation?.id;if(e===m)return;m=e,j(u,new Set,!0);let n=t.activeConversation?.activeEntryId,r=n?I(a).rows.find(e=>e.node.entry.id===n):void 0;j(d,r?{kind:`entry`,row:r}:{kind:`root`},!0)});let h=k(()=>I(f).segments.length>0&&I(f).segments.every(e=>I(u).has(e.id)));function g(e){let t=new Set(I(u));t.has(e)?t.delete(e):t.add(e),j(u,t,!0)}function _(){j(u,I(h)?new Set:new Set(I(f).segments.map(e=>e.id)),!0)}function v(e){let t=new Set(I(u));t.add(e),j(u,t,!0);let n=I(a).rows.find(t=>t.node.entry.id===e);n&&j(d,{kind:`entry`,row:n},!0)}var y=NPe(),b=M(y),x=M(b),S=P(M(x),2),ee=e=>{var t=MPe(),n=M(t),r=e=>{var t=APe();_5(N(t),{class:`size-3.5`,strokeWidth:2}),E(),z(e,t)},i=e=>{var t=jPe();y5(N(t),{class:`size-3.5`,strokeWidth:2}),E(),z(e,t)};V(n,e=>{I(h)?e(r):e(i,-1)}),T(t),F(e=>Qi(t,1,e),[()=>Ki(wl({variant:`ghost`,size:`sm`}))]),_i(`click`,t,_),z(e,t)};V(S,e=>{I(f).segments.length>0&&e(ee)}),T(x);var C=P(x,2);ePe(M(C),{get items(){return I(f).items},get visibleIndexById(){return I(f).visibleIndexById},get treeNodeIds(){return I(o)},get toolCallsById(){return I(i)},get laneCount(){return I(a).laneCount},get hasConversation(){return I(s)},get rootActive(){return I(c)},get rootOnActivePath(){return I(l)},get expanded(){return I(u)},get selectedKey(){return I(p)},onSelect:e=>j(d,e,!0),onToggleSegment:g,get onNavigateToEntry(){return t.onNavigateToEntry},get onEditEntry(){return t.onEditEntry}}),T(C),T(b);var te=P(b,2);TPe(M(te),{get selection(){return I(d)},get toolCallsById(){return I(i)},get onNavigateToEntry(){return t.onNavigateToEntry},get onEditEntry(){return t.onEditEntry},onSelectRow:e=>j(d,{kind:`entry`,row:e},!0),onExpandSegment:v}),T(te),T(y),z(e,y),O()}vi([`click`]);var FPe=L(`<!> <span>Compact context</span>`,1),P5=L(`<!> <!>`,1);function IPe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`treeNodes`,19,()=>[]),i=q(t,`toolCalls`,19,()=>[]),a=A(!1);function o(e){n(e),t.onOpenChange?.(e)}function s(e,r){t.onNavigateToEntry?.(e,r),n(!1),t.onOpenChange?.(!1)}function c(e){t.onEditEntry?.(e),n(!1),t.onOpenChange?.(!1)}var l=P5(),u=N(l);ZX(u,{title:`Conversation history`,description:`Browse the branch tree, preview any point, then jump to or fork from it.`,class:`conversation-history-dialog`,onOpenChange:o,get open(){return n()},set open(e){n(e)},headerActions:e=>{var n=R();U(N(n),()=>v1,(e,n)=>{n(e,{children:(e,n)=>{var r=P5(),i=N(r);{let e=k(()=>wl({variant:`ghost`,size:`icon-sm`})),n=k(()=>!t.activeConversation);U(i,()=>C1,(t,r)=>{r(t,{get class(){return I(e)},"aria-label":`History actions`,get disabled(){return I(n)},children:(e,t)=>{v5(e,{class:`size-4`,strokeWidth:2})},$$slots:{default:!0}})})}U(P(i,2),()=>b1,(e,n)=>{n(e,{align:`end`,class:`w-48`,children:(e,n)=>{var r=R(),i=N(r);{let e=k(()=>!t.activeConversation);U(i,()=>x1,(t,n)=>{n(t,{get disabled(){return I(e)},onSelect:()=>j(a,!0),children:(e,t)=>{var n=FPe();_5(N(n),{}),E(2),z(e,n)},$$slots:{default:!0}})})}z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}),z(e,n)},children:(e,n)=>{PPe(e,{get activeConversation(){return t.activeConversation},get treeNodes(){return r()},get toolCalls(){return i()},onNavigateToEntry:s,onEditEntry:c})},$$slots:{headerActions:!0,default:!0}}),_Q(P(u,2),{title:`Compact conversation`,description:`This summarizes earlier messages to reduce context size. The full history stays available in the branch tree.`,confirmLabel:`Compact context`,onConfirm:()=>t.onCompact?.(),get open(){return I(a)},set open(e){j(a,e,!0)}}),z(e,l),O()}var LPe=new Set([`$$slots`,`$$events`,`$$legacy`]);function F5(e,t){let n=G(t,LPe),r=[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]];ic(e,K({name:`folder-open`},()=>n,{get iconNode(){return r}}))}var RPe=L(`<!> `,1),zPe=L(`<!> Open`,1),BPe=L(`<div class="footer-path"><!> <span class="footer-path-text"> </span> <span class="footer-signals"></span></div> <div class="footer-actions"><!></div>`,1);function VPe(e,t){D(t,!0);let n=q(t,`signals`,19,()=>[]),r=q(t,`loading`,3,!1);var i=BPe(),a=N(i),o=M(a);F5(o,{size:14,strokeWidth:2.1,"aria-hidden":`true`});var s=P(o,2),c=M(s,!0);T(s);var l=P(s,2);Ni(l,21,n,Ai,(e,n)=>{let r=k(()=>t.signalMeta[I(n)]),i=k(()=>I(r).icon);{let t=k(()=>I(r).tone??`neutral`);of(e,{get tone(){return I(t)},size:`xs`,get title(){return I(r).title},children:(e,t)=>{var n=RPe(),a=N(n);U(a,()=>I(i),(e,t)=>{t(e,{size:11,strokeWidth:2.2})});var o=P(a,1,!0);F(()=>B(o,I(r).label)),z(e,n)},$$slots:{default:!0}})}}),T(l),T(a);var u=P(a,2),d=M(u);{let e=k(()=>!t.path||r()),n=k(()=>t.path?`Open ${t.path}`:`Open`);Ol(d,{class:`footer-open-button`,size:`sm`,get disabled(){return I(e)},get title(){return I(n)},get onclick(){return t.onOpen},children:(e,t)=>{var n=zPe();F5(N(n),{size:14,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}})}T(u),F(e=>{W(a,`title`,t.path),B(c,e)},[()=>t.path?Rd(t.path,t.homeDir):`—`]),z(e,i),O()}var HPe=new Set([`$$slots`,`$$events`,`$$legacy`]);function UPe(e,t){let n=G(t,HPe),r=[[`path`,{d:`M16 14v2.2l1.6 1`}],[`path`,{d:`M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2`}],[`circle`,{cx:`16`,cy:`16`,r:`6`}]];ic(e,K({name:`folder-clock`},()=>n,{get iconNode(){return r}}))}var WPe=L(`<!><span>New chat</span>`,1),GPe=L(`<!><span>Copy path</span>`,1),KPe=L(`<!><span>Forget project</span>`,1),I5=L(`<!> <!>`,1),qPe=L(`<!> <!> <!>`,1),JPe=L(`<div role="option" tabindex="-1"><!> <span class="row-main"><span class="row-title"><strong> </strong> <small class="row-sub"> </small></span> <small class="row-path"> </small></span> <span class="row-actions"><button class="row-open" type="button" title="Open project"><!>Open</button> <!></span></div>`),YPe=L(`<section class="group"><header class="group-head"><span>Recent</span></header> <div class="rows" role="listbox" aria-label="Recent projects"></div></section>`),XPe=L(`<span class="group-count"> </span>`),ZPe=L(`<span class="skeleton-row"></span>`),QPe=L(`<div class="rows" aria-label="Loading directories"></div>`),$Pe=L(`<!>Opened`,1),eFe=L(`<!> `,1),tFe=L(`<div role="option" tabindex="-1"><!> <span class="row-main"><strong> </strong></span> <span class="row-badges"><!> <!> <button class="row-drill" type="button" title="Open folder" aria-label="Open folder"><!></button></span></div>`),nFe=L(`<div class="rows" role="listbox" aria-label="Folders"></div>`),rFe=L(`<div class="empty"><!> <p> </p> <span> </span></div>`),iFe=L(`<div class="picker-scroll"><!> <section class="group"><header class="group-head"><span>Folders</span> <!></header> <!></section></div>`);function aFe(e,t){D(t,!0);let n=q(t,`listEl`,15);var r=iFe(),i=M(r),a=e=>{var n=YPe(),r=P(M(n),2);W(r,`tabindex`,-1),Ni(r,21,()=>t.recentProjects,Ai,(e,n,r)=>{let i=k(()=>r);var a=JPe();let o;var s=M(a);UPe(s,{size:16,strokeWidth:2.05,"aria-hidden":`true`});var c=P(s,2),l=M(c),u=M(l),d=M(u,!0);T(u);var f=P(u,2),p=M(f);T(f),T(l);var m=P(l,2),h=M(m,!0);T(m),T(c);var g=P(c,2),_=M(g);F5(M(_),{size:13,strokeWidth:2.2}),E(),T(_),U(P(_,2),()=>v1,(e,r)=>{r(e,{children:(e,r)=>{var i=I5(),a=N(i);{let e=k(()=>wl({variant:`ghost`,size:`icon-xs`}));U(a,()=>C1,(t,n)=>{n(t,{get class(){return I(e)},title:`Project actions`,"aria-label":`Project actions`,onclick:e=>e.stopPropagation(),children:(e,t)=>{v5(e,{size:15,strokeWidth:2})},$$slots:{default:!0}})})}U(P(a,2),()=>b1,(e,r)=>{r(e,{align:`end`,class:`w-44`,children:(e,r)=>{var i=qPe(),a=N(i);U(a,()=>x1,(e,r)=>{r(e,{onSelect:()=>void t.onSelect?.(I(n).dir),children:(e,t)=>{var n=WPe();KZ(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})});var o=P(a,2);U(o,()=>x1,(e,r)=>{r(e,{onSelect:()=>void t.copyPath(I(n).dir),children:(e,t)=>{var n=GPe();G3(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})});var s=P(o,2),c=e=>{var r=I5(),i=N(r);U(i,()=>S1,(e,t)=>{t(e,{})}),U(P(i,2),()=>x1,(e,r)=>{r(e,{variant:`destructive`,onSelect:()=>t.onForget?.(I(n).id),children:(e,t)=>{var n=KPe();YQ(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})}),z(e,r)};V(s,e=>{t.onForget&&e(c)}),z(e,i)},$$slots:{default:!0}})}),z(e,i)},$$slots:{default:!0}})}),T(g),T(a),F((e,r,s,c)=>{W(a,`id`,`recent:${I(n).id}`),o=Qi(a,1,`row recent-row app-interactive-row`,null,o,{selected:t.selectedIndex===I(i)}),W(a,`aria-selected`,t.selectedIndex===I(i)),W(a,`title`,e),B(d,I(n).name),B(p,`${r??``} chats · ${s??``}`),B(h,c)},[()=>`${I(n).dir}\n${M1(I(n).updatedAt)}`,()=>t.conversationCountFor(I(n)),()=>j1(I(n).updatedAt),()=>Wd(I(n).dir,t.homeDir)]),_i(`click`,a,()=>t.onSelectedIndexChange?.(I(i))),_i(`dblclick`,a,()=>void t.onSelect?.(I(n).dir)),_i(`keydown`,a,e=>t.onRowKeydown(e,I(i),{kind:`recent`,id:`recent:${I(n).id}`,path:I(n).dir,project:I(n)})),_i(`click`,_,e=>{e.stopPropagation(),t.onSelect?.(I(n).dir)}),z(e,a)}),T(r),T(n),F(()=>W(r,`aria-activedescendant`,t.selectedItem?.kind===`recent`?t.activeDescendant:void 0)),z(e,n)};V(i,e=>{t.showRecent&&e(a)});var o=P(i,2),s=M(o),c=P(M(s),2),l=e=>{var n=XPe(),r=M(n,!0);T(n),F(()=>B(r,t.filteredEntries.length)),z(e,n)};V(c,e=>{!t.loading&&t.filteredEntries.length&&e(l)}),T(s);var u=P(s,2),d=e=>{var t=QPe();Ni(t,20,()=>Array.from({length:7}),Ai,(e,t)=>{z(e,ZPe())}),T(t),z(e,t)},f=e=>{var n=nFe();W(n,`tabindex`,-1),Ni(n,21,()=>t.filteredEntries,Ai,(e,n,r)=>{let i=k(()=>t.recentCount+r);var a=tFe();let o;var s=M(a);S$(s,{size:15,strokeWidth:2.1,"aria-hidden":`true`});var c=P(s,2),l=M(c),u=M(l,!0);T(l),T(c);var d=P(c,2),f=M(d),p=e=>{of(e,{tone:`good`,size:`xs`,children:(e,t)=>{var n=$Pe();t$(N(n),{size:11}),E(),z(e,n)},$$slots:{default:!0}})},m=k(()=>t.isOpened(I(n).path));V(f,e=>{I(m)&&e(p)});var h=P(f,2);Ni(h,17,()=>t.uniqueSignals(I(n).signals),Ai,(e,n)=>{let r=k(()=>t.signalMeta[I(n)]),i=k(()=>I(r).icon);{let t=k(()=>I(r).tone??`neutral`);of(e,{get tone(){return I(t)},size:`xs`,get title(){return I(r).title},children:(e,t)=>{var n=eFe(),a=N(n);U(a,()=>I(i),(e,t)=>{t(e,{size:11,strokeWidth:2.2})});var o=P(a,1,!0);F(()=>B(o,I(r).label)),z(e,n)},$$slots:{default:!0}})}});var g=P(h,2);Rw(M(g),{size:15,strokeWidth:2.2,"aria-hidden":`true`}),T(g),T(d),T(a),F(()=>{W(a,`id`,`folder:${I(n).path}`),o=Qi(a,1,`row folder-row app-interactive-row`,null,o,{selected:t.selectedIndex===I(i)}),W(a,`aria-selected`,t.selectedIndex===I(i)),W(a,`title`,I(n).path),B(u,I(n).name)}),_i(`click`,a,()=>t.onSelectedIndexChange?.(I(i))),_i(`dblclick`,a,()=>void t.load(I(n).path)),_i(`keydown`,a,e=>t.onRowKeydown(e,I(i),{kind:`folder`,id:`folder:${I(n).path}`,path:I(n).path,entry:I(n)})),_i(`click`,g,e=>{e.stopPropagation(),t.load(I(n).path)}),z(e,a)}),T(n),F(()=>W(n,`aria-activedescendant`,t.selectedItem?.kind===`folder`?t.activeDescendant:void 0)),z(e,n)},p=e=>{var n=rFe(),r=M(n);F5(r,{size:26,strokeWidth:1.8});var i=P(r,2),a=M(i,!0);T(i);var o=P(i,2),s=M(o,!0);T(o),T(n),F((e,t)=>{B(a,e),B(s,t)},[()=>t.query.trim()?`No folders match your filter.`:`No subfolders here.`,()=>t.query.trim()?`Clear the filter or paste a path.`:`Use Open below to choose this folder as the project.`]),z(e,n)};V(u,e=>{t.loading?e(d):t.filteredEntries.length?e(f,1):e(p,-1)}),T(o),T(r),Ta(r,e=>n(e),()=>n()),z(e,r),O()}vi([`click`,`dblclick`,`keydown`]);var oFe=new Set([`$$slots`,`$$events`,`$$legacy`]);function sFe(e,t){let n=G(t,oFe),r=[[`path`,{d:`M8 6L12 2L16 6`}],[`path`,{d:`M12 2V22`}]];ic(e,K({name:`move-up`},()=>n,{get iconNode(){return r}}))}var cFe=L(`<span class="crumb current"> </span>`),lFe=L(`<button class="crumb app-interactive-row" type="button"> </button>`),uFe=L(`<!> <!>`,1),dFe=L(`<div class="path-bar"><nav class="crumbs" aria-label="Current location"></nav> <div class="path-tools"><!> <!> <span class="path-tools-sep" aria-hidden="true"></span> <!></div></div> <form class="picker-search"><!> <!></form>`,1);function fFe(e,t){D(t,!0);let n=q(t,`query`,15),r=q(t,`showHidden`,15);var i=dFe(),a=N(i),o=M(a);Ni(o,21,()=>t.crumbs,Ai,(e,n,r)=>{var i=uFe(),a=N(i),o=e=>{Rw(e,{class:`crumb-sep`,size:13,strokeWidth:2.2,"aria-hidden":`true`})};V(a,e=>{r>0&&e(o)});var s=P(a,2),c=e=>{var t=cFe(),r=M(t,!0);T(t),F(()=>{W(t,`title`,I(n).path),B(r,I(n).label)}),z(e,t)},l=e=>{var r=lFe(),i=M(r,!0);T(r),F(()=>{W(r,`title`,I(n).path),r.disabled=t.loading,B(i,I(n).label)}),_i(`click`,r,()=>t.onLoad?.(I(n).path)),z(e,r)};V(s,e=>{r===t.crumbs.length-1?e(c):e(l,-1)}),z(e,i)}),T(o);var s=P(o,2),c=M(s);{let e=k(()=>!t.parent||t.loading);Ol(c,{variant:`ghost`,size:`icon-sm`,get disabled(){return I(e)},title:`Parent directory`,ariaLabel:`Parent directory`,onclick:()=>t.onLoad?.(t.parent),children:(e,t)=>{sFe(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}})}var l=P(c,2);Ol(l,{variant:`ghost`,size:`icon-sm`,get disabled(){return t.loading},title:`Refresh`,ariaLabel:`Refresh`,get onclick(){return t.onReload},children:(e,t)=>{O8(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}}),n$(P(l,4),{label:`Hidden`,class:`hidden-switch`,get checked(){return r()},set checked(e){r(e)}}),T(s),T(a);var u=P(a,2),d=M(u);rZ(d,{size:14,strokeWidth:2.2,"aria-hidden":`true`}),SQ(P(d,2),{oninput:()=>t.onQueryChange?.(n()),placeholder:`Filter folders or paste a path`,get disabled(){return t.loading},size:`sm`,ariaLabel:`Filter folders or enter a path`,get value(){return n()},set value(e){n(e)}}),T(u),gi(`submit`,u,function(...e){t.onSubmit?.apply(this,e)}),z(e,i),O()}vi([`click`]);var pFe=new Set([`$$slots`,`$$events`,`$$legacy`]);function L5(e,t){let n=G(t,pFe),r=[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`}],[`path`,{d:`M12 22V12`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`}],[`path`,{d:`m7.5 4.27 9 5.15`}]];ic(e,K({name:`package`},()=>n,{get iconNode(){return r}}))}var R5={git:{label:`Git`,title:`Git repository`,tone:`accent`,icon:Td},package:{label:`Pkg`,title:`JavaScript package`,icon:L5},workspace:{label:`Workspace`,title:`Workspace marker`,tone:`accent`,icon:L5},python:{label:`Py`,title:`Python project`,icon:Fd},rust:{label:`Rust`,title:`Rust project`,icon:Fd},go:{label:`Go`,title:`Go module`,icon:Fd}};function z5(e){return[...new Set(e??[])]}function mFe(e,t){let n=e.trim();if(!t)return n;if(n===`~`)return t;if(n.startsWith(`~/`)||n.startsWith(`~\\`)){let e=t.includes(`\\`)?`\\`:`/`;return`${t.replace(/[\\/]+$/,``)}${e}${n.slice(2)}`}return n}var hFe=L(`<p class="picker-error"> </p>`),gFe=L(`<div class="picker-body" role="presentation"><!> <!> <!></div>`);function _Fe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`projects`,19,()=>[]),i=q(t,`conversations`,19,()=>[]),a=A(``),o=A(void 0),s=A(!1),c=A(void 0),l=A(!1),u=A(-1),d=A(!1),f=A(!1),p=A(void 0),m=k(()=>new Set(r().map(e=>Gd(e.dir)))),h=k(()=>{let e=new Map;for(let t of i())e.set(t.projectId,(e.get(t.projectId)??0)+1);return e}),g=k(()=>{let e=new Set;return[...r()].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).filter(t=>{let n=Gd(t.dir);return e.has(n)?!1:(e.add(n),!0)}).slice(0,7)}),_=k(()=>{let e=I(o)?.entries??[],t=I(a).trim();if(!t||Kd(t))return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}),v=k(()=>I(g).length>0&&!I(a).trim()),y=k(()=>{let e=[];if(I(v))for(let t of I(g))e.push({kind:`recent`,id:`recent:${t.id}`,path:t.dir,project:t});for(let t of I(_))e.push({kind:`folder`,id:`folder:${t.path}`,path:t.path,entry:t});return e}),b=k(()=>I(v)?I(g).length:0),x=k(()=>I(u)>=0?I(y)[I(u)]:void 0),S=k(()=>I(x)?.kind===`folder`?I(x).entry:void 0),ee=k(()=>I(x)?.path??I(o)?.path??``),C=k(()=>z5(I(S)?.signals??(I(x)?[]:I(o)?.signals))),te=k(()=>I(x)?.id),ne=k(()=>Xd(I(o)?.path,t.homeDir));function re(e){return I(m).has(Gd(e))}function ie(e){return I(h).get(e.id)??0}async function ae(e){j(s,!0),j(c,void 0);try{j(o,await Ure(e,I(l)),!0),j(a,``),j(u,-1)}catch(e){j(c,e instanceof Error?e.message:String(e),!0)}finally{j(s,!1)}}function oe(){ae(I(o)?.path||void 0)}function w(){requestAnimationFrame(()=>{I(p)?.querySelector(`.row.selected`)?.scrollIntoView({block:`nearest`})})}function se(e){n(e),e||t.onClose?.()}function ce(e){e.preventDefault();let n=I(a).trim();if(!n)return;if(Kd(n)){ae(mFe(n,t.homeDir));return}let r=I(y).find(e=>e.kind===`folder`);r&&ae(r.path)}async function le(){let e=I(ee);e&&await t.onSelect?.(e)}function ue(e){e.kind===`recent`?t.onSelect?.(e.path):ae(e.path)}function de(e,t,n){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),j(u,t,!0),ue(n))}async function fe(e){try{await uE(e),id.success(`Path copied`)}catch{id.error(`Could not copy to clipboard`)}}function pe(e){let t=e.target?.tagName===`INPUT`,n=I(y).length;switch(e.key){case`ArrowDown`:e.preventDefault(),n&&(j(u,I(u)<0?0:Math.min(I(u)+1,n-1),!0),w());break;case`ArrowUp`:e.preventDefault(),n&&(j(u,I(u)<=0?0:I(u)-1,!0),w());break;case`ArrowRight`:!t&&I(S)&&(e.preventDefault(),ae(I(S).path));break;case`Enter`:e.metaKey||e.ctrlKey?(e.preventDefault(),le()):!t&&I(x)&&(e.preventDefault(),ue(I(x)));break;case`ArrowLeft`:!t&&I(o)?.parent&&(e.preventDefault(),ae(I(o).parent));break;case`Backspace`:I(a).length===0&&I(o)?.parent&&(e.preventDefault(),ae(I(o).parent));break}}rr(()=>{n()&&!I(d)&&ae(I(o)?.path||void 0),j(d,n(),!0)}),rr(()=>{n()&&I(l)!==I(f)&&oe(),j(f,I(l),!0)}),ZX(e,{title:`Open Project`,class:`project-picker-dialog`,onOpenChange:se,get open(){return n()},set open(e){n(e)},footer:e=>{VPe(e,{get path(){return I(ee)},get homeDir(){return t.homeDir},get signals(){return I(C)},get signalMeta(){return R5},get loading(){return I(s)},onOpen:()=>void le()})},children:(e,n)=>{var r=gFe(),i=M(r);{let e=k(()=>I(o)?.parent);fFe(i,{get crumbs(){return I(ne)},get loading(){return I(s)},get parent(){return I(e)},onLoad:e=>void ae(e),onReload:oe,onQueryChange:()=>j(u,-1),onSubmit:ce,get query(){return I(a)},set query(e){j(a,e,!0)},get showHidden(){return I(l)},set showHidden(e){j(l,e,!0)}})}var d=P(i,2),f=e=>{var t=hFe(),n=M(t,!0);T(t),F(()=>B(n,I(c))),z(e,t)};V(d,e=>{I(c)&&e(f)}),aFe(P(d,2),{get showRecent(){return I(v)},get recentProjects(){return I(g)},get filteredEntries(){return I(_)},get loading(){return I(s)},get query(){return I(a)},get selectedIndex(){return I(u)},get selectedItem(){return I(x)},get activeDescendant(){return I(te)},get recentCount(){return I(b)},get signalMeta(){return R5},get homeDir(){return t.homeDir},isOpened:re,conversationCountFor:ie,get uniqueSignals(){return z5},load:e=>void ae(e),copyPath:e=>void fe(e),get onSelect(){return t.onSelect},get onForget(){return t.onForget},onSelectedIndexChange:e=>j(u,e,!0),onRowKeydown:de,get listEl(){return I(p)},set listEl(e){j(p,e,!0)}}),T(r),_i(`keydown`,r,pe),z(e,r)},$$slots:{footer:!0,default:!0}}),O()}vi([`keydown`]);var vFe=L(`<!> <!>`,1);function yFe(e,t){D(t,!0);let n=k(()=>H6.status),r=k(()=>H6.projects),i=k(()=>H6.conversations),a=k(()=>_8.activeConversation),o=k(()=>_8.treeNodes),s=k(()=>_8.toolCalls);async function c(e,t=!1){await j6(e,t),$3()}async function l(e){await j6(e.parentEntryId),x6(e.text),$3()}var u=vFe(),d=N(u);{let e=k(()=>I(n)?.storage.home);_Fe(d,{get projects(){return I(r)},get conversations(){return I(i)},get homeDir(){return I(e)},onSelect:e=>void A6(e),onForget:e=>void k6(e),get open(){return Y.projectPickerOpen},set open(e){Y.projectPickerOpen=e}})}IPe(P(d,2),{get activeConversation(){return I(a)},get treeNodes(){return I(o)},get toolCalls(){return I(s)},onNavigateToEntry:(e,t)=>{c(e,t)},onEditEntry:e=>{l(e)},onCompact:()=>void ADe(),get open(){return Q3.historyDialogOpen},set open(e){Q3.historyDialogOpen=e}}),z(e,u),O()}function bFe(e){return typeof e==`function`}function B5(e){return typeof e==`object`&&!!e}var xFe=[`string`,`number`,`bigint`,`boolean`];function V5(e){return e==null||xFe.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>V5(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var H5=Symbol(`box`),U5=Symbol(`is-writable`);function SFe(e){return B5(e)&&H5 in e}function CFe(e){return W5.isBox(e)&&U5 in e}function W5(e){let t=A(Mn(e));return{[H5]:!0,[U5]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}function wFe(e,t){let n=k(e);return t?{[H5]:!0,[U5]:!0,get current(){return I(n)},set current(e){t(e)}}:{[H5]:!0,get current(){return e()}}}function TFe(e){return W5.isBox(e)?e:bFe(e)?W5.with(e):W5(e)}function EFe(e){return Object.entries(e).reduce((e,[t,n])=>W5.isBox(n)?(W5.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function DFe(e){return W5.isWritableBox(e)?{[H5]:!0,get current(){return e.current}}:e}W5.from=TFe,W5.with=wFe,W5.flatten=EFe,W5.readonly=DFe,W5.isBox=SFe,W5.isWritableBox=CFe;function OFe(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var kFe=/\d/,AFe=[`-`,`_`,`/`,`.`];function jFe(e=``){if(!kFe.test(e))return e!==e.toLowerCase()}function MFe(e){let t=[],n=``,r,i;for(let a of e){let e=AFe.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=jFe(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function G5(e){return e?MFe(e).map(e=>PFe(e)).join(``):``}function NFe(e){return FFe(G5(e||``))}function PFe(e){return e?e[0].toUpperCase()+e.slice(1):``}function FFe(e){return e?e[0].toLowerCase()+e.slice(1):``}function K5(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[G5(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[NFe(e)]=n}return ws(e,n),t}function q5(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function IFe(e,t,n,r){let i=Array.isArray(t)?t:[t];return i.forEach(t=>e.addEventListener(t,n,r)),()=>{i.forEach(t=>e.removeEventListener(t,n,r))}}function LFe(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var RFe=LFe(/[A-Z]/,e=>`-${e.toLowerCase()}`);function zFe(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${RFe(t)}: ${e[t]};`).join(`
|
|
145
|
-
`)}function J5(e={}){return zFe(e).replace(`
|
|
146
|
-
`,` `)}J5({position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`});var BFe=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function VFe(e){return BFe.has(e)}function Y5(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&VFe(e))t[e]=OFe(n,i);else if(a&&o)t[e]=q5(n,i);else if(e===`class`){let r=V5(n),a=V5(i);r&&a?t[e]=Gi(n,i):r?t[e]=Gi(n):a&&(t[e]=Gi(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=K5(i);t[e]={...n,...r}}else if(o&&a)t[e]={...K5(n),...i};else if(o&&s){let r=K5(n),a=K5(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=J5(t.style).replaceAll(`
|
|
147
|
-
`,` `)),t.hidden!==!0&&(t.hidden=void 0,delete t.hidden),t.disabled!==!0&&(t.disabled=void 0,delete t.disabled),t}var HFe=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function UFe(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=HFe,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Vt(e=>{let n=hi(t,`focusin`,e),r=hi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?UFe(this.#e):null}};function WFe(e,t){switch(e){case`post`:rr(t);break;case`pre`:ar(t);break}}function X5(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;WFe(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Zr(()=>n(t,o));return o=t,r})}function Z5(e,t,n){let r=or(()=>{let i=!1;X5(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});rr(()=>r)}function Q5(e,t,n){X5(e,`post`,t,n)}function GFe(e,t,n){X5(e,`pre`,t,n)}Q5.pre=GFe;function KFe(e,t){Z5(e,`post`,t)}function qFe(e,t){Z5(e,`pre`,t)}KFe.pre=qFe;function JFe(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function YFe(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function $5(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(Mn(o)),u=A(!1),d=A(void 0),f=A(Mn([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?JFe(h,s):c?YFe(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function XFe(e,t,n){return $5(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Q5(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function ZFe(e,t,n){return $5(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Q5.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}XFe.pre=ZFe;function QFe(e){Jr().then(e)}var $Fe=9;function eIe(e){return B5(e)&&e.nodeType===$Fe}function tIe(e){return B5(e)&&e.constructor?.name===`VisualViewport`}function nIe(e){return eIe(e)?e:tIe(e)?e.document:e?.ownerDocument??document}function rIe(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var e7=class{element;#e=k(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return I(this.#e)}set root(e){j(this.#e,e)}constructor(e){typeof e==`function`?this.element=W5.with(e):this.element=e}getDocument=()=>nIe(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>rIe(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function t7(e,t){return{[ei()]:n=>W5.isBox(e)?(e.current=n,Zr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Zr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function iIe({layout:e,panesArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];for(let e=0;e<t.length;e++){let{maxSize:n=100,minSize:c=0}=t[e].constraints;e===s?(r=c,i=n):(a+=c,o+=n)}return{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function n7(e,t=`Assertion failed!`){if(!e)throw console.error(t),Error(t)}function r7(e,t,n=10){return i7(e,t,n)===0}function i7(e,t,n=10){let r=o7(e,n),i=o7(t,n);return Math.sign(r-i)}function a7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function o7(e,t){return Number.parseFloat(e.toFixed(t))}var s7=typeof document<`u`;function aIe(e){return e instanceof HTMLElement}function c7(e){return e.type===`keydown`}function l7(e){return e.type.startsWith(`mouse`)}function u7(e){return e.type.startsWith(`touch`)}function d7({paneConstraints:e,paneIndex:t,initialSize:n}){let r=e[t];n7(r!=null,`Pane constraints should not be null.`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r,c=n;return i7(c,s)<0&&(c=oIe(c,a,i,s)),c=Math.min(o,c),Number.parseFloat(c.toFixed(10))}function oIe(e,t,n,r){return t&&i7(e,(n+r)/2)<0?n:r}function f7(){}function sIe({groupId:e,layout:t,panesArray:n,domContext:r}){let i=p7(e,r);for(let e=0;e<n.length-1;e++){let{valueMax:r,valueMin:a,valueNow:o}=iIe({layout:t,panesArray:n,pivotIndices:[e,e+1]}),s=i[e];if(aIe(s)){let t=n[e];s.setAttribute(`aria-controls`,t.opts.id.current),s.setAttribute(`aria-valuemax`,`${Math.round(r)}`),s.setAttribute(`aria-valuemin`,`${Math.round(a)}`),s.setAttribute(`aria-valuenow`,o==null?``:`${Math.round(o)}`)}}return()=>{for(let e of i)e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)}}function p7(e,t){return s7?Array.from(t.querySelectorAll(`[data-pane-resizer-id][data-pane-group-id="${e}"]`)):[]}function m7({groupId:e,id:t,domContext:n}){return s7?p7(e,n).findIndex(e=>e.getAttribute(`data-pane-resizer-id`)===t)??null:null}function h7({groupId:e,dragHandleId:t,domContext:n}){let r=m7({groupId:e,id:t,domContext:n});return r==null?[-1,-1]:[r,r+1]}function g7(e,t,n){let r=e.map(e=>e.constraints),i=_7(e,t),a=r[i],o=i===e.length-1?[i-1,i]:[i,i+1],s=n[i];return{...a,paneSize:s,pivotIndices:o}}function _7(e,t){return e.findIndex(e=>e.opts.id.current===t.opts.id.current)}function v7(e,t,n){for(let r=0;r<t.length;r++){let i=t[r],a=e[r];n7(a);let{collapsedSize:o=0,collapsible:s}=a.constraints,c=n[a.opts.id.current];if(!(c==null||i!==c))continue;n[a.opts.id.current]=i;let{onCollapse:l,onExpand:u,onResize:d}=a.callbacks;d?.(i,c),s&&(l||u)&&(u&&(c==null||c===o)&&i!==o&&u(),l&&(c==null||c!==o)&&i===o&&l())}}function cIe({panesArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];n7(e);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];n7(o);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function lIe({layout:e,paneConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} pane layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!r7(r,100))for(let e=0;e<t.length;e++){let t=n[e];n7(t!=null),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];n7(r!=null);let a=d7({paneConstraints:t,paneIndex:e,initialSize:r});r!==a&&(i+=r-a,n[e]=a)}if(!r7(i,0))for(let e=0;e<t.length;e++){let r=n[e];n7(r!=null);let a=r+i,o=d7({paneConstraints:t,paneIndex:e,initialSize:a});if(r!==o&&(i-=o-r,n[e]=o,r7(i,0)))break}return n}function uIe(e,t){return s7&&t.querySelector(`[data-pane-group][data-pane-group-id="${e}"]`)||null}function y7(e,t){return s7&&t.querySelector(`[data-pane-resizer-id="${e}"]`)||null}function dIe({event:e,dragHandleId:t,dir:n,initialDragState:r,domContext:i}){let a=n===`horizontal`,o=y7(t,i);n7(o);let s=o.getAttribute(`data-pane-group-id`);n7(s);let{initialCursorPosition:c}=r,l=b7(n,e),u=uIe(s,i);n7(u);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function fIe({event:e,dragHandleId:t,dir:n,initialDragState:r,keyboardResizeBy:i,domContext:a}){if(c7(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:dIe({event:e,dragHandleId:t,dir:n,initialDragState:r,domContext:a})}function b7(e,t){let n=e===`horizontal`;if(l7(t))return n?t.clientX:t.clientY;if(u7(t)){let e=t.touches[0];return n7(e),n?e.screenX:e.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function pIe({groupId:e,handleId:t,panesArray:n,domContext:r}){let i=y7(t,r),a=p7(e,r),o=i?a.indexOf(i):-1;return[n[o]?.opts.id.current??null,n[o+1]?.opts.id.current??null]}function x7({delta:e,layout:t,paneConstraints:n,pivotIndices:r,trigger:i}){if(r7(e,0))return t;let a=[...t],[o,s]=r,c=0;if(i===`keyboard`){{let r=e<0?s:o,i=n[r];if(n7(i),i.collapsible){let i=t[r];n7(i!=null);let a=n[r];n7(a);let{collapsedSize:o=0,minSize:s=0}=a;if(r7(i,o)){let t=s-i;i7(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?o:s,i=n[r];n7(i);let{collapsible:a}=i;if(a){let i=t[r];n7(i!=null);let a=n[r];n7(a);let{collapsedSize:o=0,minSize:s=0}=a;if(r7(i,s)){let t=i-o;i7(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?s:o,a=0;for(;;){let e=t[i];n7(e!=null);let o=d7({paneConstraints:n,paneIndex:i,initialSize:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let c=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-c:c}{let r=e<0?o:s;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(c),o=t[r];n7(o!=null);let s=o-i,l=d7({paneConstraints:n,paneIndex:r,initialSize:s});if(!r7(o,l)&&(c+=o-l,a[r]=l,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(r7(c,0))return t;{let r=e<0?s:o,i=t[r];n7(i!=null);let l=i+c,u=d7({paneConstraints:n,paneIndex:r,initialSize:l});if(a[r]=u,!r7(u,l)){let t=l-u,r=e<0?s:o;for(;r>=0&&r<n.length;){let i=a[r];n7(i!=null);let o=i+t,s=d7({paneConstraints:n,paneIndex:r,initialSize:o});if(r7(i,s)||(t-=s-i,a[r]=s),r7(t,0))break;e>0?r--:r++}}}return r7(a.reduce((e,t)=>t+e,0),100)?a:t}var S7=null,C7=null;function w7(e){switch(e){case`horizontal`:return`ew-resize`;case`horizontal-max`:return`w-resize`;case`horizontal-min`:return`e-resize`;case`vertical`:return`ns-resize`;case`vertical-max`:return`n-resize`;case`vertical-min`:return`s-resize`}}function mIe(){C7!==null&&(document.head.removeChild(C7),S7=null,C7=null)}function hIe(e,t){if(S7===e)return;S7=e;let n=w7(e);C7===null&&(C7=t.createElement(`style`),t.head.appendChild(C7)),C7.innerHTML=`*{cursor: ${n}!important;}`}function gIe({defaultSize:e,dragState:t,layout:n,panesArray:r,paneIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e??`1`:r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function T7(e){try{if(typeof localStorage>`u`)throw TypeError(`localStorage is not supported in this environment`);e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>localStorage.setItem(e,t)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function E7(e){return`paneforge:${e}`}function D7(e){return e.map(e=>e.opts.order.current?`${e.opts.order.current}:${JSON.stringify(e.constraints)}`:JSON.stringify(e.constraints)).sort().join(`,`)}function O7(e,t){try{let n=E7(e),r=t.getItem(n),i=JSON.parse(r||``);if(typeof i==`object`&&i)return i}catch{}return null}function _Ie(e,t,n){return(O7(e,n)||{})[D7(t)]||null}function vIe(e,t,n,r,i){let a=E7(e),o=D7(t),s=O7(e,i)||{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}var k7={};function yIe(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function bIe({autoSaveId:e,layout:t,storage:n,panesArray:r,paneSizeBeforeCollapse:i}){if(t.length===0||t.length!==r.length)return;let a=k7[e];a??(a=yIe(vIe,100),k7[e]=a);let o=[...r],s=new Map(i);a(e,o,s,t,n)}var A7={getItem:e=>(T7(A7),A7.getItem(e)),setItem:(e,t)=>{T7(A7),A7.setItem(e,t)}},j7=new Rs(`PaneGroup`),xIe=class e{static create(t){return j7.set(new e(t))}opts;attachment;domContext;#e=A(null);get dragState(){return I(this.#e)}set dragState(e){j(this.#e,e)}#t=A([]);get layout(){return I(this.#t)}set layout(e){j(this.#t,e)}#n=A([]);get panesArray(){return I(this.#n)}set panesArray(e){j(this.#n,e)}#r=A(!1);get panesArrayChanged(){return I(this.#r)}set panesArrayChanged(e){j(this.#r,e,!0)}#i=A(Mn({}));get paneIdToLastNotifiedSizeMap(){return I(this.#i)}set paneIdToLastNotifiedSizeMap(e){j(this.#i,e,!0)}paneSizeBeforeCollapseMap=new Map;prevDelta=0;constructor(e){this.opts=e,this.attachment=t7(this.opts.ref),this.domContext=new e7(this.opts.ref),Ps([()=>this.opts.id.current,()=>this.layout,()=>this.panesArray],()=>sIe({groupId:this.opts.id.current,layout:this.layout,panesArray:this.panesArray,domContext:this.domContext})),rr(()=>Zr(()=>this.#a())),Ps([()=>this.opts.autoSaveId.current,()=>this.layout,()=>this.opts.storage.current],()=>{this.opts.autoSaveId.current&&bIe({autoSaveId:this.opts.autoSaveId.current,layout:this.layout,storage:this.opts.storage.current,panesArray:this.panesArray,paneSizeBeforeCollapse:this.paneSizeBeforeCollapseMap})}),Ps(()=>this.panesArrayChanged,()=>{if(!this.panesArrayChanged)return;this.panesArrayChanged=!1;let e=this.layout,t=null;if(this.opts.autoSaveId.current){let e=_Ie(this.opts.autoSaveId.current,this.panesArray,this.opts.storage.current);e&&(this.paneSizeBeforeCollapseMap=new Map(Object.entries(e.expandToSizes)),t=e.layout)}t??=cIe({panesArray:this.panesArray});let n=lIe({layout:t,paneConstraints:this.panesArray.map(e=>e.constraints)});a7(e,n)||(this.layout=n,this.opts.onLayout.current?.(n),v7(this.panesArray,n,this.paneIdToLastNotifiedSizeMap))})}setLayout=e=>{this.layout=e};registerResizeHandle=e=>t=>{t.preventDefault();let n=this.opts.direction.current,r=this.dragState,i=this.opts.id.current,a=this.opts.keyboardResizeBy.current,o=this.layout,s=this.panesArray,{initialLayout:c}=r??{},l=this.domContext.getDocument(),u=h7({groupId:i,dragHandleId:e,domContext:this.domContext}),d=fIe({event:t,dragHandleId:e,dir:n,initialDragState:r,keyboardResizeBy:a,domContext:this.domContext});if(d===0)return;let f=n===`horizontal`;l.dir===`rtl`&&f&&(d=-d);let p=s.map(e=>e.constraints),m=x7({delta:d,layout:c??o,paneConstraints:p,pivotIndices:u,trigger:c7(t)?`keyboard`:`mouse-or-touch`}),h=!a7(o,m);(l7(t)||u7(t))&&this.prevDelta!==d&&(this.prevDelta=d,hIe(h?f?`horizontal`:`vertical`:f?d<0?`horizontal-min`:`horizontal-max`:d<0?`vertical-min`:`vertical-max`,l)),h&&(this.setLayout(m),this.opts.onLayout.current?.(m),v7(s,m,this.paneIdToLastNotifiedSizeMap))};resizePane=(e,t)=>{let n=this.layout,r=this.panesArray,i=r.map(e=>e.constraints),{paneSize:a,pivotIndices:o}=g7(r,e,n);n7(a!=null);let s=x7({delta:_7(r,e)===r.length-1?a-t:t-a,layout:n,paneConstraints:i,pivotIndices:o,trigger:`imperative-api`});a7(n,s)||(this.setLayout(s),this.opts.onLayout.current?.(s),v7(r,s,this.paneIdToLastNotifiedSizeMap))};startDragging=(e,t)=>{let n=this.opts.direction.current,r=this.layout,i=y7(e,this.domContext);n7(i);let a=b7(n,t);this.dragState={dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}};stopDragging=()=>{mIe(),this.dragState=null};isPaneCollapsed=e=>{let t=this.panesArray,n=this.layout,{collapsedSize:r=0,collapsible:i,paneSize:a}=g7(t,e,n);return typeof a!=`number`||typeof r!=`number`?!1:i===!0&&r7(a,r)};expandPane=e=>{let t=this.layout,n=this.panesArray;if(!e.constraints.collapsible)return;let r=n.map(e=>e.constraints),{collapsedSize:i=0,paneSize:a,minSize:o=0,pivotIndices:s}=g7(n,e,t);if(a!==i)return;let c=this.paneSizeBeforeCollapseMap.get(e.opts.id.current),l=c!=null&&c>=o?c:o,u=x7({delta:_7(n,e)===n.length-1?a-l:l-a,layout:t,paneConstraints:r,pivotIndices:s,trigger:`imperative-api`});a7(t,u)||(this.setLayout(u),this.opts.onLayout.current?.(u),v7(n,u,this.paneIdToLastNotifiedSizeMap))};collapsePane=e=>{let t=this.layout,n=this.panesArray;if(!e.constraints.collapsible)return;let r=n.map(e=>e.constraints),{collapsedSize:i=0,paneSize:a,pivotIndices:o}=g7(n,e,t);if(n7(a!=null),a===i)return;this.paneSizeBeforeCollapseMap.set(e.opts.id.current,a);let s=x7({delta:_7(n,e)===n.length-1?a-i:i-a,layout:t,paneConstraints:r,pivotIndices:o,trigger:`imperative-api`});a7(t,s)||(this.layout=s,this.opts.onLayout.current?.(s),v7(n,s,this.paneIdToLastNotifiedSizeMap))};getPaneSize=e=>g7(this.panesArray,e,this.layout).paneSize;getPaneStyle=(e,t)=>{let n=this.panesArray,r=this.layout,i=this.dragState;return gIe({defaultSize:t,dragState:i,layout:r,panesArray:n,paneIndex:_7(n,e)})};isPaneExpanded=e=>{let{collapsedSize:t=0,collapsible:n,paneSize:r}=g7(this.panesArray,e,this.layout);return!n||r>t};registerPane=e=>{let t=[...this.panesArray,e];return t.sort((e,t)=>{let n=e.opts.order.current,r=t.opts.order.current;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),this.panesArray=t,this.panesArrayChanged=!0,()=>{let t=[...this.panesArray],n=_7(this.panesArray,e);n<0||(t.splice(n,1),this.panesArray=t,delete this.paneIdToLastNotifiedSizeMap[e.opts.id.current],this.panesArrayChanged=!0)}};#a=()=>{let e=this.opts.id.current,t=p7(e,this.domContext),n=this.panesArray,r=t.map(t=>{let r=t.getAttribute(`data-pane-resizer-id`);if(!r)return f7;let[i,a]=pIe({groupId:e,handleId:r,panesArray:n,domContext:this.domContext});if(i==null||a==null)return f7;let o=IFe(t,`keydown`,t=>{if(t.defaultPrevented||t.key!==`Enter`)return;t.preventDefault();let n=this.panesArray,a=n.findIndex(e=>e.opts.id.current===i);if(a<0)return;let o=n[a];n7(o);let s=this.layout,c=s[a],{collapsedSize:l=0,collapsible:u,minSize:d=0}=o.constraints;if(!(c!=null&&u))return;let f=x7({delta:r7(c,l)?d-c:l-c,layout:s,paneConstraints:n.map(e=>e.constraints),pivotIndices:h7({groupId:e,dragHandleId:r,domContext:this.domContext}),trigger:`keyboard`});s!==f&&(this.layout=f)});return()=>{o()}});return()=>{for(let e of r)e()}};#o=k(()=>({id:this.opts.id.current,"data-pane-group":``,"data-direction":this.opts.direction.current,"data-pane-group-id":this.opts.id.current,style:{display:`flex`,flexDirection:this.opts.direction.current===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`},...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},SIe=[`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`],CIe=class e{static create(t){return new e(t,j7.get())}opts;#e;attachment;domContext;#t=k(()=>this.#e.dragState?.dragHandleId===this.opts.id.current);#n=A(!1);resizeHandler=null;constructor(e,t){this.opts=e,this.#e=t,this.attachment=t7(this.opts.ref),this.domContext=new e7(this.opts.ref),rr(()=>{this.opts.disabled.current?this.resizeHandler=null:this.resizeHandler=this.#e.registerResizeHandle(this.opts.id.current)}),rr(()=>{let e=this.opts.ref.current;if(!e)return;let t=this.opts.disabled.current,n=this.resizeHandler,r=I(this.#t);if(t||n===null||!r)return;let i=e=>{n(e)},a=e=>{n(e)},o=()=>{e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1)},s=this.domContext.getDocument().body,c=this.domContext.getWindow();return q5(hi(s,`contextmenu`,o),hi(s,`mousemove`,i),hi(s,`touchmove`,i,{passive:!1}),hi(s,`mouseleave`,a),hi(c,`mouseup`,o),hi(c,`touchend`,o))})}#r=e=>{e.preventDefault(),!this.opts.disabled.current&&(this.#e.startDragging(this.opts.id.current,e),this.opts.onDraggingChange.current(!0))};#i=()=>{let e=this.opts.ref.current;e&&(e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1))};#a=e=>{if(this.opts.disabled.current||!this.resizeHandler||e.defaultPrevented)return;if(SIe.includes(e.key)){e.preventDefault(),this.resizeHandler(e);return}if(e.key!==`F6`)return;e.preventDefault();let t=p7(this.#e.opts.id.current,this.domContext),n=m7({groupId:this.#e.opts.id.current,id:this.opts.id.current,domContext:this.domContext});if(n===null)return;let r=0;r=e.shiftKey?n>0?n-1:t.length-1:n+1<t.length?n+1:0,t[r].focus()};#o=()=>{j(this.#n,!1)};#s=()=>{j(this.#n,!0)};#c=e=>{this.#r(e)};#l=()=>{this.#i()};#u=()=>{this.#i()};#d=()=>{this.#i()};#f=e=>{this.#r(e)};#p=k(()=>({id:this.opts.id.current,role:`separator`,"data-direction":this.#e.opts.direction.current,"data-pane-group-id":this.#e.opts.id.current,"data-active":I(this.#t)?`pointer`:I(this.#n)?`keyboard`:void 0,"data-enabled":!this.opts.disabled.current,"data-pane-resizer-id":this.opts.id.current,"data-pane-resizer":``,tabIndex:this.opts.tabIndex.current,style:{cursor:w7(this.#e.opts.direction.current),touchAction:`none`,userSelect:`none`,"-webkit-user-select":`none`,"-webkit-touch-callout":`none`},onkeydown:this.#a,onblur:this.#o,onfocus:this.#s,onmousedown:this.#c,onmouseup:this.#l,ontouchcancel:this.#u,ontouchend:this.#d,ontouchstart:this.#f,...this.attachment}));get props(){return I(this.#p)}set props(e){j(this.#p,e)}},wIe=class e{static create(t){return new e(t,j7.get())}opts;group;attachment;domContext;#e=A(``);#t=k(()=>({onCollapse:this.opts.onCollapse.current,onExpand:this.opts.onExpand.current,onResize:this.opts.onResize.current}));get callbacks(){return I(this.#t)}set callbacks(e){j(this.#t,e)}#n=k(()=>({collapsedSize:this.opts.collapsedSize.current,collapsible:this.opts.collapsible.current,defaultSize:this.opts.defaultSize.current,maxSize:this.opts.maxSize.current,minSize:this.opts.minSize.current}));get constraints(){return I(this.#n)}set constraints(e){j(this.#n,e)}#r=e=>{j(this.#e,e,!0),QFe(()=>{if(this.opts.ref.current){let e=this.opts.ref.current;if(getComputedStyle(e).transitionDuration===`0s`){j(this.#e,``);return}let t=n=>{n.propertyName===`flex-grow`&&(j(this.#e,``),e.removeEventListener(`transitionend`,t))};e.addEventListener(`transitionend`,t)}else j(this.#e,``)})};pane={collapse:()=>{this.#r(`collapsing`),this.group.collapsePane(this)},expand:()=>{this.#r(`expanding`),this.group.expandPane(this)},getSize:()=>this.group.getPaneSize(this),isCollapsed:()=>this.group.isPaneCollapsed(this),isExpanded:()=>this.group.isPaneExpanded(this),resize:e=>this.group.resizePane(this,e),getId:()=>this.opts.id.current};constructor(e,t){this.opts=e,this.group=t,this.attachment=t7(this.opts.ref),this.domContext=new e7(this.opts.ref),Oa(()=>this.group.registerPane(this)),Ps(()=>gt(this.constraints),()=>{this.group.panesArrayChanged=!0})}#i=k(()=>this.group.isPaneCollapsed(this));#a=k(()=>I(this.#e)===``?I(this.#i)?`collapsed`:`expanded`:I(this.#e));#o=k(()=>({id:this.opts.id.current,style:this.group.getPaneStyle(this,this.opts.defaultSize.current),"data-pane":``,"data-pane-id":this.opts.id.current,"data-pane-group-id":this.group.opts.id.current,"data-collapsed":I(this.#i)?``:void 0,"data-expanded":I(this.#i)?void 0:``,"data-pane-state":I(this.#a),...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},TIe=new Set([`$$slots`,`$$events`,`$$legacy`,`autoSaveId`,`direction`,`id`,`keyboardResizeBy`,`onLayoutChange`,`storage`,`ref`,`child`,`children`]),EIe=L(`<div><!></div>`);function DIe(e,t){let n=Ti();D(t,!0);let r=q(t,`autoSaveId`,3,null),i=q(t,`id`,3,n),a=q(t,`keyboardResizeBy`,3,null),o=q(t,`onLayoutChange`,3,f7),s=q(t,`storage`,3,A7),c=q(t,`ref`,15,null),l=G(t,TIe),u=xIe.create({id:W5.with(()=>i()??n),ref:W5.with(()=>c(),e=>c(e)),autoSaveId:W5.with(()=>r()),direction:W5.with(()=>t.direction),keyboardResizeBy:W5.with(()=>a()),onLayout:W5.with(()=>o()),storage:W5.with(()=>s())}),d=()=>u.layout,f=u.setLayout,p=()=>u.opts.id.current,m=k(()=>Y5(l,u.props));var h={getLayout:d,setLayout:f,getId:p},g=R(),_=N(g),v=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(m)})),z(e,n)},y=e=>{var n=EIe();_a(n,()=>({...I(m)})),H(M(n),()=>t.children??w),T(n),z(e,n)};return V(_,e=>{t.child?e(v):e(y,-1)}),z(e,g),O(h)}var OIe=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`collapsedSize`,`collapsible`,`defaultSize`,`maxSize`,`minSize`,`onCollapse`,`onExpand`,`onResize`,`order`,`child`,`children`]),kIe=L(`<div><!></div>`);function M7(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,3,n),i=q(t,`ref`,15,null),a=q(t,`onCollapse`,3,f7),o=q(t,`onExpand`,3,f7),s=q(t,`onResize`,3,f7),c=G(t,OIe),l=wIe.create({id:W5.with(()=>r()),ref:W5.with(()=>i(),e=>i(e)),collapsedSize:W5.with(()=>t.collapsedSize),collapsible:W5.with(()=>t.collapsible),defaultSize:W5.with(()=>t.defaultSize),maxSize:W5.with(()=>t.maxSize),minSize:W5.with(()=>t.minSize),onCollapse:W5.with(()=>a()),onExpand:W5.with(()=>o()),onResize:W5.with(()=>s()),order:W5.with(()=>t.order)}),u=l.pane.collapse,d=l.pane.expand,f=l.pane.getSize,p=l.pane.isCollapsed,m=l.pane.isExpanded,h=l.pane.resize,g=l.pane.getId,_=k(()=>Y5(c,l.props));var v={collapse:u,expand:d,getSize:f,isCollapsed:p,isExpanded:m,resize:h,getId:g},y=R(),b=N(y),x=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(_)})),z(e,n)},S=e=>{var n=kIe();_a(n,()=>({...I(_)})),H(M(n),()=>t.children??w),T(n),z(e,n)};return V(b,e=>{t.child?e(x):e(S,-1)}),z(e,y),O(v)}var AIe=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`disabled`,`onDraggingChange`,`tabindex`,`child`,`children`]),jIe=L(`<div><!></div>`);function MIe(e,t){let n=Ti();D(t,!0);let r=q(t,`id`,3,n),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=q(t,`onDraggingChange`,3,f7),s=q(t,`tabindex`,3,0),c=G(t,AIe),l=CIe.create({id:W5.with(()=>r()),ref:W5.with(()=>i(),e=>i(e)),disabled:W5.with(()=>a()),onDraggingChange:W5.with(()=>o()),tabIndex:W5.with(()=>s())}),u=k(()=>Y5(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=jIe();_a(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var NIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`withHandle`]),PIe=L(`<div class="bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"></div>`);function N7(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`withHandle`,3,!1),i=G(t,NIe);var a=R(),o=N(a);{let e=k(()=>ol(`cn-resizable-handle bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:translate-x-0 data-[direction=vertical]:after:-translate-y-1/2 [&[data-direction=vertical]>div]:rotate-90`,t.class));U(o,()=>MIe,(t,a)=>{a(t,K({"data-slot":`resizable-handle`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{var n=R(),i=N(n),a=e=>{z(e,PIe())};V(i,e=>{r()&&e(a)}),z(e,n)},$$slots:{default:!0}}))})}z(e,a),O()}var FIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`this`,`class`]);function IIe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`this`,15),i=G(t,FIe);var a=R(),o=N(a);{let e=k(()=>ol(`cn-resizable-panel-group flex h-full w-full data-[direction=vertical]:flex-col`,t.class));U(o,()=>DIe,(t,a)=>{Ta(a(t,K({"data-slot":`resizable-pane-group`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}})),e=>r(e),()=>r())})}z(e,a),O()}var LIe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function P7(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,LIe);var i=R();U(N(i),()=>Fy,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var RIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function zIe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,RIe);var i=R(),a=N(i);{let e=k(()=>ol(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-sidebar/70 duration-200 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,t.class));U(a,()=>ch,(t,i)=>{i(t,K({"data-slot":`sheet-overlay`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var BIe=new Set([`$$slots`,`$$events`,`$$legacy`]);function VIe(e,t){let n=G(t,BIe);var r=R();U(N(r),()=>qp,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var HIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`side`,`portalProps`,`children`]),UIe=L(`<!> <!>`,1);function F7(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`side`,3,`right`),i=G(t,HIe);VIe(e,K(()=>t.portalProps,{children:(e,a)=>{var o=UIe(),s=N(o);zIe(s,{});var c=P(s,2);{let e=k(()=>ol(`bg-sidebar text-foreground data-open:animate-in data-closed:animate-out fixed z-50 flex flex-col overflow-hidden shadow-lg outline-none duration-200`,r()===`right`&&`data-open:slide-in-from-right data-closed:slide-out-to-right inset-y-0 right-0 h-full w-[min(90vw,24rem)] border-l`,r()===`left`&&`data-open:slide-in-from-left data-closed:slide-out-to-left inset-y-0 left-0 h-full w-[min(85vw,20rem)] border-r`,r()===`top`&&`data-open:slide-in-from-top data-closed:slide-out-to-top inset-x-0 top-0 h-auto max-h-[85vh] border-b`,r()===`bottom`&&`data-open:slide-in-from-bottom data-closed:slide-out-to-bottom inset-x-0 bottom-0 h-auto max-h-[85vh] border-t`,t.class));U(c,()=>Hy,(a,o)=>{o(a,K({"data-slot":`sheet-content`,get"data-side"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}))})}z(e,o)},$$slots:{default:!0}})),O()}var WIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function I7(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,WIe);var i=R(),a=N(i);{let e=k(()=>ol(`text-foreground font-medium`,t.class));U(a,()=>Kp,(t,i)=>{i(t,K({"data-slot":`sheet-title`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var GIe=new Set([`$$slots`,`$$events`,`$$legacy`]);function KIe(e,t){let n=G(t,GIe),r=[[`path`,{d:`M12 7v14`}],[`path`,{d:`M16 12h2`}],[`path`,{d:`M16 8h2`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`}],[`path`,{d:`M6 12h2`}],[`path`,{d:`M6 8h2`}]];ic(e,K({name:`book-open-text`},()=>n,{get iconNode(){return r}}))}var qIe=new Set([`$$slots`,`$$events`,`$$legacy`]);function L7(e,t){let n=G(t,qIe),r=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]];ic(e,K({name:`code-xml`},()=>n,{get iconNode(){return r}}))}var JIe=new Set([`$$slots`,`$$events`,`$$legacy`]);function R7(e,t){let n=G(t,JIe),r=[[`path`,{d:`M3 5h1`}],[`path`,{d:`M3 12h1`}],[`path`,{d:`M3 19h1`}],[`path`,{d:`M8 5h1`}],[`path`,{d:`M8 12h1`}],[`path`,{d:`M8 19h1`}],[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}]];ic(e,K({name:`logs`},()=>n,{get iconNode(){return r}}))}var YIe=new Set([`$$slots`,`$$events`,`$$legacy`]);function z7(e,t){let n=G(t,YIe),r=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];ic(e,K({name:`settings`},()=>n,{get iconNode(){return r}}))}function B7(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`auth`?{kind:`auth`,id:`auth`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:{kind:e.kind,id:e.id}}function V7(e){return e.kind===`task`?e.task?.name??e.task?.command??e.id:e.kind===`file`?e.file?.name??e.relativePath?.split(`/`).pop()??e.path?.split(`/`).pop()??`File`:e.kind===`pr`?`#${e.number}`:e.kind===`settings`?`Settings`:e.kind===`auth`?`Authentication`:e.kind===`logs`?`Nerve Logs`:e.kind===`pending-conversation`?e.title:e.conversation.title}function XIe(e,t){if(e.kind===`task`)return e.task?`${e.task.name??e.task.command} · ${e.task.status} · ${Rd(e.task.cwd,t)} · ${e.task.id}`:`Missing task · ${e.id}`;if(e.kind===`file`)return e.file?.path??e.path??e.id;if(e.kind===`pr`)return e.title?`#${e.number} ${e.title}`:`Pull request #${e.number}`;if(e.kind===`settings`)return`Workbench settings`;if(e.kind===`auth`)return`Providers & authentication`;if(e.kind===`logs`)return`Nerve application logs`;let n=e.project?.dir?pE(e.project.dir,t):e.kind===`pending-conversation`?pE(e.projectDir,t):`Unknown project`;return e.kind===`pending-conversation`?`${e.title} · ${n} · created on first send`:`${e.conversation.title} · ${n} · ${e.conversation.id}`}function H7(e){if(e.error)return e.error;if(e.kind===`conversation`||e.kind===`pending-conversation`)return e.activity.label??(e.hasDraft?`Unsaved draft`:void 0);if(e.sending){if(e.kind===`task`)return`Task active`;if(e.kind===`file`)return`Loading file`}if(e.kind===`task`)return e.task?.status??`missing`;if(e.kind===`file`&&e.file?.truncated)return`Truncated`}function U7(e){return e.kind===`file`?e.displayMode===`rendered`?`Show raw markdown`:`Show rendered markdown`:``}function ZIe(e){return e.kind===`file`?e.wrapLines?`Disable line wrap`:`Wrap long lines`:``}function QIe(e,t){let n=B7(t);return e.findIndex(e=>{let t=B7(e);return t.kind===n.kind&&t.id===n.id})}var $Ie=L(`<span class="tab-status" aria-hidden="true"></span>`),eLe=L(`<button type="button" class="tab-file-toggle"><!></button>`),W7=L(`<span class="tab-kind-icon"><!></span>`),tLe=L(`<span class="draft-dot" title="Draft" aria-label="Draft"></span>`),nLe=L(`<div><div class="tab-leading"><!></div> <button type="button" class="tab-select" role="tab"><!> <span class="tab-title"> </span> <!></button> <button type="button" class="tab-close" title="Close tab"><!></button></div>`);function rLe(e,t){D(t,!0);function n(e){t.tab.kind===`file`&&(e.stopPropagation(),t.onToggleFileDisplayMode?.(t.tab.id))}async function r(e,t){if(e)try{await uE(e),id.success(`Copied ${t}`)}catch{id.error(`Could not copy to clipboard`)}}function i(){let e=B7(t.tab),n=QIe(t.tabs,t.tab),i=n>0,a=n!==-1&&n<t.tabs.length-1,o=[];if(t.tab.kind===`file`){let e=t.tab.file?.path??t.tab.path,n=t.tab.relativePath??t.tab.file?.relativePath;o.push({label:`Copy Path`,icon:G3,disabled:!e,onSelect:()=>void r(e,`path`)},{label:`Copy Relative Path`,icon:G3,disabled:!n,onSelect:()=>void r(n,`relative path`)},{type:`separator`},{label:ZIe(t.tab),icon:L7,disabled:!t.onToggleFileLineWrap,onSelect:()=>t.onToggleFileLineWrap?.(t.tab.id)})}return o.push({label:`Refresh`,icon:O8,shortcut:t.refreshShortcut,disabled:!t.onRefresh,onSelect:()=>t.onRefresh?.(e)}),o.push({type:`separator`},{label:`Close Pane`,icon:KX,shortcut:t.closeShortcut,onSelect:()=>t.onClose?.(e)},{label:`Close Other Panes`,icon:KX,shortcut:t.closeOthersShortcut,disabled:t.tabs.length<=1||!t.onCloseOther,onSelect:()=>t.onCloseOther?.(e)},{label:`Close Panes on Right`,icon:KX,disabled:!a||!t.onCloseRight,onSelect:()=>t.onCloseRight?.(e)},{label:`Close Panes on Left`,icon:KX,disabled:!i||!t.onCloseLeft,onSelect:()=>t.onCloseLeft?.(e)}),o}{let r=k(i),a=k(()=>`center-tab-menu-trigger ${t.tab.kind===`task`||t.tab.kind===`file`?`wide-tab`:``}`);F$(e,{get items(){return I(r)},get triggerClass(){return I(a)},children:(e,r)=>{var i=nLe();let a;var o=M(i),s=M(o),c=e=>{{let n=k(()=>H7(t.tab));$S(e,{class:`tab-agent-status`,get tone(){return t.tab.activity.tone},get pulse(){return t.tab.activity.pulse},get label(){return I(n)}})}},l=e=>{var n=$Ie();F(e=>W(n,`title`,e),[()=>H7(t.tab)]),z(e,n)},u=e=>{var r=R(),i=N(r),a=e=>{var r=eLe(),i=M(r),a=e=>{KIe(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})},o=e=>{L7(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})};V(i,e=>{t.tab.displayMode===`rendered`?e(a):e(o,-1)}),T(r),F((e,n)=>{W(r,`aria-label`,e),W(r,`title`,n),r.disabled=!t.onToggleFileDisplayMode},[()=>U7(t.tab),()=>U7(t.tab)]),_i(`click`,r,n),z(e,r)},o=e=>{var t=W7();h1(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)};V(i,e=>{t.tab.markdown?e(a):e(o,-1)}),z(e,r)},d=e=>{var t=W7();m$(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)},f=e=>{var t=W7();z7(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)},p=e=>{var t=W7();HX(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)},m=e=>{var t=W7();R7(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)};V(s,e=>{t.tab.kind===`conversation`||t.tab.kind===`pending-conversation`?e(c):t.tab.kind===`task`?e(l,1):t.tab.kind===`file`?e(u,2):t.tab.kind===`pr`?e(d,3):t.tab.kind===`settings`?e(f,4):t.tab.kind===`auth`?e(p,5):t.tab.kind===`logs`&&e(m,6)}),T(o);var h=P(o,2),g=M(h),_=e=>{var t=W7();Fd(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)};V(g,e=>{t.tab.kind===`task`&&e(_)});var v=P(g,2),y=M(v,!0);T(v);var b=P(v,2),x=e=>{z(e,tLe())};V(b,e=>{(t.tab.kind===`conversation`||t.tab.kind===`pending-conversation`)&&t.tab.hasDraft&&e(x)}),T(h);var S=P(h,2);KX(M(S),{size:13,strokeWidth:2.2}),T(S),T(i),F((e,n,r,o)=>{a=Qi(i,1,`center-tab`,null,a,e),W(h,`aria-selected`,t.tab.active),W(h,`title`,n),B(y,r),W(S,`aria-label`,o)},[()=>({active:t.tab.active,running:t.tab.sending,errored:!!t.tab.error}),()=>XIe(t.tab,t.homeDir),()=>V7(t.tab),()=>`Close ${V7(t.tab)}`]),_i(`click`,h,()=>t.onSelect?.(B7(t.tab))),_i(`click`,S,()=>t.onClose?.(B7(t.tab))),z(e,i)},$$slots:{default:!0}})}O()}vi([`click`]);function iLe(e,t){{let n=k(()=>t.shortcut?`New chat (${t.shortcut})`:`New chat`);Ol(e,{variant:`ghost`,size:`icon-sm`,ariaLabel:`New chat`,get"aria-keyshortcuts"(){return t.shortcutAria},get title(){return I(n)},get onclick(){return t.onNewConversation},children:(e,t)=>{KZ(e,{size:13,strokeWidth:2.25})},$$slots:{default:!0}})}}var aLe=L(`<nav class="center-tab-strip" aria-label="Open center tabs"><div class="tab-scroller" role="tablist" aria-label="Open center panes"></div> <div class="tab-actions"><!></div></nav>`);function oLe(e,t){D(t,!0);let n=q(t,`tabs`,19,()=>[]),r=b$(`conversation.new`),i=x$(`conversation.new`),a=b$(`pane.refresh`),o=b$(`pane.close`),s=b$(`pane.closeOthers`);var c=aLe(),l=M(c);Ni(l,21,n,e=>`${e.kind}:${e.id}`,(e,r)=>{rLe(e,{get tab(){return I(r)},get tabs(){return n()},get homeDir(){return t.homeDir},get refreshShortcut(){return a},get closeShortcut(){return o},get closeOthersShortcut(){return s},get onSelect(){return t.onSelect},get onClose(){return t.onClose},get onRefresh(){return t.onRefresh},get onCloseOther(){return t.onCloseOther},get onCloseRight(){return t.onCloseRight},get onCloseLeft(){return t.onCloseLeft},get onToggleFileDisplayMode(){return t.onToggleFileDisplayMode},get onToggleFileLineWrap(){return t.onToggleFileLineWrap}})}),T(l);var u=P(l,2);iLe(M(u),{get shortcut(){return r},get shortcutAria(){return i},get onNewConversation(){return t.onNewConversation}}),T(u),T(c),z(e,c),O()}var sLe=L(`<div class="file-empty svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">No file selected</strong> <p class="svelte-lvkzk0">Open a file from a tool result to view it here.</p></div>`),cLe=L(`<div class="file-empty svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">Loading file</strong> <p class="svelte-lvkzk0"> </p></div>`),lLe=L(`<div class="file-empty danger svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">Could not open file</strong> <p class="svelte-lvkzk0"> </p></div>`),uLe=L(`<div class="image-wrap svelte-lvkzk0"><img class="svelte-lvkzk0"/></div>`),dLe=L(`<div class="markdown-view svelte-lvkzk0"><!></div>`),fLe=L(`<div></div>`),pLe=L(`<span> </span>`),mLe=L(`<pre><code class="svelte-lvkzk0"></code></pre>`),hLe=L(`<div class="file-empty svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">Binary preview unavailable</strong> <p class="svelte-lvkzk0">This file can be opened as metadata only for now.</p></div>`),gLe=L(`<section class="file-pane svelte-lvkzk0"><!></section>`);function _Le(e,t){D(t,!0);let n=A(void 0),r=A(void 0),i=A(void 0),a=A(null),o=A(void 0),s=k(()=>t.view?.content),c=k(()=>I(s)?.relativePath??t.view?.path),l=k(()=>N6(I(c))),u=k(()=>I(s)?.lineStart??1),d=k(()=>t.view?.line??I(s)?.targetLine),f=k(()=>t.view?.displayMode??(I(d)?`raw`:P6(I(c)))),p=k(()=>T1(I(c))),m=k(()=>I(s)?.type===`text`&&I(s).text!==void 0&&I(f)===`raw`?`${I(p)??``}\0${I(s).text}`:void 0),h=k(()=>I(m)?`${I(m)}\0${I(u)}\0${I(d)??``}`:void 0),g=k(()=>I(s)?.type===`image`&&I(s).dataBase64&&I(s).mimeType?`data:${I(s).mimeType};base64,${I(s).dataBase64}`:void 0),_=k(()=>I(s)?.type===`text`&&I(s).text!==void 0?I(s).text.split(`
|
|
148
|
-
`):[]),v=k(()=>I(u)+Math.max(0,I(_).length-1)),y=k(()=>`${Math.max(2,String(I(v)).length)}ch`),b=k(()=>`--line-number-width: ${I(y)}; counter-reset: code-line ${I(u)-1};`);function x(e,t,n){let r=0;return e.replaceAll(/<\/span>\r?\n<span class="line">/g,`</span><span class="line">`).replaceAll(/<span class="line"/g,()=>{let e=t+r;return r+=1,`<span class="${e===n?`line file-target-line`:`line`}" data-file-line="${e}"`})}rr(()=>{if(I(s)?.type!==`text`||I(s).text===void 0||!I(m))return;let e=I(h);if(!e||I(r)===e||I(i)===e)return;let t=f1(I(s).text,I(p));if(typeof t==`string`){j(n,x(t,I(u),I(d)),!0),j(r,e,!0),j(i,void 0);return}if(!t){j(i,e,!0);return}let a=!1;return t.then(t=>{a||I(h)!==e||(t?(j(n,x(t,I(u),I(d)),!0),j(r,e,!0),j(i,void 0)):j(i,e,!0))}),()=>{a=!0}}),rr(()=>{if(!I(a)||I(s)?.type!==`text`||!I(d))return;let e=`${I(s).path}:${I(u)}:${I(d)}:${I(f)}:${I(r)??I(m)??I(_).length}`;I(o)!==e&&Jr().then(()=>{let t=I(a)?.querySelector(`[data-file-line="${I(d)}"]`);t&&(t.scrollIntoView({block:`center`,inline:`nearest`}),j(o,e))})});var S=gLe();cZ(M(S),{class:`file-scroll`,viewportClass:`file-viewport`,type:`auto`,orientation:`both`,get viewportRef(){return I(a)},set viewportRef(e){j(a,e,!0)},children:(e,i)=>{var a=R(),o=N(a),c=e=>{var t=sLe();h1(M(t),{size:28,strokeWidth:1.7}),E(4),T(t),z(e,t)},p=e=>{var n=cLe(),r=M(n);O8(r,{class:`spin`,size:28,strokeWidth:1.7});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>B(a,t.view.path)),z(e,n)},m=e=>{var n=lLe(),r=M(n);Ld(r,{size:28,strokeWidth:1.7});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>B(a,t.view.error)),z(e,n)},v=e=>{var t=uLe(),n=M(t);T(t),F(()=>{W(n,`src`,I(g)),W(n,`alt`,I(s)?.relativePath??`File preview`)}),z(e,t)},y=e=>{var i=R(),a=N(i),o=e=>{var t=dLe(),n=M(t);{let e=k(()=>I(s).text??``);U3(n,{get text(){return I(e)},trimCodeBlocks:!1,get onCopy(){return ad}})}T(t),z(e,t)},c=e=>{var r=fLe();let i;zi(r,()=>I(n),!0),T(r),F(()=>{i=Qi(r,1,`code-view svelte-lvkzk0`,null,i,{"wrap-lines":t.view?.wrapLines}),ea(r,I(b))}),z(e,r)},p=e=>{var n=mLe();let r;var i=M(n);Ni(i,21,()=>I(_),Ai,(e,t,n)=>{let r=k(()=>I(u)+n);var i=pLe(),a=M(i,!0);T(i),F(()=>{Qi(i,1,Ki(I(r)===I(d)?`code-line file-target-line`:`code-line`),`svelte-lvkzk0`),W(i,`data-file-line`,I(r)),B(a,I(t))}),z(e,i)}),T(i),T(n),F(()=>{r=Qi(n,1,`code-view plain svelte-lvkzk0`,null,r,{"wrap-lines":t.view?.wrapLines}),ea(n,I(b))}),z(e,n)};V(a,e=>{I(l)&&I(f)===`rendered`?e(o):I(n)&&I(r)===I(h)?e(c,1):e(p,-1)}),z(e,i)},x=e=>{var t=hLe();h1(M(t),{size:28,strokeWidth:1.7}),E(4),T(t),z(e,t)};V(o,e=>{t.view?t.view.loading&&!I(s)?e(p,1):t.view.error?e(m,2):I(g)?e(v,3):I(s)?.type===`text`?e(y,4):e(x,-1):e(c)}),z(e,a)},$$slots:{default:!0}}),T(S),z(e,S),O()}var vLe={get activeCenterFileView(){let e=Y.activeCenterTab;if(e?.kind===`file`)return bT.fileViews[GT(e.id)]},get openFileTabs(){return bT.openFileTabIds}};function yLe(e,t){D(t,!0);let n=k(()=>vLe.activeCenterFileView);_Le(e,{get view(){return I(n)}}),O()}var bLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function xLe(e,t){let n=G(t,bLe),r=[[`path`,{d:`M12.531 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l.427-.473`}],[`path`,{d:`m16.5 3.5 5 5`}],[`path`,{d:`m21.5 3.5-5 5`}]];ic(e,K({name:`funnel-x`},()=>n,{get iconNode(){return r}}))}var SLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function CLe(e,t){let n=G(t,SLe),r=[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];ic(e,K({name:`tag`},()=>n,{get iconNode(){return r}}))}var wLe=L(`<button type="button"><!> </button>`),TLe=L(`<button type="button"> </button>`),ELe=L(`<!>Clear`,1),G7=L(`<!> `,1),DLe=L(`<!>Copy`,1),OLe=L(`<button type="button" class="field-clear svelte-11qnnwt" aria-label="Clear search"><!></button>`),kLe=L(`<button type="button" class="field-clear svelte-11qnnwt" aria-label="Clear component filter"><!></button>`),ALe=L(`<div class="logs-error svelte-11qnnwt"> </div>`),jLe=L(`<div class="logs-notice svelte-11qnnwt"> </div>`),MLe=L(`<div class="empty svelte-11qnnwt">No application logs match these filters.</div>`),NLe=L(`<button type="button" class="caret svelte-11qnnwt"><!></button>`),PLe=L(`<span class="caret svelte-11qnnwt" aria-hidden="true"></span>`),FLe=L(`<span class="duration svelte-11qnnwt"> </span>`),ILe=L(`<code class="svelte-11qnnwt"> </code>`),LLe=L(`<div class="refs svelte-11qnnwt"></div>`),RLe=L(`<dt class="svelte-11qnnwt"> </dt> <dd class="svelte-11qnnwt"> </dd>`,1),zLe=L(`<dl class="context svelte-11qnnwt"></dl>`),BLe=L(`<pre class="error-block svelte-11qnnwt"> </pre>`),VLe=L(`<div class="log-detail svelte-11qnnwt"><!> <!> <!></div>`),HLe=L(`<article><div class="log-line svelte-11qnnwt"><!> <span class="time svelte-11qnnwt"> </span> <span> </span> <span class="source svelte-11qnnwt"> </span> <span class="message svelte-11qnnwt"> </span> <!></div> <!></article>`),ULe=L(`<div class="logs-list svelte-11qnnwt" role="log" aria-label="Application logs"><!> <!></div>`),WLe=L(`<section class="logs-pane svelte-11qnnwt"><header class="logs-toolbar svelte-11qnnwt"><div class="toolbar-line svelte-11qnnwt"><div class="segmented svelte-11qnnwt" role="group" aria-label="Log level filter"></div> <span class="toolbar-divider svelte-11qnnwt" aria-hidden="true"></span> <div class="segmented svelte-11qnnwt" role="group" aria-label="Log source filter"></div> <div class="toolbar-actions svelte-11qnnwt"><span class="result-count svelte-11qnnwt"> </span> <!> <!> <!> <!></div></div> <div class="toolbar-line search-line svelte-11qnnwt"><label class="field search-field svelte-11qnnwt"><!> <!> <!></label> <label class="field component-field svelte-11qnnwt"><!> <!> <!></label></div></header> <!> <!> <!></section> <!>`,1);function GLe(e,t){D(t,!0);let n=[`all`,`debug`,`info`,`warn`,`error`],r=[`all`,`orchestrator`,`desktop`,`web`,`cli`],i=A(void 0),a=A(`all`),o=A(`all`),s=A(``),c=A(``),l=A(!1),u=A(!1),d=A(!1),f=A(void 0),p=A(void 0),m=new To,h=k(()=>[...I(i)?.logs??[]].reverse()),g=k(()=>I(a)!==`all`||I(o)!==`all`||I(s).trim()!==``||I(c).trim()!==``),_=k(()=>I(g)?`This removes stored Nerve application logs matching the current filters. New request logs may appear immediately after pruning.`:`This removes stored Nerve application logs. New request logs may appear immediately after pruning.`);function v(e){return[e.requestId,e.projectId,e.conversationId,e.agentId,e.runId,e.toolCallId,e.taskId].filter(e=>!!e)}function y(e){return e.context?Object.entries(e.context).map(([e,t])=>[e,typeof t==`string`?t:JSON.stringify(t)]):[]}function b(e){return!!e.error||y(e).length>0||v(e).length>0}function x(e){m.has(e)?m.delete(e):m.add(e)}async function S(){j(l,!0),j(f,void 0);try{j(i,await rie({level:I(a)===`all`?void 0:I(a),source:I(o)===`all`?void 0:I(o),component:I(s).trim()||void 0,contains:I(c).trim()||void 0,limit:160}),!0)}catch(e){j(f,e instanceof Error?e.message:String(e),!0)}finally{j(l,!1)}}function ee(){j(a,`all`),j(o,`all`),j(s,``),j(c,``)}function C(){return{level:I(a)===`all`?void 0:I(a),source:I(o)===`all`?void 0:I(o),component:I(s).trim()||void 0,contains:I(c).trim()||void 0}}async function te(){j(u,!0),j(f,void 0),j(p,void 0);try{let e=await iie(C());m.clear(),j(p,`Pruned ${e.pruned} ${e.pruned===1?`log entry`:`log entries`}.`),await S()}catch(e){j(f,e instanceof Error?e.message:String(e),!0)}finally{j(u,!1)}}function ne(){uE(I(h).map(e=>`${e.ts} ${e.level.toUpperCase()} ${e.source}/${e.component} ${e.message}`).join(`
|
|
149
|
-
`)).catch(()=>void 0)}rr(()=>{S()});var re=WLe(),ie=N(re),ae=M(ie),oe=M(ae),w=M(oe);Ni(w,20,()=>n,e=>e,(e,t)=>{var n=wLe();let r;var i=M(n),o=e=>{{let n=k(()=>Xw(t));$S(e,{size:`xs`,get tone(){return I(n)}})}};V(i,e=>{t!==`all`&&e(o)});var s=P(i);T(n),F(()=>{r=Qi(n,1,`svelte-11qnnwt`,null,r,{active:I(a)===t}),B(s,` ${t??``}`)}),_i(`click`,n,()=>j(a,t,!0)),z(e,n)}),T(w);var se=P(w,4);Ni(se,20,()=>r,e=>e,(e,t)=>{var n=TLe();let r;var i=M(n,!0);T(n),F(()=>{r=Qi(n,1,`svelte-11qnnwt`,null,r,{active:I(o)===t}),B(i,t)}),_i(`click`,n,()=>j(o,t,!0)),z(e,n)}),T(se);var ce=P(se,2),le=M(ce),de=M(le);T(le);var fe=P(le,2),pe=e=>{Ol(e,{size:`sm`,variant:`ghost`,onclick:ee,children:(e,t)=>{var n=ELe();xLe(N(n),{size:13}),E(),z(e,n)},$$slots:{default:!0}})};V(fe,e=>{I(g)&&e(pe)});var me=P(fe,2);{let e=k(()=>I(l)||I(u));Ol(me,{size:`sm`,variant:`secondary`,onclick:S,get disabled(){return I(e)},children:(e,t)=>{var n=G7(),r=N(n);{let e=k(()=>I(l)?`animate-spin`:``);O8(r,{size:13,get class(){return I(e)}})}var i=P(r,1,!0);F(()=>B(i,I(l)?`Loading`:`Refresh`)),z(e,n)},$$slots:{default:!0}})}var he=P(me,2);{let e=k(()=>I(h).length===0||I(u));Ol(he,{size:`sm`,variant:`ghost`,onclick:ne,get disabled(){return I(e)},children:(e,t)=>{var n=DLe();G3(N(n),{size:13}),E(),z(e,n)},$$slots:{default:!0}})}var ge=P(he,2);{let e=k(()=>I(l)||I(u));Ol(ge,{size:`sm`,variant:`destructive`,onclick:()=>j(d,!0),get disabled(){return I(e)},children:(e,t)=>{var n=G7(),r=N(n);YQ(r,{size:13});var i=P(r,1,!0);F(()=>B(i,I(u)?`Pruning`:`Prune`)),z(e,n)},$$slots:{default:!0}})}T(ce),T(oe);var _e=P(oe,2),ve=M(_e),ye=M(ve);rZ(ye,{size:13,"aria-hidden":`true`});var be=P(ye,2);SQ(be,{placeholder:`Search messages`,get value(){return I(c)},set value(e){j(c,e,!0)}});var xe=P(be,2),Se=e=>{var t=OLe();KX(M(t),{size:12}),T(t),_i(`click`,t,()=>j(c,``)),z(e,t)};V(xe,e=>{I(c)&&e(Se)}),T(ve);var Ce=P(ve,2),we=M(Ce);CLe(we,{size:13,"aria-hidden":`true`});var Te=P(we,2);SQ(Te,{placeholder:`Component filter`,get value(){return I(s)},set value(e){j(s,e,!0)}});var Ee=P(Te,2),De=e=>{var t=kLe();KX(M(t),{size:12}),T(t),_i(`click`,t,()=>j(s,``)),z(e,t)};V(Ee,e=>{I(s)&&e(De)}),T(Ce),T(_e),T(ae);var Oe=P(ae,2),ke=e=>{var t=ALe(),n=M(t,!0);T(t),F(()=>B(n,I(f))),z(e,t)};V(Oe,e=>{I(f)&&e(ke)});var Ae=P(Oe,2),je=e=>{var t=jLe(),n=M(t,!0);T(t),F(()=>B(n,I(p))),z(e,t)};V(Ae,e=>{I(p)&&e(je)}),cZ(P(Ae,2),{class:`logs-scroll`,type:`auto`,children:(e,t)=>{var n=ULe(),r=M(n),i=e=>{z(e,MLe())};V(r,e=>{I(h).length===0&&!I(l)&&e(i)}),Ni(P(r,2),17,()=>I(h),e=>e.id,(e,t)=>{let n=k(()=>b(I(t))),r=k(()=>m.has(I(t).id));var i=HLe();let a;var o=M(i),s=M(o),c=e=>{var n=NLe();Rw(M(n),{size:13}),T(n),F(()=>{W(n,`aria-expanded`,I(r)),W(n,`aria-label`,I(r)?`Collapse details`:`Expand details`)}),_i(`click`,n,()=>x(I(t).id)),z(e,n)},l=e=>{z(e,PLe())};V(s,e=>{I(n)?e(c):e(l,-1)});var u=P(s,2),d=M(u,!0);T(u);var f=P(u,2),p=M(f,!0);T(f);var h=P(f,2),g=M(h);T(h);var _=P(h,2),S=M(_,!0);T(_);var ee=P(_,2),C=e=>{var n=FLe(),r=M(n);T(n),F(()=>B(r,`${I(t).durationMs??``}ms`)),z(e,n)};V(ee,e=>{I(t).durationMs!==void 0&&e(C)}),T(o);var te=P(o,2),ne=e=>{var n=VLe(),r=M(n),i=e=>{var n=LLe();Ni(n,20,()=>v(I(t)),e=>e,(e,t)=>{var n=ILe(),r=M(n,!0);T(n),F(()=>B(r,t)),z(e,n)}),T(n),z(e,n)},a=k(()=>v(I(t)).length>0);V(r,e=>{I(a)&&e(i)});var o=P(r,2),s=e=>{var n=zLe();Ni(n,21,()=>y(I(t)),([e,t])=>e,(e,t)=>{var n=k(()=>ue(I(t),2));let r=()=>I(n)[0],i=()=>I(n)[1];var a=RLe(),o=N(a),s=M(o,!0);T(o);var c=P(o,2),l=M(c,!0);T(c),F(()=>{B(s,r()),B(l,i())}),z(e,a)}),T(n),z(e,n)},c=k(()=>y(I(t)).length>0);V(o,e=>{I(c)&&e(s)});var l=P(o,2),u=e=>{var n=BLe(),r=M(n,!0);T(n),F(()=>B(r,I(t).error.stack??I(t).error.message)),z(e,n)};V(l,e=>{I(t).error&&e(u)}),T(n),z(e,n)};V(te,e=>{I(n)&&I(r)&&e(ne)}),T(i),F(e=>{a=Qi(i,1,`log-row ${I(t).level}`,`svelte-11qnnwt`,a,{open:I(r)}),W(o,`data-detail`,I(n)?``:void 0),B(d,e),Qi(f,1,`level ${I(t).level}`,`svelte-11qnnwt`),B(p,I(t).level),W(h,`title`,`${I(t).source}/${I(t).component}`),B(g,`${I(t).source??``}/${I(t).component??``}`),W(_,`title`,I(t).message),B(S,I(t).message)},[()=>A1(I(t).ts)]),z(e,i)}),T(n),z(e,n)},$$slots:{default:!0}}),T(ie);var Me=P(ie,2);{let e=k(()=>I(g)?`Prune filtered logs?`:`Prune all logs?`),t=k(()=>I(g)?`Prune filtered logs`:`Prune all logs`);_Q(Me,{get title(){return I(e)},get description(){return I(_)},get confirmLabel(){return I(t)},destructive:!0,onConfirm:()=>void te(),get open(){return I(d)},set open(e){j(d,e,!0)}})}F(()=>B(de,`${I(h).length??``} ${I(h).length===1?`entry`:`entries`}`)),z(e,re),O()}vi([`click`]);function KLe(e){GLe(e,{})}function K7(e){return e?.kind===`conversation`||e?.kind===`pending-conversation`}function q7(e){return`${e.kind}:${e.id}`}function J7(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function qLe(e,t){return e.length===t.length&&e.every((e,n)=>J7(e,t[n]))}function JLe(e,t,n,r=4){let i=new Set(n.filter(K7).map(q7)),a=e.filter(e=>i.has(q7(e)));if(!K7(t))return a.slice(0,r);let o=q7(t);return i.has(o)?[t,...a.filter(e=>q7(e)!==o)].slice(0,r):a.slice(0,r)}function YLe(e,t,n=4){if(!K7(t))return e.slice(0,n);let r=q7(t);return e.some(e=>q7(e)===r)?e.slice(0,n):[t,...e].slice(0,n)}var XLe=L(`<div class="conversation-pane-layer svelte-1iptmh4"><!></div>`),ZLe=L(`<!> <div class="center-workspace-content svelte-1iptmh4"><!> <!></div>`,1);function Y7(e,t){D(t,!0);let n=k(()=>H6.status),r=k(()=>H6.centerTabs),i=k(()=>H6.activeCenterTab),a=k(()=>Y.openCenterTabs),o=k(()=>K7(I(i))?I(i):void 0),s=A(Mn([])),c=k(()=>YLe(I(s),I(o)));rr(()=>{let e=JLe(I(s),I(i),I(a));qLe(I(s),e)||j(s,e,!0)});function l(e){e.kind===`conversation`?l6(e.id):e.kind===`pending-conversation`||e.kind===`task`?BT(e):e.kind===`file`?L6(e.id):e.kind===`pr`?S8(e.id):e.kind===`auth`?UZ():OZ()}function u(e){g5(h5(e),e)}function d(e){g5(lNe(e),e)}function f(e){g5(cNe(e),e)}var p=ZLe(),m=N(p);{let e=k(()=>I(n)?.storage.home);oLe(m,{get tabs(){return I(r)},get homeDir(){return I(e)},onSelect:e=>void BT(e),onClose:e=>void VT(e),onRefresh:l,onCloseOther:u,onCloseRight:d,onCloseLeft:f,get onToggleFileDisplayMode(){return IDe},get onToggleFileLineWrap(){return LDe},get onNewConversation(){return D6}})}var h=P(m,2),g=M(h),_=e=>{UAe(e,{})},v=e=>{yLe(e,{})},y=e=>{TAe(e,{})},b=e=>{ZMe(e,{})},x=e=>{zfe(e,{})},S=e=>{KLe(e,{})};V(g,e=>{I(i)?.kind===`task`?e(_):I(i)?.kind===`file`?e(v,1):I(i)?.kind===`pr`?e(y,2):I(i)?.kind===`settings`?e(b,3):I(i)?.kind===`auth`?e(x,4):I(i)?.kind===`logs`&&e(S,5)});var ee=P(g,2),C=e=>{var t=R();Ni(N(t),17,()=>I(c),e=>q7(e),(e,t)=>{let n=k(()=>J7(I(o),I(t)));var r=XLe();m8(M(r),{get tab(){return I(t)},get active(){return I(n)}}),T(r),F(()=>W(r,`hidden`,!I(n))),z(e,r)}),z(e,t)},te=e=>{m8(e,{active:!0})};V(ee,e=>{I(c).length>0?e(C):I(i)||e(te,1)}),T(h),z(e,p),O()}var QLe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`]);function $Le(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15,``),i=G(t,QLe);var a=R(),o=N(a);{let e=k(()=>ol(`gap-2 group/tabs flex data-[orientation=horizontal]:flex-col`,t.class));U(o,()=>rS,(t,a)=>{a(t,K({"data-slot":`tabs`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},get value(){return r()},set value(e){r(e)}}))})}z(e,a),O()}var eRe=Cl({base:`rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,variants:{variant:{default:`cn-tabs-list-variant-default bg-muted`,line:`cn-tabs-list-variant-line gap-1 bg-transparent`}},defaultVariants:{variant:`default`}}),tRe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`variant`,`class`]);function nRe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=G(t,tRe);var a=R(),o=N(a);{let e=k(()=>ol(eRe({variant:r()}),t.class));U(o,()=>oS,(t,a)=>{a(t,K({"data-slot":`tabs-list`,get"data-variant"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var rRe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function iRe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,rRe);var i=R(),a=N(i);{let e=k(()=>ol(`gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground`,`after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,t.class));U(a,()=>lS,(t,i)=>{i(t,K({"data-slot":`tabs-trigger`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var aRe=L(`<!> <span class="sr-only"> </span>`,1),X7=L(`<span> </span>`),oRe=L(`<!> <!>`,1);function sRe(e,t){D(t,!0);let n=q(t,`tabs`,19,()=>[]),r=q(t,`value`,15,``);function i(e){let t=e.ariaLabel??e.label;return e.count?`${t} (${e.count})`:t}var a=R(),o=N(a);{let e=k(()=>ol(`tabs-bar-root min-w-0`,t.class));U(o,()=>$Le,(a,o)=>{o(a,{get class(){return I(e)},get onValueChange(){return t.onValueChange},get value(){return r()},set value(e){r(e)},children:(e,r)=>{var a=R();U(N(a),()=>nRe,(e,r)=>{r(e,{variant:`line`,get"aria-label"(){return t.ariaLabel},class:`tabs-bar-list w-full justify-start overflow-x-auto overflow-y-hidden`,children:(e,t)=>{var r=R();Ni(N(r),17,n,e=>e.value,(e,t)=>{var n=R(),r=N(n);{let e=k(()=>i(I(t))),n=k(()=>I(t).title??i(I(t))),a=k(()=>ol(`tabs-bar-trigger`,I(t).icon&&`tabs-bar-icon-trigger`));U(r,()=>iRe,(r,i)=>{i(r,{get value(){return I(t).value},get disabled(){return I(t).disabled},get"aria-label"(){return I(e)},get title(){return I(n)},get class(){return I(a)},children:(e,n)=>{var r=oRe(),i=N(r),a=e=>{let n=k(()=>I(t).icon);var r=aRe(),i=N(r);U(i,()=>I(n),(e,t)=>{t(e,{size:14,strokeWidth:2.2,"aria-hidden":`true`})});var a=P(i,2),o=M(a,!0);T(a),F(()=>B(o,I(t).label)),z(e,r)},o=e=>{var n=X7(),r=M(n,!0);T(n),F(()=>B(r,I(t).label)),z(e,n)};V(i,e=>{I(t).icon?e(a):e(o,-1)});var s=P(i,2),c=e=>{var n=X7(),r=M(n,!0);T(n),F(e=>{Qi(n,1,e),B(r,I(t).count)},[()=>Ki(ol(`tabs-bar-count`,I(t).icon&&`tabs-bar-icon-count`))]),z(e,n)};V(s,e=>{I(t).count&&e(c)}),z(e,r)},$$slots:{default:!0}})})}z(e,n)}),z(e,r)},$$slots:{default:!0}})}),z(e,a)},$$slots:{default:!0}})})}z(e,a),O()}var cRe=L(`<aside class="utility-panel"><div class="utility-tabs"><!></div> <!></aside>`);function lRe(e,t){D(t,!0);let n=q(t,`activeTab`,15,`git`),r=q(t,`conversationAgents`,19,()=>[]),i=q(t,`tasks`,19,()=>[]),a=new Set([`starting`,`running`,`ready`,`stopping`]),o=k(()=>i().filter(e=>a.has(e.status)).length),s=k(()=>[{value:`git`,label:`Git`,icon:Td},{value:`tasks`,label:`Tasks`,icon:Fd,count:I(o)},{value:`info`,label:`Context`,icon:O5}]);function c(e){n(e),t.onTabChange?.(n())}var l=cRe(),u=M(l);sRe(M(u),{get tabs(){return I(s)},ariaLabel:`Utility panel tabs`,onValueChange:c,get value(){return n()},set value(e){n(e)}}),T(u),cZ(P(u,2),{class:`utility-scroll`,viewportClass:`utility-content`,type:`auto`,children:(e,a)=>{var o=R(),s=N(o),c=e=>{mT(e,{get status(){return t.status},get activeProject(){return t.activeProject},get activeConversation(){return t.activeConversation},get activeAgent(){return t.activeAgent},get conversationAgents(){return r()},get exportUrl(){return t.exportUrl},get systemPromptUrl(){return t.systemPromptUrl},get onSelectAgent(){return t.onSelectAgent}})},l=e=>{Gke(e,{get activeProject(){return t.activeProject},get activeAgent(){return t.activeAgent}})},u=e=>{Sje(e,{get activeProject(){return t.activeProject},get tasks(){return i()},get selectedTask(){return t.selectedTask},get homeDir(){return t.homeDir},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},get onPruneTasks(){return t.onPruneTasks},get onRunCommand(){return t.onRunCommand}})};V(s,e=>{n()===`info`?e(c):n()===`git`?e(l,1):n()===`tasks`&&e(u,2)}),z(e,o)},$$slots:{default:!0}}),T(l),z(e,l),O()}function Z7(e,t){D(t,!0);let n=k(()=>H6.status),r=k(()=>H6.activeProject),i=k(()=>_8.activeConversation),a=k(()=>_8.activeAgent),o=k(()=>_8.conversationAgents),s=k(()=>q8.scopedTasks),c=k(()=>q8.selectedTask);function l(e){hT.agentId=e.id,hT.projectId=e.projectId,hT.conversationId=e.conversationId,bC.utilityTab=`info`}{let t=k(()=>I(n)?.storage.home);lRe(e,{get activeTab(){return bC.utilityTab},get status(){return I(n)},get activeProject(){return I(r)},get activeConversation(){return I(i)},get activeAgent(){return I(a)},get conversationAgents(){return I(o)},get tasks(){return I(s)},get selectedTask(){return I(c)},get homeDir(){return I(t)},get exportUrl(){return wDe},get systemPromptUrl(){return TDe},onTabChange:e=>bC.utilityTab=e,onSelectAgent:l,onOpenTaskOutput:e=>{bC.utilityTab=`tasks`,a5(e)},onCancelTask:e=>void J8(e),onRestartTask:e=>void Y8(e),onRemoveTask:e=>void zAe(e),onPruneTasks:()=>void BAe(),onRunCommand:e=>{bC.utilityTab=`tasks`,(async()=>{await a5((await VAe(e)).id)})()}})}O()}var uRe=L(`<button><!> <span class="conversation-label svelte-prx1kd"> </span></button>`),dRe=L(`<span class="tt-title"> </span> <span class="tt-row"><span class="tt-key">status</span> </span> <span class="tt-row"><span class="tt-key">mode</span> </span> <span class="tt-row"><span class="tt-key">model</span> </span> <span class="tt-row"><span class="tt-key">updated</span> </span> <span class="tt-id"> </span>`,1),fRe=L(`<!> <!>`,1);function Q7(e,t){D(t,!0);let n=q(t,`isOpen`,3,!1),r=q(t,`isActive`,3,!1),i=k(()=>t.row.agent?.status??`idle`),a=k(()=>t.activity??z6({conversationId:t.row.conversation.id,agent:t.row.agent,mode:t.row.agent?.mode??t.row.conversation.mode})),o=k(()=>t.row.agent?.mode??t.row.conversation.mode),s=k(()=>t.row.agent?.permissionLevel??t.row.conversation.permissionLevel);F$(e,{get items(){return t.menuItems},triggerClass:`conversation-context-trigger`,children:(e,c)=>{var l=R();U(N(l),()=>E1,(e,c)=>{c(e,{children:(e,c)=>{var l=fRe(),u=N(l);{let e=(e,i)=>{let o=()=>i?.().props;var s=uRe(),c=()=>t.onOpenConversation?.(t.row.conversation.id);_a(s,()=>({...o(),type:`button`,class:`conversation-row`,"data-active":r(),title:t.row.conversation.title,onclick:c}),void 0,void 0,void 0,`svelte-prx1kd`);var l=M(s);{let e=k(()=>n()?`solid`:`outline`);$S(l,{class:`conversation-status`,get tone(){return I(a).tone},get pulse(){return I(a).pulse},get label(){return I(a).label},get variant(){return I(e)},size:`sm`})}var u=P(l,2),d=M(u,!0);T(u),T(s),F(()=>B(d,t.row.conversation.title)),z(e,s)};U(u,()=>k1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(u,2),()=>D1,(e,n)=>{n(e,{side:`right`,sideOffset:6,class:`nav-tooltip conversation-tooltip`,children:(e,n)=>{var r=dRe(),a=N(r),c=M(a,!0);T(a);var l=P(a,2),u=P(M(l),1,!0);T(l);var d=P(l,2),f=P(M(d));T(d);var p=P(d,2),m=P(M(p),1,!0);T(p);var h=P(p,2),g=P(M(h),1,!0);T(h);var _=P(h,2),v=M(_,!0);T(_),F((e,n)=>{B(c,t.row.conversation.title),B(u,I(i)),B(f,`${I(o)??``} · ${I(s)??``}`),B(m,e),B(g,n),B(v,t.row.conversation.id)},[()=>mE(t.row.agent),()=>M1(t.row.conversation.updatedAt)]),z(e,r)},$$slots:{default:!0}})}),z(e,l)},$$slots:{default:!0}})}),z(e,l)},$$slots:{default:!0}}),O()}var pRe=L(`<p class="empty svelte-1m5r4e2">No conversations match.</p>`),mRe=L(`<div class="conversations-modal svelte-1m5r4e2"><div class="search-box svelte-1m5r4e2"><!> <!></div> <div class="list-region svelte-1m5r4e2"><!></div></div>`);function hRe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`projectLabel`,3,``),i=q(t,`projectIds`,19,()=>[]),a=q(t,`conversations`,19,()=>[]),o=q(t,`agents`,19,()=>[]),s=q(t,`conversationActivityById`,19,()=>({})),c=A(``),l=A(null),u=k(()=>_E({conversations:a(),agents:o(),projectIds:i(),filter:I(c)}));rr(()=>{n()&&(j(c,``),queueMicrotask(()=>I(l)?.focus()))});function d(e){n(e),t.onOpenChange?.(e)}function f(e){t.onOpenConversation?.(e),d(!1)}{let i=k(()=>`${I(u).length} in ${r()}`);ZX(e,{title:`Conversations`,get description(){return I(i)},class:`project-conversations-dialog`,onOpenChange:d,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var r=R();U(N(r),()=>O1,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=mRe(),i=M(r),a=M(i);rZ(a,{size:13,strokeWidth:2.25,"aria-hidden":`true`}),SQ(P(a,2),{size:`sm`,placeholder:`Filter conversations`,ariaLabel:`Filter conversations`,get ref(){return I(l)},set ref(e){j(l,e,!0)},get value(){return I(c)},set value(e){j(c,e,!0)}}),T(i);var o=P(i,2),d=M(o),p=e=>{z(e,pRe())},m=e=>{M$(e,{get items(){return I(u)},getKey:e=>e.conversation.id,estimateSize:()=>32,viewportClass:`conversations-virtual-list`,row:(e,n)=>{let r=()=>n?.().item;{let n=k(()=>t.openConversationTabIds?.has(r().conversation.id)??!1),i=k(()=>r().conversation.id===t.selectedConversationId),a=k(()=>t.buildMenu?.(r().conversation)??[]);Q7(e,{get row(){return r()},get isOpen(){return I(n)},get isActive(){return I(i)},get activity(){return s()[r().conversation.id]},get menuItems(){return I(a)},onOpenConversation:f})}},$$slots:{row:!0}})};V(d,e=>{I(u).length===0?e(p):e(m,-1)}),T(o),T(r),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}O()}var gRe=L(`<!> <!>`,1),_Re=L(`<div class="prune-body svelte-1bkj6xz"><!> <div class="prune-control svelte-1bkj6xz"><!></div> <p class="prune-summary svelte-1bkj6xz">Removes up to <strong class="svelte-1bkj6xz"> </strong> </p></div>`);function vRe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`projectLabel`,3,``),i=q(t,`totalCount`,3,0),a=q(t,`ageEligible`,3,()=>0),o=q(t,`keepEligible`,3,()=>0),s=[{value:`olderThanDays`,label:`By age`,detail:`Remove conversations not updated within the selected window.`},{value:`keepLatest`,label:`By count`,detail:`Keep the most recent conversations and remove the rest.`}],c=[{value:`1`,label:`Older than 1 day`},{value:`2`,label:`Older than 2 days`},{value:`3`,label:`Older than 3 days`},{value:`7`,label:`Older than 7 days`},{value:`14`,label:`Older than 14 days`},{value:`30`,label:`Older than 30 days`},{value:`90`,label:`Older than 90 days`}],l=[{value:`5`,label:`Keep the latest 5`},{value:`10`,label:`Keep the latest 10`},{value:`20`,label:`Keep the latest 20`},{value:`50`,label:`Keep the latest 50`},{value:`100`,label:`Keep the latest 100`}],u=A(`olderThanDays`),d=A(`7`),f=A(`20`),p=k(()=>I(u)===`olderThanDays`?a()(Number(I(d))):o()(Number(I(f))));function m(){return I(u)===`olderThanDays`?{strategy:`olderThanDays`,olderThanDays:Number(I(d))}:{strategy:`keepLatest`,keepLatest:Number(I(f))}}function h(){t.onConfirm?.(m()),n(!1),t.onOpenChange?.(!1)}function g(e){n(e),t.onOpenChange?.(e)}{let t=e=>{var t=gRe(),n=N(t);Ol(n,{variant:`ghost`,onclick:()=>g(!1),children:(e,t)=>{E(),z(e,wi(`Cancel`))},$$slots:{default:!0}});var r=P(n,2);{let e=k(()=>I(p)===0);Ol(r,{variant:`destructive`,onclick:h,get disabled(){return I(e)},children:(e,t)=>{E(),z(e,wi(`Clean up`))},$$slots:{default:!0}})}z(e,t)},a=k(()=>r()?`Choose how to clean up conversations in “${r()}”.`:`Choose how to clean up conversations.`);ZX(e,{title:`Clean up conversations`,get description(){return I(a)},class:`prune-dialog`,onOpenChange:g,get open(){return n()},set open(e){n(e)},footer:t,children:(e,t)=>{var n=_Re(),r=M(n);l5(r,{get items(){return s},ariaLabel:`Cleanup strategy`,get value(){return I(u)},set value(e){j(u,e,!0)}});var a=P(r,2),o=M(a),m=e=>{QQ(e,{get items(){return c},ariaLabel:`Age window`,get value(){return I(d)},set value(e){j(d,e,!0)}})},h=e=>{QQ(e,{get items(){return l},ariaLabel:`Conversations to keep`,get value(){return I(f)},set value(e){j(f,e,!0)}})};V(o,e=>{I(u)===`olderThanDays`?e(m):e(h,-1)}),T(a);var g=P(a,2),_=P(M(g)),v=M(_,!0);T(_);var y=P(_);T(g),T(n),F(()=>{B(v,I(p)),B(y,` of ${i()??``} conversation${i()===1?``:`s`}. Active conversations and tasks are skipped.`)}),z(e,n)},$$slots:{footer:!0,default:!0}})}O()}var yRe=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
150
|
-
<path d="M0.228341 8.36915C0.228341 8.36915 -0.356212 7.94324 0.345251 7.37453L1.97956 5.89736C1.97956 5.89736 2.44721 5.40004 2.94164 5.83334L18.0231 17.375V22.9094C18.0231 22.9094 18.0158 23.7785 16.9124 23.6825L0.228341 8.36915Z" fill="currentColor" />
|
|
151
|
-
<path d="M4.11555 11.9367L0.228273 15.5089C0.228273 15.5089 -0.171172 15.8093 0.228273 16.346L2.03308 18.0053C2.03308 18.0053 2.46175 18.4706 3.09502 17.9413L7.21611 14.7827L4.11555 11.9367Z" fill="currentColor" />
|
|
152
|
-
<path d="M10.94 11.9661L18.0691 6.46362L18.0228 0.95865C18.0228 0.95865 17.7183 -0.242793 16.7027 0.382548L7.21589 9.11025L10.94 11.9661Z" fill="currentColor" />
|
|
153
|
-
<path d="M16.9121 23.69C17.3261 24.1183 17.8279 23.978 17.8279 23.978L23.3838 21.2108C24.0951 20.7208 23.9952 20.1127 23.9952 20.1127V3.58803C23.9952 2.86175 23.2596 2.61063 23.2596 2.61063L18.4441 0.264377C17.3919 -0.392968 16.7027 0.382548 16.7027 0.382548C16.7027 0.382548 17.5892 -0.262484 18.0228 0.95865L18.0228 22.8086C18.0228 22.9588 17.9911 23.1065 17.9278 23.2394C17.8011 23.4979 17.5259 23.7392 16.8658 23.6383L16.9121 23.69Z" fill="currentColor" />
|
|
154
|
-
</svg>
|
|
155
|
-
`;function bRe(e,t){D(t,!1);let n=yRe.replace(`<svg `,`<svg class="size-3.5" `);Ea();var r=R();zi(N(r),()=>n),z(e,r),O()}var xRe=`<svg viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
156
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="currentColor" />
|
|
157
|
-
</svg>
|
|
158
|
-
`;function SRe(e,t){D(t,!1);let n=xRe.replace(`<svg `,`<svg class="size-3.5" `);Ea();var r=R();zi(N(r),()=>n),z(e,r),O()}function $7(e,t){return e.filter(e=>e.projectId===t).length}function CRe(e,t,n){let r=Date.now()-n*24*60*60*1e3;return e.filter(e=>{let n=Date.parse(e.updatedAt);return e.projectId===t&&Number.isFinite(n)&&n<r}).length}function wRe(e,t,n){return Math.max(0,$7(e,t)-n)}async function e9(e,t){try{await uE(e),id.success(`Copied ${t}`)}catch{id.error(`Could not copy to clipboard`)}}function TRe(e,t){let n=[];return t.editorAvailability?.vscode.available&&n.push({label:`Open in VS Code`,icon:bRe,onSelect:()=>t.onOpenProjectInEditor?.(e.id,`vscode`)}),t.editorAvailability?.zed.available&&n.push({label:`Open in Zed`,icon:SRe,onSelect:()=>t.onOpenProjectInEditor?.(e.id,`zed`)}),n}function ERe(e,t){let n=TRe(e,t),r=[{label:`New chat`,icon:KZ,shortcut:t.newConversationShortcut,onSelect:()=>t.onNewConversationInProject?.(e.dir)}];return n.length>0&&r.push({type:`separator`},...n),r.push({type:`separator`},{label:`Copy path`,icon:G3,onSelect:()=>void e9(e.dir,`path`)},{label:`Clean up`,icon:YQ,destructive:!0,disabled:t.conversationCount(e.id)===0,onSelect:()=>t.requestPrune(e)},{label:`Remove project`,icon:YQ,destructive:!0,onSelect:()=>t.requestDelete({kind:`project`,id:e.id,label:pE(e.dir,t.homeDir)})}),r}function t9(e,t,n){return[{label:`Open conversation`,icon:W3,onSelect:()=>n.onOpenConversation?.(t.id)},{label:`New chat`,icon:KZ,shortcut:n.newConversationShortcut,onSelect:()=>n.onNewConversationInProject?.(e.dir)},{type:`separator`},{label:`Copy conversation id`,icon:G3,onSelect:()=>void e9(t.id,`conversation id`)},{label:`Delete conversation`,icon:YQ,destructive:!0,onSelect:()=>n.requestDelete({kind:`conversation`,id:t.id,label:t.title})}]}var DRe=L(`<p class="empty svelte-r5acf5">No projects yet.</p>`),ORe=L(`<span class="project-count svelte-r5acf5"> </span>`),kRe=L(`<p class="empty child svelte-r5acf5">No conversations.</p>`),ARe=L(`<button type="button" class="more-button svelte-r5acf5"> </button>`),jRe=L(`<div class="conversation-list svelte-r5acf5"><!> <!> <!></div>`),MRe=L(`<p class="empty svelte-r5acf5"> </p>`),NRe=L(`<div class="tree-list svelte-r5acf5"><!> <!> <!></div>`),PRe=L(`<aside class="project-tree svelte-r5acf5"><div class="search-box svelte-r5acf5"><!> <!></div> <!></aside>`),FRe=L(`<!> <!> <!> <!>`,1);function IRe(e,t){D(t,!0);let n=q(t,`projects`,19,()=>[]),r=q(t,`conversations`,19,()=>[]),i=q(t,`agents`,19,()=>[]),a=q(t,`conversationActivityById`,19,()=>({})),o=q(t,`searchFocusToken`,3,0),s=A(``),c=A(null),l=0,u=Mn({}),d=A(void 0),f=A(void 0),p=A(void 0),m=b$(`projectSearch.focus`),h=x$(`projectSearch.focus`),g=b$(`conversation.new`);rr(()=>{o()!==l&&(l=o(),I(c)?.focus(),I(c)?.select())});function _(e){j(d,e,!0)}let v=k(()=>({homeDir:t.homeDir,newConversationShortcut:g,editorAvailability:t.editorAvailability,conversationCount:e=>$7(r(),e),onOpenConversation:t.onOpenConversation,onNewConversationInProject:t.onNewConversationInProject,onOpenProjectInEditor:t.onOpenProjectInEditor,requestPrune:y,requestDelete:_}));function y(e){j(f,{id:e.id,label:pE(e.dir,t.homeDir)},!0)}function b(){I(d)&&(I(d).kind===`project`?t.onDeleteProject?.(I(d).id):t.onDeleteConversation?.(I(d).id))}function x(e){I(f)&&t.onPruneProjectConversations?.(I(f).id,e)}let S=k(()=>vE({projects:n(),conversations:r(),agents:i(),filter:I(s),homeDir:t.homeDir})),ee=k(()=>I(S).groups),C=k(()=>I(S).hiddenProjects);var te=FRe(),ne=N(te);U(ne,()=>O1,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=PRe(),i=M(r),o=M(i);rZ(o,{size:13,strokeWidth:2.25,"aria-hidden":`true`});var l=P(o,2);{let e=k(()=>m?`Search projects / conversations (${m})`:`Search projects / conversations`);SQ(l,{size:`sm`,placeholder:`Search projects / conversations`,ariaLabel:`Search projects or conversations`,get"aria-keyshortcuts"(){return h},get title(){return I(e)},get ref(){return I(c)},set ref(e){j(c,e,!0)},get value(){return I(s)},set value(e){j(s,e,!0)}})}T(i),cZ(P(i,2),{class:`tree-scroll`,viewportClass:`tree-viewport`,type:`auto`,children:(e,n)=>{var r=NRe(),i=M(r),o=e=>{z(e,DRe())};V(i,e=>{I(ee).length===0&&e(o)});var s=P(i,2);Ni(s,17,()=>I(ee),e=>e.key,(e,n)=>{{let r=k(()=>ERe(I(n).project,I(v)));F$(e,{get items(){return I(r)},triggerClass:`project-context-trigger`,children:(e,r)=>{{let r=e=>{var t=R(),r=N(t),i=e=>{var t=ORe(),r=M(t,!0);T(t),F(()=>B(r,I(n).totalRows)),z(e,t)};V(r,e=>{I(n).totalRows>0&&e(i)}),z(e,t)},i=e=>{Ol(e,{size:`icon-xs`,variant:`ghost`,title:`New chat in project`,ariaLabel:`New chat`,onclick:()=>t.onNewConversationInProject?.(I(n).project.dir),children:(e,t)=>{KZ(e,{})},$$slots:{default:!0}})},o=k(()=>!u[I(n).key]);tT(e,{get title(){return I(n).label},get icon(){return S$},get open(){return I(o)},onOpenChange:e=>u[I(n).key]=!e,meta:r,actions:i,children:(e,r)=>{var i=jRe(),o=M(i),s=e=>{z(e,kRe())};V(o,e=>{I(n).rows.length===0&&e(s)});var c=P(o,2);Ni(c,17,()=>I(n).rows,e=>e.conversation.id,(e,r)=>{{let i=k(()=>t.openConversationTabIds?.has(I(r).conversation.id)??!1),o=k(()=>I(r).conversation.id===t.selectedConversationId),s=k(()=>t9(I(n).project,I(r).conversation,I(v)));Q7(e,{get row(){return I(r)},get isOpen(){return I(i)},get isActive(){return I(o)},get activity(){return a()[I(r).conversation.id]},get menuItems(){return I(s)},get onOpenConversation(){return t.onOpenConversation}})}});var l=P(c,2),u=e=>{var t=ARe(),r=M(t);T(t),F(()=>B(r,`+${I(n).hiddenRows??``} more`)),_i(`click`,t,()=>j(p,I(n),!0)),z(e,t)};V(l,e=>{I(n).hiddenRows>0&&e(u)}),T(i),z(e,i)},$$slots:{meta:!0,actions:!0,default:!0}})}},$$slots:{default:!0}})}});var c=P(s,2),l=e=>{var t=MRe(),n=M(t);T(t),F(()=>B(n,`+${I(C)??``} more projects`)),z(e,t)};V(c,e=>{I(C)>0&&e(l)}),T(r),z(e,r)},$$slots:{default:!0}}),T(r),z(e,r)},$$slots:{default:!0}})});var re=P(ne,2);{let e=k(()=>!!I(d)),t=k(()=>I(d)?.kind===`project`?`Remove project?`:`Delete conversation?`),n=k(()=>I(d)?I(d).kind===`project`?`This removes “${I(d).label}” from Nerve and deletes its Nerve conversations. Files on disk are not deleted.`:`This permanently removes “${I(d).label}”.`:``),r=k(()=>I(d)?.kind===`project`?`Remove`:`Delete`);_Q(re,{get open(){return I(e)},get title(){return I(t)},get description(){return I(n)},get confirmLabel(){return I(r)},destructive:!0,onConfirm:b,onOpenChange:e=>{e||j(d,void 0)}})}var ie=P(re,2),ae=e=>{{let n=k(()=>!!I(p)),o=k(()=>I(p).projects.map(e=>e.id));hRe(e,{get open(){return I(n)},get projectLabel(){return I(p).label},get project(){return I(p).project},get projectIds(){return I(o)},get conversations(){return r()},get agents(){return i()},get selectedConversationId(){return t.selectedConversationId},get openConversationTabIds(){return t.openConversationTabIds},get conversationActivityById(){return a()},get onOpenConversation(){return t.onOpenConversation},buildMenu:e=>I(p)?t9(I(p).project,e,I(v)):[],onOpenChange:e=>{e||j(p,void 0)}})}};V(ie,e=>{I(p)&&e(ae)});var oe=P(ie,2);{let e=k(()=>!!I(f)),t=k(()=>I(f)?.label??``),n=k(()=>I(f)?$7(r(),I(f).id):0);vRe(oe,{get open(){return I(e)},get projectLabel(){return I(t)},get totalCount(){return I(n)},ageEligible:e=>I(f)?CRe(r(),I(f).id,e):0,keepEligible:e=>I(f)?wRe(r(),I(f).id,e):0,onConfirm:x,onOpenChange:e=>{e||j(f,void 0)}})}z(e,te),O()}vi([`click`]);var n9=Mn({searchFocusToken:0});function LRe(){n9.searchFocusToken+=1}function r9(e,t){D(t,!0);let n=k(()=>H6.status),r=k(()=>H6.projects),i=k(()=>H6.conversations),a=k(()=>H6.agents),o=k(()=>H6.openConversationTabIds),s=k(()=>_8.conversationActivityById);{let t=k(()=>I(n)?.storage.home),c=k(()=>I(n)?.runtime.editors);IRe(e,{get projects(){return I(r)},get conversations(){return I(i)},get agents(){return I(a)},get homeDir(){return I(t)},get selectedProjectId(){return hT.projectId},get selectedConversationId(){return hT.conversationId},get openConversationTabIds(){return I(o)},get conversationActivityById(){return I(s)},get searchFocusToken(){return n9.searchFocusToken},get editorAvailability(){return I(c)},get onOpenConversation(){return u6},get onNewConversationInProject(){return O6},onOpenProjectInEditor:(e,t)=>void ODe(e,t),onDeleteProject:e=>void k6(e),onDeleteConversation:e=>void DDe(e),onPruneProjectConversations:(e,t)=>void kDe(e,t)})}O()}var RRe=L(`<!> <div class="pane-shell navigator-pane"><!></div>`,1),zRe=L(`<!> <div class="pane-shell utility-shell"><!></div>`,1),BRe=L(`<div class="workspace-shell compact"><div class="pane-shell center-shell"><!></div></div> <!> <!>`,1),VRe=L(`<div class="pane-shell navigator-pane"><!></div>`),i9=L(`<!> <!>`,1),HRe=L(`<div class="pane-shell center-shell"><!></div>`),URe=L(`<div class="pane-shell utility-shell"><!></div>`),WRe=L(`<!> <!> <!>`,1),GRe=L(`<div class="workspace-shell"><!></div>`);function KRe(e,t){D(t,!0);let n=k(()=>QC.isCompact),r=k(()=>H6.activeCenterTab),i;rr(()=>{let e=I(r)?`${I(r).kind}:${I(r).id}`:void 0;e!==i&&(i=e,bC.navDrawerOpen&&LC())}),rr(()=>{!I(n)&&(bC.navDrawerOpen||bC.utilityDrawerOpen)&&LC()});var a=R(),o=N(a),s=e=>{var t=BRe(),n=N(t),r=M(n);Y7(M(r),{}),T(r),T(n);var i=P(n,2);U(i,()=>P7,(e,t)=>{t(e,{get open(){return bC.navDrawerOpen},get onOpenChange(){return NC},children:(e,t)=>{var n=R();U(N(n),()=>F7,(e,t)=>{t(e,{side:`left`,class:`sheet-pane`,children:(e,t)=>{var n=RRe(),r=N(n);U(r,()=>I7,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{E(),z(e,wi(`Project navigator`))},$$slots:{default:!0}})});var i=P(r,2);r9(M(i),{}),T(i),z(e,n)},$$slots:{default:!0}})}),z(e,n)},$$slots:{default:!0}})}),U(P(i,2),()=>P7,(e,t)=>{t(e,{get open(){return bC.utilityDrawerOpen},get onOpenChange(){return PC},children:(e,t)=>{var n=R();U(N(n),()=>F7,(e,t)=>{t(e,{side:`right`,class:`sheet-pane`,children:(e,t)=>{var n=zRe(),r=N(n);U(r,()=>I7,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{E(),z(e,wi(`Utility panel`))},$$slots:{default:!0}})});var i=P(r,2);Z7(M(i),{}),T(i),z(e,n)},$$slots:{default:!0}})}),z(e,n)},$$slots:{default:!0}})}),z(e,t)},c=e=>{var t=GRe();IIe(M(t),{direction:`horizontal`,autoSaveId:`nerve.workspace.v3`,keyboardResizeBy:8,children:(e,t)=>{var n=WRe(),r=N(n),i=e=>{var t=i9(),n=N(t);M7(n,{defaultSize:19,minSize:14,maxSize:32,order:1,children:(e,t)=>{var n=VRe();r9(M(n),{}),T(n),z(e,n)},$$slots:{default:!0}}),N7(P(n,2),{"aria-label":`Resize agents panel`}),z(e,t)};V(r,e=>{bC.sidebarCollapsed||e(i)});var a=P(r,2);M7(a,{defaultSize:57,minSize:38,order:2,children:(e,t)=>{var n=HRe();Y7(M(n),{}),T(n),z(e,n)},$$slots:{default:!0}});var o=P(a,2),s=e=>{var t=i9(),n=N(t);N7(n,{"aria-label":`Resize utility panel`}),M7(P(n,2),{defaultSize:24,minSize:19,maxSize:40,order:3,children:(e,t)=>{var n=URe();Z7(M(n),{}),T(n),z(e,n)},$$slots:{default:!0}}),z(e,t)};V(o,e=>{bC.utilityCollapsed||e(s)}),z(e,n)},$$slots:{default:!0}}),T(t),z(e,t)};V(o,e=>{I(n)?e(s):e(c,-1)}),z(e,a),O()}var qRe=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="nerve-mark-title">
|
|
159
|
-
<title id="nerve-mark-title">Nerve</title>
|
|
160
|
-
<path d="M4 5v14" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
161
|
-
<path d="M4 5l6 7-6 7" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
162
|
-
<path d="M14 5l6 7-6 7" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
163
|
-
<circle cx="20" cy="12" r="1.125" fill="currentColor" />
|
|
164
|
-
</svg>
|
|
165
|
-
`,JRe=L(`<!> <span class="project-button-label svelte-16e3b57">Open Project</span>`,1),YRe=L(`<span class="window-divider svelte-16e3b57" aria-hidden="true"></span> <!> <!> <!>`,1),XRe=L(`<!> <!> <!> <!>`,1),ZRe=L(`<header><div class="title-left svelte-16e3b57"><span class="brand svelte-16e3b57"><span class="brand-mark svelte-16e3b57" aria-hidden="true"></span></span> <span class="divider svelte-16e3b57" aria-hidden="true"></span> <!></div> <!></header>`);function QRe(e,t){D(t,!0);let n=q(t,`desktop`,3,!1),r=q(t,`maximized`,3,!1),i=q(t,`closeToTray`,3,!0),a=q(t,`quitting`,3,!1),o=q(t,`settingsActive`,3,!1),s=q(t,`authActive`,3,!1),c=q(t,`logsActive`,3,!1);var l=ZRe();let u;var d=M(l),f=M(d),p=M(f);zi(p,()=>qRe,!0),T(p),T(f);var m=P(f,4);{let e=k(()=>t.activeProject?.dir??`Open a project`);Ol(m,{variant:`ghost`,size:`sm`,class:`project-button`,ariaLabel:`Open project`,get title(){return I(e)},onclick:()=>t.onOpenProject?.(),children:(e,t)=>{var n=JRe();S$(N(n),{size:14,strokeWidth:2.1,"aria-hidden":`true`}),E(2),z(e,n)},$$slots:{default:!0}})}T(d),U(P(d,2),()=>kS,(e,l)=>{l(e,{class:`title-actions`,"aria-label":`Application actions`,children:(e,l)=>{var u=XRe(),d=N(u);Ol(d,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open Nerve logs`,title:`Open Nerve logs`,get active(){return c()},get pressed(){return c()},onclick:()=>t.onOpenLogs?.(),children:(e,t)=>{R7(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var f=P(d,2);Ol(f,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open authentication`,title:`Providers & authentication`,get active(){return s()},get pressed(){return s()},onclick:()=>t.onOpenAuth?.(),children:(e,t)=>{HX(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var p=P(f,2);Ol(p,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open settings`,title:`Open settings`,get active(){return o()},get pressed(){return o()},onclick:()=>t.onOpenSettings?.(),children:(e,t)=>{z7(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var m=P(p,2),h=e=>{var n=YRe(),o=P(N(n),2);Ol(o,{variant:`ghost`,size:`icon-sm`,class:`window-control`,ariaLabel:`Minimize window`,title:`Minimize`,get disabled(){return a()},onclick:()=>t.onMinimize?.(),children:(e,t)=>{y1(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var s=P(o,2);{let e=k(()=>r()?`Restore window`:`Maximize window`),n=k(()=>r()?`Restore`:`Maximize`);Ol(s,{variant:`ghost`,size:`icon-sm`,class:`window-control`,get ariaLabel(){return I(e)},get title(){return I(n)},get disabled(){return a()},onclick:()=>t.onToggleMaximize?.(),children:(e,t)=>{var n=R(),i=N(n),a=e=>{G3(e,{size:15,strokeWidth:2.1})},o=e=>{ZE(e,{size:14,strokeWidth:2.1})};V(i,e=>{r()?e(a):e(o,-1)}),z(e,n)},$$slots:{default:!0}})}var c=P(s,2);{let e=k(()=>a()?`Closing Nerve`:i()?`Close window to tray`:`Close Nerve`),n=k(()=>a()?`Closing Nerve…`:i()?`Close to tray`:`Close Nerve`);Ol(c,{variant:`ghost`,size:`icon-sm`,class:`window-control close-control`,get ariaLabel(){return I(e)},get title(){return I(n)},get disabled(){return a()},onclick:()=>t.onClose?.(),children:(e,t)=>{var n=R(),r=N(n),i=e=>{GE(e,{class:`animate-spin`,size:16,strokeWidth:2.1})},o=e=>{KX(e,{size:16,strokeWidth:2.1})};V(r,e=>{a()?e(i):e(o,-1)}),z(e,n)},$$slots:{default:!0}})}z(e,n)};V(m,e=>{n()&&e(h)}),z(e,u)},$$slots:{default:!0}})}),T(l),F(()=>u=Qi(l,1,`titlebar svelte-16e3b57`,null,u,{desktop:n()})),z(e,l),O()}function $Re(e,t){D(t,!0);let n=k(()=>H6.activeProject),r=k(()=>H6.activeCenterTab),i=k(()=>f5.settingsDraft),a=k(()=>qu.quitting||xd.quitRequested);function o(){Y.projectPickerOpen=!0}async function s(){let e=I(i)?.desktop.closeToTray??!0;e||(xd.quitRequested=!0,qu.quitting=!0);try{await $u({closeToTray:e})}catch(t){e||(xd.quitRequested=!1,qu.quitting=!1),Y.error=t instanceof Error?t.message:String(t)}}{let t=k(()=>I(i)?.desktop.closeToTray??!0),c=k(()=>I(r)?.kind===`settings`),l=k(()=>I(r)?.kind===`auth`),u=k(()=>I(r)?.kind===`logs`);QRe(e,{get activeProject(){return I(n)},get desktop(){return qu.isDesktop},get maximized(){return qu.windowState.maximized},get closeToTray(){return I(t)},get quitting(){return I(a)},get settingsActive(){return I(c)},get authActive(){return I(l)},get logsActive(){return I(u)},onOpenProject:o,onOpenLogs:()=>eNe(),onOpenAuth:()=>BZ(),onOpenSettings:()=>void wZ(),onMinimize:()=>void Zu(),onToggleMaximize:()=>void Qu(),onClose:()=>void s()})}O()}var eze=L(`<main class="app-frame svelte-1huiqxf"><!> <!> <!> <!> <!></main> <!>`,1);function tze(e){var t=eze(),n=N(t),r=M(n);$Re(r,{});var i=P(r,2);KRe(i,{});var a=P(i,2);uNe(a,{});var o=P(a,2);bd(o,{}),Cd(P(o,2),{}),T(n),yFe(P(n,2),{}),z(e,t)}var nze=32e3;function a9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function o9(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function s9(e){return hT.conversationId===e}function c9(e){return Y.openCenterTabs.some(t=>t.kind===`conversation`&&t.id===e)}function l9(e){return{runId:e,messages:[],toolDrafts:[],toolOutputByToolCallId:{}}}function u9(e,t){return!t||e.live.runId===t||!e.live.runId?(e.live={...e.live,runId:t||e.live.runId},e.live):(e.live=l9(t),e.live)}function d9(e){return typeof e.liveMessageId==`string`?e.liveMessageId:String(e.runId??`unknown`)}function f9(e){return`live:${d9(e)}:${String(e.kind??`text`)}:${Number(e.contentIndex??0)}`}function rze(e){return`live:run-status:${e||`active`}`}function p9(e,t){e.transcript=e.transcript.filter(e=>e.runStatus?.state===`retrying`?!!(t&&e.runStatus.runId!==t):!0)}function ize(e){let t=e.text;t.length>32e3&&(t=t.slice(t.length-nze));let n=e.chunks.length>400?e.chunks.slice(e.chunks.length-400):e.chunks;return{...e,text:t,chunks:n}}function m9(e){if(!e||typeof e!=`object`)return;let t=e,n={estimated:typeof t.estimated==`boolean`?t.estimated:!0};return typeof t.path==`string`&&(n.path=t.path),n.lineCount=o9(t.lineCount),n.operationCount=o9(t.operationCount),n.generatedLineCount=o9(t.generatedLineCount),n.estimatedAdditions=o9(t.estimatedAdditions),n.estimatedDeletions=o9(t.estimatedDeletions),n}function h9(e){return`live:${d9(e)}:tool-draft:${Number(e.contentIndex??0)}`}function g9(e){s9(e.conversationId)&&(Y.error=e.error)}function aze(e,t){if(e.activeEntryIds.indexOf(t.id)!==-1)return!0;let n=e.activeEntryId??e.activeEntryIds.at(-1);return n?t.parentEntryId===n:e.activeEntryIds.length===0&&!t.parentEntryId}function oze(e,t){let n=e.activeEntryIds.indexOf(t.id);n===-1?e.activeEntryIds=[...e.activeEntryIds,t.id]:e.activeEntryIds=e.activeEntryIds.slice(0,n+1),e.activeEntryId=t.id}function sze(e,t){Y.conversations=Y.conversations.map(n=>n.id===e?{...n,activeEntryId:t,updatedAt:new Date().toISOString()}:n)}function cze(e,t){if(e.treeNodes.find(e=>e.entry.id===t.id)){e.treeNodes=e.treeNodes.map(e=>e.entry.id===t.id?{...e,entry:t}:e);return}e.treeNodes=[...e.treeNodes.map(e=>t.parentEntryId&&e.entry.id===t.parentEntryId?{...e,childEntryIds:Array.from(new Set([...e.childEntryIds,t.id]))}:e),{entry:t,childEntryIds:[]}]}function lze(e){return e===`manual`||e===`threshold`||e===`overflow`?e:void 0}function uze(e){return`live:compaction:${String(e.data?.runId??e.data?.conversationId??`active`)}:${String(e.data?.reason??`manual`)}`}function _9(e,t,n){return{id:n?.id??uze(e),state:t,reason:lze(e.data?.reason)??n?.reason,conversationId:a9(e.data?.conversationId),agentId:a9(e.data?.agentId),runId:a9(e.data?.runId),contextWindow:o9(e.data?.contextWindow)??n?.contextWindow,contextTokens:o9(e.data?.contextTokens)??n?.contextTokens,thresholdTokens:o9(e.data?.thresholdTokens)??n?.thresholdTokens,triggerReserveTokens:o9(e.data?.triggerReserveTokens)??n?.triggerReserveTokens,keepRecentTokens:o9(e.data?.keepRecentTokens)??n?.keepRecentTokens,failedEntryId:a9(e.data?.failedEntryId)??n?.failedEntryId,errorMessage:t===`failed`?a9(e.data?.message)??n?.errorMessage:n?.errorMessage,createdAt:a9(e.data?.startedAt)??n?.createdAt??e.ts}}function dze(e,t){let n=yT.conversationViews[UT(e)];n&&(t.seq<=n.cursorSeq||(n.cursorSeq=t.seq,n.live.compaction=void 0,n.error=void 0,g9(n)))}function fze(e,t){let n=u9(e,a9(t.data?.runId)),r=_9(t,`running`,n.compaction);n.compaction=r,r.failedEntryId&&(n.hiddenEntryIds=Array.from(new Set([...n.hiddenEntryIds??[],r.failedEntryId]))),e.error=void 0}function pze(e,t){let n=u9(e,a9(t.data?.runId)),r=_9(t,`failed`,n.compaction);n.compaction=r,r.failedEntryId&&(n.hiddenEntryIds=(n.hiddenEntryIds??[]).filter(e=>e!==r.failedEntryId))}var v9=new Map,mze=1e3;function y9(e){let t=v9.get(e);t&&(clearTimeout(t),v9.delete(e))}function hze(e){if(!c9(e))return;y9(e);let t=setTimeout(()=>{v9.delete(e),b9(e)},mze);v9.set(e,t)}async function b9(e){if(!c9(e))return;let t=await Aw(e).catch(()=>void 0),n=yT.conversationViews[UT(e)];!t||!n||(n.contextUsage=t)}function gze(e,t,n){return e.filter(e=>e.key!==t&&(!n||e.providerToolCallId!==n))}function x9(e){return e&&typeof e==`object`?e:void 0}function _ze(e){let t=x9(e.details),n=x9(t?.details);for(let e of[t?.toolCall,n?.toolCall]){let t=pue.safeParse(e);if(t.success)return t.data}}function vze(e,t){if(!t)return!0;if(!aze(e,t))return!1;oze(e,t),cze(e,t),sze(e.conversationId,t.id),s9(e.conversationId)&&(hT.entryId=t.id),t.kind===`run_status`&&p9(e,t.runId);let n=c6(t),r=new Set(n.map(e=>e.id).filter(Boolean));if(e.transcript=[...e.transcript.filter(e=>!e.id||!r.has(e.id)),...n].filter((e,t,n)=>e.optimistic?!n.some(t=>!t.optimistic&&t.role===e.role&&t.text===e.text):!0),S9(e,_ze(t)),t.role===`assistant`&&t.liveMessageId){let n=`live:${t.liveMessageId}:`;e.live.messages=e.live.messages.filter(e=>!e.id?.startsWith(n)),e.live.toolDrafts=e.live.toolDrafts.filter(e=>!e.key.startsWith(n)),e.streamingText=n6(e.live)}return!0}function S9(e,t){if(!t)return;if(t.hidden){e.toolCalls=e.toolCalls.filter(e=>e.id!==t.id);return}e.toolCalls=e.toolCalls.findIndex(e=>e.id===t.id)===-1?[...e.toolCalls,t]:e.toolCalls.map(e=>e.id===t.id?t:e);let n=t.providerToolCallId??t.sourceToolCallId;n&&(e.live.toolDrafts=e.live.toolDrafts.filter(e=>e.providerToolCallId!==n))}function C9(e,t){let n=e.live.messages.findIndex(e=>e.id===t.id);e.live.messages=n===-1?[...e.live.messages,t]:e.live.messages.map(e=>e.id===t.id?t:e)}function yze(e,t){let n=typeof t.data?.delta==`string`?t.data.delta:``;if(!n)return;u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let r=f9(t.data),i=e.live.messages.find(e=>e.id===r),a=Number(t.data?.offset??i?.text.length??0);if(!(i&&i.text.length>a)){if(i&&i.text.length<a){l6(e.conversationId);return}C9(e,{id:r,role:`assistant`,displayKind:(t.data?.kind===`thinking`?`thinking`:`text`)==`thinking`?`thinking`:`message`,text:`${i?.text??``}${n}`,createdAt:i?.createdAt??new Date().toISOString(),contentIndex:Number(t.data?.contentIndex??0),live:!0,done:!1,redacted:i?.redacted}),e.streamingText=n6(e.live),e.sending=!0}}function bze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=f9(t.data),r=e.live.messages.find(e=>e.id===n),i=t.data?.kind===`thinking`?`thinking`:`text`;C9(e,{id:n,role:`assistant`,displayKind:i===`thinking`?`thinking`:`message`,text:typeof t.data?.finalText==`string`?t.data.finalText:r?.text??``,createdAt:r?.createdAt??new Date().toISOString(),contentIndex:Number(t.data?.contentIndex??0),live:!1,done:!0,redacted:i===`thinking`?!!t.data?.redacted:void 0}),e.streamingText=n6(e.live)}function w9(e,t,n){let r=h9(t.data),i=e.live.toolDrafts.find(e=>e.key===r),a={kind:`tool_call_draft`,key:r,runId:typeof t.data?.runId==`string`?t.data.runId:i?.runId,conversationId:e.conversationId,contentIndex:Number(t.data?.contentIndex??i?.contentIndex??0),providerToolCallId:typeof t.data?.providerToolCallId==`string`?t.data.providerToolCallId:i?.providerToolCallId,toolName:typeof t.data?.toolName==`string`?t.data.toolName:i?.toolName,argsText:typeof n.argsText==`string`?n.argsText:i?.argsText??``,args:n.args??i?.args,progress:m9(n.progress)??i?.progress,done:typeof n.done==`boolean`?n.done:i?.done,createdAt:i?.createdAt??new Date().toISOString(),updatedAt:new Date().toISOString()};e.live.toolDrafts=i?e.live.toolDrafts.map(e=>e.key===r?a:e):[...e.live.toolDrafts,a]}function xze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0),w9(e,t,{})}function Sze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=h9(t.data),r=e.live.toolDrafts.find(e=>e.key===n),i=typeof t.data?.delta==`string`?t.data.delta:``,a=Number(t.data?.offset??r?.argsText.length??0);if(!(r&&r.argsText.length>a)){if(r&&r.argsText.length<a){l6(e.conversationId);return}w9(e,t,{argsText:`${r?.argsText??``}${i}`})}}function Cze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0),w9(e,t,{args:t.data?.args&&typeof t.data.args==`object`?t.data.args:void 0,done:!0})}function wze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=h9(t.data),r=typeof t.data?.providerToolCallId==`string`?t.data.providerToolCallId:void 0;e.live.toolDrafts=gze(e.live.toolDrafts,n,r)}function Tze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=m9(t.data?.progress);n&&w9(e,t,{progress:n})}function Eze(e,t){let n=t.data?.toolCallId,r=t.data?.delta,i=t.data?.stream;if(typeof n!=`string`||typeof r!=`string`||r.length===0||i!==`stdout`&&i!==`stderr`&&i!==`combined`)return;let a=e.live.toolOutputByToolCallId[n],o=Number(t.data?.offset??a?.text.length??0);if(a&&a.text.length>o)return;if(a&&a.text.length<o){l6(e.conversationId);return}let s=new Date().toISOString(),c=ize({chunks:[...a?.chunks??[],{stream:i,text:r,ts:s}],text:`${a?.text??``}${r}`,updatedAt:s});e.live.toolOutputByToolCallId={...e.live.toolOutputByToolCallId,[n]:c}}function Dze(e,t){let n=String(t.data?.runId??``),r=u9(e,n),i={attempt:o9(t.data?.attempt)??0,maxRetries:o9(t.data?.maxRetries)??0,delayMs:o9(t.data?.delayMs)??0,retryAt:a9(t.data?.retryAt)??new Date().toISOString(),errorMessage:a9(t.data?.errorMessage),failedEntryId:a9(t.data?.failedEntryId)},a={conversationId:a9(t.data?.conversationId),agentId:a9(t.data?.agentId),runId:n,state:`retrying`,...i};r.runStatus=a,i.failedEntryId&&(r.hiddenEntryIds=Array.from(new Set([...r.hiddenEntryIds??[],i.failedEntryId]))),p9(e,n),e.transcript=[...e.transcript,{id:rze(n),role:`system`,kind:`run_status`,displayKind:`message`,text:`Retrying model request…`,live:!0,createdAt:t.ts,runStatus:a}],e.activeRun&&e.activeRun.runId===n&&(e.activeRun={...e.activeRun,status:`retrying`,retry:i}),e.sending=!0,e.error=void 0}function Oze(e){return e===`conversation.entry.appended`||e===`conversation.compaction.started`||e===`conversation.compaction.failed`||e===`conversation.context.updated`||e===`conversation.tool_call.updated`||e.startsWith(`conversation.prompt.`)||e.startsWith(`conversation.run.`)||e.startsWith(`conversation.live.`)}function T9(e){let t=e.data?.conversationId;if(typeof t==`string`)return t;let n=e.data?.entry;if(typeof n?.conversationId==`string`)return n.conversationId;let r=e.data?.toolCall;if(typeof r?.conversationId==`string`)return r.conversationId}function kze(e){let t=T9(e);if(!t||!c9(t))return;let n=kD(t);if(!(e.seq<=n.cursorSeq)){switch(n.cursorSeq=e.seq,e.type){case`conversation.run.started`:n.sending=!0,n.queuedPrompts=[],n.error=void 0;break;case`conversation.entry.appended`:vze(n,e.data?.entry)||l6(t),hze(t);break;case`conversation.context.updated`:y9(t),n.contextUsage=e.data?.contextUsage??n.contextUsage;break;case`conversation.prompt.queued`:Aze(n,e.data?.queuedPrompt);break;case`conversation.prompt.dequeued`:case`conversation.prompt.cancelled`:jze(n,e.data?.queuedPrompt);break;case`conversation.tool_call.updated`:S9(n,e.data?.toolCall);break;case`conversation.run.retrying`:Dze(n,e);break;case`conversation.compaction.started`:fze(n,e);break;case`conversation.compaction.failed`:pze(n,e);break;case`conversation.live.message.started`:u9(n,String(e.data?.runId??``)),n.live.runStatus=void 0,p9(n,String(e.data?.runId??``)),n.sending=!0;break;case`conversation.live.content.delta`:yze(n,e);break;case`conversation.live.content.done`:bze(n,e);break;case`conversation.live.tool_draft.started`:xze(n,e);break;case`conversation.live.tool_draft.delta`:Sze(n,e);break;case`conversation.live.tool_draft.done`:Cze(n,e);break;case`conversation.live.tool_draft.discarded`:wze(n,e);break;case`conversation.live.tool_draft.progress`:Tze(n,e);break;case`conversation.live.tool_output.delta`:Eze(n,e);break;case`conversation.run.completed`:p9(n,String(e.data?.runId??``)),n.sending=!1,n.streamingText=``,n.live=l9(),n.activeRun=void 0,n.queuedPrompts=[],n.error=void 0,l6(t).then(()=>{hT.conversationId===t&&u6(t)}),s9(t)&&G8(a9(e.data?.projectId));break;case`conversation.run.failed`:{p9(n,String(e.data?.runId??``));let t=n.live.compaction?.state===`failed`?n.live.compaction:void 0;n.sending=!1,n.streamingText=``,n.live={...l9(),compaction:t},n.activeRun=void 0,n.queuedPrompts=[],n.error=e.data?.aborted?void 0:String(e.data?.message??`Agent error`);break}case`conversation.run.suspended`:p9(n,String(e.data?.runId??``)),n.sending=!1,n.streamingText=``,n.live=l9(),n.activeRun=void 0,n.queuedPrompts=[],n.error=void 0;break}g9(n)}}function Aze(e,t){t&&(e.queuedPrompts=e.queuedPrompts.findIndex(e=>e.id===t.id)===-1?[...e.queuedPrompts,t]:e.queuedPrompts.map(e=>e.id===t.id?t:e))}function jze(e,t){t&&(e.queuedPrompts=e.queuedPrompts.filter(e=>e.id!==t.id))}function Mze(){return o$(Nze)}function Nze(e){if(Oze(e.type)){kze(e);return}if(e.type===`conversation.compacted`||e.type===`conversation.navigated`){let t=T9(e);t&&c9(t)&&(e.type===`conversation.compacted`&&dze(t,e),l6(t))}if(e.type===`agent.configured`){let t=e.data?.agent;typeof t?.conversationId==`string`&&b9(t.conversationId)}}function Pze(e,t){switch(e.type){case`approval.requested`:return Fze(e,t);case`user_question.requested`:return Ize(e,t);case`plan_review.requested`:return Lze(e,t);case`conversation.run.completed`:return Rze(e,t);case`conversation.run.failed`:return zze(e,t);case`conversation.run.suspended`:return;default:return}}function Fze(e,t){let n=k9(e.data?.approval),r=k9(e.data?.toolCall),i=A9(r?.toolName),a=A9(n?.risk)??A9(r?.risk),o=A9(n?.reason);return{backgroundOnly:!1,kind:`error`,tag:j9(`approval`,A9(n?.id)),payload:{title:i?`Approval needed: ${i}`:`Approval needed`,body:O9([a?`Risk: ${a}`:void 0,o??`An agent is waiting for tool approval.`,E9(e,t)]),urgency:`attention`}}}function Ize(e,t){let n=k9(e.data?.question),r=A9(n?.question),i=A9(n?.context),a=A9(n?.recommendation);return{backgroundOnly:!1,kind:`error`,tag:j9(`question`,A9(n?.id)),payload:{title:`Nerve needs your answer`,body:O9([r??`An agent asked a question.`,i?`Context: ${i}`:void 0,a?`Recommendation: ${a}`:void 0,E9(e,t)]),urgency:`attention`}}}function Lze(e,t){let n=k9(e.data?.planReview),r=A9(n?.title),i=A9(n?.summary),a=A9(n?.planPath);return{backgroundOnly:!1,kind:`error`,tag:j9(`plan-review`,A9(n?.id)),payload:{title:r?`Plan ready: ${r}`:`Plan ready for review`,body:O9([r,i??`An agent submitted a plan for review.`,a?`Plan: ${a}`:void 0,E9(e,t)]),urgency:`attention`}}}function Rze(e,t){return{backgroundOnly:!0,kind:`success`,tag:j9(`run-completed`,A9(e.data?.runId)),payload:{title:`Agent run completed`,body:O9([E9(e,t)])??`Nerve finished a run.`,urgency:`normal`}}}function zze(e,t){if(e.data?.aborted===!0)return;let n=k9(e.data?.retryExhausted);if(n){let r=Uze(n.maxRetries),i=A9(n.errorMessage)??A9(e.data?.message);return{backgroundOnly:!1,kind:`error`,tag:j9(`run-retry-exhausted`,A9(e.data?.runId)),payload:{title:`Model request needs retry`,body:O9([r===void 0?`Model request failed after retries. Open Nerve and click Continue.`:`Model request failed after ${r} ${r===1?`retry`:`retries`}. Open Nerve and click Continue.`,i,E9(e,t)]),urgency:`attention`}}}return{backgroundOnly:!0,kind:`error`,tag:j9(`run-failed`,A9(e.data?.runId)),payload:{title:`Agent run failed`,body:O9([A9(e.data?.message)??`Nerve hit an agent error.`,E9(e,t)]),urgency:`attention`}}}function E9(e,t){return O9([Bze(e,t),Vze(e,t)])}function Bze(e,t){let n=D9(e,`conversationId`);if(!n)return;let r=t.conversations.find(e=>e.id===n)?.title;return r?`Chat: ${r}`:void 0}function Vze(e,t){let n=D9(e,`projectId`);if(!n)return;let r=t.projects.find(e=>e.id===n);if(r)return`Project: ${r.name||r.dir}`}function D9(e,t){let n=A9(e.data?.[t]);if(n)return n;for(let n of[`approval`,`question`,`planReview`,`toolCall`]){let r=A9(k9(e.data?.[n])?.[t]);if(r)return r}}function O9(e){let t=e.filter(Boolean).join(` · `);return t?Hze(t):void 0}function Hze(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=220?t:`${t.slice(0,219)}…`}function k9(e){return e&&typeof e==`object`?e:void 0}function A9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function Uze(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function j9(e,t){return t?`nerve:${e}:${t}`:void 0}var M9;function Wze(){return M9||(M9=o$(Gze),()=>{M9?.(),M9=void 0})}function Gze(e){if(!Kze(e))return;let t=Pze(e,{projects:Y.projects,conversations:Y.conversations});t&&ld(t.payload,{backgroundOnly:t.backgroundOnly,kind:t.kind,tag:t.tag})}function Kze(e){let t=Date.parse(e.ts);return Number.isFinite(t)&&Date.now()-t<6e4}function N9(e){return e&&typeof e==`object`?e:void 0}function P9(e){return typeof e==`string`?e:void 0}function qze(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.updatedAt==`string`)}function Jze(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.projectId==`string`&&typeof t.updatedAt==`string`)}function Yze(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.conversationId==`string`&&typeof t.status==`string`)}function Xze(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.conversationId==`string`&&typeof t.status==`string`&&typeof t.updatedAt==`string`)}function Zze(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.conversationId==`string`&&typeof t.status==`string`&&typeof t.updatedAt==`string`)}function Qze(e){let t=N9(e);return!!(t&&typeof t.id==`string`)}function $ze(e){Y.conversations=Y.conversations.findIndex(t=>t.id===e.id)===-1?[e,...Y.conversations]:Y.conversations.map(t=>t.id===e.id?e:t)}function eBe(e){Y.conversations=Y.conversations.filter(t=>t.id!==e)}function F9(e){Y.agents=xDe(e,Y.agents)}function I9(e,t,n){if(!e)return;let r=Y.agents.find(t=>t.id===e);!r||r.updatedAt>n||F9({...r,status:t,updatedAt:n})}function tBe(e){if(e.status!==`pending`){nBe(e.id);return}Y.approvals=Y.approvals.findIndex(t=>t.id===e.id)===-1?[e,...Y.approvals]:Y.approvals.map(t=>t.id===e.id?{...t,...e}:t)}function nBe(e){Y.approvals=Y.approvals.filter(t=>t.id!==e)}function rBe(e){if(e.status!==`pending`){iBe(e.id);return}Y.userQuestions=Y.userQuestions.findIndex(t=>t.id===e.id)===-1?[e,...Y.userQuestions]:Y.userQuestions.map(t=>t.id===e.id?e:t)}function iBe(e){Y.userQuestions=Y.userQuestions.filter(t=>t.id!==e)}function aBe(e){if(e.status!==`pending`){oBe(e.id);return}Y.planReviews=Y.planReviews.findIndex(t=>t.id===e.id)===-1?[e,...Y.planReviews]:Y.planReviews.map(t=>t.id===e.id?e:t)}function oBe(e){Y.planReviews=Y.planReviews.filter(t=>t.id!==e)}function sBe(e){Y.planReviews=Y.planReviews.filter(t=>t.agentId!==e)}function cBe(e){let t=e.data??{},n=N9(t.agent),r=N9(t.conversation),i=N9(t.approval),a=N9(t.question),o=N9(t.planReview);if(Jze(r)&&$ze(r),e.type===`conversation.deleted`){let e=P9(t.conversationId)??P9(t.id);e&&eBe(e)}if(qze(n)&&F9(n),Yze(i)){let e=Qze(t.toolCall)?t.toolCall:void 0;tBe({...i,toolCall:e})}if(Xze(a)&&rBe(a),Zze(o)&&aBe(o),e.type===`plan_review.force_exited`){let e=P9(t.agentId);e&&sBe(e)}}var lBe=150,L9;function uBe(){return o$(dBe)}function dBe(e){if(cBe(e),gBe(e),mBe(e.type)){let t=hBe(e.data?.agent);t&&F9(t)}_Be(e.type)&&fBe()}function fBe(){L9&&clearTimeout(L9),L9=setTimeout(()=>{L9=void 0,e6.invalidateQueries({queryKey:t6.workspace}),E6()},lBe)}function pBe(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function mBe(e){return e===`agent.created`||e===`agent.configured`||e===`agent.mode_changed`||e===`agent.status_changed`}function hBe(e){if(!e||typeof e!=`object`)return;let t=e;return typeof t.id==`string`&&typeof t.updatedAt==`string`?t:void 0}function gBe(e){let t=pBe(e.data?.agentId);switch(e.type){case`conversation.run.started`:I9(t,`running`,e.ts);break;case`conversation.run.suspended`:I9(t,`awaiting_user`,e.ts);break;case`conversation.run.completed`:I9(t,`idle`,e.ts);break;case`conversation.run.failed`:I9(t,e.data?.aborted?`aborted`:`error`,e.ts);break}}function _Be(e){return e===`conversation.created`||e===`conversation.updated`||e===`conversation.deleted`||e===`conversation.compacted`||e===`conversation.branch_summarized`||e===`conversation.navigated`||e===`project.deleted`||e===`agent.created`||e===`agent.configured`||e===`agent.status_changed`||e.startsWith(`agent.subagent_`)||e.startsWith(`agent.explore_`)||e===`project.created`||e.startsWith(`approval.`)||e.startsWith(`user_question.`)||e.startsWith(`plan_review.`)||e===`plan.written`||e===`agent.mode_changed`||e===`conversation.tool_call.updated`||e===`conversation.run.started`||e===`conversation.run.completed`||e===`conversation.run.failed`||e===`conversation.run.suspended`||e.startsWith(`task.`)||R9(e)}function R9(e){return e.startsWith(`settings.`)||e.startsWith(`secrets.`)||e.startsWith(`auth.`)||e.startsWith(`providers.`)}function vBe(){return o$(yBe)}function yBe(e){R9(e.type)&&!(e.type.startsWith(`settings.`)&&NZ())&&OZ()}function bBe(e,t){if(t.visibility===`foreground`)return e.filter(e=>e.id!==t.id);let n=e.findIndex(e=>e.id===t.id);return n<0?[t,...e]:e.map((e,r)=>r===n?t:e)}function xBe(){let e=[a$(`task.log`,CBe),a$(`task.removed`,SBe),a$(`task.created`,z9),a$(`task.started`,z9),a$(`task.ready`,z9),a$(`task.ready_timeout`,z9),a$(`task.promoted`,z9),a$(`task.completed`,z9),a$(`task.failed`,z9),a$(`task.cancelled`,z9),a$(`task.orphaned`,z9),a$(`task.orphan_cleanup_succeeded`,z9)];return()=>{for(let t of e.splice(0))t()}}function z9(e){let t=e.data?.task;t?.id&&(wT.tasks=bBe(wT.tasks,t))}function SBe(e){let t=String(e.data?.taskId??``);t&&(wT.tasks=wT.tasks.filter(e=>e.id!==t),wT.selectedTaskId===t&&(wT.selectedTaskId=void 0,wT.taskLogs=void 0))}function CBe(e){z9(e);let t=String(e.data?.taskId??``),n=Y.activeCenterTab?.kind===`task`&&Y.activeCenterTab.id===t;t&&t===wT.selectedTaskId&&n&&bD(t).then(e=>{wT.taskLogs=e})}function wBe(){return a$(`usage.subscription.updated`,TBe)}function TBe(e){let t=e.data;t?.provider&&(_Z.subscriptionUsage={..._Z.subscriptionUsage,[t.provider]:t})}function EBe(){let e=[uBe(),Mze(),xBe(),vBe(),Ufe(),wBe(),Wze()];return()=>{for(let t of e.splice(0))t()}}function DBe(e){function t(t){return!(t.metaKey||t.ctrlKey)||t.altKey?!1:t.key===`=`||t.key===`+`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()+1),!0):t.key===`-`||t.key===`_`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()-1),!0):t.key===`0`?(t.preventDefault(),e.setUiZoomLevel(0),!0):!1}function n(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:{kind:e.kind,id:e.id}}function r(){let t=e.activeCenterTab();return t?e.centerTabs().findIndex(e=>e.kind===t.kind&&e.id===t.id):-1}function i(t){let i=e.centerTabs();if(i.length===0)return!1;let a=r(),o=((a===-1?0:a)+t+i.length)%i.length;return e.selectCenterTab(n(i[o])),!0}function a(t){let r=e.centerTabs()[t];return r?(e.selectCenterTab(n(r)),!0):!1}function o(){if(!e.hasConversationComposer())return!1;let t=[`read_only`,`supervised`,`autonomous`],n=t[(t.indexOf(e.selectedPermissionLevel())+1)%t.length]??t[0];return e.setComposerPermission(n),!0}function s(){if(!e.hasConversationComposer())return!1;let t=e.usableModels().find(t=>`${t.provider}:${t.modelId}`===e.selectedModelKey()),n=t?.supportedThinkingLevels?.length?t.supportedThinkingLevels:[`off`],r=n[(n.indexOf(e.selectedThinkingLevel())+1)%n.length]??n[0]??`off`;return e.setComposerThinkingLevel(r),!0}function c(){return e.hasConversationComposer()?(e.setComposerMode(e.selectedMode()===`coding`?`planning`:`coding`),!0):!1}function l(t){if(t.startsWith(`pane.focusByIndex.`)){let e=Number(t.split(`.`).at(-1))-1;return Number.isInteger(e)&&a(e)}let n=e.activeCenterTab();switch(t){case`conversation.new`:return e.newConversation(),!0;case`conversation.newFromProject`:return e.openProjectPicker(),!0;case`pane.close`:return n?(e.closeCenterTab(n),!0):!1;case`pane.closeOthers`:return n?(e.closeCenterTabs(e.centerTabsExcept(n),n),!0):!1;case`pane.refresh`:return n?(e.refreshCenterTab(n),!0):!1;case`pane.previous`:return i(-1);case`pane.next`:return i(1);case`projectSearch.focus`:return e.focusProjectSearch(),!0;case`composer.focus`:case`composer.cancelMic`:return e.hasConversationComposer()?(e.composerEscape(),!0):!1;case`composer.stopRun`:return!e.sending()&&!e.live()?!1:(e.abortActiveRun(),!0);case`composer.toggleMic`:return e.hasConversationComposer()?(e.toggleMic(),!0):!1;case`composer.toggleMode`:return c();case`composer.cyclePermission`:return o();case`composer.cycleThinking`:return s();case`zoom.in`:case`zoom.out`:case`zoom.reset`:case`composer.send`:return!1}return!1}function u(e){if(t(e))return;let n=v$.find(t=>Npe(e,t.defaultBinding));n&&(Mpe(e.target)&&!n.allowInEditable||l(n.id)&&n.id!==`composer.focus`&&n.id!==`composer.cancelMic`&&e.preventDefault())}return{activeCenterTabIndex:r,centerTabIdentity:n,cyclePermissionLevel:o,cycleThinkingLevel:s,handleWorkbenchShortcut:u,handleZoomShortcut:t,selectCenterTabByIndex:a,selectRelativeCenterTab:i,toggleComposerModeShortcut:c}}var B9,V9,H9=0,U9=!1,W9=0,G9,K9,q9=0,OBe=1e4,kBe=15e3,ABe=7e4,jBe=[250,500,1e3,1500,2500,4e3,5e3];async function MBe(){U9=!1;try{cw(),wC(RC()),Y.config=await NBe(`load client config`,hD),Y.status=Y.config.status,Y.error=void 0,gT.projectDir=Y.config.status.storage.home,await Promise.all([E6(),CDe()]),await rDe(),await OZ(),zBe(),lw(`info`,`workbench`,`Workbench initialized`),Z9(Y.config.wsUrl)}catch(e){Y.error=e instanceof Error?e.message:String(e),Y.connection=`error`,lw(`error`,`workbench`,`Workbench initialization failed`,{error:e})}}async function NBe(e,t){for(let[n,r]of jBe.entries())try{return await t()}catch(t){if(U9)throw t;Y.connection=`connecting`,Y.error=`Waiting for Nerve daemon to start (${FBe(t)})`,lw(`warn`,`workbench`,`Workbench initialization retrying`,{context:{label:e,attempt:n+1,delayMs:r},error:t}),await PBe(r)}return await t()}function PBe(e){return new Promise(t=>setTimeout(t,e))}function FBe(e){return e instanceof Error?e.message:String(e)}function IBe(e){if(globalThis.location?.protocol===`http:`||globalThis.location?.protocol===`https:`){let e=new URL(`/ws`,globalThis.location.href);return e.protocol=globalThis.location.protocol===`https:`?`wss:`:`ws:`,e}return new URL(e)}function J9(){V9!==void 0&&(clearTimeout(V9),V9=void 0)}function LBe(e){if(U9)return;J9();let t=Math.min(500*2**H9,5e3);H9+=1,Y.connection=`connecting`,V9=setTimeout(()=>{V9=void 0,U9||Z9(e)},t)}function RBe(){Y9(),K9=setInterval(()=>{U9||Date.now()-q9<ABe||(lw(`warn`,`websocket`,`WebSocket liveness timeout; reconnecting`),B9?.close())},kBe)}function Y9(){K9!==void 0&&(clearInterval(K9),K9=void 0)}function zBe(){X9(),G9=setInterval(()=>{DZ().catch(()=>void 0)},OBe)}function X9(){G9!==void 0&&(clearInterval(G9),G9=void 0)}function BBe(e){e.seq&&e.seq<=Y.lastEventSeq||(e.seq&&(Y.lastEventSeq=e.seq),Hfe(e))}function Z9(e){J9();let t=W9+1;W9=t,B9?.close();let n=IBe(e);Y.lastEventSeq>0&&n.searchParams.set(`since`,String(Y.lastEventSeq));let r=new WebSocket(n);B9=r,Y.connection=`connecting`,r.addEventListener(`open`,()=>{t===W9&&(H9=0,Y.connection=`live`,q9=Date.now(),RBe(),lw(`info`,`websocket`,`WebSocket connected`,{context:{since:Y.lastEventSeq}}))}),r.addEventListener(`message`,e=>{if(t!==W9)return;q9=Date.now();let n=JSON.parse(String(e.data));n.type!==`heartbeat`&&n.type&&BBe(n)}),r.addEventListener(`close`,()=>{if(t===W9){if(B9=void 0,U9){Y.connection=`closed`;return}l$(),lw(`warn`,`websocket`,`WebSocket closed; reconnect scheduled`),LBe(e)}}),r.addEventListener(`error`,()=>{t===W9&&(Y.connection=`error`,lw(`error`,`websocket`,`WebSocket error`))})}function VBe(){U9=!0,J9(),X9(),Y9(),W9+=1,B9?.close(),B9=void 0,l$(),Y.connection=`closed`}function HBe(e,t){D(t,!0);let n=k(()=>H6.activeProject),r=k(()=>_8.activeConversation),i=k(()=>H6.activeCenterTab),a=k(()=>H6.centerTabs),o=k(()=>_8.live),s=k(()=>_8.pendingConversationActive),c=k(()=>_8.selectedMode),l=k(()=>_8.selectedModelKey),u=k(()=>_8.selectedPermissionLevel),d=k(()=>_8.selectedThinkingLevel),f=k(()=>_8.sending),p=k(()=>f5.settingsDraft),m=k(()=>_8.usableModels),h=k(()=>I(p)?.ui.zoomLevel??CC.level);function g(){Y.projectPickerOpen=!0}function _(){bC.sidebarCollapsed&&AC(!1),LRe()}function v(e){e.kind===`conversation`?l6(e.id):e.kind===`pending-conversation`||e.kind===`task`?BT(e):e.kind===`file`?L6(e.id):e.kind===`pr`?S8(e.id):OZ()}let y=DBe({currentZoomLevel:()=>I(h),setUiZoomLevel:RZ,centerTabs:()=>I(a),activeCenterTab:()=>I(i),selectCenterTab:BT,newConversation:D6,openProjectPicker:g,closeCenterTab:VT,closeCenterTabs:g5,centerTabsExcept:h5,refreshCenterTab:v,focusProjectSearch:_,hasConversationComposer:()=>!!(I(r)||I(s)),sending:()=>I(f),live:()=>I(o),abortActiveRun:M6,composerEscape:BEe,toggleMic:VEe,selectedPermissionLevel:()=>I(u),setComposerPermission:b6,usableModels:()=>I(m),selectedModelKey:()=>I(l),selectedThinkingLevel:()=>I(d),setComposerThinkingLevel:v6,selectedMode:()=>I(c),setComposerMode:y6}),b;rr(()=>{let e=I(p)?.desktop.closeToTray;!qu.isDesktop||e===void 0||e===b||(b=e,ed(e))});let x;rr(()=>{let e=I(n)?.id;e!==x&&(x=e,e?H8(e,{reason:`project`,force:!0}):CAe())}),Oa(()=>{let e=EBe(),t=Xu(),n=wAe();od();let r=window.location.pathname===`/settings`||window.location.pathname===`/settings/`;return r&&window.history.replaceState({},``,`/${window.location.search}${window.location.hash}`),AC(kC()),MC(jC()),window.addEventListener(`keydown`,y.handleWorkbenchShortcut,{capture:!0}),MBe().then(()=>{r&&wZ()}),()=>{window.removeEventListener(`keydown`,y.handleWorkbenchShortcut,{capture:!0}),t(),n(),e(),VBe()}});var S=R();H(N(S),()=>t.children??w),z(e,S),O()}function UBe(e){Vi(`629kra`,e=>{sr(()=>{In.title=`nerve`})}),HBe(e,{children:(e,t)=>{tze(e,{})},$$slots:{default:!0}})}function WBe(e){UBe(e,{})}var GBe=new Set([`$$slots`,`$$events`,`$$legacy`]);function KBe(e,t){let n=G(t,GBe),r=[[`path`,{d:`m15 9-6 6`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`}],[`path`,{d:`m9 9 6 6`}]];ic(e,K({name:`octagon-x`},()=>n,{get iconNode(){return r}}))}var qBe=new Set([`$$slots`,`$$events`,`$$legacy`]);function JBe(e,t){D(t,!0);let n=G(t,qBe);Gu(e,K({get theme(){return nc.current},class:`toaster group`,style:`--normal-bg: var(--color-popover); --normal-text: var(--color-popover-foreground); --normal-border: var(--color-border);`},()=>n,{loadingIcon:e=>{GE(e,{class:`size-4 animate-spin`})},successIcon:e=>{t$(e,{class:`size-4`})},errorIcon:e=>{KBe(e,{class:`size-4`})},infoIcon:e=>{O5(e,{class:`size-4`})},warningIcon:e=>{Ld(e,{class:`size-4`})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}})),O()}var Q9=L(`<!> <!>`,1);function YBe(e,t){D(t,!1),Ea();var n=Q9(),r=N(n);$ee(r,{}),jo(P(r,2),{get client(){return e6},children:(e,t)=>{var n=Q9(),r=N(n);WBe(r,{});var i=P(r,2),a=e=>{JBe(e,{position:`bottom-right`,closeButton:!0})};V(i,e=>{qu.isDesktop||e(a)}),z(e,n)},$$slots:{default:!0}}),z(e,n),O()}var $9=document.getElementById(`app`);if(!$9)throw Error(`Missing #app mount target.`);XBe()&&v({immediate:!0}),Ei(YBe,{target:$9});function XBe(){return`serviceWorker`in navigator&&window.nerveDesktop?.kind!==`electron`}export{i2 as t};
|