zero-workspace 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +187 -0
- package/config/component-versions.json +16 -0
- package/config/scenarioCapabilities.json +29 -0
- package/config/version-notes.yaml +244 -0
- package/dist/adapters/OutputAdapter.d.ts +79 -0
- package/dist/adapters/OutputAdapter.d.ts.map +1 -0
- package/dist/adapters/OutputAdapter.js +124 -0
- package/dist/adapters/OutputAdapter.js.map +1 -0
- package/dist/cli/check-node-version.d.ts +3 -0
- package/dist/cli/check-node-version.d.ts.map +1 -0
- package/dist/cli/check-node-version.js +153 -0
- package/dist/cli/check-node-version.js.map +1 -0
- package/dist/cli/plugins.d.ts +41 -0
- package/dist/cli/plugins.d.ts.map +1 -0
- package/dist/cli/plugins.js +742 -0
- package/dist/cli/plugins.js.map +1 -0
- package/dist/cli/rebuild.d.ts +63 -0
- package/dist/cli/rebuild.d.ts.map +1 -0
- package/dist/cli/rebuild.js +989 -0
- package/dist/cli/rebuild.js.map +1 -0
- package/dist/cli/repair.d.ts +7 -0
- package/dist/cli/repair.d.ts.map +1 -0
- package/dist/cli/repair.js +925 -0
- package/dist/cli/repair.js.map +1 -0
- package/dist/cli/setup.d.ts +7 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +452 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/update.d.ts +10 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +426 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/webui.d.ts +6 -0
- package/dist/cli/webui.d.ts.map +1 -0
- package/dist/cli/webui.js +210 -0
- package/dist/cli/webui.js.map +1 -0
- package/dist/http/index.d.ts +3 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +15 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/middleware/errorHandler.d.ts +16 -0
- package/dist/http/middleware/errorHandler.d.ts.map +1 -0
- package/dist/http/middleware/errorHandler.js +79 -0
- package/dist/http/middleware/errorHandler.js.map +1 -0
- package/dist/http/routes/admin.d.ts +3 -0
- package/dist/http/routes/admin.d.ts.map +1 -0
- package/dist/http/routes/admin.js +730 -0
- package/dist/http/routes/admin.js.map +1 -0
- package/dist/http/routes/backup.d.ts +3 -0
- package/dist/http/routes/backup.d.ts.map +1 -0
- package/dist/http/routes/backup.js +172 -0
- package/dist/http/routes/backup.js.map +1 -0
- package/dist/http/routes/config.d.ts +3 -0
- package/dist/http/routes/config.d.ts.map +1 -0
- package/dist/http/routes/config.js +157 -0
- package/dist/http/routes/config.js.map +1 -0
- package/dist/http/routes/context.d.ts +3 -0
- package/dist/http/routes/context.d.ts.map +1 -0
- package/dist/http/routes/context.js +82 -0
- package/dist/http/routes/context.js.map +1 -0
- package/dist/http/routes/log.d.ts +3 -0
- package/dist/http/routes/log.d.ts.map +1 -0
- package/dist/http/routes/log.js +105 -0
- package/dist/http/routes/log.js.map +1 -0
- package/dist/http/routes/memo.d.ts +6 -0
- package/dist/http/routes/memo.d.ts.map +1 -0
- package/dist/http/routes/memo.js +29 -0
- package/dist/http/routes/memo.js.map +1 -0
- package/dist/http/routes/node.d.ts +3 -0
- package/dist/http/routes/node.d.ts.map +1 -0
- package/dist/http/routes/node.js +251 -0
- package/dist/http/routes/node.js.map +1 -0
- package/dist/http/routes/state.d.ts +3 -0
- package/dist/http/routes/state.d.ts.map +1 -0
- package/dist/http/routes/state.js +48 -0
- package/dist/http/routes/state.js.map +1 -0
- package/dist/http/routes/workspace.d.ts +3 -0
- package/dist/http/routes/workspace.d.ts.map +1 -0
- package/dist/http/routes/workspace.js +249 -0
- package/dist/http/routes/workspace.js.map +1 -0
- package/dist/http/server.d.ts +10 -0
- package/dist/http/server.d.ts.map +1 -0
- package/dist/http/server.js +284 -0
- package/dist/http/server.js.map +1 -0
- package/dist/http/services.d.ts +93 -0
- package/dist/http/services.d.ts.map +1 -0
- package/dist/http/services.js +297 -0
- package/dist/http/services.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1073 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/guidanceContent.d.ts +18 -0
- package/dist/prompts/guidanceContent.d.ts.map +1 -0
- package/dist/prompts/guidanceContent.js +814 -0
- package/dist/prompts/guidanceContent.js.map +1 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +4 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/instructions.d.ts +56 -0
- package/dist/prompts/instructions.d.ts.map +1 -0
- package/dist/prompts/instructions.js +1343 -0
- package/dist/prompts/instructions.js.map +1 -0
- package/dist/services/BackupService.d.ts +104 -0
- package/dist/services/BackupService.d.ts.map +1 -0
- package/dist/services/BackupService.js +549 -0
- package/dist/services/BackupService.js.map +1 -0
- package/dist/services/CapabilityService.d.ts +38 -0
- package/dist/services/CapabilityService.d.ts.map +1 -0
- package/dist/services/CapabilityService.js +256 -0
- package/dist/services/CapabilityService.js.map +1 -0
- package/dist/services/ConfigService.d.ts +35 -0
- package/dist/services/ConfigService.d.ts.map +1 -0
- package/dist/services/ConfigService.js +105 -0
- package/dist/services/ConfigService.js.map +1 -0
- package/dist/services/ContextService.d.ts +65 -0
- package/dist/services/ContextService.d.ts.map +1 -0
- package/dist/services/ContextService.js +503 -0
- package/dist/services/ContextService.js.map +1 -0
- package/dist/services/DetectionService.d.ts +76 -0
- package/dist/services/DetectionService.d.ts.map +1 -0
- package/dist/services/DetectionService.js +262 -0
- package/dist/services/DetectionService.js.map +1 -0
- package/dist/services/DispatchService.d.ts +267 -0
- package/dist/services/DispatchService.d.ts.map +1 -0
- package/dist/services/DispatchService.js +1357 -0
- package/dist/services/DispatchService.js.map +1 -0
- package/dist/services/EventService.d.ts +81 -0
- package/dist/services/EventService.d.ts.map +1 -0
- package/dist/services/EventService.js +187 -0
- package/dist/services/EventService.js.map +1 -0
- package/dist/services/GuidanceService.d.ts +64 -0
- package/dist/services/GuidanceService.d.ts.map +1 -0
- package/dist/services/GuidanceService.js +259 -0
- package/dist/services/GuidanceService.js.map +1 -0
- package/dist/services/HealthService.d.ts +43 -0
- package/dist/services/HealthService.d.ts.map +1 -0
- package/dist/services/HealthService.js +276 -0
- package/dist/services/HealthService.js.map +1 -0
- package/dist/services/InstallationService.d.ts +62 -0
- package/dist/services/InstallationService.d.ts.map +1 -0
- package/dist/services/InstallationService.js +204 -0
- package/dist/services/InstallationService.js.map +1 -0
- package/dist/services/LogService.d.ts +35 -0
- package/dist/services/LogService.d.ts.map +1 -0
- package/dist/services/LogService.js +189 -0
- package/dist/services/LogService.js.map +1 -0
- package/dist/services/MemoService.d.ts +39 -0
- package/dist/services/MemoService.d.ts.map +1 -0
- package/dist/services/MemoService.js +288 -0
- package/dist/services/MemoService.js.map +1 -0
- package/dist/services/NodeService.d.ts +90 -0
- package/dist/services/NodeService.d.ts.map +1 -0
- package/dist/services/NodeService.js +958 -0
- package/dist/services/NodeService.js.map +1 -0
- package/dist/services/OpenSpecParser.d.ts +43 -0
- package/dist/services/OpenSpecParser.d.ts.map +1 -0
- package/dist/services/OpenSpecParser.js +191 -0
- package/dist/services/OpenSpecParser.js.map +1 -0
- package/dist/services/ReferenceService.d.ts +35 -0
- package/dist/services/ReferenceService.d.ts.map +1 -0
- package/dist/services/ReferenceService.js +195 -0
- package/dist/services/ReferenceService.js.map +1 -0
- package/dist/services/RepairService.d.ts +36 -0
- package/dist/services/RepairService.d.ts.map +1 -0
- package/dist/services/RepairService.js +429 -0
- package/dist/services/RepairService.js.map +1 -0
- package/dist/services/SearchService.d.ts +34 -0
- package/dist/services/SearchService.d.ts.map +1 -0
- package/dist/services/SearchService.js +293 -0
- package/dist/services/SearchService.js.map +1 -0
- package/dist/services/SessionService.d.ts +136 -0
- package/dist/services/SessionService.d.ts.map +1 -0
- package/dist/services/SessionService.js +297 -0
- package/dist/services/SessionService.js.map +1 -0
- package/dist/services/StateService.d.ts +97 -0
- package/dist/services/StateService.d.ts.map +1 -0
- package/dist/services/StateService.js +846 -0
- package/dist/services/StateService.js.map +1 -0
- package/dist/services/TutorialService.d.ts +114 -0
- package/dist/services/TutorialService.d.ts.map +1 -0
- package/dist/services/TutorialService.js +1262 -0
- package/dist/services/TutorialService.js.map +1 -0
- package/dist/services/WorkspaceService.d.ts +273 -0
- package/dist/services/WorkspaceService.d.ts.map +1 -0
- package/dist/services/WorkspaceService.js +1764 -0
- package/dist/services/WorkspaceService.js.map +1 -0
- package/dist/services/index.d.ts +15 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +14 -0
- package/dist/services/index.js.map +1 -0
- package/dist/storage/FileSystemAdapter.d.ts +223 -0
- package/dist/storage/FileSystemAdapter.d.ts.map +1 -0
- package/dist/storage/FileSystemAdapter.js +384 -0
- package/dist/storage/FileSystemAdapter.js.map +1 -0
- package/dist/storage/JsonStorage.d.ts +158 -0
- package/dist/storage/JsonStorage.d.ts.map +1 -0
- package/dist/storage/JsonStorage.js +613 -0
- package/dist/storage/JsonStorage.js.map +1 -0
- package/dist/storage/MarkdownStorage.d.ts +178 -0
- package/dist/storage/MarkdownStorage.d.ts.map +1 -0
- package/dist/storage/MarkdownStorage.js +918 -0
- package/dist/storage/MarkdownStorage.js.map +1 -0
- package/dist/storage/SessionBindingStorage.d.ts +69 -0
- package/dist/storage/SessionBindingStorage.d.ts.map +1 -0
- package/dist/storage/SessionBindingStorage.js +131 -0
- package/dist/storage/SessionBindingStorage.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +6 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/tools/capability.d.ts +18 -0
- package/dist/tools/capability.d.ts.map +1 -0
- package/dist/tools/capability.js +73 -0
- package/dist/tools/capability.js.map +1 -0
- package/dist/tools/config.d.ts +14 -0
- package/dist/tools/config.d.ts.map +1 -0
- package/dist/tools/config.js +61 -0
- package/dist/tools/config.js.map +1 -0
- package/dist/tools/context.d.ts +22 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +139 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/dispatch.d.ts +41 -0
- package/dist/tools/dispatch.d.ts.map +1 -0
- package/dist/tools/dispatch.js +380 -0
- package/dist/tools/dispatch.js.map +1 -0
- package/dist/tools/help.d.ts +44 -0
- package/dist/tools/help.d.ts.map +1 -0
- package/dist/tools/help.js +227 -0
- package/dist/tools/help.js.map +1 -0
- package/dist/tools/import.d.ts +17 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +96 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +13 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/log.d.ts +21 -0
- package/dist/tools/log.d.ts.map +1 -0
- package/dist/tools/log.js +93 -0
- package/dist/tools/log.js.map +1 -0
- package/dist/tools/memo.d.ts +26 -0
- package/dist/tools/memo.d.ts.map +1 -0
- package/dist/tools/memo.js +188 -0
- package/dist/tools/memo.js.map +1 -0
- package/dist/tools/node.d.ts +34 -0
- package/dist/tools/node.d.ts.map +1 -0
- package/dist/tools/node.js +328 -0
- package/dist/tools/node.js.map +1 -0
- package/dist/tools/search.d.ts +14 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +95 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/session.d.ts +22 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +127 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/state.d.ts +10 -0
- package/dist/tools/state.d.ts.map +1 -0
- package/dist/tools/state.js +79 -0
- package/dist/tools/state.js.map +1 -0
- package/dist/tools/workspace.d.ts +38 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +240 -0
- package/dist/tools/workspace.js.map +1 -0
- package/dist/types/capability.d.ts +36 -0
- package/dist/types/capability.d.ts.map +1 -0
- package/dist/types/capability.js +3 -0
- package/dist/types/capability.js.map +1 -0
- package/dist/types/confirmation.d.ts +35 -0
- package/dist/types/confirmation.d.ts.map +1 -0
- package/dist/types/confirmation.js +3 -0
- package/dist/types/confirmation.js.map +1 -0
- package/dist/types/context.d.ts +174 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/context.js +3 -0
- package/dist/types/context.js.map +1 -0
- package/dist/types/errors.d.ts +81 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +154 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/guidance.d.ts +162 -0
- package/dist/types/guidance.d.ts.map +1 -0
- package/dist/types/guidance.js +4 -0
- package/dist/types/guidance.js.map +1 -0
- package/dist/types/health.d.ts +61 -0
- package/dist/types/health.d.ts.map +1 -0
- package/dist/types/health.js +3 -0
- package/dist/types/health.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/memo.d.ts +132 -0
- package/dist/types/memo.d.ts.map +1 -0
- package/dist/types/memo.js +3 -0
- package/dist/types/memo.js.map +1 -0
- package/dist/types/node.d.ts +316 -0
- package/dist/types/node.d.ts.map +1 -0
- package/dist/types/node.js +3 -0
- package/dist/types/node.js.map +1 -0
- package/dist/types/repair.d.ts +62 -0
- package/dist/types/repair.d.ts.map +1 -0
- package/dist/types/repair.js +4 -0
- package/dist/types/repair.js.map +1 -0
- package/dist/types/search.d.ts +58 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/search.js +3 -0
- package/dist/types/search.js.map +1 -0
- package/dist/types/settings.d.ts +109 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +30 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/workspace.d.ts +357 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/types/workspace.js +3 -0
- package/dist/types/workspace.js.map +1 -0
- package/dist/utils/contentValidation.d.ts +47 -0
- package/dist/utils/contentValidation.d.ts.map +1 -0
- package/dist/utils/contentValidation.js +93 -0
- package/dist/utils/contentValidation.js.map +1 -0
- package/dist/utils/devLog.d.ts +43 -0
- package/dist/utils/devLog.d.ts.map +1 -0
- package/dist/utils/devLog.js +94 -0
- package/dist/utils/devLog.js.map +1 -0
- package/dist/utils/errorLogger.d.ts +27 -0
- package/dist/utils/errorLogger.d.ts.map +1 -0
- package/dist/utils/errorLogger.js +105 -0
- package/dist/utils/errorLogger.js.map +1 -0
- package/dist/utils/git.d.ts +123 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +400 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/hash.d.ts +32 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +37 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/id.d.ts +54 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +96 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +42 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +228 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/manualChangeFormatter.d.ts +8 -0
- package/dist/utils/manualChangeFormatter.d.ts.map +1 -0
- package/dist/utils/manualChangeFormatter.js +21 -0
- package/dist/utils/manualChangeFormatter.js.map +1 -0
- package/dist/utils/paramValidator.d.ts +35 -0
- package/dist/utils/paramValidator.d.ts.map +1 -0
- package/dist/utils/paramValidator.js +214 -0
- package/dist/utils/paramValidator.js.map +1 -0
- package/dist/utils/port.d.ts +7 -0
- package/dist/utils/port.d.ts.map +1 -0
- package/dist/utils/port.js +28 -0
- package/dist/utils/port.js.map +1 -0
- package/dist/utils/processManager.d.ts +53 -0
- package/dist/utils/processManager.d.ts.map +1 -0
- package/dist/utils/processManager.js +267 -0
- package/dist/utils/processManager.js.map +1 -0
- package/dist/utils/sessionLogger.d.ts +28 -0
- package/dist/utils/sessionLogger.d.ts.map +1 -0
- package/dist/utils/sessionLogger.js +142 -0
- package/dist/utils/sessionLogger.js.map +1 -0
- package/dist/utils/time.d.ts +15 -0
- package/dist/utils/time.d.ts.map +1 -0
- package/dist/utils/time.js +32 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/validation.d.ts +23 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +88 -0
- package/dist/utils/validation.js.map +1 -0
- package/docs//346/227/245/345/277/227/347/263/273/347/273/237.md +389 -0
- package/docs//347/224/250/346/210/267/346/211/213/345/206/214.md +1446 -0
- package/docs//347/224/250/346/210/267/346/211/213/345/206/214/344/270/216/346/212/200/346/234/257/346/214/207/345/215/227.md +873 -0
- package/package.json +94 -0
- package/plugin/README.md +141 -0
- package/plugin/agents/zero-executor.md +114 -0
- package/plugin/agents/zero-reviewer.md +133 -0
- package/plugin/docs/diagnostic-guide.md +128 -0
- package/plugin/hooks/hooks.json.deprecated +70 -0
- package/plugin/scripts/cursor-hook-entry.cjs +217 -0
- package/plugin/scripts/hook-entry.cjs +663 -0
- package/plugin/scripts/openspec-import.cjs +714 -0
- package/plugin/scripts/shared/binding.cjs +98 -0
- package/plugin/scripts/shared/config.cjs +65 -0
- package/plugin/scripts/shared/context.cjs +120 -0
- package/plugin/scripts/shared/index.cjs +34 -0
- package/plugin/scripts/shared/logger.cjs +196 -0
- package/plugin/scripts/shared/reminder.cjs +261 -0
- package/plugin/scripts/shared/utils.cjs +62 -0
- package/plugin/scripts/shared/workspace.cjs +322 -0
- package/plugin/skills/aligning-intent/SKILL.md +275 -0
- package/plugin/skills/analyzing-measurements/SKILL.md +223 -0
- package/plugin/skills/bootstrapping-workspace/SKILL.md +260 -0
- package/plugin/skills/designing-solutions/SKILL.md +363 -0
- package/plugin/skills/diagnosing-issues/SKILL.md +219 -0
- package/plugin/skills/discovering-context/SKILL.md +283 -0
- package/plugin/skills/dispatching-parent/SKILL.md +399 -0
- package/plugin/skills/executing-task/SKILL.md +340 -0
- package/plugin/skills/memo-create/SKILL.md +222 -0
- package/plugin/skills/planning-verification/SKILL.md +245 -0
- package/plugin/skills/preparing-dispatch/SKILL.md +299 -0
- package/plugin/skills/researching-tech/SKILL.md +223 -0
- package/plugin/skills/reviewing-quality/SKILL.md +354 -0
- package/plugin/skills/reviewing-spec/SKILL.md +333 -0
- package/plugin/skills/starting-info-flow/SKILL.md +196 -0
- package/web/README.md +5 -0
- package/web/dist/assets/DocsView-Bls_Vjsr.css +1 -0
- package/web/dist/assets/DocsView-Cxc0B63r.js +1447 -0
- package/web/dist/assets/HomeView-C7df9thb.js +9 -0
- package/web/dist/assets/HomeView-ufUdnfHk.css +1 -0
- package/web/dist/assets/MarkdownContent-DXp6CtSP.js +308 -0
- package/web/dist/assets/MarkdownContent-NFqiOBLH.css +1 -0
- package/web/dist/assets/NotFoundView-BYX1oZAn.css +1 -0
- package/web/dist/assets/NotFoundView-zrc0lT9q.js +1 -0
- package/web/dist/assets/WorkspaceView-BckqgNcX.js +27 -0
- package/web/dist/assets/WorkspaceView-J1dgpYMx.css +1 -0
- package/web/dist/assets/WsConfirmDialog-C1CvL4my.css +1 -0
- package/web/dist/assets/WsConfirmDialog-gLEP7uBD.js +4 -0
- package/web/dist/assets/arc-DPkKTkUT.js +1 -0
- package/web/dist/assets/architectureDiagram-VXUJARFQ-CEGpqUlZ.js +36 -0
- package/web/dist/assets/blockDiagram-VD42YOAC-Bv-mqdQH.js +122 -0
- package/web/dist/assets/c4Diagram-YG6GDRKO-DRyPatZ_.js +10 -0
- package/web/dist/assets/channel-B84mKLDZ.js +1 -0
- package/web/dist/assets/chunk-4BX2VUAB-c7DivX0u.js +1 -0
- package/web/dist/assets/chunk-55IACEB6-CGKTaLlo.js +1 -0
- package/web/dist/assets/chunk-B4BG7PRW-Czhx5Q_P.js +165 -0
- package/web/dist/assets/chunk-DI55MBZ5-CQVA7hcZ.js +220 -0
- package/web/dist/assets/chunk-FMBD7UC4-hEiPmi7V.js +15 -0
- package/web/dist/assets/chunk-QN33PNHL-rL6yYI-E.js +1 -0
- package/web/dist/assets/chunk-QZHKN3VN-BRyHBBzq.js +1 -0
- package/web/dist/assets/chunk-TZMSLE5B-D4PXmTz9.js +1 -0
- package/web/dist/assets/classDiagram-2ON5EDUG-CNn53ohi.js +1 -0
- package/web/dist/assets/classDiagram-v2-WZHVMYZB-CNn53ohi.js +1 -0
- package/web/dist/assets/cose-bilkent-S5V4N54A-BAREnRga.js +1 -0
- package/web/dist/assets/cytoscape.esm-BnkdMOzK.js +321 -0
- package/web/dist/assets/dagre-6UL2VRFP-DaYzb3MT.js +4 -0
- package/web/dist/assets/defaultLocale-C4B-KCzX.js +1 -0
- package/web/dist/assets/diagram-PSM6KHXK-BFltDqvd.js +24 -0
- package/web/dist/assets/diagram-QEK2KX5R-CR4VU2La.js +43 -0
- package/web/dist/assets/diagram-S2PKOQOG-0UfIeT-1.js +24 -0
- package/web/dist/assets/erDiagram-Q2GNP2WA-Bo17Xmng.js +60 -0
- package/web/dist/assets/flowDiagram-NV44I4VS-CzqhQp8s.js +162 -0
- package/web/dist/assets/ganttDiagram-JELNMOA3-TXwXtUcq.js +267 -0
- package/web/dist/assets/gitGraphDiagram-NY62KEGX-CoFQTy9O.js +65 -0
- package/web/dist/assets/graph-CIQcRIVd.js +1 -0
- package/web/dist/assets/index-BgLd_o_M.css +1 -0
- package/web/dist/assets/index-Cd_J3fZn.js +30 -0
- package/web/dist/assets/infoDiagram-WHAUD3N6-Dq0xXfVu.js +2 -0
- package/web/dist/assets/init-Gi6I4Gst.js +1 -0
- package/web/dist/assets/journeyDiagram-XKPGCS4Q-jIg5BOfC.js +139 -0
- package/web/dist/assets/kanban-definition-3W4ZIXB7-D2giu6aZ.js +89 -0
- package/web/dist/assets/katex-XbL3y5x-.js +261 -0
- package/web/dist/assets/layout-Bm-XCM-8.js +1 -0
- package/web/dist/assets/linear-FbekP9OZ.js +1 -0
- package/web/dist/assets/min-BrRCpYmF.js +1 -0
- package/web/dist/assets/mindmap-definition-VGOIOE7T-o-4ubbY9.js +68 -0
- package/web/dist/assets/noto-emoji-0-400-normal-BTQbhB77.woff +0 -0
- package/web/dist/assets/noto-emoji-0-400-normal-DHdy6Uhy.woff2 +0 -0
- package/web/dist/assets/noto-emoji-1-400-normal-0IvkdXBB.woff +0 -0
- package/web/dist/assets/noto-emoji-1-400-normal-BY9OovbM.woff2 +0 -0
- package/web/dist/assets/noto-emoji-10-400-normal-D9w4QCof.woff2 +0 -0
- package/web/dist/assets/noto-emoji-10-400-normal-DtCumcZR.woff +0 -0
- package/web/dist/assets/noto-emoji-11-400-normal-BboTlyvx.woff +0 -0
- package/web/dist/assets/noto-emoji-12-400-normal-BB5pgBKj.woff2 +0 -0
- package/web/dist/assets/noto-emoji-12-400-normal-g186qhiA.woff +0 -0
- package/web/dist/assets/noto-emoji-2-400-normal-BKCR1azW.woff2 +0 -0
- package/web/dist/assets/noto-emoji-2-400-normal-BYH0KhDr.woff +0 -0
- package/web/dist/assets/noto-emoji-3-400-normal-CnPTUeEK.woff +0 -0
- package/web/dist/assets/noto-emoji-3-400-normal-TrTb2VQM.woff2 +0 -0
- package/web/dist/assets/noto-emoji-4-400-normal-BxD0KVdj.woff +0 -0
- package/web/dist/assets/noto-emoji-4-400-normal-s_n9EyG1.woff2 +0 -0
- package/web/dist/assets/noto-emoji-5-400-normal-C190AIxR.woff +0 -0
- package/web/dist/assets/noto-emoji-5-400-normal-Ctfx4xc6.woff2 +0 -0
- package/web/dist/assets/noto-emoji-6-400-normal-DlXlXWt7.woff +0 -0
- package/web/dist/assets/noto-emoji-6-400-normal-NzsjD754.woff2 +0 -0
- package/web/dist/assets/noto-emoji-7-400-normal-BHP8KeA6.woff2 +0 -0
- package/web/dist/assets/noto-emoji-7-400-normal-CtuKhtAZ.woff +0 -0
- package/web/dist/assets/noto-emoji-8-400-normal-DR49ZFe7.woff +0 -0
- package/web/dist/assets/noto-emoji-8-400-normal-Dvmkf6b2.woff2 +0 -0
- package/web/dist/assets/noto-emoji-9-400-normal-BeHJQ2iK.woff2 +0 -0
- package/web/dist/assets/noto-emoji-9-400-normal-BlXmCgeQ.woff +0 -0
- package/web/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/web/dist/assets/pieDiagram-ADFJNKIX-C45wSpld.js +30 -0
- package/web/dist/assets/quadrantDiagram-AYHSOK5B-tv-_fe-W.js +7 -0
- package/web/dist/assets/reduce-CoLNNlNb.js +1 -0
- package/web/dist/assets/requirementDiagram-UZGBJVZJ-Dn6PDfkL.js +64 -0
- package/web/dist/assets/sankeyDiagram-TZEHDZUN-CbXTZAsG.js +10 -0
- package/web/dist/assets/sequenceDiagram-WL72ISMW-B-o1CUJ5.js +145 -0
- package/web/dist/assets/stateDiagram-FKZM4ZOC-hzrupXQi.js +1 -0
- package/web/dist/assets/stateDiagram-v2-4FDKWEC3-DN-c2M96.js +1 -0
- package/web/dist/assets/timeline-definition-IT6M3QCI-R5SP9GDo.js +61 -0
- package/web/dist/assets/treemap-KMMF4GRG-Pg9KlUOt.js +128 -0
- package/web/dist/assets/xychartDiagram-PRI3JC2R-C3vbJhd1.js +7 -0
- package/web/dist/favicon.svg +13 -0
- package/web/dist/index.html +17 -0
- package//351/205/215/347/275/256/346/226/271/345/274/217.md +330 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{G as Le,H as Ni,r as Y,j as G,d as pe,e as D,v as Ce,F as Ne,q as Te,f as h,o as $,_ as ze,s as le,I as ue,ao as Ve,w as q,L as Me,t as B,ap as $i,$ as We,aq as js,ar as yo,J as Re,O as Se,as as Ci,at as zt,au as Mi,K as Ee,av as Js,p as Ii,M as xe,aw as Ie,l as Xe,ax as Qs,ay as Bt,az as gn,aA as ea,n as Ge,aB as Di,aC as ta,aD as ct,aE as _o,aF as na,aG as oa,aH as It,aI as $e,aJ as be,aK as ia,aL as Ti,aM as sa,aN as mn,aO as aa,N as la,T as Pi,a0 as Ut,a3 as ra,P as Ai,a1 as nn,a2 as Xt,aP as Po,a4 as ua,aQ as ca,a6 as da,g as fa,h as ha,aR as Ao}from"./index-Cd_J3fZn.js";import{u as ht,W as Be,b as Oi,w as zi,g as va,a as Oo}from"./WsConfirmDialog-gLEP7uBD.js";import{aC as Nt}from"./MarkdownContent-DXp6CtSP.js";const St={create(e,t){return Le.post(`/workspaces/${e}/nodes`,t)},list(e,t,n){return Le.get(`/workspaces/${e}/nodes`,{params:{rootId:t,depth:n}})},get(e,t){return Le.get(`/workspaces/${e}/nodes/${t}`)},update(e,t,n){return Le.patch(`/workspaces/${e}/nodes/${t}`,n)},delete(e,t){return Le.delete(`/workspaces/${e}/nodes/${t}`)},transition(e,t,n){return Le.post(`/workspaces/${e}/nodes/${t}/transition`,n)}},zo={get(e,t,n){return Le.get(`/workspaces/${e}/nodes/${t}/context`,{params:n})},focus(e,t){return Le.post(`/workspaces/${e}/focus`,{nodeId:t})},isolate(e,t,n){return Le.patch(`/workspaces/${e}/nodes/${t}/isolate`,{isolate:n})},reference(e,t,n){return Le.post(`/workspaces/${e}/nodes/${t}/references`,n)}},Wn={list(e,t){return Le.get(`/workspaces/${e}/memos`,{params:{tags:t}})},async get(e,t){return(await Le.get(`/workspaces/${e}/memos/${t}`)).memo},delete(e,t){return Le.delete(`/workspaces/${e}/memos/${t}`)}},Bi=Ni("node",()=>{const e=Y(null),t=Y(null),n=Y(null),o=Y(null),i=Y(!1),s=Y(null),a=ht();async function l(){const m=a.currentWorkspace?.id;if(m){i.value=!0,s.value=null;try{const w=await St.list(m);e.value=w.tree}catch(w){throw s.value=w instanceof Error?w.message:"获取节点树失败",w}finally{i.value=!1}}}async function r(m){const w=a.currentWorkspace?.id;if(w){t.value=m,i.value=!0,s.value=null;try{const[g,v]=await Promise.all([St.get(w,m),zo.get(w,m)]);n.value=g.meta,o.value=v}catch(g){throw s.value=g instanceof Error?g.message:"获取节点详情失败",g}finally{i.value=!1}}}async function u(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{const g=await St.create(w,m);return await l(),g}catch(g){throw s.value=g instanceof Error?g.message:"创建节点失败",g}finally{i.value=!1}}async function c(m){const w=a.currentWorkspace?.id,g=t.value;if(!w||!g)throw new Error("未选择节点");i.value=!0,s.value=null;try{await St.update(w,g,m),await l(),await r(g)}catch(v){throw s.value=v instanceof Error?v.message:"更新节点失败",v}finally{i.value=!1}}async function f(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{await St.delete(w,m),await l(),t.value===m&&(t.value=null,n.value=null,o.value=null)}catch(g){throw s.value=g instanceof Error?g.message:"删除节点失败",g}finally{i.value=!1}}async function d(m,w,g){const v=a.currentWorkspace?.id,C=t.value;if(!v||!C)throw new Error("未选择节点");i.value=!0,s.value=null;try{const O=await St.transition(v,C,{action:m,reason:w,conclusion:g});return await l(),await r(C),O}catch(O){throw s.value=O instanceof Error?O.message:"状态转换失败",O}finally{i.value=!1}}async function _(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{await zo.focus(w,m),await a.fetchWorkspace(w)}catch(g){throw s.value=g instanceof Error?g.message:"设置焦点失败",g}finally{i.value=!1}}function k(){t.value=null,n.value=null,o.value=null}function p(){e.value=null,k()}return{nodeTree:e,selectedNodeId:t,selectedNodeMeta:n,nodeContext:o,loading:i,error:s,fetchNodeTree:l,selectNode:r,createNode:u,updateNode:c,deleteNode:f,transition:d,setFocus:_,clearSelection:k,clearAll:p}}),wo=Ni("memo",()=>{const e=Y([]),t=Y([]),n=Y(null),o=Y(!1),i=Y(null),s=G(()=>e.value.length);async function a(c,f){o.value=!0,i.value=null;try{const d=await Wn.list(c,f);e.value=d.memos,t.value=d.allTags}catch(d){throw i.value=d instanceof Error?d.message:"获取 memo 列表失败",d}finally{o.value=!1}}async function l(c,f){o.value=!0,i.value=null;try{const d=await Wn.get(c,f);return n.value=d,d}catch(d){throw i.value=d instanceof Error?d.message:"获取 memo 失败",d}finally{o.value=!1}}function r(){e.value=[],t.value=[],n.value=null,i.value=null}async function u(c,f){o.value=!0,i.value=null;try{await Wn.delete(c,f),e.value=e.value.filter(d=>d.id!==f),n.value?.id===f&&(n.value=null)}catch(d){throw i.value=d instanceof Error?d.message:"删除 memo 失败",d}finally{o.value=!1}}return{memos:e,allTags:t,currentMemo:n,loading:o,error:i,memoCount:s,fetchMemos:a,fetchMemo:l,clearMemos:r,deleteMemo:u}}),pa={key:1,class:"node-plan-wrapper"},ga=pe({__name:"NodeIcon",props:{type:{},status:{},isMemo:{type:Boolean},contentLength:{},memoCount:{}},setup(e){const t=e,n=G(()=>t.type==="planning"),o=G(()=>t.memoCount!==void 0?t.memoCount<=3?1:t.memoCount<=8?2:3:!t.contentLength||t.contentLength<500?1:t.contentLength<=1e3?2:3);return(i,s)=>e.isMemo?($(),D("div",{key:0,class:Ce(["node-memo","lines-"+o.value])},[($(!0),D(Ne,null,Te(o.value,a=>($(),D("span",{class:"memo-line",key:a}))),128))],2)):n.value?($(),D("div",pa,[h("div",{class:Ce(["node-plan",e.status])},null,2)])):($(),D("div",{key:2,class:Ce(["node-exec",e.status])},null,2))}}),Qe=ze(ga,[["__scopeId","data-v-0a165cd6"]]),ma={key:0,class:"focus-wrapper"},ya={key:1,class:"focus-wrapper-diamond"},_a={class:"node-plan-wrapper"},wa=pe({__name:"FocusCrosshair",props:{type:{},status:{}},setup(e){return(t,n)=>e.type==="execution"?($(),D("div",ma,[le(Qe,{type:e.type,status:e.status},null,8,["type","status"]),n[0]||(n[0]=h("div",{class:"focus-crosshair"},[h("span")],-1))])):($(),D("div",ya,[h("div",_a,[le(Qe,{type:e.type,status:e.status},null,8,["type","status"])]),n[1]||(n[1]=h("div",{class:"focus-diamond"},[h("span")],-1))]))}}),Vi=ze(wa,[["__scopeId","data-v-e0c1e480"]]),ba={pending:{icon:"CircleClose",color:"#909399",label:"待执行",emoji:"⚪"},completed:{icon:"CircleCheck",color:"#67C23A",label:"已完成",emoji:"✅"},implementing:{icon:"Loading",color:"#409EFF",label:"执行中",emoji:"🔵"},validating:{icon:"Clock",color:"#E6A23C",label:"验证中",emoji:"🟡"},failed:{icon:"CircleCloseFilled",color:"#F56C6C",label:"失败",emoji:"❌"},planning:{icon:"Edit",color:"#9B59B6",label:"规划中",emoji:"◇"},monitoring:{icon:"View",color:"#3498DB",label:"监控中",emoji:"◈"},cancelled:{icon:"Remove",color:"#95A5A6",label:"已取消",emoji:"⊘"}},Ri={info_collection:{label:"INFO",color:"#E6A23C",textColor:"#000",description:"收集项目信息,完成时自动归档规则和文档到工作区"},info_summary:{label:"SUMM",color:"#909399",textColor:"#fff",description:"信息总结,从已有信息中提取结构化内容"},validation:{label:"VALID",color:"#67C23A",textColor:"#fff",description:"验证类任务(预留)"}},xa={pending:{label:"待派发",color:"#909399",bgColor:"#f4f4f5",description:"等待派发执行"},executing:{label:"执行中",color:"#409EFF",bgColor:"#ecf5ff",description:"Subagent 正在执行"},testing:{label:"测试中",color:"#E6A23C",bgColor:"#fdf6ec",description:"测试节点验证中"},passed:{label:"已通过",color:"#67C23A",bgColor:"#f0f9eb",description:"测试通过"},failed:{label:"已失败",color:"#F56C6C",bgColor:"#fef0f0",description:"执行或测试失败"}},Sa=pe({__name:"RoleBadge",props:{role:{}},setup(e){const t=e,n=G(()=>t.role?Ri[t.role]:null);return(o,i)=>n.value?($(),D("span",{key:0,class:"role-badge",style:Ve({background:n.value.color,color:n.value.textColor})},q(n.value.label),5)):ue("",!0)}}),Hi=ze(Sa,[["__scopeId","data-v-c567ac5e"]]),Ea=pe({__name:"DispatchBadge",props:{status:{}},setup(e){function t(n){switch(n){case"pending":return"WAIT";case"executing":return"RUN";case"testing":return"TEST";case"passed":return"PASS";case"failed":return"FAIL";default:return""}}return(n,o)=>($(),D("span",{class:Ce(["dispatch-badge",e.status])},q(t(e.status)),3))}}),bo=ze(Ea,[["__scopeId","data-v-0ef054ee"]]),ka={key:0,class:"depth-dots"},Na=["title"],$a={class:"node-title"},Ca=pe({__name:"TreeNodeItem",props:{node:{},isFocused:{type:Boolean},isSelected:{type:Boolean},isActivePath:{type:Boolean},depth:{},hasChildren:{type:Boolean},isExpanded:{type:Boolean}},emits:["click","toggleExpand"],setup(e,{emit:t}){const n=e,o=t,i=G(()=>n.node.id.startsWith("memo-")||n.node.id==="__memo_drawer__"),s=n.depth?n.hasChildren?n.depth-1:n.depth:0;function a(){o("click",n.node)}function l(r){r.stopPropagation(),o("toggleExpand")}return(r,u)=>($(),D("div",{class:Ce(["tree-node-item",{selected:e.isSelected,"active-path":e.isActivePath,"is-memo":i.value}]),onClick:a},[B(s)>0?($(),D("span",ka,[($(!0),D(Ne,null,Te(B(s),c=>($(),D("span",{key:c,class:"dot"}))),128))])):ue("",!0),e.hasChildren?($(),D("button",{key:1,class:Ce(["expand-btn",{expanded:e.isExpanded}]),onClick:l,title:e.isExpanded?"收起":"展开"},[...u[0]||(u[0]=[h("span",{class:"expand-icon"},"▶",-1)])],10,Na)):ue("",!0),e.isFocused&&!i.value?($(),Me(Vi,{key:2,type:e.node.type,status:e.node.status},null,8,["type","status"])):($(),Me(Qe,{key:3,type:e.node.type,status:e.node.status,"is-memo":i.value,"content-length":e.node.contentLength,"memo-count":e.node.memoCount},null,8,["type","status","is-memo","content-length","memo-count"])),h("span",$a,q(e.node.title),1),le(Hi,{role:e.node.role},null,8,["role"]),e.node.dispatch?($(),Me(bo,{key:4,status:e.node.dispatch.status},null,8,["status"])):ue("",!0)],2))}}),Li=ze(Ca,[["__scopeId","data-v-13ec9572"]]),Ma={key:0,class:"tree-children"},Ia=pe({__name:"TreeChildren",props:{children:{},selectedId:{},focusId:{},activePathIds:{},depth:{}},emits:["select"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=$i({}),a=Y([]);function l(p){return s[p]!==!1}function r(p){s[p]=!l(p)}function u(p){o.children.forEach(m=>{s[m.id]=p}),a.value.forEach(m=>{m?.setAllExpanded(p)})}t({setAllExpanded:u});function c(p){i("select",p)}function f(p){return o.focusId===p}function d(p){return o.selectedId===p}function _(p){return o.activePathIds.has(p)}function k(p){return!!(p.children&&p.children.length>0)}return(p,m)=>{const w=yo("TreeChildren",!0);return $(!0),D(Ne,null,Te(e.children,g=>($(),D("div",{key:g.id,class:"tree-node-wrapper"},[le(Li,{node:g,"is-focused":f(g.id),"is-selected":d(g.id),"is-active-path":_(g.id),depth:e.depth,"has-children":k(g),"is-expanded":l(g.id),onClick:v=>c(g),onToggleExpand:v=>r(g.id)},null,8,["node","is-focused","is-selected","is-active-path","depth","has-children","is-expanded","onClick","onToggleExpand"]),k(g)?We(($(),D("div",Ma,[le(w,{ref_for:!0,ref:v=>{v&&(a.value[e.children.indexOf(g)]=v)},children:g.children,"selected-id":e.selectedId,"focus-id":e.focusId,"active-path-ids":e.activePathIds,depth:e.depth+1,onSelect:c},null,8,["children","selected-id","focus-id","active-path-ids","depth"])],512)),[[js,l(g.id)]]):ue("",!0)]))),128)}}}),Da=ze(Ia,[["__scopeId","data-v-899ad2a2"]]),Ta={class:"empty-state"},Pa={class:"empty-icon"},Aa={class:"empty-title"},Oa={key:0,class:"empty-description"},za={key:1,class:"empty-action"},Ba=pe({__name:"WsEmpty",props:{title:{default:""},description:{default:""}},setup(e){return(t,n)=>($(),D("div",Ta,[h("div",Pa,[Re(t.$slots,"icon",{},()=>[n[0]||(n[0]=h("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none"},[h("rect",{x:"12",y:"12",width:"40",height:"40",rx:"4",stroke:"currentColor","stroke-width":"2"}),h("path",{d:"M20 28L28 36L44 20",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.3"})],-1))],!0)]),h("div",Aa,[Re(t.$slots,"title",{},()=>[Se(q(e.title||"暂无数据"),1)],!0)]),e.description||t.$slots.description?($(),D("div",Oa,[Re(t.$slots,"description",{},()=>[Se(q(e.description),1)],!0)])):ue("",!0),t.$slots.action?($(),D("div",za,[Re(t.$slots,"action",{},void 0,!0)])):ue("",!0)]))}}),Va=ze(Ba,[["__scopeId","data-v-841069d4"]]),Ra={class:"node-tree"},Ha={key:0,class:"tree-container"},La={key:0,class:"tree-children"},Fa=pe({__name:"NodeTree",props:{tree:{},selectedId:{},focusId:{},memos:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,i=Y(null),s=Y(!0),a=G(()=>{if(!n.memos||n.memos.length===0)return null;const k=n.memos.map(p=>({id:p.id,type:"execution",title:p.title,status:"pending",contentLength:p.contentLength,children:[]}));return{id:"__memo_drawer__",type:"planning",title:`草稿 (${n.memos.length})`,status:"pending",memoCount:n.memos.length,children:k}}),l=G(()=>{const k=n.tree?.children||[];return a.value?[...k,a.value]:k}),r=G(()=>{const k=new Set;if(!n.selectedId||!n.tree)return k;function p(m,w,g){if(g.push(m.id),m.id===w)return g.forEach(v=>k.add(v)),!0;if(m.children&&m.children.length>0){for(const v of m.children)if(p(v,w,[...g]))return!0}return!1}return p(n.tree,n.selectedId,[]),k.size===0&&a.value&&(n.selectedId==="__memo_drawer__"||n.selectedId.startsWith("memo-"))&&(k.add("__memo_drawer__"),n.selectedId!=="__memo_drawer__"&&k.add(n.selectedId)),k});function u(k){o("select",k.id)}function c(k){return n.focusId===k}function f(k){return n.selectedId===k}function d(k){return r.value.has(k)}function _(){s.value=!s.value,i.value?.setAllExpanded(s.value)}return(k,p)=>($(),D("div",Ra,[e.tree?($(),D("div",Ha,[le(Li,{node:e.tree,"is-focused":c(e.tree.id),"is-selected":f(e.tree.id),"is-active-path":d(e.tree.id),depth:0,onClick:p[0]||(p[0]=m=>u(e.tree)),onDblclick:_},null,8,["node","is-focused","is-selected","is-active-path"]),l.value.length>0?($(),D("div",La,[le(Da,{ref_key:"treeChildrenRef",ref:i,children:l.value,"selected-id":e.selectedId,"focus-id":e.focusId,"active-path-ids":r.value,depth:1,onSelect:u},null,8,["children","selected-id","focus-id","active-path-ids"])])):ue("",!0)])):($(),Me(Va,{key:1,description:"暂无节点"}))]))}}),Ga=ze(Fa,[["__scopeId","data-v-0f71ff3f"]]);function Zt(e){return Ci()?(gn(e),!0):!1}function ot(e){return typeof e=="function"?e():B(e)}const Wa=typeof window<"u"&&typeof document<"u",Ya=e=>typeof e<"u",Ua=Object.prototype.toString,Xa=e=>Ua.call(e)==="[object Object]",Za=()=>{};function Ka(e,t){function n(...o){return new Promise((i,s)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(s)})}return n}const Fi=e=>e();function qa(e=Fi){const t=Y(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...s)=>{t.value&&e(...s)};return{isActive:aa(t),pause:n,resume:o,eventFilter:i}}function Bo(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function ja(e,t,n={}){const{eventFilter:o=Fi,...i}=n;return Ee(e,Ka(o,t),i)}function Et(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:s,pause:a,resume:l,isActive:r}=qa(o);return{stop:ja(e,t,{...i,eventFilter:s}),pause:a,resume:l,isActive:r}}function Ja(e,t={}){if(!_o(e))return na(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=oa(()=>({get(){return e.value[o]},set(i){var s;if((s=ot(t.replaceRef))!=null?s:!0)if(Array.isArray(e.value)){const l=[...e.value];l[o]=i,e.value=l}else{const l={...e.value,[o]:i};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[o]=i}}));return n}function no(e,t=!1){function n(f,{flush:d="sync",deep:_=!1,timeout:k,throwOnTimeout:p}={}){let m=null;const g=[new Promise(v=>{m=Ee(e,C=>{f(C)!==t&&(m?.(),v(C))},{flush:d,deep:_,immediate:!0})})];return k!=null&&g.push(Bo(k,p).then(()=>ot(e)).finally(()=>m?.())),Promise.race(g)}function o(f,d){if(!_o(f))return n(C=>C===f,d);const{flush:_="sync",deep:k=!1,timeout:p,throwOnTimeout:m}=d??{};let w=null;const v=[new Promise(C=>{w=Ee([e,f],([O,F])=>{t!==(O===F)&&(w?.(),C(O))},{flush:_,deep:k,immediate:!0})})];return p!=null&&v.push(Bo(p,m).then(()=>ot(e)).finally(()=>(w?.(),ot(e)))),Promise.race(v)}function i(f){return n(d=>!!d,f)}function s(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function r(f,d){return n(_=>{const k=Array.from(_);return k.includes(f)||k.includes(ot(f))},d)}function u(f){return c(1,f)}function c(f=1,d){let _=-1;return n(()=>(_+=1,_>=f),d)}return Array.isArray(ot(e))?{toMatch:n,toContains:r,changed:u,changedTimes:c,get not(){return no(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:s,toBeNaN:l,toBeUndefined:a,changed:u,changedTimes:c,get not(){return no(e,!t)}}}function oo(e){return no(e)}function Qa(e){var t;const n=ot(e);return(t=n?.$el)!=null?t:n}const Gi=Wa?window:void 0;function Wi(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=Gi):[t,n,o,i]=e,!t)return Za;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const s=[],a=()=>{s.forEach(c=>c()),s.length=0},l=(c,f,d,_)=>(c.addEventListener(f,d,_),()=>c.removeEventListener(f,d,_)),r=Ee(()=>[Qa(t),ot(i)],([c,f])=>{if(a(),!c)return;const d=Xa(f)?{...f}:f;s.push(...n.flatMap(_=>o.map(k=>l(c,_,k,d))))},{immediate:!0,flush:"post"}),u=()=>{r(),a()};return Zt(u),u}function el(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Vo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=Gi,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=o,r=el(t);return Wi(i,s,c=>{c.repeat&&ot(l)||r(c)&&n(c)},a)}function tl(e){return JSON.parse(JSON.stringify(e))}function Yn(e,t,n,o={}){var i,s,a;const{clone:l=!1,passive:r=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:d}=o,_=Bt(),k=n||_?.emit||((i=_?.$emit)==null?void 0:i.bind(_))||((a=(s=_?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(_?.proxy));let p=u;t||(t="modelValue"),p=p||`update:${t.toString()}`;const m=v=>l?typeof l=="function"?l(v):tl(v):v,w=()=>Ya(e[t])?m(e[t]):f,g=v=>{d?d(v)&&k(p,v):k(p,v)};if(r){const v=w(),C=Y(v);let O=!1;return Ee(()=>e[t],F=>{O||(O=!0,C.value=m(F),Ge(()=>O=!1))}),Ee(C,F=>{!O&&(F!==e[t]||c)&&g(F)},{deep:c}),C}else return G({get(){return w()},set(v){g(v)}})}var nl={value:()=>{}};function Pn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new yn(n)}function yn(e){this._=e}function ol(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}yn.prototype=Pn.prototype={constructor:yn,on:function(e,t){var n=this._,o=ol(e+"",n),i,s=-1,a=o.length;if(arguments.length<2){for(;++s<a;)if((i=(e=o[s]).type)&&(i=il(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=o[s]).type)n[i]=Ro(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ro(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new yn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,s;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],o=0,i=s.length;o<i;++o)s[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,n)}};function il(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Ro(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=nl,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var io="http://www.w3.org/1999/xhtml";const Ho={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function An(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ho.hasOwnProperty(t)?{space:Ho[t],local:e}:e}function sl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===io&&t.documentElement.namespaceURI===io?t.createElement(e):t.createElementNS(n,e)}}function al(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yi(e){var t=An(e);return(t.local?al:sl)(t)}function ll(){}function xo(e){return e==null?ll:function(){return this.querySelector(e)}}function rl(e){typeof e!="function"&&(e=xo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=new Array(a),r,u,c=0;c<a;++c)(r=s[c])&&(u=e.call(r,r.__data__,c,s))&&("__data__"in r&&(u.__data__=r.__data__),l[c]=u);return new Fe(o,this._parents)}function ul(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cl(){return[]}function Ui(e){return e==null?cl:function(){return this.querySelectorAll(e)}}function dl(e){return function(){return ul(e.apply(this,arguments))}}function fl(e){typeof e=="function"?e=dl(e):e=Ui(e);for(var t=this._groups,n=t.length,o=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,r,u=0;u<l;++u)(r=a[u])&&(o.push(e.call(r,r.__data__,u,a)),i.push(r));return new Fe(o,i)}function Xi(e){return function(){return this.matches(e)}}function Zi(e){return function(t){return t.matches(e)}}var hl=Array.prototype.find;function vl(e){return function(){return hl.call(this.children,e)}}function pl(){return this.firstElementChild}function gl(e){return this.select(e==null?pl:vl(typeof e=="function"?e:Zi(e)))}var ml=Array.prototype.filter;function yl(){return Array.from(this.children)}function _l(e){return function(){return ml.call(this.children,e)}}function wl(e){return this.selectAll(e==null?yl:_l(typeof e=="function"?e:Zi(e)))}function bl(e){typeof e!="function"&&(e=Xi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=[],r,u=0;u<a;++u)(r=s[u])&&e.call(r,r.__data__,u,s)&&l.push(r);return new Fe(o,this._parents)}function Ki(e){return new Array(e.length)}function xl(){return new Fe(this._enter||this._groups.map(Ki),this._parents)}function Sn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sn.prototype={constructor:Sn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Sl(e){return function(){return e}}function El(e,t,n,o,i,s){for(var a=0,l,r=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],o[a]=l):n[a]=new Sn(e,s[a]);for(;a<r;++a)(l=t[a])&&(i[a]=l)}function kl(e,t,n,o,i,s,a){var l,r,u=new Map,c=t.length,f=s.length,d=new Array(c),_;for(l=0;l<c;++l)(r=t[l])&&(d[l]=_=a.call(r,r.__data__,l,t)+"",u.has(_)?i[l]=r:u.set(_,r));for(l=0;l<f;++l)_=a.call(e,s[l],l,s)+"",(r=u.get(_))?(o[l]=r,r.__data__=s[l],u.delete(_)):n[l]=new Sn(e,s[l]);for(l=0;l<c;++l)(r=t[l])&&u.get(d[l])===r&&(i[l]=r)}function Nl(e){return e.__data__}function $l(e,t){if(!arguments.length)return Array.from(this,Nl);var n=t?kl:El,o=this._parents,i=this._groups;typeof e!="function"&&(e=Sl(e));for(var s=i.length,a=new Array(s),l=new Array(s),r=new Array(s),u=0;u<s;++u){var c=o[u],f=i[u],d=f.length,_=Cl(e.call(c,c&&c.__data__,u,o)),k=_.length,p=l[u]=new Array(k),m=a[u]=new Array(k),w=r[u]=new Array(d);n(c,f,p,m,w,_,t);for(var g=0,v=0,C,O;g<k;++g)if(C=p[g]){for(g>=v&&(v=g+1);!(O=m[v])&&++v<k;);C._next=O||null}}return a=new Fe(a,o),a._enter=l,a._exit=r,a}function Cl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ml(){return new Fe(this._exit||this._groups.map(Ki),this._parents)}function Il(e,t,n){var o=this.enter(),i=this,s=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),o&&i?o.merge(i).order():i}function Dl(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,s=o.length,a=Math.min(i,s),l=new Array(i),r=0;r<a;++r)for(var u=n[r],c=o[r],f=u.length,d=l[r]=new Array(f),_,k=0;k<f;++k)(_=u[k]||c[k])&&(d[k]=_);for(;r<i;++r)l[r]=n[r];return new Fe(l,this._parents)}function Tl(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,s=o[i],a;--i>=0;)(a=o[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Pl(e){e||(e=Al);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,i=new Array(o),s=0;s<o;++s){for(var a=n[s],l=a.length,r=i[s]=new Array(l),u,c=0;c<l;++c)(u=a[c])&&(r[c]=u);r.sort(t)}return new Fe(i,this._parents).order()}function Al(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ol(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zl(){return Array.from(this)}function Bl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,s=o.length;i<s;++i){var a=o[i];if(a)return a}return null}function Vl(){let e=0;for(const t of this)++e;return e}function Rl(){return!this.node()}function Hl(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function Ll(e){return function(){this.removeAttribute(e)}}function Fl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gl(e,t){return function(){this.setAttribute(e,t)}}function Wl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Yl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ul(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Xl(e,t){var n=An(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Fl:Ll:typeof t=="function"?n.local?Ul:Yl:n.local?Wl:Gl)(n,t))}function qi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Zl(e){return function(){this.style.removeProperty(e)}}function Kl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ql(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function jl(e,t,n){return arguments.length>1?this.each((t==null?Zl:typeof t=="function"?ql:Kl)(e,t,n??"")):Dt(this.node(),e)}function Dt(e,t){return e.style.getPropertyValue(t)||qi(e).getComputedStyle(e,null).getPropertyValue(t)}function Jl(e){return function(){delete this[e]}}function Ql(e,t){return function(){this[e]=t}}function er(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tr(e,t){return arguments.length>1?this.each((t==null?Jl:typeof t=="function"?er:Ql)(e,t)):this.node()[e]}function ji(e){return e.trim().split(/^|\s+/)}function So(e){return e.classList||new Ji(e)}function Ji(e){this._node=e,this._names=ji(e.getAttribute("class")||"")}Ji.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Qi(e,t){for(var n=So(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function es(e,t){for(var n=So(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function nr(e){return function(){Qi(this,e)}}function or(e){return function(){es(this,e)}}function ir(e,t){return function(){(t.apply(this,arguments)?Qi:es)(this,e)}}function sr(e,t){var n=ji(e+"");if(arguments.length<2){for(var o=So(this.node()),i=-1,s=n.length;++i<s;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?ir:t?nr:or)(n,t))}function ar(){this.textContent=""}function lr(e){return function(){this.textContent=e}}function rr(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ur(e){return arguments.length?this.each(e==null?ar:(typeof e=="function"?rr:lr)(e)):this.node().textContent}function cr(){this.innerHTML=""}function dr(e){return function(){this.innerHTML=e}}function fr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hr(e){return arguments.length?this.each(e==null?cr:(typeof e=="function"?fr:dr)(e)):this.node().innerHTML}function vr(){this.nextSibling&&this.parentNode.appendChild(this)}function pr(){return this.each(vr)}function gr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mr(){return this.each(gr)}function yr(e){var t=typeof e=="function"?e:Yi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _r(){return null}function wr(e,t){var n=typeof e=="function"?e:Yi(e),o=t==null?_r:typeof t=="function"?t:xo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function br(){var e=this.parentNode;e&&e.removeChild(this)}function xr(){return this.each(br)}function Sr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Er(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kr(e){return this.select(e?Er:Sr)}function Nr(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $r(e){return function(t){e.call(this,t,this.__data__)}}function Cr(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Mr(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++o]=s;++o?t.length=o:delete this.__on}}}function Ir(e,t,n){return function(){var o=this.__on,i,s=$r(t);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},o?o.push(i):this.__on=[i]}}function Dr(e,t,n){var o=Cr(e+""),i,s=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var r=0,u=l.length,c;r<u;++r)for(i=0,c=l[r];i<s;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(l=t?Ir:Mr,i=0;i<s;++i)this.each(l(o[i],t,n));return this}function ts(e,t,n){var o=qi(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tr(e,t){return function(){return ts(this,e,t)}}function Pr(e,t){return function(){return ts(this,e,t.apply(this,arguments))}}function Ar(e,t){return this.each((typeof t=="function"?Pr:Tr)(e,t))}function*Or(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,s=o.length,a;i<s;++i)(a=o[i])&&(yield a)}var ns=[null];function Fe(e,t){this._groups=e,this._parents=t}function on(){return new Fe([[document.documentElement]],ns)}function zr(){return this}Fe.prototype=on.prototype={constructor:Fe,select:rl,selectAll:fl,selectChild:gl,selectChildren:wl,filter:bl,data:$l,enter:xl,exit:Ml,join:Il,merge:Dl,selection:zr,order:Tl,sort:Pl,call:Ol,nodes:zl,node:Bl,size:Vl,empty:Rl,each:Hl,attr:Xl,style:jl,property:tr,classed:sr,text:ur,html:hr,raise:pr,lower:mr,append:yr,insert:wr,remove:xr,clone:kr,datum:Nr,on:Dr,dispatch:Ar,[Symbol.iterator]:Or};function Ye(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],ns)}function Br(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ke(e,t){if(e=Br(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Vr={passive:!1},Kt={capture:!0,passive:!1};function Un(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function os(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",$t,Kt);"onselectstart"in t?n.on("selectstart.drag",$t,Kt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function is(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",$t,Kt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ln=e=>()=>e;function so(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:s,x:a,y:l,dx:r,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:r,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}so.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Rr(e){return!e.ctrlKey&&!e.button}function Hr(){return this.parentNode}function Lr(e,t){return t??{x:e.x,y:e.y}}function Fr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gr(){var e=Rr,t=Hr,n=Lr,o=Fr,i={},s=Pn("start","drag","end"),a=0,l,r,u,c,f=0;function d(C){C.on("mousedown.drag",_).filter(o).on("touchstart.drag",m).on("touchmove.drag",w,Vr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(C,O){if(!(c||!e.call(this,C,O))){var F=v(this,t.call(this,C,O),C,O,"mouse");F&&(Ye(C.view).on("mousemove.drag",k,Kt).on("mouseup.drag",p,Kt),os(C.view),Un(C),u=!1,l=C.clientX,r=C.clientY,F("start",C))}}function k(C){if($t(C),!u){var O=C.clientX-l,F=C.clientY-r;u=O*O+F*F>f}i.mouse("drag",C)}function p(C){Ye(C.view).on("mousemove.drag mouseup.drag",null),is(C.view,u),$t(C),i.mouse("end",C)}function m(C,O){if(e.call(this,C,O)){var F=C.changedTouches,L=t.call(this,C,O),R=F.length,se,K;for(se=0;se<R;++se)(K=v(this,L,C,O,F[se].identifier,F[se]))&&(Un(C),K("start",C,F[se]))}}function w(C){var O=C.changedTouches,F=O.length,L,R;for(L=0;L<F;++L)(R=i[O[L].identifier])&&($t(C),R("drag",C,O[L]))}function g(C){var O=C.changedTouches,F=O.length,L,R;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),L=0;L<F;++L)(R=i[O[L].identifier])&&(Un(C),R("end",C,O[L]))}function v(C,O,F,L,R,se){var K=s.copy(),H=Ke(se||F,O),M,oe,x;if((x=n.call(C,new so("beforestart",{sourceEvent:F,target:d,identifier:R,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:K}),L))!=null)return M=x.x-H[0]||0,oe=x.y-H[1]||0,function I(b,A,V){var W=H,U;switch(b){case"start":i[R]=I,U=a++;break;case"end":delete i[R],--a;case"drag":H=Ke(V||A,O),U=a;break}K.call(b,C,new so(b,{sourceEvent:A,subject:x,target:d,identifier:R,active:U,x:H[0]+M,y:H[1]+oe,dx:H[0]-W[0],dy:H[1]-W[1],dispatch:K}),L)}}return d.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ln(!!C),d):e},d.container=function(C){return arguments.length?(t=typeof C=="function"?C:ln(C),d):t},d.subject=function(C){return arguments.length?(n=typeof C=="function"?C:ln(C),d):n},d.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:ln(!!C),d):o},d.on=function(){var C=s.on.apply(s,arguments);return C===s?d:C},d.clickDistance=function(C){return arguments.length?(f=(C=+C)*C,d):Math.sqrt(f)},d}function Eo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ss(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function sn(){}var qt=.7,En=1/qt,Ct="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wr=/^#([0-9a-f]{3,8})$/,Yr=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Ur=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),Xr=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${jt}\\)$`),Zr=new RegExp(`^rgba\\(${Je},${Je},${Je},${jt}\\)$`),Kr=new RegExp(`^hsl\\(${jt},${Je},${Je}\\)$`),qr=new RegExp(`^hsla\\(${jt},${Je},${Je},${jt}\\)$`),Lo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Eo(sn,wt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fo,formatHex:Fo,formatHex8:jr,formatHsl:Jr,formatRgb:Go,toString:Go});function Fo(){return this.rgb().formatHex()}function jr(){return this.rgb().formatHex8()}function Jr(){return as(this).formatHsl()}function Go(){return this.rgb().formatRgb()}function wt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Wo(t):n===3?new He(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Yr.exec(e))?new He(t[1],t[2],t[3],1):(t=Ur.exec(e))?new He(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Xr.exec(e))?rn(t[1],t[2],t[3],t[4]):(t=Zr.exec(e))?rn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Kr.exec(e))?Xo(t[1],t[2]/100,t[3]/100,1):(t=qr.exec(e))?Xo(t[1],t[2]/100,t[3]/100,t[4]):Lo.hasOwnProperty(e)?Wo(Lo[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function Wo(e){return new He(e>>16&255,e>>8&255,e&255,1)}function rn(e,t,n,o){return o<=0&&(e=t=n=NaN),new He(e,t,n,o)}function Qr(e){return e instanceof sn||(e=wt(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function ao(e,t,n,o){return arguments.length===1?Qr(e):new He(e,t,n,o??1)}function He(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Eo(He,ao,ss(sn,{brighter(e){return e=e==null?En:Math.pow(En,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(yt(this.r),yt(this.g),yt(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yo,formatHex:Yo,formatHex8:eu,formatRgb:Uo,toString:Uo}));function Yo(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}`}function eu(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}${mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Uo(){const e=kn(this.opacity);return`${e===1?"rgb(":"rgba("}${yt(this.r)}, ${yt(this.g)}, ${yt(this.b)}${e===1?")":`, ${e})`}`}function kn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mt(e){return e=yt(e),(e<16?"0":"")+e.toString(16)}function Xo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,o)}function as(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof sn||(e=wt(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),s=Math.max(t,n,o),a=NaN,l=s-i,r=(s+i)/2;return l?(t===s?a=(n-o)/l+(n<o)*6:n===s?a=(o-t)/l+2:a=(t-n)/l+4,l/=r<.5?s+i:2-s-i,a*=60):l=r>0&&r<1?0:a,new Ue(a,l,r,e.opacity)}function tu(e,t,n,o){return arguments.length===1?as(e):new Ue(e,t,n,o??1)}function Ue(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Eo(Ue,tu,ss(sn,{brighter(e){return e=e==null?En:Math.pow(En,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new He(Xn(e>=240?e-240:e+120,i,o),Xn(e,i,o),Xn(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ue(Zo(this.h),un(this.s),un(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kn(this.opacity);return`${e===1?"hsl(":"hsla("}${Zo(this.h)}, ${un(this.s)*100}%, ${un(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zo(e){return e=(e||0)%360,e<0?e+360:e}function un(e){return Math.max(0,Math.min(1,e||0))}function Xn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ko=e=>()=>e;function nu(e,t){return function(n){return e+n*t}}function ou(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function iu(e){return(e=+e)==1?ls:function(t,n){return n-t?ou(t,n,e):ko(isNaN(t)?n:t)}}function ls(e,t){var n=t-e;return n?nu(e,n):ko(isNaN(e)?t:e)}const Nn=(function e(t){var n=iu(t);function o(i,s){var a=n((i=ao(i)).r,(s=ao(s)).r),l=n(i.g,s.g),r=n(i.b,s.b),u=ls(i.opacity,s.opacity);return function(c){return i.r=a(c),i.g=l(c),i.b=r(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function su(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(s){for(i=0;i<n;++i)o[i]=e[i]*(1-s)+t[i]*s;return o}}function au(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),s=new Array(n),a;for(a=0;a<o;++a)i[a]=Gt(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(l){for(a=0;a<o;++a)s[a]=i[a](l);return s}}function ru(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function qe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uu(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Gt(e[i],t[i]):o[i]=t[i];return function(s){for(i in n)o[i]=n[i](s);return o}}var lo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zn=new RegExp(lo.source,"g");function cu(e){return function(){return e}}function du(e){return function(t){return e(t)+""}}function rs(e,t){var n=lo.lastIndex=Zn.lastIndex=0,o,i,s,a=-1,l=[],r=[];for(e=e+"",t=t+"";(o=lo.exec(e))&&(i=Zn.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,r.push({i:a,x:qe(o,i)})),n=Zn.lastIndex;return n<t.length&&(s=t.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?r[0]?du(r[0].x):cu(t):(t=r.length,function(u){for(var c=0,f;c<t;++c)l[(f=r[c]).i]=f.x(u);return l.join("")})}function Gt(e,t){var n=typeof t,o;return t==null||n==="boolean"?ko(t):(n==="number"?qe:n==="string"?(o=wt(t))?(t=o,Nn):rs:t instanceof wt?Nn:t instanceof Date?ru:au(t)?su:Array.isArray(t)?lu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uu:qe)(e,t)}var Ko=180/Math.PI,ro={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function us(e,t,n,o,i,s){var a,l,r;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(r=e*n+t*o)&&(n-=e*r,o-=t*r),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,r/=l),e*o<t*n&&(e=-e,t=-t,r=-r,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Ko,skewX:Math.atan(r)*Ko,scaleX:a,scaleY:l}}var cn;function fu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ro:us(t.a,t.b,t.c,t.d,t.e,t.f)}function hu(e){return e==null||(cn||(cn=document.createElementNS("http://www.w3.org/2000/svg","g")),cn.setAttribute("transform",e),!(e=cn.transform.baseVal.consolidate()))?ro:(e=e.matrix,us(e.a,e.b,e.c,e.d,e.e,e.f))}function cs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function s(u,c,f,d,_,k){if(u!==f||c!==d){var p=_.push("translate(",null,t,null,n);k.push({i:p-4,x:qe(u,f)},{i:p-2,x:qe(c,d)})}else(f||d)&&_.push("translate("+f+t+d+n)}function a(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,o)-2,x:qe(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function l(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,o)-2,x:qe(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function r(u,c,f,d,_,k){if(u!==f||c!==d){var p=_.push(i(_)+"scale(",null,",",null,")");k.push({i:p-4,x:qe(u,f)},{i:p-2,x:qe(c,d)})}else(f!==1||d!==1)&&_.push(i(_)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,d),a(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),r(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(_){for(var k=-1,p=d.length,m;++k<p;)f[(m=d[k]).i]=m.x(_);return f.join("")}}}var vu=cs(fu,"px, ","px)","deg)"),pu=cs(hu,", ",")",")"),gu=1e-12;function qo(e){return((e=Math.exp(e))+1/e)/2}function mu(e){return((e=Math.exp(e))-1/e)/2}function yu(e){return((e=Math.exp(2*e))-1)/(e+1)}const _n=(function e(t,n,o){function i(s,a){var l=s[0],r=s[1],u=s[2],c=a[0],f=a[1],d=a[2],_=c-l,k=f-r,p=_*_+k*k,m,w;if(p<gu)w=Math.log(d/u)/t,m=function(L){return[l+L*_,r+L*k,u*Math.exp(t*L*w)]};else{var g=Math.sqrt(p),v=(d*d-u*u+o*p)/(2*u*n*g),C=(d*d-u*u-o*p)/(2*d*n*g),O=Math.log(Math.sqrt(v*v+1)-v),F=Math.log(Math.sqrt(C*C+1)-C);w=(F-O)/t,m=function(L){var R=L*w,se=qo(O),K=u/(n*g)*(se*yu(t*R+O)-mu(O));return[l+K*_,r+K*k,u*se/qo(t*R+O)]}}return m.duration=w*1e3*t/Math.SQRT2,m}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a,r=l*l;return e(a,l,r)},i})(Math.SQRT2,2,4);var Tt=0,Ht=0,Vt=0,ds=1e3,$n,Lt,Cn=0,bt=0,On=0,Jt=typeof performance=="object"&&performance.now?performance:Date,fs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function No(){return bt||(fs(_u),bt=Jt.now()+On)}function _u(){bt=0}function Mn(){this._call=this._time=this._next=null}Mn.prototype=hs.prototype={constructor:Mn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?No():+n)+(t==null?0:+t),!this._next&&Lt!==this&&(Lt?Lt._next=this:$n=this,Lt=this),this._call=e,this._time=n,uo()},stop:function(){this._call&&(this._call=null,this._time=1/0,uo())}};function hs(e,t,n){var o=new Mn;return o.restart(e,t,n),o}function wu(){No(),++Tt;for(var e=$n,t;e;)(t=bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function jo(){bt=(Cn=Jt.now())+On,Tt=Ht=0;try{wu()}finally{Tt=0,xu(),bt=0}}function bu(){var e=Jt.now(),t=e-Cn;t>ds&&(On-=t,Cn=e)}function xu(){for(var e,t=$n,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$n=n);Lt=e,uo(o)}function uo(e){if(!Tt){Ht&&(Ht=clearTimeout(Ht));var t=e-bt;t>24?(e<1/0&&(Ht=setTimeout(jo,e-Jt.now()-On)),Vt&&(Vt=clearInterval(Vt))):(Vt||(Cn=Jt.now(),Vt=setInterval(bu,ds)),Tt=1,fs(jo))}}function Jo(e,t,n){var o=new Mn;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Su=Pn("start","end","cancel","interrupt"),Eu=[],vs=0,Qo=1,co=2,wn=3,ei=4,fo=5,bn=6;function zn(e,t,n,o,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;ku(e,n,{name:t,index:o,group:i,on:Su,tween:Eu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:vs})}function $o(e,t){var n=Ze(e,t);if(n.state>vs)throw new Error("too late; already scheduled");return n}function et(e,t){var n=Ze(e,t);if(n.state>wn)throw new Error("too late; already running");return n}function Ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ku(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=hs(s,0,n.time);function s(u){n.state=Qo,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,d,_;if(n.state!==Qo)return r();for(c in o)if(_=o[c],_.name===n.name){if(_.state===wn)return Jo(a);_.state===ei?(_.state=bn,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete o[c]):+c<t&&(_.state=bn,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete o[c])}if(Jo(function(){n.state===wn&&(n.state=ei,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=co,n.on.call("start",e,e.__data__,n.index,n.group),n.state===co){for(n.state=wn,i=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(_=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=_);i.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(r),n.state=fo,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);n.state===fo&&(n.on.call("end",e,e.__data__,n.index,n.group),r())}function r(){n.state=bn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function xn(e,t){var n=e.__transition,o,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){s=!1;continue}i=o.state>co&&o.state<fo,o.state=bn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}s&&delete e.__transition}}function Nu(e){return this.each(function(){xn(this,e)})}function $u(e,t){var n,o;return function(){var i=et(this,e),s=i.tween;if(s!==n){o=n=s;for(var a=0,l=o.length;a<l;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function Cu(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var s=et(this,e),a=s.tween;if(a!==o){i=(o=a).slice();for(var l={name:t,value:n},r=0,u=i.length;r<u;++r)if(i[r].name===t){i[r]=l;break}r===u&&i.push(l)}s.tween=i}}function Mu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ze(this.node(),n).tween,i=0,s=o.length,a;i<s;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?$u:Cu)(n,e,t))}function Co(e,t,n){var o=e._id;return e.each(function(){var i=et(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ze(i,o).value[t]}}function ps(e,t){var n;return(typeof t=="number"?qe:t instanceof wt?Nn:(n=wt(t))?(t=n,Nn):rs)(e,t)}function Iu(e){return function(){this.removeAttribute(e)}}function Du(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tu(e,t,n){var o,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===o?s:s=t(o=a,n)}}function Pu(e,t,n){var o,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?s:s=t(o=a,n)}}function Au(e,t,n){var o,i,s;return function(){var a,l=n(this),r;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),r=l+"",a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l)))}}function Ou(e,t,n){var o,i,s;return function(){var a,l=n(this),r;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),r=l+"",a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l)))}}function zu(e,t){var n=An(e),o=n==="transform"?pu:ps;return this.attrTween(e,typeof t=="function"?(n.local?Ou:Au)(n,o,Co(this,"attr."+e,t)):t==null?(n.local?Du:Iu)(n):(n.local?Pu:Tu)(n,o,t))}function Bu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ru(e,t){var n,o;function i(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&Vu(e,s)),n}return i._value=t,i}function Hu(e,t){var n,o;function i(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&Bu(e,s)),n}return i._value=t,i}function Lu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=An(e);return this.tween(n,(o.local?Ru:Hu)(o,t))}function Fu(e,t){return function(){$o(this,e).delay=+t.apply(this,arguments)}}function Gu(e,t){return t=+t,function(){$o(this,e).delay=t}}function Wu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Fu:Gu)(t,e)):Ze(this.node(),t).delay}function Yu(e,t){return function(){et(this,e).duration=+t.apply(this,arguments)}}function Uu(e,t){return t=+t,function(){et(this,e).duration=t}}function Xu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yu:Uu)(t,e)):Ze(this.node(),t).duration}function Zu(e,t){if(typeof t!="function")throw new Error;return function(){et(this,e).ease=t}}function Ku(e){var t=this._id;return arguments.length?this.each(Zu(t,e)):Ze(this.node(),t).ease}function qu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,e).ease=n}}function ju(e){if(typeof e!="function")throw new Error;return this.each(qu(this._id,e))}function Ju(e){typeof e!="function"&&(e=Xi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=[],r,u=0;u<a;++u)(r=s[u])&&e.call(r,r.__data__,u,s)&&l.push(r);return new at(o,this._parents,this._name,this._id)}function Qu(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var r=t[l],u=n[l],c=r.length,f=a[l]=new Array(c),d,_=0;_<c;++_)(d=r[_]||u[_])&&(f[_]=d);for(;l<o;++l)a[l]=t[l];return new at(a,this._parents,this._name,this._id)}function ec(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function tc(e,t,n){var o,i,s=ec(t)?$o:et;return function(){var a=s(this,e),l=a.on;l!==o&&(i=(o=l).copy()).on(t,n),a.on=i}}function nc(e,t){var n=this._id;return arguments.length<2?Ze(this.node(),n).on.on(e):this.each(tc(n,e,t))}function oc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ic(){return this.on("end.remove",oc(this._id))}function sc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xo(e));for(var o=this._groups,i=o.length,s=new Array(i),a=0;a<i;++a)for(var l=o[a],r=l.length,u=s[a]=new Array(r),c,f,d=0;d<r;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,zn(u[d],t,n,d,u,Ze(c,n)));return new at(s,this._parents,t,n)}function ac(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ui(e));for(var o=this._groups,i=o.length,s=[],a=[],l=0;l<i;++l)for(var r=o[l],u=r.length,c,f=0;f<u;++f)if(c=r[f]){for(var d=e.call(c,c.__data__,f,r),_,k=Ze(c,n),p=0,m=d.length;p<m;++p)(_=d[p])&&zn(_,t,n,p,d,k);s.push(d),a.push(c)}return new at(s,a,t,n)}var lc=on.prototype.constructor;function rc(){return new lc(this._groups,this._parents)}function uc(e,t){var n,o,i;return function(){var s=Dt(this,e),a=(this.style.removeProperty(e),Dt(this,e));return s===a?null:s===n&&a===o?i:i=t(n=s,o=a)}}function gs(e){return function(){this.style.removeProperty(e)}}function cc(e,t,n){var o,i=n+"",s;return function(){var a=Dt(this,e);return a===i?null:a===o?s:s=t(o=a,n)}}function dc(e,t,n){var o,i,s;return function(){var a=Dt(this,e),l=n(this),r=l+"";return l==null&&(r=l=(this.style.removeProperty(e),Dt(this,e))),a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l))}}function fc(e,t){var n,o,i,s="style."+t,a="end."+s,l;return function(){var r=et(this,e),u=r.on,c=r.value[s]==null?l||(l=gs(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),r.on=o}}function hc(e,t,n){var o=(e+="")=="transform"?vu:ps;return t==null?this.styleTween(e,uc(e,o)).on("end.style."+e,gs(e)):typeof t=="function"?this.styleTween(e,dc(e,o,Co(this,"style."+e,t))).each(fc(this._id,e)):this.styleTween(e,cc(e,o,t),n).on("end.style."+e,null)}function vc(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function pc(e,t,n){var o,i;function s(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&vc(e,a,n)),o}return s._value=t,s}function gc(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,pc(e,t,n??""))}function mc(e){return function(){this.textContent=e}}function yc(e){return function(){var t=e(this);this.textContent=t??""}}function _c(e){return this.tween("text",typeof e=="function"?yc(Co(this,"text",e)):mc(e==null?"":e+""))}function wc(e){return function(t){this.textContent=e.call(this,t)}}function bc(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&wc(i)),t}return o._value=e,o}function xc(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,bc(e))}function Sc(){for(var e=this._name,t=this._id,n=ms(),o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,r,u=0;u<l;++u)if(r=a[u]){var c=Ze(r,t);zn(r,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new at(o,this._parents,e,n)}function Ec(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},r={value:function(){--i===0&&s()}};n.each(function(){var u=et(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(r)),u.on=t}),i===0&&s()})}var kc=0;function at(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function ms(){return++kc}var nt=on.prototype;at.prototype={constructor:at,select:sc,selectAll:ac,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:Ju,merge:Qu,selection:rc,transition:Sc,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:nc,attr:zu,attrTween:Lu,style:hc,styleTween:gc,text:_c,textTween:xc,remove:ic,tween:Mu,delay:Wu,duration:Xu,ease:Ku,easeVarying:ju,end:Ec,[Symbol.iterator]:nt[Symbol.iterator]};function Nc(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $c={time:null,delay:0,duration:250,ease:Nc};function Cc(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Mc(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=ms(),(n=$c).time=No(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,r,u=0;u<l;++u)(r=a[u])&&zn(r,e,t,u,a,n||Cc(r,t));return new at(o,this._parents,e,t)}on.prototype.interrupt=Nu;on.prototype.transition=Mc;const dn=e=>()=>e;function Ic(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function it(e,t,n){this.k=e,this.x=t,this.y=n}it.prototype={constructor:it,scale:function(e){return e===1?this:new it(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new it(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pt=new it(1,0,0);it.prototype;function Kn(e){e.stopImmediatePropagation()}function Rt(e){e.preventDefault(),e.stopImmediatePropagation()}function Dc(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Tc(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ti(){return this.__zoom||Pt}function Pc(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ac(){return navigator.maxTouchPoints||"ontouchstart"in this}function Oc(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function zc(){var e=Dc,t=Tc,n=Oc,o=Pc,i=Ac,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,r=_n,u=Pn("start","zoom","end"),c,f,d,_=500,k=150,p=0,m=10;function w(x){x.property("__zoom",ti).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",se).on("dblclick.zoom",K).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(x,I,b,A){var V=x.selection?x.selection():x;V.property("__zoom",ti),x!==V?O(x,I,b,A):V.interrupt().each(function(){F(this,arguments).event(A).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(x,I,b,A){w.scaleTo(x,function(){var V=this.__zoom.k,W=typeof I=="function"?I.apply(this,arguments):I;return V*W},b,A)},w.scaleTo=function(x,I,b,A){w.transform(x,function(){var V=t.apply(this,arguments),W=this.__zoom,U=b==null?C(V):typeof b=="function"?b.apply(this,arguments):b,te=W.invert(U),re=typeof I=="function"?I.apply(this,arguments):I;return n(v(g(W,re),U,te),V,a)},b,A)},w.translateBy=function(x,I,b,A){w.transform(x,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),a)},null,A)},w.translateTo=function(x,I,b,A,V){w.transform(x,function(){var W=t.apply(this,arguments),U=this.__zoom,te=A==null?C(W):typeof A=="function"?A.apply(this,arguments):A;return n(Pt.translate(te[0],te[1]).scale(U.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof b=="function"?-b.apply(this,arguments):-b),W,a)},A,V)};function g(x,I){return I=Math.max(s[0],Math.min(s[1],I)),I===x.k?x:new it(I,x.x,x.y)}function v(x,I,b){var A=I[0]-b[0]*x.k,V=I[1]-b[1]*x.k;return A===x.x&&V===x.y?x:new it(x.k,A,V)}function C(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}function O(x,I,b,A){x.on("start.zoom",function(){F(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).event(A).end()}).tween("zoom",function(){var V=this,W=arguments,U=F(V,W).event(A),te=t.apply(V,W),re=b==null?C(te):typeof b=="function"?b.apply(V,W):b,fe=Math.max(te[1][0]-te[0][0],te[1][1]-te[0][1]),ge=V.__zoom,j=typeof I=="function"?I.apply(V,W):I,ne=r(ge.invert(re).concat(fe/ge.k),j.invert(re).concat(fe/j.k));return function(ee){if(ee===1)ee=j;else{var ce=ne(ee),me=fe/ce[2];ee=new it(me,re[0]-ce[0]*me,re[1]-ce[1]*me)}U.zoom(null,ee)}})}function F(x,I,b){return!b&&x.__zooming||new L(x,I)}function L(x,I){this.that=x,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,I),this.taps=0}L.prototype={event:function(x){return x&&(this.sourceEvent=x),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(x,I){return this.mouse&&x!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(x){var I=Ye(this.that).datum();u.call(x,this.that,new Ic(x,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),I)}};function R(x,...I){if(!e.apply(this,arguments))return;var b=F(this,I).event(x),A=this.__zoom,V=Math.max(s[0],Math.min(s[1],A.k*Math.pow(2,o.apply(this,arguments)))),W=Ke(x);if(b.wheel)(b.mouse[0][0]!==W[0]||b.mouse[0][1]!==W[1])&&(b.mouse[1]=A.invert(b.mouse[0]=W)),clearTimeout(b.wheel);else{if(A.k===V)return;b.mouse=[W,A.invert(W)],xn(this),b.start()}Rt(x),b.wheel=setTimeout(U,k),b.zoom("mouse",n(v(g(A,V),b.mouse[0],b.mouse[1]),b.extent,a));function U(){b.wheel=null,b.end()}}function se(x,...I){if(d||!e.apply(this,arguments))return;var b=x.currentTarget,A=F(this,I,!0).event(x),V=Ye(x.view).on("mousemove.zoom",re,!0).on("mouseup.zoom",fe,!0),W=Ke(x,b),U=x.clientX,te=x.clientY;os(x.view),Kn(x),A.mouse=[W,this.__zoom.invert(W)],xn(this),A.start();function re(ge){if(Rt(ge),!A.moved){var j=ge.clientX-U,ne=ge.clientY-te;A.moved=j*j+ne*ne>p}A.event(ge).zoom("mouse",n(v(A.that.__zoom,A.mouse[0]=Ke(ge,b),A.mouse[1]),A.extent,a))}function fe(ge){V.on("mousemove.zoom mouseup.zoom",null),is(ge.view,A.moved),Rt(ge),A.event(ge).end()}}function K(x,...I){if(e.apply(this,arguments)){var b=this.__zoom,A=Ke(x.changedTouches?x.changedTouches[0]:x,this),V=b.invert(A),W=b.k*(x.shiftKey?.5:2),U=n(v(g(b,W),A,V),t.apply(this,I),a);Rt(x),l>0?Ye(this).transition().duration(l).call(O,U,A,x):Ye(this).call(w.transform,U,A,x)}}function H(x,...I){if(e.apply(this,arguments)){var b=x.touches,A=b.length,V=F(this,I,x.changedTouches.length===A).event(x),W,U,te,re;for(Kn(x),U=0;U<A;++U)te=b[U],re=Ke(te,this),re=[re,this.__zoom.invert(re),te.identifier],V.touch0?!V.touch1&&V.touch0[2]!==re[2]&&(V.touch1=re,V.taps=0):(V.touch0=re,W=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),W&&(V.taps<2&&(f=re[0],c=setTimeout(function(){c=null},_)),xn(this),V.start())}}function M(x,...I){if(this.__zooming){var b=F(this,I).event(x),A=x.changedTouches,V=A.length,W,U,te,re;for(Rt(x),W=0;W<V;++W)U=A[W],te=Ke(U,this),b.touch0&&b.touch0[2]===U.identifier?b.touch0[0]=te:b.touch1&&b.touch1[2]===U.identifier&&(b.touch1[0]=te);if(U=b.that.__zoom,b.touch1){var fe=b.touch0[0],ge=b.touch0[1],j=b.touch1[0],ne=b.touch1[1],ee=(ee=j[0]-fe[0])*ee+(ee=j[1]-fe[1])*ee,ce=(ce=ne[0]-ge[0])*ce+(ce=ne[1]-ge[1])*ce;U=g(U,Math.sqrt(ee/ce)),te=[(fe[0]+j[0])/2,(fe[1]+j[1])/2],re=[(ge[0]+ne[0])/2,(ge[1]+ne[1])/2]}else if(b.touch0)te=b.touch0[0],re=b.touch0[1];else return;b.zoom("touch",n(v(U,te,re),b.extent,a))}}function oe(x,...I){if(this.__zooming){var b=F(this,I).event(x),A=x.changedTouches,V=A.length,W,U;for(Kn(x),d&&clearTimeout(d),d=setTimeout(function(){d=null},_),W=0;W<V;++W)U=A[W],b.touch0&&b.touch0[2]===U.identifier?delete b.touch0:b.touch1&&b.touch1[2]===U.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(U=Ke(U,this),Math.hypot(f[0]-U[0],f[1]-U[1])<m)){var te=Ye(this).on("dblclick.zoom");te&&te.apply(this,arguments)}}}return w.wheelDelta=function(x){return arguments.length?(o=typeof x=="function"?x:dn(+x),w):o},w.filter=function(x){return arguments.length?(e=typeof x=="function"?x:dn(!!x),w):e},w.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:dn(!!x),w):i},w.extent=function(x){return arguments.length?(t=typeof x=="function"?x:dn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),w):t},w.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],w):[s[0],s[1]]},w.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(x){return arguments.length?(n=x,w):n},w.duration=function(x){return arguments.length?(l=+x,w):l},w.interpolate=function(x){return arguments.length?(r=x,w):r},w.on=function(){var x=u.on.apply(u,arguments);return x===u?w:x},w.clickDistance=function(x){return arguments.length?(p=(x=+x)*x,w):Math.sqrt(p)},w.tapDistance=function(x){return arguments.length?(m=+x,w):m},w}var ae=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ae||{}),Mo=(e=>(e.Partial="partial",e.Full="full",e))(Mo||{}),pt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(pt||{}),dt=(e=>(e.Strict="strict",e.Loose="loose",e))(dt||{}),ho=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ho||{}),Wt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Wt||{});const Bc=["INPUT","SELECT","TEXTAREA"],Vc=typeof document<"u"?document:null;function vo(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,s=typeof o?.closest=="function"?o.closest(".nokey"):null;return Bc.includes(o?.nodeName)||i||!!s}function Rc(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ni(e,t,n,o){const i=t.replace("+",`
|
|
2
|
+
`).replace(`
|
|
3
|
+
|
|
4
|
+
`,`
|
|
5
|
+
+`).split(`
|
|
6
|
+
`).map(a=>a.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const s=i.every((a,l)=>n.has(a)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(e.toLowerCase()),s}function Hc(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Lc(n.code,e);return Array.isArray(e)?e.some(i=>ni(n[o],i,t,n.type==="keyup")):ni(n[o],e,t,n.type==="keyup")}}function Lc(e,t){return t.includes(e)?"code":"key"}function Yt(e,t){const n=G(()=>be(t?.target)??Vc),o=ct(be(e)===!0);let i=!1;const s=new Set;let a=r(be(e));Ee(()=>be(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&l(),a=r(u)},{immediate:!0}),Wi(["blur","contextmenu"],l),Vo((...u)=>a(...u),u=>{var c,f;const d=be(t?.actInsideInputWithModifier)??!0,_=be(t?.preventDefault)??!1;if(i=Rc(u),(!i||i&&!d)&&vo(u))return;const p=((f=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:f[0])||u.target,m=p?.nodeName==="BUTTON"||p?.nodeName==="A";!_&&(i||!m)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Vo((...u)=>a(...u),u=>{const c=be(t?.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!c)&&vo(u))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,s.clear(),o.value=be(e)===!0}function r(u){return u===null?(l(),()=>!1):typeof u=="boolean"?(l(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?Hc(u,s):u}return o}const ys="vue-flow__node-desc",_s="vue-flow__edge-desc",Fc="vue-flow__aria-live",ws=["Enter"," ","Escape"],Mt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function In(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Dn(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Bn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function xt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function bs(e,t){return{x:xt(e.x,t[0][0],t[1][0]),y:xt(e.y,t[0][1],t[1][1])}}function oi(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function ft(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function _t(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!ft(e)}function Ft(e){return _t(e)&&"computedPosition"in e}function fn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Gc(e){return fn(e.width)&&fn(e.height)&&fn(e.x)&&fn(e.y)}function Wc(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:mn({width:0,height:0}),computedPosition:mn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Pe(e.data)?e.data:{},events:mn(Pe(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function xs(e,t,n){var o,i;const s={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:Pe(e.data)?e.data:{},events:mn(Pe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??s,e,{id:e.id.toString()})}function Ss(e,t,n,o){const i=typeof e=="string"?e:e.id,s=new Set,a=o==="source"?"target":"source";for(const l of n)l[a]===i&&s.add(l[o]);return t.filter(l=>s.has(l.id))}function Yc(...e){if(e.length===3){const[s,a,l]=e;return Ss(s,a,l,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(s=>ft(s)&&s.source===o).map(s=>n.find(a=>_t(a)&&a.id===s.target))}function Uc(...e){if(e.length===3){const[s,a,l]=e;return Ss(s,a,l,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(s=>ft(s)&&s.target===o).map(s=>n.find(a=>_t(a)&&a.id===s.source))}function Es({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function Xc(e,t){return t.some(n=>ft(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function Qt({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function en({x:e,y:t},{x:n,y:o,zoom:i},s=!1,a=[1,1]){const l={x:(e-n)/i,y:(t-o)/i};return s?Vn(l,a):l}function Zc(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function ks({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function Kc({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Ns(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=Zc(t,ks({...o.computedPosition,...o.dimensions}))}return Kc(t)}function $s(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const s={...en(t,n),width:t.width/n.zoom,height:t.height/n.zoom},a=[];for(const l of e){const{dimensions:r,selectable:u=!0,hidden:c=!1}=l,f=r.width??l.width??null,d=r.height??l.height??null;if(i&&!u||c)continue;const _=Dn(s,In(l)),k=f===null||d===null,p=o&&_>0,m=(f??0)*(d??0);(k||p||_>=m||l.dragging)&&a.push(l)}return a}function Cs(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function kt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return an(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function qc(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=kt(e,n),i=kt(e,t);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof e=="object"){const o=kt(e.top??e.y??0,n),i=kt(e.bottom??e.y??0,n),s=kt(e.left??e.x??0,t),a=kt(e.right??e.x??0,t);return{top:o,right:a,bottom:i,left:s,x:s+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function jc(e,t,n,o,i,s){const{x:a,y:l}=Qt(e,{x:t,y:n,zoom:o}),{x:r,y:u}=Qt({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=i-r,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(f)}}function ii(e,t,n,o,i,s=.1){const a=qc(s,t,n),l=(t-a.x)/e.width,r=(n-a.y)/e.height,u=Math.min(l,r),c=xt(u,o,i),f=e.x+e.width/2,d=e.y+e.height/2,_=t/2-f*c,k=n/2-d*c,p=jc(e,_,k,c,t,n),m={left:Math.min(p.left-a.left,0),top:Math.min(p.top-a.top,0),right:Math.min(p.right-a.right,0),bottom:Math.min(p.bottom-a.bottom,0)};return{x:_-m.left+m.right,y:k-m.top+m.bottom,zoom:c}}function Jc(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Ms(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Ms(n,t):!1}function tn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function si(e){const t=e.ctrlKey&&Tn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function ai(e,t,n){return e<t?xt(Math.abs(e-t),1,t)/t:e>n?-xt(Math.abs(e-n),1,t)/t:0}function Is(e,t,n=15,o=40){const i=ai(e.x,o,t.width-o)*n,s=ai(e.y,o,t.height-o)*n;return[i,s]}function qn(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const s=Number(i.width.replace("px",""));i.width=`${s+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+o}px`}else i.height+=o;if(e.position.x<0){const s=Math.abs(e.position.x);if(t.position.x=t.position.x-s,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+s}px`}else i.width+=s;e.position.x=0}if(e.position.y<0){const s=Math.abs(e.position.y);if(t.position.y=t.position.y-s,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+s}px`}else i.height+=s;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=s=>{const a=t.style;return{...a(s),...i}}:t.style={...t.style,...i}}}}function li(e,t){var n,o;const i=e.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")t.findIndex(r=>r.id===a.item.id)===-1&&t.push(a.item);else if(a.type==="remove"){const l=t.findIndex(r=>r.id===a.id);l!==-1&&t.splice(l,1)}const s=t.map(a=>a.id);for(const a of t)for(const l of e)if(l.id===a.id)switch(l.type){case"select":a.selected=l.selected;break;case"position":if(Ft(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const r=t[s.indexOf(a.parentNode)];r&&Ft(r)&&qn(a,r)}break;case"dimensions":if(Ft(a)&&(typeof l.dimensions<"u"&&(a.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(a.style={...a.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(a.resizing=l.resizing),a.expandParent&&a.parentNode)){const r=t[s.indexOf(a.parentNode)];r&&Ft(r)&&(!!r.dimensions.width&&!!r.dimensions.height?qn(a,r):Ge(()=>{qn(a,r)}))}break}return t}function rt(e,t){return{id:e,type:"select",selected:t}}function ri(e){return{item:e,type:"add"}}function ui(e){return{id:e,type:"remove"}}function ci(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function ut(e,t=new Set,n=!1){const o=[];for(const[i,s]of e){const a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),o.push(rt(s.id,a)))}return o}const di=()=>{};function X(e){const t=new Set;let n=di,o=()=>!1;const i=()=>t.size>0||o(),s=d=>{n=d},a=()=>{n=di},l=d=>{o=d},r=()=>{o=()=>!1},u=d=>{t.delete(d)};return{on:d=>{t.add(d);const _=()=>u(d);return Zt(_),{off:_}},off:u,trigger:d=>{const _=[n];return i()?_.push(...t):e&&_.push(e),Promise.allSettled(_.map(k=>k(d)))},hasListeners:i,listeners:t,setEmitter:s,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:r}}function fi(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Qc(e,t,n,o){var i,s;const a=new Map;for(const[l,r]of e)(r.selected||r.id===o)&&(!r.parentNode||!Ms(r,e))&&(r.draggable||t&&typeof r.draggable>"u")&&e.get(l)&&a.set(l,{id:r.id,position:r.position||{x:0,y:0},distance:{x:n.x-((i=r.computedPosition)==null?void 0:i.x)||0,y:n.y-((s=r.computedPosition)==null?void 0:s.y)||0},from:{x:r.computedPosition.x,y:r.computedPosition.y},extent:r.extent,parentNode:r.parentNode,dimensions:{...r.dimensions},expandParent:r.expandParent});return Array.from(a.values())}function jn({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const s=n(i.id);s&&o.push(s)}return[e?o.find(i=>i.id===e):o[0],o]}function Ds(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function ed(e,t,n){const[o,i,s,a]=typeof e!="string"?Ds(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-s]]:!1}function td(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&i?.range==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const s=ed(i,e,o);s&&(i=s)}else t(new Oe(Ae.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const s=o?.computedPosition.x||0,a=o?.computedPosition.y||0;i=[[i[0][0]+s,i[0][1]+a],[i[1][0]+s,i[1][1]+a]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[s,a,l,r]=Ds(i.padding),u=o?.computedPosition.x||0,c=o?.computedPosition.y||0;i=[[i.range[0][0]+u+r,i.range[0][1]+c+s],[i.range[1][0]+u-a,i.range[1][1]+c-l]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function nd({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Io(e,t,n,o,i){const s=nd(e.dimensions,td(e,n,o,i)),a=bs(t,s);return{position:{x:a.x-(i?.computedPosition.x||0),y:a.y-(i?.computedPosition.y||0)},computedPosition:a}}function At(e,t,n=ae.Left,o=!1){const i=(t?.x??0)+e.computedPosition.x,s=(t?.y??0)+e.computedPosition.y,{width:a,height:l}=t??ad(e);if(o)return{x:i+a/2,y:s+l/2};switch(t?.position??n){case ae.Top:return{x:i+a/2,y:s};case ae.Right:return{x:i+a,y:s+l/2};case ae.Bottom:return{x:i+a/2,y:s+l};case ae.Left:return{x:i,y:s+l/2}}}function hi(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function od({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:s,width:a,height:l,viewport:r}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+s)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=ks({x:(0-r.x)/r.zoom,y:(0-r.y)/r.zoom,width:a/r.zoom,height:l/r.zoom}),f=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),d=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(f*d)>0}function id(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const s=t(e.source),a=t(e.target);return!s||!a?0:(n&&(i=o?e.zIndex:Math.max(s.computedPosition.z||0,a.computedPosition.z||0)),i)}var Ae=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Ae||{});const vi={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
|
|
7
|
+
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
8
|
+
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
9
|
+
Node: ${e}
|
|
10
|
+
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
11
|
+
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
12
|
+
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
13
|
+
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
14
|
+
Edge: ${e}
|
|
15
|
+
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
16
|
+
Edge: ${e}
|
|
17
|
+
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
18
|
+
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
19
|
+
Edge: ${e}
|
|
20
|
+
Source: ${t}
|
|
21
|
+
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
22
|
+
Edge: ${e}
|
|
23
|
+
Source: ${t}
|
|
24
|
+
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
25
|
+
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
26
|
+
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Oe extends Error{constructor(t,...n){var o;super((o=vi[t])==null?void 0:o.call(vi,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Do(e){return"clientX"in e}function sd(e){return"sourceEvent"in e}function je(e,t){const n=Do(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-(t?.left??0),y:i-(t?.top??0)}}const Tn=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ad(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Vn(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const ld=()=>!0;function Jn(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function rd(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Dn(i,In(s))>0&&o.push(s);return o}const ud=250;function cd(e,t,n,o){var i,s;let a=[],l=Number.POSITIVE_INFINITY;const r=rd(e,n,t+ud);for(const u of r){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((s=u.handleBounds)==null?void 0:s.target)??[]];for(const f of c){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:d,y:_}=At(u,f,f.position,!0),k=Math.sqrt((d-e.x)**2+(_-e.y)**2);k>t||(k<l?(a=[{...f,x:d,y:_}],l=k):k===l&&a.push({...f,x:d,y:_}))}}if(!a.length)return null;if(a.length>1){const u=o.type==="source"?"target":"source";return a.find(c=>c.type===u)??a[0]}return a[0]}function pi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:r,isValidConnection:u=ld},c,f,d,_){const k=s==="target",p=t?a.querySelector(`.${l}-flow__handle[data-id="${r}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:w}=je(e),g=a.elementFromPoint(m,w),v=g?.classList.contains(`${l}-flow__handle`)?g:p,C={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const O=Ts(void 0,v),F=v.getAttribute("data-nodeid"),L=v.getAttribute("data-handleid"),R=v.classList.contains("connectable"),se=v.classList.contains("connectableend");if(!F||!O)return C;const K={source:k?F:o,sourceHandle:k?L:i,target:k?o:F,targetHandle:k?i:L};C.connection=K;const M=R&&se&&(n===dt.Strict?k&&O==="source"||!k&&O==="target":F!==o||L!==i);C.isValid=M&&u(K,{nodes:f,edges:c,sourceNode:d(K.source),targetNode:d(K.target)}),C.toHandle=Ps(F,O,L,_,n,!0)}return C}function Ts(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function dd(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function fd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Ps(e,t,n,o,i,s=!1){var a,l,r;const u=o.get(e);if(!u)return null;const c=i===dt.Strict?(a=u.handleBounds)==null?void 0:a[t]:[...((l=u.handleBounds)==null?void 0:l.source)??[],...((r=u.handleBounds)==null?void 0:r.target)??[]],f=(n?c?.find(d=>d.id===n):c?.[0])??null;return f&&s?{...f,...At(u,f,f.position,!0)}:f}const po={[ae.Left]:ae.Right,[ae.Right]:ae.Left,[ae.Top]:ae.Bottom,[ae.Bottom]:ae.Top},hd=["production","prod"];function an(e,...t){As()&&console.warn(`[Vue Flow]: ${e}`,...t)}function As(){return!hd.includes("production")}function gi(e,t,n,o,i){const s=t.querySelectorAll(`.vue-flow__handle.${e}`);return s?.length?Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Bn(a)}}):null}function go(e,t,n,o,i,s=!1,a){i.value=!1,e.selected?(s||e.selected&&t)&&(o([e]),Ge(()=>{a.blur()})):n([e])}function Pe(e){return typeof B(e)<"u"}function vd(e,t,n,o){if(!e||!e.source||!e.target)return n(new Oe(Ae.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let i;return ft(e)?i=e:i={...e,id:Es(e)},i=xs(i,void 0,o),Xc(i,t)?!1:i}function pd(e,t,n,o,i){if(!t.source||!t.target)return i(new Oe(Ae.EDGE_INVALID,e.id)),!1;if(!n)return i(new Oe(Ae.EDGE_NOT_FOUND,e.id)),!1;const{id:s,...a}=e;return{...a,id:o?Es(t):s,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function mi(e,t,n){const o={},i=[];for(let s=0;s<e.length;++s){const a=e[s];if(!_t(a)){n(new Oe(Ae.NODE_INVALID,a?.id)||`[ID UNKNOWN|INDEX ${s}]`);continue}const l=Wc(a,t(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[s]=l}for(const s of i){const a=t(s.parentNode)||i.find(l=>l.id===s.parentNode);s.parentNode&&!a&&n(new Oe(Ae.NODE_MISSING_PARENT,s.id,s.parentNode)),(s.parentNode||o[s.id])&&(o[s.id]&&(s.isParent=!0),a&&(a.isParent=!0))}return i}function yi(e,t,n,o,i,s){let a=i;const l=o.get(a)||new Map;o.set(a,l.set(n,t)),a=`${i}-${e}`;const r=o.get(a)||new Map;if(o.set(a,r.set(n,t)),s){a=`${i}-${e}-${s}`;const u=o.get(a)||new Map;o.set(a,u.set(n,t))}}function Qn(e,t,n){e.clear();for(const o of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=o,r={edgeId:o.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,c=`${s}-${l}--${i}-${a}`;yi("source",r,c,e,i,a),yi("target",r,u,e,s,l)}}function _i(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function eo(e,t,n,o,i,s,a,l){const r=[];for(const u of e){const c=ft(u)?u:vd(u,l,i,s);if(!c)continue;const f=n(c.source),d=n(c.target);if(!f||!d){i(new Oe(Ae.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!f){i(new Oe(Ae.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!d){i(new Oe(Ae.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:l,nodes:a,sourceNode:f,targetNode:d})){i(new Oe(Ae.EDGE_INVALID,c.id));continue}const _=o(c.id);r.push({...xs(c,_,s),sourceNode:f,targetNode:d})}return r}const wi=Symbol("vueFlow"),Os=Symbol("nodeId"),zs=Symbol("nodeRef"),gd=Symbol("edgeId"),md=Symbol("edgeRef"),Rn=Symbol("slots");function Bs(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:s,nodeExtent:a,nodeDragThreshold:l,viewport:r,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:f,panBy:d,findNode:_,multiSelectionActive:k,nodesSelectionActive:p,selectNodesOnDrag:m,removeSelectedElements:w,addSelectedNodes:g,updateNodePositions:v,emits:C}=De(),{onStart:O,onDrag:F,onStop:L,onClick:R,el:se,disabled:K,id:H,selectable:M,dragHandle:oe}=e,x=ct(!1);let I=[],b,A=null,V={x:void 0,y:void 0},W={x:0,y:0},U=null,te=!1,re=!1,fe=0,ge=!1;const j=wd(),ne=({x:de,y:ve})=>{V={x:de,y:ve};let E=!1;if(I=I.map(y=>{const N={x:de-y.distance.x,y:ve-y.distance.y},{computedPosition:S}=Io(y,n.value?Vn(N,o.value):N,C.error,a.value,y.parentNode?_(y.parentNode):void 0);return E=E||y.position.x!==S.x||y.position.y!==S.y,y.position=S,y}),re=re||E,!!E&&(v(I,!0,!0),x.value=!0,U)){const[y,N]=jn({id:H,dragItems:I,findNode:_});F({event:U,node:y,nodes:N})}},ee=()=>{if(!A)return;const[de,ve]=Is(W,A,c.value);if(de!==0||ve!==0){const E={x:(V.x??0)-de/r.value.zoom,y:(V.y??0)-ve/r.value.zoom};d({x:de,y:ve})&&ne(E)}fe=requestAnimationFrame(ee)},ce=(de,ve)=>{te=!0;const E=_(H);!m.value&&!k.value&&E&&(E.selected||w()),E&&be(M)&&m.value&&go(E,k.value,g,w,p,!1,ve);const y=j(de.sourceEvent);if(V=y,I=Qc(s.value,f.value,y,H),I.length){const[N,S]=jn({id:H,dragItems:I,findNode:_});O({event:de.sourceEvent,node:N,nodes:S})}},me=(de,ve)=>{var E;de.sourceEvent.type==="touchmove"&&de.sourceEvent.touches.length>1||(re=!1,l.value===0&&ce(de,ve),V=j(de.sourceEvent),A=((E=t.value)==null?void 0:E.getBoundingClientRect())||null,W=je(de.sourceEvent,A))},_e=(de,ve)=>{const E=j(de.sourceEvent);if(!ge&&te&&u.value&&(ge=!0,ee()),!te){const y=E.xSnapped-(V.x??0),N=E.ySnapped-(V.y??0);Math.sqrt(y*y+N*N)>l.value&&ce(de,ve)}(V.x!==E.xSnapped||V.y!==E.ySnapped)&&I.length&&te&&(U=de.sourceEvent,W=je(de.sourceEvent,A),ne(E))},ke=de=>{let ve=!1;if(!te&&!x.value&&!k.value){const E=de.sourceEvent,y=j(E),N=y.xSnapped-(V.x??0),S=y.ySnapped-(V.y??0),P=Math.sqrt(N*N+S*S);P!==0&&P<=l.value&&(R?.(E),ve=!0)}if(I.length&&!ve){re&&(v(I,!1,!1),re=!1);const[E,y]=jn({id:H,dragItems:I,findNode:_});L({event:de.sourceEvent,node:E,nodes:y})}I=[],x.value=!1,ge=!1,te=!1,V={x:void 0,y:void 0},cancelAnimationFrame(fe)};return Ee([()=>be(K),se],([de,ve],E,y)=>{if(ve){const N=Ye(ve);de||(b=Gr().on("start",S=>me(S,ve)).on("drag",S=>_e(S,ve)).on("end",S=>ke(S)).filter(S=>{const P=S.target,Z=be(oe);return!S.button&&(!i.value||!fi(P,`.${i.value}`,ve)&&(!Z||fi(P,Z,ve)))}),N.call(b)),y(()=>{N.on(".drag",null),b&&(b.on("start",null),b.on("drag",null),b.on("end",null))})}}),x}function yd(){return{doubleClick:X(),click:X(),mouseEnter:X(),mouseMove:X(),mouseLeave:X(),contextMenu:X(),updateStart:X(),update:X(),updateEnd:X()}}function _d(e,t){const n=yd();return n.doubleClick.on(o=>{var i,s;t.edgeDoubleClick(o),(s=(i=e.events)==null?void 0:i.doubleClick)==null||s.call(i,o)}),n.click.on(o=>{var i,s;t.edgeClick(o),(s=(i=e.events)==null?void 0:i.click)==null||s.call(i,o)}),n.mouseEnter.on(o=>{var i,s;t.edgeMouseEnter(o),(s=(i=e.events)==null?void 0:i.mouseEnter)==null||s.call(i,o)}),n.mouseMove.on(o=>{var i,s;t.edgeMouseMove(o),(s=(i=e.events)==null?void 0:i.mouseMove)==null||s.call(i,o)}),n.mouseLeave.on(o=>{var i,s;t.edgeMouseLeave(o),(s=(i=e.events)==null?void 0:i.mouseLeave)==null||s.call(i,o)}),n.contextMenu.on(o=>{var i,s;t.edgeContextMenu(o),(s=(i=e.events)==null?void 0:i.contextMenu)==null||s.call(i,o)}),n.updateStart.on(o=>{var i,s;t.edgeUpdateStart(o),(s=(i=e.events)==null?void 0:i.updateStart)==null||s.call(i,o)}),n.update.on(o=>{var i,s;t.edgeUpdate(o),(s=(i=e.events)==null?void 0:i.update)==null||s.call(i,o)}),n.updateEnd.on(o=>{var i,s;t.edgeUpdateEnd(o),(s=(i=e.events)==null?void 0:i.updateEnd)==null||s.call(i,o)}),Object.entries(n).reduce((o,[i,s])=>(o.emit[i]=s.trigger,o.on[i]=s.on,o),{emit:{},on:{}})}function wd(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=De();return i=>{var s;const a=((s=o.value)==null?void 0:s.getBoundingClientRect())??{left:0,top:0},l=sd(i)?i.sourceEvent:i,{x:r,y:u}=je(l,a),c=en({x:r,y:u},e.value),{x:f,y:d}=n.value?Vn(c,t.value):c;return{xSnapped:f,ySnapped:d,...c}}}function hn(){return!0}function Vs({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:s,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:r,connectionMode:u,connectionRadius:c,connectOnClick:f,connectionClickStartHandle:d,nodesConnectable:_,autoPanOnConnect:k,autoPanSpeed:p,findNode:m,panBy:w,startConnection:g,updateConnection:v,endConnection:C,emits:O,viewport:F,edges:L,nodes:R,isValidConnection:se,nodeLookup:K}=De();let H=null,M=!1,oe=null;function x(b){var A;const V=be(n)==="target",W=Do(b),U=oi(b.target),te=b.currentTarget;if(te&&(W&&b.button===0||!W)){let re=function(ie){E=je(ie,ke),ne=cd(en(E,F.value,!1,[1,1]),c.value,K.value,S),y||(N(),y=!0);const he=pi(ie,{handle:ne,connectionMode:u.value,fromNodeId:be(t),fromHandleId:be(e),fromType:V?"target":"source",isValidConnection:j,doc:U,lib:"vue",flowId:l,nodeLookup:K.value},L.value,R.value,m,K.value);oe=he.handleDomNode,H=he.connection,M=fd(!!ne,he.isValid);const we={...Q,isValid:M,to:he.toHandle&&M?Qt({x:he.toHandle.x,y:he.toHandle.y},F.value):E,toHandle:he.toHandle,toPosition:M&&he.toHandle?he.toHandle.position:po[S.position],toNode:he.toHandle?K.value.get(he.toHandle.nodeId):null};if(M&&ne&&Q?.toHandle&&we.toHandle&&Q.toHandle.type===we.toHandle.type&&Q.toHandle.nodeId===we.toHandle.nodeId&&Q.toHandle.id===we.toHandle.id&&Q.to.x===we.to.x&&Q.to.y===we.to.y)return;const z=ne??he.toHandle;if(v(z&&M?Qt({x:z.x,y:z.y},F.value):E,z,dd(!!z,M)),Q=we,!ne&&!M&&!oe)return Jn(ve);H&&H.source!==H.target&&oe&&(Jn(ve),ve=oe,oe.classList.add("connecting","vue-flow__handle-connecting"),oe.classList.toggle("valid",!!M),oe.classList.toggle("vue-flow__handle-valid",!!M))},fe=function(ie){"touches"in ie&&ie.touches.length>0||((ne||oe)&&H&&M&&(s?s(ie,H):O.connect(H)),O.connectEnd(ie),i&&a?.(ie),Jn(ve),cancelAnimationFrame(ee),C(ie),y=!1,M=!1,H=null,oe=null,U.removeEventListener("mousemove",re),U.removeEventListener("mouseup",fe),U.removeEventListener("touchmove",re),U.removeEventListener("touchend",fe))};const ge=m(be(t));let j=be(o)||se.value||hn;!j&&ge&&(j=(V?ge.isValidSourcePos:ge.isValidTargetPos)||hn);let ne,ee=0;const{x:ce,y:me}=je(b),_e=Ts(be(i),te),ke=(A=r.value)==null?void 0:A.getBoundingClientRect();if(!ke||!_e)return;const de=Ps(be(t),_e,be(e),K.value,u.value);if(!de)return;let ve,E=je(b,ke),y=!1;const N=()=>{if(!k.value)return;const[ie,he]=Is(E,ke,p.value);w({x:ie,y:he}),ee=requestAnimationFrame(N)},S={...de,nodeId:be(t),type:_e,position:de.position},P=K.value.get(be(t)),J={inProgress:!0,isValid:null,from:At(P,S,ae.Left,!0),fromHandle:S,fromPosition:S.position,fromNode:P,to:E,toHandle:null,toPosition:po[S.position],toNode:null};g({nodeId:be(t),id:be(e),type:_e,position:te?.getAttribute("data-handlepos")||ae.Top,...E},{x:ce-ke.left,y:me-ke.top}),O.connectStart({event:b,nodeId:be(t),handleId:be(e),handleType:_e});let Q=J;U.addEventListener("mousemove",re),U.addEventListener("mouseup",fe),U.addEventListener("touchmove",re),U.addEventListener("touchend",fe)}}function I(b){var A,V;if(!f.value)return;const W=be(n)==="target";if(!d.value){O.clickConnectStart({event:b,nodeId:be(t),handleId:be(e)}),g({nodeId:be(t),type:be(n),id:be(e),position:ae.Top,...je(b)},void 0,!0);return}let U=be(o)||se.value||hn;const te=m(be(t));if(!U&&te&&(U=(W?te.isValidSourcePos:te.isValidTargetPos)||hn),te&&(typeof te.connectable>"u"?_.value:te.connectable)===!1)return;const re=oi(b.target),fe=pi(b,{handle:{nodeId:be(t),id:be(e),type:be(n),position:ae.Top,...je(b)},connectionMode:u.value,fromNodeId:d.value.nodeId,fromHandleId:d.value.id??null,fromType:d.value.type,isValidConnection:U,doc:re,lib:"vue",flowId:l,nodeLookup:K.value},L.value,R.value,m,K.value),ge=((A=fe.connection)==null?void 0:A.source)===((V=fe.connection)==null?void 0:V.target);fe.isValid&&fe.connection&&!ge&&O.connect(fe.connection),O.clickConnectEnd(b),C(b,!0)}return{handlePointerDown:x,handleClick:I}}function bd(){return zt(Os,"")}function Rs(e){const t=e??bd()??"",n=zt(zs,Y(null)),{findNode:o,edges:i,emits:s}=De(),a=o(t);return a||s.error(new Oe(Ae.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:a,parentNode:G(()=>o(a.parentNode)),connectedEdges:G(()=>Cs([a],i.value))}}function xd(){return{doubleClick:X(),click:X(),mouseEnter:X(),mouseMove:X(),mouseLeave:X(),contextMenu:X(),dragStart:X(),drag:X(),dragStop:X()}}function Sd(e,t){const n=xd();return n.doubleClick.on(o=>{var i,s;t.nodeDoubleClick(o),(s=(i=e.events)==null?void 0:i.doubleClick)==null||s.call(i,o)}),n.click.on(o=>{var i,s;t.nodeClick(o),(s=(i=e.events)==null?void 0:i.click)==null||s.call(i,o)}),n.mouseEnter.on(o=>{var i,s;t.nodeMouseEnter(o),(s=(i=e.events)==null?void 0:i.mouseEnter)==null||s.call(i,o)}),n.mouseMove.on(o=>{var i,s;t.nodeMouseMove(o),(s=(i=e.events)==null?void 0:i.mouseMove)==null||s.call(i,o)}),n.mouseLeave.on(o=>{var i,s;t.nodeMouseLeave(o),(s=(i=e.events)==null?void 0:i.mouseLeave)==null||s.call(i,o)}),n.contextMenu.on(o=>{var i,s;t.nodeContextMenu(o),(s=(i=e.events)==null?void 0:i.contextMenu)==null||s.call(i,o)}),n.dragStart.on(o=>{var i,s;t.nodeDragStart(o),(s=(i=e.events)==null?void 0:i.dragStart)==null||s.call(i,o)}),n.drag.on(o=>{var i,s;t.nodeDrag(o),(s=(i=e.events)==null?void 0:i.drag)==null||s.call(i,o)}),n.dragStop.on(o=>{var i,s;t.nodeDragStop(o),(s=(i=e.events)==null?void 0:i.dragStop)==null||s.call(i,o)}),Object.entries(n).reduce((o,[i,s])=>(o.emit[i]=s.trigger,o.on[i]=s.on,o),{emit:{},on:{}})}function Hs(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:s,nodesDraggable:a,emits:l}=De();return(r,u=!1)=>{const c=s.value?i.value[0]:5,f=s.value?i.value[1]:5,d=u?4:1,_=r.x*c*d,k=r.y*f*d,p=[];for(const m of e.value)if(m.draggable||a&&typeof m.draggable>"u"){const w={x:m.computedPosition.x+_,y:m.computedPosition.y+k},{position:g}=Io(m,w,l.error,t.value,m.parentNode?o(m.parentNode):void 0);p.push({id:m.id,position:g,from:m.position,distance:{x:r.x,y:r.y},dimensions:m.dimensions})}n(p,!0,!1)}}const vn=.1,Ed=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function lt(){return an("Viewport not initialized yet."),Promise.resolve(!1)}const kd={zoomIn:lt,zoomOut:lt,zoomTo:lt,fitView:lt,setCenter:lt,fitBounds:lt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:lt,setTransform:lt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Nd(e){function t(o,i){return new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(i?.interpolate==="linear"?Gt:_n).scaleBy(to(e.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),o):s(!1)})}function n(o,i,s,a){return new Promise(l=>{var r;const{x:u,y:c}=bs({x:-o,y:-i},e.translateExtent),f=Pt.translate(-u,-c).scale(s);e.d3Selection&&e.d3Zoom?(r=e.d3Zoom)==null||r.interpolate(a?.interpolate==="linear"?Gt:_n).transform(to(e.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),f):l(!1)})}return G(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i),zoomOut:i=>t(1/1.2,i),zoomTo:(i,s)=>new Promise(a=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(s?.interpolate==="linear"?Gt:_n).scaleTo(to(e.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),i):a(!1)}),setViewport:(i,s)=>n(i.x,i.y,i.zoom,s),setTransform:(i,s)=>n(i.x,i.y,i.zoom,s),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:vn,includeHiddenNodes:!1,duration:0})=>{var s,a;const l=[];for(const d of e.nodes)d.dimensions.width&&d.dimensions.height&&(i?.includeHiddenNodes||!d.hidden)&&(!((s=i.nodes)!=null&&s.length)||(a=i.nodes)!=null&&a.length&&i.nodes.includes(d.id))&&l.push(d);if(!l.length)return Promise.resolve(!1);const r=Ns(l),{x:u,y:c,zoom:f}=ii(r,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??vn);return n(u,c,f,i)},setCenter:(i,s,a)=>{const l=typeof a?.zoom<"u"?a.zoom:e.maxZoom,r=e.dimensions.width/2-i*l,u=e.dimensions.height/2-s*l;return n(r,u,l,a)},fitBounds:(i,s={padding:vn})=>{const{x:a,y:l,zoom:r}=ii(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,s.padding??vn);return n(a,l,r,s)},project:i=>en(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:s,y:a}=e.vueFlowRef.getBoundingClientRect(),l={x:i.x-s,y:i.y-a};return en(l,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:s,y:a}=e.vueFlowRef.getBoundingClientRect(),l={x:i.x+s,y:i.y+a};return Qt(l,e.viewport)}return{x:0,y:0}}}:kd)}function to(e,t=0,n=Ed,o=()=>{}){const i=typeof t=="number"&&t>0;return i||o(),i?e.transition().duration(t).ease(n).on("end",o):e}function $d(e,t,n){const o=Mi(!0);return o.run(()=>{const i=()=>{o.run(()=>{let p,m,w=!!(n.nodes.value.length||n.edges.value.length);p=Et([e.modelValue,()=>{var g,v;return(v=(g=e.modelValue)==null?void 0:g.value)==null?void 0:v.length}],([g])=>{g&&Array.isArray(g)&&(m?.pause(),n.setElements(g),!m&&!w&&g.length?w=!0:m?.resume())}),m=Et([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([g,v])=>{var C;(C=e.modelValue)!=null&&C.value&&Array.isArray(e.modelValue.value)&&(p?.pause(),e.modelValue.value=[...g,...v],Ge(()=>{p?.resume()}))},{immediate:w}),gn(()=>{p?.stop(),m?.stop()})})},s=()=>{o.run(()=>{let p,m,w=!!n.nodes.value.length;p=Et([e.nodes,()=>{var g,v;return(v=(g=e.nodes)==null?void 0:g.value)==null?void 0:v.length}],([g])=>{g&&Array.isArray(g)&&(m?.pause(),n.setNodes(g),!m&&!w&&g.length?w=!0:m?.resume())}),m=Et([n.nodes,()=>n.nodes.value.length],([g])=>{var v;(v=e.nodes)!=null&&v.value&&Array.isArray(e.nodes.value)&&(p?.pause(),e.nodes.value=[...g],Ge(()=>{p?.resume()}))},{immediate:w}),gn(()=>{p?.stop(),m?.stop()})})},a=()=>{o.run(()=>{let p,m,w=!!n.edges.value.length;p=Et([e.edges,()=>{var g,v;return(v=(g=e.edges)==null?void 0:g.value)==null?void 0:v.length}],([g])=>{g&&Array.isArray(g)&&(m?.pause(),n.setEdges(g),!m&&!w&&g.length?w=!0:m?.resume())}),m=Et([n.edges,()=>n.edges.value.length],([g])=>{var v;(v=e.edges)!=null&&v.value&&Array.isArray(e.edges.value)&&(p?.pause(),e.edges.value=[...g],Ge(()=>{p?.resume()}))},{immediate:w}),gn(()=>{p?.stop(),m?.stop()})})},l=()=>{o.run(()=>{Ee(()=>t.maxZoom,()=>{t.maxZoom&&Pe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},r=()=>{o.run(()=>{Ee(()=>t.minZoom,()=>{t.minZoom&&Pe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{Ee(()=>t.translateExtent,()=>{t.translateExtent&&Pe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{Ee(()=>t.nodeExtent,()=>{t.nodeExtent&&Pe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{Ee(()=>t.applyDefault,()=>{Pe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},d=()=>{o.run(()=>{const p=async m=>{let w=m;typeof t.autoConnect=="function"&&(w=await t.autoConnect(m)),w!==!1&&n.addEdges([w])};Ee(()=>t.autoConnect,()=>{Pe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),Ee(n.autoConnect,(m,w,g)=>{m?n.onConnect(p):n.hooks.value.connect.off(p),g(()=>{n.hooks.value.connect.off(p)})},{immediate:!0})})},_=()=>{const p=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const m of Object.keys(t)){const w=m;if(!p.includes(w)){const g=Ie(()=>t[w]),v=n[w];_o(v)&&o.run(()=>{Ee(g,C=>{Pe(C)&&(v.value=C)},{immediate:!0})})}}};(()=>{i(),s(),a(),r(),l(),u(),c(),f(),d(),_()})()}),()=>o.stop()}function Cd(){return{edgesChange:X(),nodesChange:X(),nodeDoubleClick:X(),nodeClick:X(),nodeMouseEnter:X(),nodeMouseMove:X(),nodeMouseLeave:X(),nodeContextMenu:X(),nodeDragStart:X(),nodeDrag:X(),nodeDragStop:X(),nodesInitialized:X(),miniMapNodeClick:X(),miniMapNodeDoubleClick:X(),miniMapNodeMouseEnter:X(),miniMapNodeMouseMove:X(),miniMapNodeMouseLeave:X(),connect:X(),connectStart:X(),connectEnd:X(),clickConnectStart:X(),clickConnectEnd:X(),paneReady:X(),init:X(),move:X(),moveStart:X(),moveEnd:X(),selectionDragStart:X(),selectionDrag:X(),selectionDragStop:X(),selectionContextMenu:X(),selectionStart:X(),selectionEnd:X(),viewportChangeStart:X(),viewportChange:X(),viewportChangeEnd:X(),paneScroll:X(),paneClick:X(),paneContextMenu:X(),paneMouseEnter:X(),paneMouseMove:X(),paneMouseLeave:X(),edgeContextMenu:X(),edgeMouseEnter:X(),edgeMouseMove:X(),edgeMouseLeave:X(),edgeDoubleClick:X(),edgeClick:X(),edgeUpdateStart:X(),edgeUpdate:X(),edgeUpdateEnd:X(),updateNodeInternals:X(),error:X(e=>an(e.message))}}function Md(e,t){const n=Bt();ea(()=>{for(const[i,s]of Object.entries(t.value)){const a=l=>{e(i,l)};s.setEmitter(a),Zt(s.removeEmitter),s.setHasEmitListeners(()=>o(i)),Zt(s.removeHasEmitListeners)}});function o(i){var s;const a=Id(i);return!!((s=n?.vnode.props)==null?void 0:s[a])}}function Id(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(i,s)=>s.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function Ls(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Mo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Wt.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:pt.Bezier,style:{}},connectionMode:dt.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:Tn()?"Meta":"Control",zoomActivationKeyCode:Tn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Cd(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Dd=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Td(e,t,n){const o=Nd(e),i=E=>{const y=E??[];e.hooks.updateNodeInternals.trigger(y)},s=E=>Uc(E,e.nodes,e.edges),a=E=>Yc(E,e.nodes,e.edges),l=E=>Cs(E,e.edges),r=({id:E,type:y,nodeId:N})=>{var S;const P=E?`-${y}-${E}`:`-${y}`;return Array.from(((S=e.connectionLookup.get(`${N}${P}`))==null?void 0:S.values())??[])},u=E=>{if(E)return t.value.get(E)},c=E=>{if(E)return n.value.get(E)},f=(E,y,N)=>{var S,P;const Z=[];for(const J of E){const Q={id:J.id,type:"position",dragging:N,from:J.from};if(y&&(Q.position=J.position,J.parentNode)){const ie=u(J.parentNode);Q.position={x:Q.position.x-(((S=ie?.computedPosition)==null?void 0:S.x)??0),y:Q.position.y-(((P=ie?.computedPosition)==null?void 0:P.y)??0)}}Z.push(Q)}Z?.length&&e.hooks.nodesChange.trigger(Z)},d=E=>{if(!e.vueFlowRef)return;const y=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!y)return;const N=window.getComputedStyle(y),{m22:S}=new window.DOMMatrixReadOnly(N.transform),P=[];for(const Z of E){const J=Z,Q=u(J.id);if(Q){const ie=Bn(J.nodeElement);if(!!(ie.width&&ie.height&&(Q.dimensions.width!==ie.width||Q.dimensions.height!==ie.height||J.forceUpdate))){const we=J.nodeElement.getBoundingClientRect();Q.dimensions=ie,Q.handleBounds.source=gi("source",J.nodeElement,we,S,Q.id),Q.handleBounds.target=gi("target",J.nodeElement,we,S,Q.id),P.push({id:Q.id,type:"dimensions",dimensions:ie})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),P.length&&e.hooks.nodesChange.trigger(P)},_=(E,y)=>{const N=new Set,S=new Set;for(const J of E)_t(J)?N.add(J.id):ft(J)&&S.add(J.id);const P=ut(t.value,N,!0),Z=ut(n.value,S);if(e.multiSelectionActive){for(const J of N)P.push(rt(J,y));for(const J of S)Z.push(rt(J,y))}P.length&&e.hooks.nodesChange.trigger(P),Z.length&&e.hooks.edgesChange.trigger(Z)},k=E=>{if(e.multiSelectionActive){const y=E.map(N=>rt(N.id,!0));e.hooks.nodesChange.trigger(y);return}e.hooks.nodesChange.trigger(ut(t.value,new Set(E.map(y=>y.id)),!0)),e.hooks.edgesChange.trigger(ut(n.value))},p=E=>{if(e.multiSelectionActive){const y=E.map(N=>rt(N.id,!0));e.hooks.edgesChange.trigger(y);return}e.hooks.edgesChange.trigger(ut(n.value,new Set(E.map(y=>y.id)))),e.hooks.nodesChange.trigger(ut(t.value,new Set,!0))},m=E=>{_(E,!0)},w=E=>{const N=(E||e.nodes).map(S=>(S.selected=!1,rt(S.id,!1)));e.hooks.nodesChange.trigger(N)},g=E=>{const N=(E||e.edges).map(S=>(S.selected=!1,rt(S.id,!1)));e.hooks.edgesChange.trigger(N)},v=E=>{if(!E||!E.length)return _([],!1);const y=E.reduce((N,S)=>{const P=rt(S.id,!1);return _t(S)?N.nodes.push(P):N.edges.push(P),N},{nodes:[],edges:[]});y.nodes.length&&e.hooks.nodesChange.trigger(y.nodes),y.edges.length&&e.hooks.edgesChange.trigger(y.edges)},C=E=>{var y;(y=e.d3Zoom)==null||y.scaleExtent([E,e.maxZoom]),e.minZoom=E},O=E=>{var y;(y=e.d3Zoom)==null||y.scaleExtent([e.minZoom,E]),e.maxZoom=E},F=E=>{var y;(y=e.d3Zoom)==null||y.translateExtent(E),e.translateExtent=E},L=E=>{e.nodeExtent=E,i()},R=E=>{var y;(y=e.d3Zoom)==null||y.clickDistance(E)},se=E=>{e.nodesDraggable=E,e.nodesConnectable=E,e.elementsSelectable=E},K=E=>{const y=E instanceof Function?E(e.nodes):E;!e.initialized&&!y.length||(e.nodes=mi(y,u,e.hooks.error.trigger))},H=E=>{const y=E instanceof Function?E(e.edges):E;if(!e.initialized&&!y.length)return;const N=eo(y,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Qn(e.connectionLookup,n.value,N),e.edges=N},M=E=>{const y=E instanceof Function?E([...e.nodes,...e.edges]):E;!e.initialized&&!y.length||(K(y.filter(_t)),H(y.filter(ft)))},oe=E=>{let y=E instanceof Function?E(e.nodes):E;y=Array.isArray(y)?y:[y];const N=mi(y,u,e.hooks.error.trigger),S=[];for(const P of N)S.push(ri(P));S.length&&e.hooks.nodesChange.trigger(S)},x=E=>{let y=E instanceof Function?E(e.edges):E;y=Array.isArray(y)?y:[y];const N=eo(y,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),S=[];for(const P of N)S.push(ri(P));S.length&&e.hooks.edgesChange.trigger(S)},I=(E,y=!0,N=!1)=>{const S=E instanceof Function?E(e.nodes):E,P=Array.isArray(S)?S:[S],Z=[],J=[];function Q(he){const we=l(he);for(const z of we)(!Pe(z.deletable)||z.deletable)&&J.push(ci(z.id,z.source,z.target,z.sourceHandle,z.targetHandle))}function ie(he){const we=[];for(const z of e.nodes)z.parentNode===he&&we.push(z);if(we.length){for(const z of we)Z.push(ui(z.id));y&&Q(we);for(const z of we)ie(z.id)}}for(const he of P){const we=typeof he=="string"?u(he):he;we&&(Pe(we.deletable)&&!we.deletable||(Z.push(ui(we.id)),y&&Q([we]),N&&ie(we.id)))}J.length&&e.hooks.edgesChange.trigger(J),Z.length&&e.hooks.nodesChange.trigger(Z)},b=E=>{const y=E instanceof Function?E(e.edges):E,N=Array.isArray(y)?y:[y],S=[];for(const P of N){const Z=typeof P=="string"?c(P):P;Z&&(Pe(Z.deletable)&&!Z.deletable||S.push(ci(typeof P=="string"?P:P.id,Z.source,Z.target,Z.sourceHandle,Z.targetHandle)))}e.hooks.edgesChange.trigger(S)},A=(E,y,N=!0)=>{const S=c(E.id);if(!S)return!1;const P=e.edges.indexOf(S),Z=pd(E,y,S,N,e.hooks.error.trigger);if(Z){const[J]=eo([Z],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Q,ie)=>ie===P?J:Q),Qn(e.connectionLookup,n.value,[J]),J}return!1},V=(E,y,N={replace:!1})=>{const S=c(E);if(!S)return;const P=typeof y=="function"?y(S):y;S.data=N.replace?P:{...S.data,...P}},W=E=>li(E,e.nodes),U=E=>{const y=li(E,e.edges);return Qn(e.connectionLookup,n.value,y),y},te=(E,y,N={replace:!1})=>{const S=u(E);if(!S)return;const P=typeof y=="function"?y(S):y;N.replace?e.nodes.splice(e.nodes.indexOf(S),1,P):Object.assign(S,P)},re=(E,y,N={replace:!1})=>{const S=u(E);if(!S)return;const P=typeof y=="function"?y(S):y;S.data=N.replace?P:{...S.data,...P}},fe=(E,y,N=!1)=>{N?e.connectionClickStartHandle=E:e.connectionStartHandle=E,e.connectionEndHandle=null,e.connectionStatus=null,y&&(e.connectionPosition=y)},ge=(E,y=null,N=null)=>{e.connectionStartHandle&&(e.connectionPosition=E,e.connectionEndHandle=y,e.connectionStatus=N)},j=(E,y)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,y?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ne=E=>{const y=Gc(E),N=y?null:Ft(E)?E:u(E.id);return!y&&!N?[null,null,y]:[y?E:In(N),N,y]},ee=(E,y=!0,N=e.nodes)=>{const[S,P,Z]=ne(E);if(!S)return[];const J=[];for(const Q of N||e.nodes){if(!Z&&(Q.id===P.id||!Q.computedPosition))continue;const ie=In(Q),he=Dn(ie,S);(y&&he>0||he>=ie.width*ie.height||he>=Number(S.width)*Number(S.height))&&J.push(Q)}return J},ce=(E,y,N=!0)=>{const[S]=ne(E);if(!S)return!1;const P=Dn(S,y);return N&&P>0||P>=Number(S.width)*Number(S.height)},me=E=>{const{viewport:y,dimensions:N,d3Zoom:S,d3Selection:P,translateExtent:Z}=e;if(!S||!P||!E.x&&!E.y)return!1;const J=Pt.translate(y.x+E.x,y.y+E.y).scale(y.zoom),Q=[[0,0],[N.width,N.height]],ie=S.constrain()(J,Q,Z),he=e.viewport.x!==ie.x||e.viewport.y!==ie.y||e.viewport.zoom!==ie.k;return S.transform(P,ie),he},_e=E=>{const y=E instanceof Function?E(e):E,N=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Pe(y.defaultEdgeOptions)&&(e.defaultEdgeOptions=y.defaultEdgeOptions);const S=y.modelValue||y.nodes||y.edges?[]:void 0;S&&(y.modelValue&&S.push(...y.modelValue),y.nodes&&S.push(...y.nodes),y.edges&&S.push(...y.edges),M(S));const P=()=>{Pe(y.maxZoom)&&O(y.maxZoom),Pe(y.minZoom)&&C(y.minZoom),Pe(y.translateExtent)&&F(y.translateExtent)};for(const Z of Object.keys(y)){const J=Z,Q=y[J];![...Dd,...N].includes(J)&&Pe(Q)&&(e[J]=Q)}oo(()=>e.d3Zoom).not.toBeNull().then(P),e.initialized||(e.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:d,setElements:M,setNodes:K,setEdges:H,addNodes:oe,addEdges:x,removeNodes:I,removeEdges:b,findNode:u,findEdge:c,updateEdge:A,updateEdgeData:V,updateNode:te,updateNodeData:re,applyEdgeChanges:U,applyNodeChanges:W,addSelectedElements:m,addSelectedNodes:k,addSelectedEdges:p,setMinZoom:C,setMaxZoom:O,setTranslateExtent:F,setNodeExtent:L,setPaneClickDistance:R,removeSelectedElements:v,removeSelectedNodes:w,removeSelectedEdges:g,startConnection:fe,updateConnection:ge,endConnection:j,setInteractive:se,setState:_e,getIntersectingNodes:ee,getIncomers:s,getOutgoers:a,getConnectedEdges:l,getHandleConnections:r,isNodeIntersecting:ce,panBy:me,fitView:E=>o.value.fitView(E),zoomIn:E=>o.value.zoomIn(E),zoomOut:E=>o.value.zoomOut(E),zoomTo:(E,y)=>o.value.zoomTo(E,y),setViewport:(E,y)=>o.value.setViewport(E,y),setTransform:(E,y)=>o.value.setTransform(E,y),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(E,y,N)=>o.value.setCenter(E,y,N),fitBounds:(E,y)=>o.value.fitBounds(E,y),project:E=>o.value.project(E),screenToFlowCoordinate:E=>o.value.screenToFlowCoordinate(E),flowToScreenCoordinate:E=>o.value.flowToScreenCoordinate(E),toObject:()=>{const E=[],y=[];for(const N of e.nodes){const{computedPosition:S,handleBounds:P,selected:Z,dimensions:J,isParent:Q,resizing:ie,dragging:he,events:we,...z}=N;E.push(z)}for(const N of e.edges){const{selected:S,sourceNode:P,targetNode:Z,events:J,...Q}=N;y.push(Q)}return JSON.parse(JSON.stringify({nodes:E,edges:y,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:E=>new Promise(y=>{const{nodes:N,edges:S,position:P,zoom:Z,viewport:J}=E;N&&K(N),S&&H(S);const[Q,ie]=J?.x&&J?.y?[J.x,J.y]:P??[null,null];if(Q&&ie){const he=J?.zoom||Z||e.viewport.zoom;return oo(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:Q,y:ie,zoom:he}).then(()=>{y(!0)})})}else y(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const E=Ls();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const y=Pt.translate(E.defaultViewport.x??0,E.defaultViewport.y??0).scale(xt(E.defaultViewport.zoom??1,E.minZoom,E.maxZoom)),N=e.viewportRef.getBoundingClientRect(),S=[[0,0],[N.width,N.height]],P=e.d3Zoom.constrain()(y,S,E.translateExtent);e.d3Zoom.transform(e.d3Selection,P)}_e(E)},$destroy:()=>{}}}const Pd=["data-id","data-handleid","data-nodeid","data-handlepos"],Ad={name:"Handle",compatConfig:{MODE:3}},Ot=pe({...Ad,props:{id:{default:null},type:{},position:{default:()=>ae.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=Qs(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Ie(()=>n.type??"source"),i=Ie(()=>n.isValidConnection??null),{id:s,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:r,vueFlowRef:u,nodesConnectable:c,noDragClassName:f,noPanClassName:d}=De(),{id:_,node:k,nodeEl:p,connectedEdges:m}=Rs(),w=Y(),g=Ie(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),v=Ie(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),C=Ie(()=>{var H,M,oe,x,I,b;return((H=a.value)==null?void 0:H.nodeId)===_&&((M=a.value)==null?void 0:M.id)===e.id&&((oe=a.value)==null?void 0:oe.type)===o.value||((x=r.value)==null?void 0:x.nodeId)===_&&((I=r.value)==null?void 0:I.id)===e.id&&((b=r.value)==null?void 0:b.type)===o.value}),O=Ie(()=>{var H,M,oe;return((H=l.value)==null?void 0:H.nodeId)===_&&((M=l.value)==null?void 0:M.id)===e.id&&((oe=l.value)==null?void 0:oe.type)===o.value}),{handlePointerDown:F,handleClick:L}=Vs({nodeId:_,handleId:e.id,isValidConnection:i,type:o}),R=G(()=>typeof e.connectable=="string"&&e.connectable==="single"?!m.value.some(H=>{const M=H[`${o.value}Handle`];return H[o.value]!==_?!1:M?M===e.id:!0}):typeof e.connectable=="number"?m.value.filter(H=>{const M=H[`${o.value}Handle`];return H[o.value]!==_?!1:M?M===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(k,m.value):Pe(e.connectable)?e.connectable:c.value);Xe(()=>{var H;if(!k.dimensions.width||!k.dimensions.height)return;const M=(H=k.handleBounds[o.value])==null?void 0:H.find(W=>W.id===e.id);if(!u.value||M)return;const oe=u.value.querySelector(".vue-flow__transformationpane");if(!p.value||!w.value||!oe||!e.id)return;const x=p.value.getBoundingClientRect(),I=w.value.getBoundingClientRect(),b=window.getComputedStyle(oe),{m22:A}=new window.DOMMatrixReadOnly(b.transform),V={id:e.id,position:e.position,x:(I.left-x.left)/A,y:(I.top-x.top)/A,type:o.value,nodeId:_,...Bn(w.value)};k.handleBounds[o.value]=[...k.handleBounds[o.value]??[],V]});function se(H){const M=Do(H);R.value&&g.value&&(M&&H.button===0||!M)&&F(H)}function K(H){!_||!l.value&&!g.value||R.value&&L(H)}return t({handleClick:L,handlePointerDown:F,onClick:K,onPointerDown:se}),(H,M)=>($(),D("div",{ref_key:"handle",ref:w,"data-id":`${B(s)}-${B(_)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":B(_),"data-handlepos":H.position,class:Ce(["vue-flow__handle",[`vue-flow__handle-${H.position}`,`vue-flow__handle-${e.id}`,B(f),B(d),o.value,{connectable:R.value,connecting:O.value,connectablestart:g.value,connectableend:v.value,connectionindicator:R.value&&(g.value&&!C.value||v.value&&C.value)}]]),onMousedown:se,onTouchstartPassive:se,onClick:K},[Re(H.$slots,"default",{id:H.id})],42,Pd))}}),Hn=function({sourcePosition:e=ae.Bottom,targetPosition:t=ae.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:s,data:a}){const l=a.label??n;return[$e(Ot,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof l!="string"&&l?$e(l):$e(Ne,[l]),$e(Ot,{type:"source",position:e,connectable:o,isValidConnection:s})]};Hn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Hn.inheritAttrs=!1;Hn.compatConfig={MODE:3};const Od=Hn,Ln=function({targetPosition:e=ae.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const s=i.label??t;return[$e(Ot,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof s!="string"&&s?$e(s):$e(Ne,[s])]};Ln.props=["targetPosition","label","isValidTargetPos","connectable","data"];Ln.inheritAttrs=!1;Ln.compatConfig={MODE:3};const zd=Ln,Fn=function({sourcePosition:e=ae.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const s=i.label??t;return[typeof s!="string"&&s?$e(s):$e(Ne,[s]),$e(Ot,{type:"source",position:e,connectable:n,isValidConnection:o})]};Fn.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Fn.inheritAttrs=!1;Fn.compatConfig={MODE:3};const Bd=Fn,Vd=["transform"],Rd=["width","height","x","y","rx","ry"],Hd=["y"],Ld={name:"EdgeText",compatConfig:{MODE:3}},Fd=pe({...Ld,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=Y({x:0,y:0,width:0,height:0}),n=Y(null),o=G(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);Xe(i),Ee([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const s=n.value.getBBox();(s.width!==t.value.width||s.height!==t.value.height)&&(t.value=s)}return(s,a)=>($(),D("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[s.labelShowBg?($(),D("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*s.labelBgPadding[0]}px`,height:`${t.value.height+2*s.labelBgPadding[1]}px`,x:-s.labelBgPadding[0],y:-s.labelBgPadding[1],style:Ve(s.labelBgStyle),rx:s.labelBgBorderRadius,ry:s.labelBgBorderRadius},null,12,Rd)):ue("",!0),h("text",Ti(s.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:s.labelStyle}),[Re(s.$slots,"default",{},()=>[typeof s.label!="string"?($(),Me(sa(s.label),{key:0})):($(),D(Ne,{key:1},[Se(q(s.label),1)],64))])],16,Hd)],8,Vd))}}),Gd=["id","d","marker-end","marker-start"],Wd=["d","stroke-width"],Yd={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Gn=pe({...Yd,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=Y(null),o=Y(null),i=Y(null),s=ia();return t({pathEl:n,interactionEl:o,labelEl:i}),(a,l)=>($(),D(Ne,null,[h("path",Ti(B(s),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,Gd),a.interactionWidth?($(),D("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Wd)):ue("",!0),a.label&&a.labelX&&a.labelY?($(),Me(Fd,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):ue("",!0)],64))}});function Fs({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(o-t)/2,l=o<t?o+a:o-a;return[s,l,i,a]}function Gs({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){const r=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+o*.125,c=Math.abs(r-e),f=Math.abs(u-t);return[r,u,c,f]}function pn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function bi({pos:e,x1:t,y1:n,x2:o,y2:i,c:s}){let a,l;switch(e){case ae.Left:a=t-pn(t-o,s),l=n;break;case ae.Right:a=t+pn(o-t,s),l=n;break;case ae.Top:a=t,l=n-pn(n-i,s);break;case ae.Bottom:a=t,l=n+pn(i-n,s);break}return[a,l]}function Ws(e){const{sourceX:t,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:s,targetPosition:a=ae.Top,curvature:l=.25}=e,[r,u]=bi({pos:o,x1:t,y1:n,x2:i,y2:s,c:l}),[c,f]=bi({pos:a,x1:i,y1:s,x2:t,y2:n,c:l}),[d,_,k,p]=Gs({sourceX:t,sourceY:n,targetX:i,targetY:s,sourceControlX:r,sourceControlY:u,targetControlX:c,targetControlY:f});return[`M${t},${n} C${r},${u} ${c},${f} ${i},${s}`,d,_,k,p]}function xi({pos:e,x1:t,y1:n,x2:o,y2:i}){let s,a;switch(e){case ae.Left:case ae.Right:s=.5*(t+o),a=n;break;case ae.Top:case ae.Bottom:s=t,a=.5*(n+i);break}return[s,a]}function Ys(e){const{sourceX:t,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:s,targetPosition:a=ae.Top}=e,[l,r]=xi({pos:o,x1:t,y1:n,x2:i,y2:s}),[u,c]=xi({pos:a,x1:i,y1:s,x2:t,y2:n}),[f,d,_,k]=Gs({sourceX:t,sourceY:n,targetX:i,targetY:s,sourceControlX:l,sourceControlY:r,targetControlX:u,targetControlY:c});return[`M${t},${n} C${l},${r} ${u},${c} ${i},${s}`,f,d,_,k]}const Si={[ae.Left]:{x:-1,y:0},[ae.Right]:{x:1,y:0},[ae.Top]:{x:0,y:-1},[ae.Bottom]:{x:0,y:1}};function Ud({source:e,sourcePosition:t=ae.Bottom,target:n}){return t===ae.Left||t===ae.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Ei(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Xd({source:e,sourcePosition:t=ae.Bottom,target:n,targetPosition:o=ae.Top,center:i,offset:s}){const a=Si[t],l=Si[o],r={x:e.x+a.x*s,y:e.y+a.y*s},u={x:n.x+l.x*s,y:n.y+l.y*s},c=Ud({source:r,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",d=c[f];let _,k,p;const m={x:0,y:0},w={x:0,y:0},[g,v,C,O]=Fs({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){k=i.x??g,p=i.y??v;const L=[{x:k,y:r.y},{x:k,y:u.y}],R=[{x:r.x,y:p},{x:u.x,y:p}];a[f]===d?_=f==="x"?L:R:_=f==="x"?R:L}else{const L=[{x:r.x,y:u.y}],R=[{x:u.x,y:r.y}];if(f==="x"?_=a.x===d?R:L:_=a.y===d?L:R,t===o){const oe=Math.abs(e[f]-n[f]);if(oe<=s){const x=Math.min(s-1,s-oe);a[f]===d?m[f]=(r[f]>e[f]?-1:1)*x:w[f]=(u[f]>n[f]?-1:1)*x}}if(t!==o){const oe=f==="x"?"y":"x",x=a[f]===l[oe],I=r[oe]>u[oe],b=r[oe]<u[oe];(a[f]===1&&(!x&&I||x&&b)||a[f]!==1&&(!x&&b||x&&I))&&(_=f==="x"?L:R)}const se={x:r.x+m.x,y:r.y+m.y},K={x:u.x+w.x,y:u.y+w.y},H=Math.max(Math.abs(se.x-_[0].x),Math.abs(K.x-_[0].x)),M=Math.max(Math.abs(se.y-_[0].y),Math.abs(K.y-_[0].y));H>=M?(k=(se.x+K.x)/2,p=_[0].y):(k=_[0].x,p=(se.y+K.y)/2)}return[[e,{x:r.x+m.x,y:r.y+m.y},..._,{x:u.x+w.x,y:u.y+w.y},n],k,p,C,O]}function Zd(e,t,n,o){const i=Math.min(Ei(e,t)/2,Ei(t,n)/2,o),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*c}`}const l=e.x<n.x?1:-1,r=e.y<n.y?-1:1;return`L ${s},${a+i*r}Q ${s},${a} ${s+i*l},${a}`}function mo(e){const{sourceX:t,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:s,targetPosition:a=ae.Top,borderRadius:l=5,centerX:r,centerY:u,offset:c=20}=e,[f,d,_,k,p]=Xd({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:s},targetPosition:a,center:{x:r,y:u},offset:c});return[f.reduce((w,g,v)=>{let C;return v>0&&v<f.length-1?C=Zd(f[v-1],g,f[v+1],l):C=`${v===0?"M":"L"}${g.x} ${g.y}`,w+=C,w},""),d,_,k,p]}function Kd(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[s,a,l,r]=Fs({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,s,a,l,r]}const qd=pe({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Kd(e);return $e(Gn,{path:n,labelX:o,labelY:i,...t,...e})}}}),jd=qd,Jd=pe({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=mo({...e,sourcePosition:e.sourcePosition??ae.Bottom,targetPosition:e.targetPosition??ae.Top});return $e(Gn,{path:n,labelX:o,labelY:i,...t,...e})}}}),Us=Jd,Qd=pe({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>$e(Us,{...e,...t,borderRadius:0})}}),ef=Qd,tf=pe({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Ws({...e,sourcePosition:e.sourcePosition??ae.Bottom,targetPosition:e.targetPosition??ae.Top});return $e(Gn,{path:n,labelX:o,labelY:i,...t,...e})}}}),nf=tf,of=pe({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Ys({...e,sourcePosition:e.sourcePosition??ae.Bottom,targetPosition:e.targetPosition??ae.Top});return $e(Gn,{path:n,labelX:o,labelY:i,...t,...e})}}}),sf=of,af={input:Bd,default:Od,output:zd},lf={default:nf,straight:jd,step:ef,smoothstep:Us,simplebezier:sf};function rf(e,t,n){const o=G(()=>p=>t.value.get(p)),i=G(()=>p=>n.value.get(p)),s=G(()=>{const p={...lf,...e.edgeTypes},m=Object.keys(p);for(const w of e.edges)w.type&&!m.includes(w.type)&&(p[w.type]=w.type);return p}),a=G(()=>{const p={...af,...e.nodeTypes},m=Object.keys(p);for(const w of e.nodes)w.type&&!m.includes(w.type)&&(p[w.type]=w.type);return p}),l=G(()=>e.onlyRenderVisibleElements?$s(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),r=G(()=>{if(e.onlyRenderVisibleElements){const p=[];for(const m of e.edges){const w=t.value.get(m.source),g=t.value.get(m.target);od({sourcePos:w.computedPosition||{x:0,y:0},targetPos:g.computedPosition||{x:0,y:0},sourceWidth:w.dimensions.width,sourceHeight:w.dimensions.height,targetWidth:g.dimensions.width,targetHeight:g.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&p.push(m)}return p}return e.edges}),u=G(()=>[...l.value,...r.value]),c=G(()=>{const p=[];for(const m of e.nodes)m.selected&&p.push(m);return p}),f=G(()=>{const p=[];for(const m of e.edges)m.selected&&p.push(m);return p}),d=G(()=>[...c.value,...f.value]),_=G(()=>{const p=[];for(const m of e.nodes)m.dimensions.width&&m.dimensions.height&&m.handleBounds!==void 0&&p.push(m);return p}),k=G(()=>l.value.length>0&&_.value.length===l.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:s,getNodeTypes:a,getEdges:r,getNodes:l,getSelectedElements:d,getSelectedNodes:c,getSelectedEdges:f,getNodesInitialized:_,areNodesInitialized:k}}class gt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=Bt())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??gt.instance;return gt.instance=o??new gt,n&&(n.config.globalProperties.$vueFlowStorage=gt.instance),gt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=Ls(),i=$i(o),s={};for(const[d,_]of Object.entries(i.hooks)){const k=`on${d.charAt(0).toUpperCase()+d.slice(1)}`;s[k]=_.on}const a={};for(const[d,_]of Object.entries(i.hooks))a[d]=_.trigger;const l=G(()=>{const d=new Map;for(const _ of i.nodes)d.set(_.id,_);return d}),r=G(()=>{const d=new Map;for(const _ of i.edges)d.set(_.id,_);return d}),u=rf(i,l,r),c=Td(i,l,r);c.setState({...i,...n});const f={...s,...u,...c,...Ja(i),nodeLookup:l,edgeLookup:r,emits:a,id:t,vueFlowVersion:"1.48.1",$destroy:()=>{this.remove(t)}};return this.set(t,f),f}getId(){return`vue-flow-${this.currentId++}`}}function De(e){const t=gt.getInstance(),n=Ci(),o=typeof e=="object",i=o?e:{id:e},s=i.id,a=s??n?.vueFlowId;let l;if(n){const r=zt(wi,null);typeof r<"u"&&r!==null&&(!a||r.id===a)&&(l=r)}if(l||a&&(l=t.get(a)),!l||a&&l.id!==a){const r=s??t.getId(),u=t.create(r,i);l=u,(n??Mi(!0)).run(()=>{Ee(u.applyDefault,(f,d,_)=>{const k=m=>{u.applyNodeChanges(m)},p=m=>{u.applyEdgeChanges(m)};f?(u.onNodesChange(k),u.onEdgesChange(p)):(u.hooks.value.nodesChange.off(k),u.hooks.value.edgesChange.off(p)),_(()=>{u.hooks.value.nodesChange.off(k),u.hooks.value.edgesChange.off(p)})},{immediate:!0}),Zt(()=>{if(l){const f=t.get(l.id);f?f.$destroy():an(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&(It(wi,l),n.vueFlowId=l.id),o){const r=Bt();r?.type.name!=="VueFlow"&&l.emits.error(new Oe(Ae.USEVUEFLOW_OPTIONS))}return l}function uf(e){const{emits:t,dimensions:n}=De();let o;Xe(()=>{const i=()=>{var s,a;if(!e.value||!(((a=(s=e.value).checkVisibility)==null?void 0:a.call(s))??!0))return;const l=Bn(e.value);(l.width===0||l.height===0)&&t.error(new Oe(Ae.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};i(),window.addEventListener("resize",i),e.value&&(o=new ResizeObserver(()=>i()),o.observe(e.value)),Di(()=>{window.removeEventListener("resize",i),o&&e.value&&o.unobserve(e.value)})})}const cf={name:"UserSelection",compatConfig:{MODE:3}},df=pe({...cf,props:{userSelectionRect:{}},setup(e){return(t,n)=>($(),D("div",{class:"vue-flow__selection vue-flow__container",style:Ve({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),ff=["tabIndex"],hf={name:"NodesSelection",compatConfig:{MODE:3}},vf=pe({...hf,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:s,userSelectionActive:a}=De(),l=Hs(),r=Y(null),u=Bs({el:r,onStart(k){t.selectionDragStart(k),t.nodeDragStart(k)},onDrag(k){t.selectionDrag(k),t.nodeDrag(k)},onStop(k){t.selectionDragStop(k),t.nodeDragStop(k)}});Xe(()=>{var k;s.value||(k=r.value)==null||k.focus({preventScroll:!0})});const c=G(()=>Ns(o.value)),f=G(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function d(k){t.selectionContextMenu({event:k,nodes:o.value})}function _(k){s.value||Mt[k.key]&&(k.preventDefault(),l({x:Mt[k.key].x,y:Mt[k.key].y},k.shiftKey))}return(k,p)=>!B(a)&&c.value.width&&c.value.height?($(),D("div",{key:0,class:Ce(["vue-flow__nodesselection vue-flow__container",B(i)]),style:Ve({transform:`translate(${B(n).x}px,${B(n).y}px) scale(${B(n).zoom})`})},[h("div",{ref_key:"el",ref:r,class:Ce([{dragging:B(u)},"vue-flow__nodesselection-rect"]),style:Ve(f.value),tabIndex:B(s)?void 0:-1,onContextmenu:d,onKeydown:_},null,46,ff)],6)):ue("",!0)}});function pf(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const gf={name:"Pane",compatConfig:{MODE:3}},mf=pe({...gf,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:s,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:r,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:f,removeNodes:d,removeEdges:_,selectionMode:k,deleteKeyCode:p,multiSelectionKeyCode:m,multiSelectionActive:w,edgeLookup:g,nodeLookup:v,connectionLookup:C,defaultEdgeOptions:O,connectionStartHandle:F,panOnDrag:L}=De(),R=ct(null),se=ct(new Set),K=ct(new Set),H=ct(null),M=Ie(()=>r.value&&(e.isSelecting||s.value)),oe=Ie(()=>F.value!==null);let x=!1,I=!1;const b=Yt(p,{actInsideInputWithModifier:!1}),A=Yt(m);Ee(b,j=>{j&&(d(f.value),_(c.value),u.value=!1)}),Ee(A,j=>{w.value=j});function V(j,ne){return ee=>{ee.target===ne&&j?.(ee)}}function W(j){if(x||oe.value){x=!1;return}i.paneClick(j),a(),u.value=!1}function U(j){var ne;if(Array.isArray(L.value)&&((ne=L.value)!=null&&ne.includes(2))){j.preventDefault();return}i.paneContextMenu(j)}function te(j){i.paneScroll(j)}function re(j){var ne,ee,ce;if(H.value=((ne=t.value)==null?void 0:ne.getBoundingClientRect())??null,!r.value||!e.isSelecting||j.button!==0||j.target!==R.value||!H.value)return;(ce=(ee=j.target)==null?void 0:ee.setPointerCapture)==null||ce.call(ee,j.pointerId);const{x:me,y:_e}=pf(j,H.value);I=!0,x=!1,a(),l.value={width:0,height:0,startX:me,startY:_e,x:me,y:_e},i.selectionStart(j)}function fe(j){var ne;if(!H.value||!l.value)return;x=!0;const{x:ee,y:ce}=je(j,H.value),{startX:me=0,startY:_e=0}=l.value,ke={startX:me,startY:_e,x:ee<me?ee:me,y:ce<_e?ce:_e,width:Math.abs(ee-me),height:Math.abs(ce-_e)},de=se.value,ve=K.value;se.value=new Set($s(n.value,ke,o.value,k.value===Mo.Partial,!0).map(y=>y.id)),K.value=new Set;const E=((ne=O.value)==null?void 0:ne.selectable)??!0;for(const y of se.value){const N=C.value.get(y);if(N)for(const{edgeId:S}of N.values()){const P=g.value.get(S);P&&(P.selectable??E)&&K.value.add(S)}}if(!_i(de,se.value)){const y=ut(v.value,se.value,!0);i.nodesChange(y)}if(!_i(ve,K.value)){const y=ut(g.value,K.value);i.edgesChange(y)}l.value=ke,s.value=!0,u.value=!1}function ge(j){var ne;j.button!==0||!I||((ne=j.target)==null||ne.releasePointerCapture(j.pointerId),!s.value&&l.value&&j.target===R.value&&W(j),s.value=!1,l.value=null,u.value=se.value.size>0,i.selectionEnd(j),e.selectionKeyPressed&&(x=!1),I=!1)}return(j,ne)=>($(),D("div",{ref_key:"container",ref:R,class:Ce(["vue-flow__pane vue-flow__container",{selection:j.isSelecting}]),onClick:ne[0]||(ne[0]=ee=>M.value?void 0:V(W,R.value)(ee)),onContextmenu:ne[1]||(ne[1]=ee=>V(U,R.value)(ee)),onWheelPassive:ne[2]||(ne[2]=ee=>V(te,R.value)(ee)),onPointerenter:ne[3]||(ne[3]=ee=>M.value?void 0:B(i).paneMouseEnter(ee)),onPointerdown:ne[4]||(ne[4]=ee=>M.value?re(ee):B(i).paneMouseMove(ee)),onPointermove:ne[5]||(ne[5]=ee=>M.value?fe(ee):B(i).paneMouseMove(ee)),onPointerup:ne[6]||(ne[6]=ee=>M.value?ge(ee):void 0),onPointerleave:ne[7]||(ne[7]=ee=>B(i).paneMouseLeave(ee))},[Re(j.$slots,"default"),B(s)&&B(l)?($(),Me(df,{key:0,"user-selection-rect":B(l)},null,8,["user-selection-rect"])):ue("",!0),B(u)&&B(f).length?($(),Me(vf,{key:1})):ue("",!0)],34))}}),yf={name:"Transform",compatConfig:{MODE:3}},_f=pe({...yf,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=De(),i=G(()=>n.value?!o.value:!1),s=G(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(a,l)=>($(),D("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ve({transform:s.value,opacity:i.value?0:void 0})},[Re(a.$slots,"default")],4))}}),wf={name:"Viewport",compatConfig:{MODE:3}},bf=pe({...wf,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:s,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:r,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:f,zoomOnDoubleClick:d,zoomOnPinch:_,zoomOnScroll:k,preventScrolling:p,noWheelClassName:m,noPanClassName:w,emits:g,connectionStartHandle:v,userSelectionActive:C,paneDragging:O,d3Zoom:F,d3Selection:L,d3ZoomHandler:R,viewport:se,viewportRef:K,paneClickDistance:H}=De();uf(K);const M=ct(!1),oe=ct(!1);let x=null,I=!1,b=0,A={x:0,y:0,zoom:0};const V=Yt(l),W=Yt(a),U=Yt(s),te=Ie(()=>(!W.value||W.value&&a.value===!0)&&(V.value||f.value)),re=Ie(()=>V.value||r.value),fe=Ie(()=>W.value||a.value===!0&&te.value!==!0),ge=Ie(()=>v.value!==null);Xe(()=>{if(!K.value){an("Viewport element is missing");return}const me=K.value,_e=me.getBoundingClientRect(),ke=zc().clickDistance(H.value).scaleExtent([t.value,n.value]).translateExtent(i.value),de=Ye(me).call(ke),ve=de.on("wheel.zoom"),E=Pt.translate(o.value.x??0,o.value.y??0).scale(xt(o.value.zoom??1,t.value,n.value)),y=[[0,0],[_e.width,_e.height]],N=ke.constrain()(E,y,i.value);ke.transform(de,N),ke.wheelDelta(si),F.value=ke,L.value=de,R.value=ve,se.value={x:N.x,y:N.y,zoom:N.k},ke.on("start",S=>{var P;if(!S.sourceEvent)return null;b=S.sourceEvent.button,M.value=!0;const Z=ee(S.transform);((P=S.sourceEvent)==null?void 0:P.type)==="mousedown"&&(O.value=!0),A=Z,g.viewportChangeStart(Z),g.moveStart({event:S,flowTransform:Z})}),ke.on("end",S=>{if(!S.sourceEvent)return null;if(M.value=!1,O.value=!1,j(te.value,b??0)&&!I&&g.paneContextMenu(S.sourceEvent),I=!1,ne(A,S.transform)){const P=ee(S.transform);A=P,g.viewportChangeEnd(P),g.moveEnd({event:S,flowTransform:P})}}),ke.filter(S=>{var P;const Z=U.value||k.value,J=_.value&&S.ctrlKey,Q=S.button,ie=S.type==="wheel";if(Q===1&&S.type==="mousedown"&&(ce(S,"vue-flow__node")||ce(S,"vue-flow__edge")))return!0;if(!te.value&&!Z&&!re.value&&!d.value&&!_.value||C.value||ge.value&&!ie||!d.value&&S.type==="dblclick"||ce(S,m.value)&&ie||ce(S,w.value)&&(!ie||re.value&&ie&&!U.value)||!_.value&&S.ctrlKey&&ie||!Z&&!re.value&&!J&&ie)return!1;if(!_&&S.type==="touchstart"&&((P=S.touches)==null?void 0:P.length)>1)return S.preventDefault(),!1;if(!te.value&&(S.type==="mousedown"||S.type==="touchstart")||a.value===!0&&Array.isArray(f.value)&&f.value.includes(0)&&Q===0||Array.isArray(f.value)&&!f.value.includes(Q)&&(S.type==="mousedown"||S.type==="touchstart"))return!1;const he=Array.isArray(f.value)&&f.value.includes(Q)||a.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!Q||Q<=1;return(!S.ctrlKey||V.value||ie)&&he}),Ee([C,te],()=>{C.value&&!M.value?ke.on("zoom",null):C.value||ke.on("zoom",S=>{se.value={x:S.transform.x,y:S.transform.y,zoom:S.transform.k};const P=ee(S.transform);I=j(te.value,b??0),g.viewportChange(P),g.move({event:S,flowTransform:P})})},{immediate:!0}),Ee([C,re,u,U,_,p,m],()=>{re.value&&!U.value&&!C.value?de.on("wheel.zoom",S=>{if(ce(S,m.value))return!1;const P=U.value||k.value,Z=_.value&&S.ctrlKey;if(!(!p.value||re.value||P||Z))return!1;S.preventDefault(),S.stopImmediatePropagation();const Q=de.property("__zoom").k||1,ie=Tn();if(!V.value&&S.ctrlKey&&_.value&&ie){const vt=Ke(S),ye=si(S),tt=Q*2**ye;ke.scaleTo(de,tt,vt,S);return}const he=S.deltaMode===1?20:1;let we=u.value===Wt.Vertical?0:S.deltaX*he,z=u.value===Wt.Horizontal?0:S.deltaY*he;!ie&&S.shiftKey&&u.value!==Wt.Vertical&&!we&&z&&(we=z,z=0),ke.translateBy(de,-(we/Q)*c.value,-(z/Q)*c.value);const T=ee(de.property("__zoom"));x&&clearTimeout(x),oe.value?(g.move({event:S,flowTransform:T}),g.viewportChange(T),x=setTimeout(()=>{g.moveEnd({event:S,flowTransform:T}),g.viewportChangeEnd(T),oe.value=!1},150)):(oe.value=!0,g.moveStart({event:S,flowTransform:T}),g.viewportChangeStart(T))},{passive:!1}):typeof ve<"u"&&de.on("wheel.zoom",function(S,P){const Z=!p.value&&S.type==="wheel"&&!S.ctrlKey,J=U.value||k.value,Q=_.value&&S.ctrlKey;if(!J&&!r.value&&!Q&&S.type==="wheel"||Z||ce(S,m.value))return null;S.preventDefault(),ve.call(this,S,P)},{passive:!1})},{immediate:!0})});function j(me,_e){return _e===2&&Array.isArray(me)&&me.includes(2)}function ne(me,_e){return me.x!==_e.x&&!Number.isNaN(_e.x)||me.y!==_e.y&&!Number.isNaN(_e.y)||me.zoom!==_e.k&&!Number.isNaN(_e.k)}function ee(me){return{x:me.x,y:me.y,zoom:me.k}}function ce(me,_e){return me.target.closest(`.${_e}`)}return(me,_e)=>($(),D("div",{ref_key:"viewportRef",ref:K,class:"vue-flow__viewport vue-flow__container"},[le(mf,{"is-selecting":fe.value,"selection-key-pressed":B(W),class:Ce({connecting:ge.value,dragging:B(O),draggable:B(f)===!0||Array.isArray(B(f))&&B(f).includes(0)})},{default:xe(()=>[le(_f,null,{default:xe(()=>[Re(me.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),xf=["id"],Sf=["id"],Ef=["id"],kf={name:"A11yDescriptions",compatConfig:{MODE:3}},Nf=pe({...kf,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=De();return(i,s)=>($(),D(Ne,null,[h("div",{id:`${B(ys)}-${B(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+q(B(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,xf),h("div",{id:`${B(_s)}-${B(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Sf),B(n)?ue("",!0):($(),D("div",{key:0,id:`${B(Fc)}-${B(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},q(B(o)),9,Ef))],64))}});function $f(){const e=De();Ee(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Cf(e,t,n){return n===ae.Left?e-t:n===ae.Right?e+t:e}function Mf(e,t,n){return n===ae.Top?e-t:n===ae.Bottom?e+t:e}const To=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=ae.Top,type:i}){return $e("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Cf(t,e,o),cy:Mf(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};To.props=["radius","centerX","centerY","position","type"];To.compatConfig={MODE:3};const ki=To,If=pe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:s,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:r,removeSelectedEdges:u,findEdge:c,findNode:f,isValidConnection:d,multiSelectionActive:_,disableKeyboardA11y:k,elementsSelectable:p,edgesUpdatable:m,edgesFocusable:w,hooks:g}=De(),v=G(()=>c(e.id)),{emit:C,on:O}=_d(v.value,s),F=zt(Rn),L=Bt(),R=Y(!1),se=Y(!1),K=Y(""),H=Y(null),M=Y("source"),oe=Y(null),x=Ie(()=>typeof v.value.selectable>"u"?p.value:v.value.selectable),I=Ie(()=>typeof v.value.updatable>"u"?m.value:v.value.updatable),b=Ie(()=>typeof v.value.focusable>"u"?w.value:v.value.focusable);It(gd,e.id),It(md,oe);const A=G(()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class),V=G(()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style),W=G(()=>{const y=v.value.type||"default",N=F?.[`edge-${y}`];if(N)return N;let S=v.value.template??r.value[y];if(typeof S=="string"&&L){const P=Object.keys(L.appContext.components);P&&P.includes(y)&&(S=yo(y,!1))}return S&&typeof S!="string"?S:(s.error(new Oe(Ae.EDGE_TYPE_MISSING,S)),!1)}),{handlePointerDown:U}=Vs({nodeId:K,handleId:H,type:M,isValidConnection:d,edgeUpdaterType:M,onEdgeUpdate:fe,onEdgeUpdateEnd:ge});return()=>{const y=f(v.value.source),N=f(v.value.target),S="pathOptions"in v.value?v.value.pathOptions:{};if(!y&&!N)return s.error(new Oe(Ae.EDGE_SOURCE_TARGET_MISSING,v.value.id,v.value.source,v.value.target)),null;if(!y)return s.error(new Oe(Ae.EDGE_SOURCE_MISSING,v.value.id,v.value.source)),null;if(!N)return s.error(new Oe(Ae.EDGE_TARGET_MISSING,v.value.id,v.value.target)),null;if(!v.value||v.value.hidden||y.hidden||N.hidden)return null;let P;o.value===dt.Strict?P=y.handleBounds.source:P=[...y.handleBounds.source||[],...y.handleBounds.target||[]];const Z=hi(P,v.value.sourceHandle);let J;o.value===dt.Strict?J=N.handleBounds.target:J=[...N.handleBounds.target||[],...N.handleBounds.source||[]];const Q=hi(J,v.value.targetHandle),ie=Z?.position||ae.Bottom,he=Q?.position||ae.Top,{x:we,y:z}=At(y,Z,ie),{x:T,y:vt}=At(N,Q,he);return v.value.sourceX=we,v.value.sourceY=z,v.value.targetX=T,v.value.targetY=vt,$e("g",{ref:oe,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${W.value===!1?"default":v.value.type||"default"}`,l.value,A.value,{updating:R.value,selected:v.value.selected,animated:v.value.animated,inactive:!x.value&&!g.value.edgeClick.hasListeners()}],tabIndex:b.value?0:void 0,"aria-label":v.value.ariaLabel===null?void 0:v.value.ariaLabel??`Edge from ${v.value.source} to ${v.value.target}`,"aria-describedby":b.value?`${_s}-${t}`:void 0,"aria-roledescription":"edge",role:b.value?"group":"img",...v.value.domAttributes,onClick:ne,onContextmenu:ee,onDblclick:ce,onMouseenter:me,onMousemove:_e,onMouseleave:ke,onKeyDown:b.value?E:void 0},[se.value?null:$e(W.value===!1?r.value.default:W.value,{id:e.id,sourceNode:y,targetNode:N,source:v.value.source,target:v.value.target,type:v.value.type,updatable:I.value,selected:v.value.selected,animated:v.value.animated,label:v.value.label,labelStyle:v.value.labelStyle,labelShowBg:v.value.labelShowBg,labelBgStyle:v.value.labelBgStyle,labelBgPadding:v.value.labelBgPadding,labelBgBorderRadius:v.value.labelBgBorderRadius,data:v.value.data,events:{...v.value.events,...O},style:V.value,markerStart:`url('#${tn(v.value.markerStart,t)}')`,markerEnd:`url('#${tn(v.value.markerEnd,t)}')`,sourcePosition:ie,targetPosition:he,sourceX:we,sourceY:z,targetX:T,targetY:vt,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth,...S}),[I.value==="source"||I.value===!0?[$e("g",{onMousedown:de,onMouseenter:te,onMouseout:re},$e(ki,{position:ie,centerX:we,centerY:z,radius:i.value,type:"source","data-type":"source"}))]:null,I.value==="target"||I.value===!0?[$e("g",{onMousedown:ve,onMouseenter:te,onMouseout:re},$e(ki,{position:he,centerX:T,centerY:vt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function te(){R.value=!0}function re(){R.value=!1}function fe(y,N){C.update({event:y,edge:v.value,connection:N})}function ge(y){C.updateEnd({event:y,edge:v.value}),se.value=!1}function j(y,N){y.button===0&&(se.value=!0,K.value=N?v.value.target:v.value.source,H.value=(N?v.value.targetHandle:v.value.sourceHandle)??null,M.value=N?"target":"source",C.updateStart({event:y,edge:v.value}),U(y))}function ne(y){var N;const S={event:y,edge:v.value};x.value&&(a.value=!1,v.value.selected&&_.value?(u([v.value]),(N=oe.value)==null||N.blur()):n([v.value])),C.click(S)}function ee(y){C.contextMenu({event:y,edge:v.value})}function ce(y){C.doubleClick({event:y,edge:v.value})}function me(y){C.mouseEnter({event:y,edge:v.value})}function _e(y){C.mouseMove({event:y,edge:v.value})}function ke(y){C.mouseLeave({event:y,edge:v.value})}function de(y){j(y,!0)}function ve(y){j(y,!1)}function E(y){var N;!k.value&&ws.includes(y.key)&&x.value&&(y.key==="Escape"?((N=oe.value)==null||N.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Df=If,Tf=pe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:s,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:r,connectionStatus:u,viewport:c,findNode:f}=De(),d=(e=zt(Rn))==null?void 0:e["connection-line"],_=G(()=>{var g;return f((g=o.value)==null?void 0:g.nodeId)}),k=G(()=>{var g;return f((g=i.value)==null?void 0:g.nodeId)??null}),p=G(()=>({x:(s.value.x-c.value.x)/c.value.zoom,y:(s.value.y-c.value.y)/c.value.zoom})),m=G(()=>r.value.markerStart?`url(#${tn(r.value.markerStart,t)})`:""),w=G(()=>r.value.markerEnd?`url(#${tn(r.value.markerEnd,t)})`:"");return()=>{var g,v,C;if(!_.value||!o.value)return null;const O=o.value.id,F=o.value.type,L=_.value.handleBounds;let R=L?.[F]??[];if(n.value===dt.Loose){const V=L?.[F==="source"?"target":"source"]??[];R=[...R,...V]}if(!R)return null;const se=(O?R.find(V=>V.id===O):R[0])??null,K=se?.position??ae.Top,{x:H,y:M}=At(_.value,se,K);let oe=null;k.value&&(n.value===dt.Strict?oe=((g=k.value.handleBounds[F==="source"?"target":"source"])==null?void 0:g.find(V=>{var W;return V.id===((W=i.value)==null?void 0:W.id)}))||null:oe=((v=[...k.value.handleBounds.source??[],...k.value.handleBounds.target??[]])==null?void 0:v.find(V=>{var W;return V.id===((W=i.value)==null?void 0:W.id)}))||null);const x=((C=i.value)==null?void 0:C.position)??(K?po[K]:null);if(!K||!x)return null;const I=a.value??r.value.type??pt.Bezier;let b="";const A={sourceX:H,sourceY:M,sourcePosition:K,targetX:p.value.x,targetY:p.value.y,targetPosition:x};return I===pt.Bezier?[b]=Ws(A):I===pt.Step?[b]=mo({...A,borderRadius:0}):I===pt.SmoothStep?[b]=mo(A):I===pt.SimpleBezier?[b]=Ys(A):b=`M${H},${M} ${p.value.x},${p.value.y}`,$e("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},$e("g",{class:"vue-flow__connection"},d?$e(d,{sourceX:H,sourceY:M,sourcePosition:K,targetX:p.value.x,targetY:p.value.y,targetPosition:x,sourceNode:_.value,sourceHandle:se,targetNode:k.value,targetHandle:oe,markerEnd:w.value,markerStart:m.value,connectionStatus:u.value}):$e("path",{d:b,class:[r.value.class,u.value,"vue-flow__connection-path"],style:{...l.value,...r.value.style},"marker-end":w.value,"marker-start":m.value})))}}}),Pf=Tf,Af=["id","markerWidth","markerHeight","markerUnits","orient"],Of={name:"MarkerType",compatConfig:{MODE:3}},zf=pe({...Of,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>($(),D("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===B(ho).ArrowClosed?($(),D("polyline",{key:0,style:Ve({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):ue("",!0),t.type===B(ho).Arrow?($(),D("polyline",{key:1,style:Ve({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):ue("",!0)],8,Af))}}),Bf={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Vf={name:"MarkerDefinitions",compatConfig:{MODE:3}},Rf=pe({...Vf,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=De(),s=G(()=>{const a=new Set,l=[],r=u=>{if(u){const c=tn(u,t);a.has(c)||(typeof u=="object"?l.push({...u,id:c,color:u.color||i.value}):l.push({id:c,color:i.value,type:u}),a.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])r(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])r(c);return l.sort((u,c)=>u.id.localeCompare(c.id))});return(a,l)=>($(),D("svg",Bf,[h("defs",null,[($(!0),D(Ne,null,Te(s.value,r=>($(),Me(zf,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,"stroke-width":r.strokeWidth,orient:r.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),Hf={name:"Edges",compatConfig:{MODE:3}},Lf=pe({...Hf,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=De();return(i,s)=>($(),D(Ne,null,[le(Rf),($(!0),D(Ne,null,Te(B(n),a=>($(),D("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:Ve({zIndex:B(id)(a,B(t),B(o))})},[le(B(Df),{id:a.id},null,8,["id"])],4))),128)),le(B(Pf))],64))}}),Ff=pe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:s,emits:a,removeSelectedNodes:l,addSelectedNodes:r,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:f,nodeExtent:d,elevateNodesOnSelect:_,disableKeyboardA11y:k,ariaLiveMessage:p,snapToGrid:m,snapGrid:w,nodeDragThreshold:g,nodesDraggable:v,elementsSelectable:C,nodesConnectable:O,nodesFocusable:F,hooks:L}=De(),R=Y(null);It(zs,R),It(Os,e.id);const se=zt(Rn),K=Bt(),H=Hs(),{node:M,parentNode:oe}=Rs(e.id),{emit:x,on:I}=Sd(M,a),b=Ie(()=>typeof M.draggable>"u"?v.value:M.draggable),A=Ie(()=>typeof M.selectable>"u"?C.value:M.selectable),V=Ie(()=>typeof M.connectable>"u"?O.value:M.connectable),W=Ie(()=>typeof M.focusable>"u"?F.value:M.focusable),U=G(()=>A.value||b.value||L.value.nodeClick.hasListeners()||L.value.nodeDoubleClick.hasListeners()||L.value.nodeMouseEnter.hasListeners()||L.value.nodeMouseMove.hasListeners()||L.value.nodeMouseLeave.hasListeners()),te=Ie(()=>!!M.dimensions.width&&!!M.dimensions.height),re=G(()=>{const N=M.type||"default",S=se?.[`node-${N}`];if(S)return S;let P=M.template||f.value[N];if(typeof P=="string"&&K){const Z=Object.keys(K.appContext.components);Z&&Z.includes(N)&&(P=yo(N,!1))}return P&&typeof P!="string"?P:(a.error(new Oe(Ae.NODE_TYPE_MISSING,P)),!1)}),fe=Bs({id:e.id,el:R,disabled:()=>!b.value,selectable:A,dragHandle:()=>M.dragHandle,onStart(N){x.dragStart(N)},onDrag(N){x.drag(N)},onStop(N){x.dragStop(N)},onClick(N){E(N)}}),ge=G(()=>M.class instanceof Function?M.class(M):M.class),j=G(()=>{const N=(M.style instanceof Function?M.style(M):M.style)||{},S=M.width instanceof Function?M.width(M):M.width,P=M.height instanceof Function?M.height(M):M.height;return!N.width&&S&&(N.width=typeof S=="string"?S:`${S}px`),!N.height&&P&&(N.height=typeof P=="string"?P:`${P}px`),N}),ne=Ie(()=>Number(M.zIndex??j.value.zIndex??0));return c(N=>{(N.includes(e.id)||!N.length)&&ce()}),Xe(()=>{Ee(()=>M.hidden,(N=!1,S,P)=>{!N&&R.value&&(e.resizeObserver.observe(R.value),P(()=>{R.value&&e.resizeObserver.unobserve(R.value)}))},{immediate:!0,flush:"post"})}),Ee([()=>M.type,()=>M.sourcePosition,()=>M.targetPosition],()=>{Ge(()=>{u([{id:e.id,nodeElement:R.value,forceUpdate:!0}])})}),Ee([()=>M.position.x,()=>M.position.y,()=>{var N;return(N=oe.value)==null?void 0:N.computedPosition.x},()=>{var N;return(N=oe.value)==null?void 0:N.computedPosition.y},()=>{var N;return(N=oe.value)==null?void 0:N.computedPosition.z},ne,()=>M.selected,()=>M.dimensions.height,()=>M.dimensions.width,()=>{var N;return(N=oe.value)==null?void 0:N.dimensions.height},()=>{var N;return(N=oe.value)==null?void 0:N.dimensions.width}],([N,S,P,Z,J,Q])=>{const ie={x:N,y:S,z:Q+(_.value&&M.selected?1e3:0)};typeof P<"u"&&typeof Z<"u"?M.computedPosition=Jc({x:P,y:Z,z:J},ie):M.computedPosition=ie},{flush:"post",immediate:!0}),Ee([()=>M.extent,d],([N,S],[P,Z])=>{(N!==P||S!==Z)&&ee()}),M.extent==="parent"||typeof M.extent=="object"&&"range"in M.extent&&M.extent.range==="parent"?oo(()=>te).toBe(!0).then(ee):ee(),()=>M.hidden?null:$e("div",{ref:R,"data-id":M.id,class:["vue-flow__node",`vue-flow__node-${re.value===!1?"default":M.type||"default"}`,{[n.value]:b.value,dragging:fe?.value,draggable:b.value,selected:M.selected,selectable:A.value,parent:M.isParent},ge.value],style:{visibility:te.value?"visible":"hidden",zIndex:M.computedPosition.z??ne.value,transform:`translate(${M.computedPosition.x}px,${M.computedPosition.y}px)`,pointerEvents:U.value?"all":"none",...j.value},tabIndex:W.value?0:void 0,role:W.value?"group":void 0,"aria-describedby":k.value?void 0:`${ys}-${t}`,"aria-label":M.ariaLabel,"aria-roledescription":"node",...M.domAttributes,onMouseenter:me,onMousemove:_e,onMouseleave:ke,onContextmenu:de,onClick:E,onDblclick:ve,onKeydown:y},[$e(re.value===!1?f.value.default:re.value,{id:M.id,type:M.type,data:M.data,events:{...M.events,...I},selected:M.selected,resizing:M.resizing,dragging:fe.value,connectable:V.value,position:M.computedPosition,dimensions:M.dimensions,isValidTargetPos:M.isValidTargetPos,isValidSourcePos:M.isValidSourcePos,parent:M.parentNode,parentNodeId:M.parentNode,zIndex:M.computedPosition.z??ne.value,targetPosition:M.targetPosition,sourcePosition:M.sourcePosition,label:M.label,dragHandle:M.dragHandle,onUpdateNodeInternals:ce})]);function ee(){const N=M.computedPosition,{computedPosition:S,position:P}=Io(M,m.value?Vn(N,w.value):N,a.error,d.value,oe.value);(M.computedPosition.x!==S.x||M.computedPosition.y!==S.y)&&(M.computedPosition={...M.computedPosition,...S}),(M.position.x!==P.x||M.position.y!==P.y)&&(M.position=P)}function ce(){R.value&&u([{id:e.id,nodeElement:R.value,forceUpdate:!0}])}function me(N){fe?.value||x.mouseEnter({event:N,node:M})}function _e(N){fe?.value||x.mouseMove({event:N,node:M})}function ke(N){fe?.value||x.mouseLeave({event:N,node:M})}function de(N){return x.contextMenu({event:N,node:M})}function ve(N){return x.doubleClick({event:N,node:M})}function E(N){A.value&&(!o.value||!b.value||g.value>0)&&go(M,s.value,r,l,i,!1,R.value),x.click({event:N,node:M})}function y(N){if(!(vo(N)||k.value))if(ws.includes(N.key)&&A.value){const S=N.key==="Escape";go(M,s.value,r,l,i,S,R.value)}else b.value&&M.selected&&Mt[N.key]&&(N.preventDefault(),p.value=`Moved selected node ${N.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~M.position.x}, y: ${~~M.position.y}`,H({x:Mt[N.key].x,y:Mt[N.key].y},N.shiftKey))}}}),Gf=Ff;function Wf(e={includeHiddenNodes:!1}){const{nodes:t}=De();return G(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Yf={class:"vue-flow__nodes vue-flow__container"},Uf={name:"Nodes",compatConfig:{MODE:3}},Xf=pe({...Uf,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=De(),i=Wf(),s=Y();return Ee(i,a=>{a&&Ge(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),Xe(()=>{s.value=new ResizeObserver(a=>{const l=a.map(r=>({id:r.target.getAttribute("data-id"),nodeElement:r.target,forceUpdate:!0}));Ge(()=>n(l))})}),Di(()=>{var a;return(a=s.value)==null?void 0:a.disconnect()}),(a,l)=>($(),D("div",Yf,[s.value?($(!0),D(Ne,{key:0},Te(B(t),(r,u,c,f)=>{const d=[r.id];if(f&&f.key===r.id&&ta(f,d))return f;const _=($(),Me(B(Gf),{id:r.id,key:r.id,"resize-observer":s.value},null,8,["id","resize-observer"]));return _.memo=d,_},l,0),128)):ue("",!0)]))}});function Zf(){const{emits:e}=De();Xe(()=>{if(As()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Oe(Ae.MISSING_STYLES))}})}const Kf=h("div",{class:"vue-flow__edge-labels"},null,-1),qf={name:"VueFlow",compatConfig:{MODE:3}},jf=pe({...qf,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=Js(),s=Yn(o,"modelValue",n),a=Yn(o,"nodes",n),l=Yn(o,"edges",n),r=De(o),u=$d({modelValue:s,nodes:a,edges:l},o,r);return Md(n,r.hooks),$f(),Zf(),It(Rn,i),Ii(u),t(r),(c,f)=>($(),D("div",{ref:B(r).vueFlowRef,class:"vue-flow"},[le(bf,null,{default:xe(()=>[le(Lf),Kf,le(Xf),Re(c.$slots,"zoom-pane")]),_:3}),Re(c.$slots,"default"),le(Nf)],512))}});var st=(e=>(e.Lines="lines",e.Dots="dots",e))(st||{});const Xs=function({dimensions:e,size:t,color:n}){return $e("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Zs=function({radius:e,color:t}){return $e("circle",{cx:e,cy:e,r:e,fill:t})};st.Lines+"",st.Dots+"";const Jf={[st.Dots]:"#81818a",[st.Lines]:"#eee"},Qf=["id","x","y","width","height","patternTransform"],eh={key:2,height:"100",width:"100"},th=["fill"],nh=["x","y","fill"],oh={name:"Background",compatConfig:{MODE:3}},ih=pe({...oh,props:{id:{},variant:{default:()=>st.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=De(),o=G(()=>{const a=n.value.zoom,[l,r]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[l*a||1,r*a||1],c=e.size*a,[f,d]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],_=[f*a||1+u[0]/2,d*a||1+u[1]/2];return{scaledGap:u,offset:_,size:c}}),i=Ie(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),s=Ie(()=>e.color||e.patternColor||Jf[e.variant||st.Dots]);return(a,l)=>($(),D("svg",{class:"vue-flow__background vue-flow__container",style:Ve({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[Re(a.$slots,"pattern-container",{id:i.value},()=>[h("pattern",{id:i.value,x:B(n).x%o.value.scaledGap[0],y:B(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Re(a.$slots,"pattern",{},()=>[a.variant===B(st).Lines?($(),Me(B(Xs),{key:0,size:a.lineWidth,color:s.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===B(st).Dots?($(),Me(B(Zs),{key:1,color:s.value,radius:o.value.size/2},null,8,["color","radius"])):ue("",!0),a.bgColor?($(),D("svg",eh,[h("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,th)])):ue("",!0)])],8,Qf)]),h("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,nh),Re(a.$slots,"default",{id:i.value})],4))}}),sh={class:"node-content"},ah={class:"node-label"},lh=pe({__name:"GraphNode",props:{data:{}},setup(e){const t=e,n=G(()=>({"graph-node":!0,selected:t.data.isSelected,"active-path":t.data.isActivePath}));return(o,i)=>($(),D("div",{class:Ce(n.value)},[le(B(Ot),{type:"target",position:B(ae).Left,class:"handle"},null,8,["position"]),h("div",sh,[e.data.isFocused?($(),Me(Vi,{key:0,type:e.data.type,status:e.data.status},null,8,["type","status"])):e.data.isMemoNode?($(),Me(Qe,{key:1,type:"execution",status:"pending","is-memo":!0,"content-length":e.data.contentLength,"memo-count":e.data.memoCount},null,8,["content-length","memo-count"])):($(),Me(Qe,{key:2,type:e.data.type,status:e.data.status},null,8,["type","status"])),h("span",ah,q(e.data.title),1),le(Hi,{role:e.data.role},null,8,["role"]),e.data.dispatch?($(),Me(bo,{key:3,status:e.data.dispatch.status},null,8,["status"])):ue("",!0)]),le(B(Ot),{type:"source",position:B(ae).Right,class:"handle"},null,8,["position"])],2))}}),rh=ze(lh,[["__scopeId","data-v-fa58a73c"]]),uh={nodeWidth:200,nodeHeight:32,horizontalGap:40,verticalGap:12};function Ks(e,t){if(e.children.length===0)return t.nodeHeight;let n=0;for(const i of e.children)n+=Ks(i,t);const o=(e.children.length-1)*t.verticalGap;return n+o}function qs(e,t){if(e.id===t)return[e.id];for(const n of e.children){const o=qs(n,t);if(o.length>0)return[e.id,...o]}return[]}function ch(e){const{tree:t,focusId:n,selectedId:o,config:i,memoNodeIds:s=new Set}=e,a={...uh,...i},l=[],r=[],u=new Set(o?qs(t,o):[]),c=new Map;function f(k){const p=Ks(k,a);return c.set(k.id,p),k.children.forEach(f),p}f(t);function d(k,p,m,w,g){const v=(m+w)/2-a.nodeHeight/2,C=s.has(k.id);if(l.push({id:k.id,type:"custom",position:{x:p,y:v},data:{title:k.title,type:k.type,status:k.status,role:k.role,dispatch:k.dispatch,isFocused:k.id===n,isSelected:k.id===o,isActivePath:u.has(k.id),isMemoNode:C,contentLength:k.contentLength,memoCount:k.memoCount}}),g){const L=u.has(g)&&u.has(k.id),R=s.has(g)||s.has(k.id);r.push({id:`${g}-${k.id}`,source:g,target:k.id,type:"smoothstep",style:L?{stroke:"var(--accent-red)",strokeWidth:2.5}:R?{stroke:"#999",strokeWidth:1.5,strokeDasharray:"8 4"}:{stroke:"#bbb",strokeWidth:2},pathOptions:{borderRadius:0,offset:0},zIndex:L?10:0})}if(k.children.length===0)return;const O=p+a.nodeWidth+a.horizontalGap;let F=m;for(const L of k.children){const R=c.get(L.id)||a.nodeHeight,se=F+R;d(L,O,F,se,k.id),F=se+a.verticalGap}}const _=c.get(t.id)||a.nodeHeight;return d(t,0,0,_,null),{nodes:l,edges:r}}const dh={class:"node-tree-graph"},fh={class:"custom-controls"},hh=["disabled"],vh={key:1,class:"empty-state"},ph=pe({__name:"NodeTreeGraph",props:{tree:{},selectedId:{},focusId:{},memos:{}},emits:["select","selectMemo"],setup(e,{emit:t}){const n=e,o=t,{fitView:i,setCenter:s,getNodes:a}=De(),l=Y([]),r=Y([]),u=Y(!0),c=G(()=>{if(!n.memos||n.memos.length===0)return null;const w=n.memos.map(g=>({id:g.id,type:"execution",title:g.title,status:"pending",contentLength:g.contentLength,children:[]}));return{id:"__memo_drawer__",type:"planning",title:`草稿 (${n.memos.length})`,status:"pending",memoCount:n.memos.length,children:w}}),f=G(()=>n.tree?c.value?{...n.tree,children:[...n.tree.children,c.value]}:n.tree:null),d=G(()=>{const w=new Set;return c.value&&(w.add(c.value.id),c.value.children.forEach(g=>w.add(g.id))),w}),_=G(()=>f.value?ch({tree:f.value,focusId:n.focusId,selectedId:n.selectedId,memoNodeIds:d.value}):{nodes:[],edges:[]});Ee(_,w=>{l.value=w.nodes,r.value=[...w.edges].sort((g,v)=>{const C=g.zIndex??0,O=v.zIndex??0;return C-O}),u.value&&w.nodes.length>0&&(u.value=!1,Ge(()=>{i({padding:.15,duration:200})}))},{immediate:!0,deep:!0});function k(w){w.node.id==="__memo_drawer__"?o("selectMemo"):o("select",w.node.id)}function p(){const w=n.selectedId||n.focusId;if(!w)return;const g=a.value.find(v=>v.id===w);g&&s(g.position.x+70,g.position.y+16,{zoom:1,duration:300})}function m(){i({padding:.15,duration:300})}return Xe(()=>{Ge(()=>{i({padding:.15})})}),(w,g)=>($(),D("div",dh,[e.tree?($(),Me(B(jf),{key:0,nodes:l.value,"onUpdate:nodes":g[0]||(g[0]=v=>l.value=v),edges:r.value,"onUpdate:edges":g[1]||(g[1]=v=>r.value=v),"nodes-draggable":!1,"nodes-connectable":!1,"zoom-on-scroll":!0,"pan-on-scroll":!1,"pan-on-drag":!0,"min-zoom":.5,"max-zoom":2,"fit-view-on-init":"",class:"flow-container",onNodeClick:k},{"node-custom":xe(v=>[le(rh,{data:v.data},null,8,["data"])]),default:xe(()=>[le(B(ih),{variant:"dots",gap:16,size:1.5,"pattern-color":"var(--bg-dot)"}),h("div",fh,[h("button",{class:"control-btn",title:"聚焦选中节点",disabled:!e.selectedId&&!e.focusId,onClick:p},[...g[2]||(g[2]=[h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},[h("path",{d:"M7 0v4M7 10v4M0 7h4M10 7h4",stroke:"currentColor","stroke-width":"1.5"}),h("rect",{x:"5",y:"5",width:"4",height:"4",stroke:"currentColor","stroke-width":"1.5",fill:"none"})],-1)])],8,hh),h("button",{class:"control-btn",title:"适应视图",onClick:m},[...g[3]||(g[3]=[h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},[h("path",{d:"M1 4V1h3M10 1h3v3M13 10v3h-3M4 13H1v-3",stroke:"currentColor","stroke-width":"1.5"})],-1)])])])]),_:1},8,["nodes","edges"])):($(),D("div",vh,[...g[4]||(g[4]=[h("div",{class:"empty-icon"},"[ ]",-1),h("span",{class:"empty-text"},"暂无节点",-1)])]))]))}}),gh=ze(ph,[["__scopeId","data-v-22555542"]]),mh=["innerHTML"],yh=pe({__name:"CompactMarkdown",props:{content:{}},setup(e){const t=e,n=G(()=>{let o=t.content||"";return o=o.replace(/```[\s\S]*?```/g,'<code class="placeholder">[代码段]</code>'),o=o.replace(/(?:^\|.+\|$\n?)+/gm,i=>i.includes("|---")||i.includes("| ---")?'<code class="placeholder">[表格]</code>':i),o=o.replace(/^#{1,6}\s+(.+)$/gm,"**$1**"),o=o.replace(/^>\s*(.*)$/gm,'<code class="quote">$1</code>'),o=o.replace(/^[\-\*]\s+/gm,'<span class="list-marker">■</span> '),o=o.replace(/^(\d+\.)\s+/gm,'<span class="list-marker">$1</span> '),o=o.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),o=o.replace(/__(.+?)__/g,"<strong>$1</strong>"),o=o.replace(new RegExp("(?<!\\*)\\*(?!\\*)(.+?)(?<!\\*)\\*(?!\\*)","g"),"<em>$1</em>"),o=o.replace(new RegExp("(?<!_)_(?!_)(.+?)(?<!_)_(?!_)","g"),"<em>$1</em>"),o=o.replace(/~~(.+?)~~/g,"<del>$1</del>"),o=o.replace(/`([^`]+)`/g,"<code>$1</code>"),o=o.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),o=o.replace(/\n{2,}/g,' <span class="sep">⋮</span> '),o=o.replace(/\n/g,' <span class="sep">⋮</span> '),o=o.replace(/\s+/g," ").trim(),o});return(o,i)=>($(),D("span",{class:"compact-markdown",innerHTML:n.value},null,8,mh))}}),_h=ze(yh,[["__scopeId","data-v-0d033bc1"]]),wh={class:"dialog-header"},bh={class:"dialog-title"},xh={class:"dialog-body"},Sh={class:"dialog-message"},Eh=["placeholder"],kh=["placeholder"],Nh={class:"dialog-footer"},$h=pe({__name:"WsPromptDialog",props:{modelValue:{type:Boolean},title:{default:"输入"},message:{},placeholder:{default:""},confirmText:{default:"确定"},cancelText:{default:"取消"},inputType:{default:"textarea"}},emits:["update:modelValue","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,i=Y(n.modelValue),s=Y(""),a=Y(null);Ee(()=>n.modelValue,async f=>{i.value=f,f&&(s.value="",await Ge(),a.value?.focus())});function l(){o("update:modelValue",!1),o("confirm",s.value)}function r(){o("update:modelValue",!1),o("cancel")}function u(){r()}function c(f){f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&l()}return(f,d)=>($(),Me(la,{to:"body"},[le(Pi,{name:"modal-fade"},{default:xe(()=>[i.value?($(),D("div",{key:0,class:"dialog-overlay",onClick:u},[h("div",{class:"dialog",onClick:d[2]||(d[2]=Ai(()=>{},["stop"]))},[h("div",wh,[h("span",bh,q(e.title),1),h("button",{class:"dialog-close",onClick:r},[...d[3]||(d[3]=[h("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[h("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])])]),h("div",xh,[h("div",Sh,q(e.message),1),e.inputType==="textarea"?We(($(),D("textarea",{key:0,ref_key:"inputRef",ref:a,"onUpdate:modelValue":d[0]||(d[0]=_=>s.value=_),class:"dialog-textarea",placeholder:e.placeholder,onKeydown:c},null,40,Eh)),[[Ut,s.value]]):We(($(),D("input",{key:1,ref_key:"inputRef",ref:a,"onUpdate:modelValue":d[1]||(d[1]=_=>s.value=_),type:"text",class:"dialog-input",placeholder:e.placeholder,onKeydown:ra(l,["enter"])},null,40,kh)),[[Ut,s.value]]),d[4]||(d[4]=h("div",{class:"dialog-hint"},"Ctrl + Enter 快速确认",-1))]),h("div",Nh,[le(Be,{variant:"secondary",size:"sm",onClick:r},{default:xe(()=>[Se(q(e.cancelText),1)]),_:1}),le(Be,{variant:"primary",size:"sm",onClick:l},{default:xe(()=>[Se(q(e.confirmText),1)]),_:1})])])])):ue("",!0)]),_:1})]))}}),Ch=ze($h,[["__scopeId","data-v-6aca7f3d"]]),Mh={key:0,class:"node-detail-wrapper"},Ih={class:"node-detail-panel"},Dh={class:"detail-header"},Th={class:"header-main"},Ph=["data-status"],Ah={class:"header-title"},Oh={class:"header-badges"},zh=["data-type"],Bh={key:1,class:"isolate-tag"},Vh={class:"header-meta"},Rh={key:0,class:"detail-section"},Hh={class:"section-title"},Lh={class:"dispatch-info"},Fh={class:"dispatch-row"},Gh={class:"dispatch-value"},Wh={class:"dispatch-row"},Yh={class:"dispatch-marker"},Uh={key:0,class:"dispatch-row"},Xh={class:"dispatch-marker"},Zh={class:"detail-section"},Kh={class:"note-box"},qh={key:1,class:"detail-section"},jh={class:"acceptance-header"},Jh={class:"acceptance-body"},Qh={key:2,class:"detail-section"},ev={class:"docs-list"},tv=["onClick"],nv={class:"memo-ref-header"},ov={class:"memo-ref-title"},iv={key:0,class:"memo-ref-meta"},sv={key:0,class:"memo-ref-summary"},av={key:1,class:"memo-ref-tags"},lv={key:1,class:"docs-item"},rv={class:"docs-main"},uv={class:"docs-path"},cv={key:0,class:"docs-expired"},dv={class:"docs-desc"},fv={key:3,class:"detail-section"},hv={class:"note-box"},vv={key:4,class:"detail-section"},pv={class:"problem-box"},gv={key:5,class:"detail-section"},mv={class:"conclusion-box"},yv={class:"conclusion-content"},_v={key:6,class:"detail-section"},wv={class:"child-conclusions"},bv={class:"child-conclusion-title"},xv=["data-status","data-incomplete"],Sv={key:0,class:"child-conclusion-content"},Ev={key:1,class:"child-conclusion-pending"},kv={class:"detail-section"},Nv={class:"section-title"},$v={class:"count-badge"},Cv={key:0,class:"log-container"},Mv={class:"log-time"},Iv={class:"log-content"},Dv={key:1,class:"log-empty"},Tv={class:"action-bar"},Pv={class:"action-group"},Av={class:"action-group"},Ov=pe({__name:"NodeDetail",emits:["selectMemo"],setup(e,{emit:t}){const n=t,o=Bi(),i=ht(),s=Y(!1),a=Y(""),l=Y(""),r=Y(null),u=Y(!1),c=G(()=>o.selectedNodeMeta),f=G(()=>o.nodeContext),d=G(()=>f.value?.chain.length?f.value.chain[f.value.chain.length-1]:null),_=G(()=>c.value?.type||"execution"),k=G(()=>_.value==="planning"),p=G(()=>c.value?.role),m=G(()=>p.value?Ri[p.value]:null),w=G(()=>c.value?.dispatch),g=G(()=>w.value?xa[w.value.status]:null),v=G(()=>{const x=d.value?.acceptanceCriteria;return!x?.length||!x[0]?[]:Object.keys(x[0])}),C=G(()=>{const x=c.value?.status,I=c.value?.type;if(!x||!I)return[];const b=[];if(I==="execution")switch(x){case"pending":b.push({action:"start",label:"开始执行",variant:"primary"});break;case"implementing":b.push({action:"submit",label:"提交验证",variant:"accent"}),b.push({action:"complete",label:"直接完成",variant:"primary"}),b.push({action:"fail",label:"标记失败",variant:"danger"});break;case"validating":b.push({action:"complete",label:"验证通过",variant:"primary"}),b.push({action:"fail",label:"验证失败",variant:"danger"});break;case"failed":b.push({action:"retry",label:"重试",variant:"primary"});break;case"completed":b.push({action:"reopen",label:"重新激活",variant:"secondary"});break}else switch(x){case"pending":b.push({action:"start",label:"开始规划",variant:"primary"});break;case"planning":b.push({action:"complete",label:"完成规划",variant:"primary"}),b.push({action:"cancel",label:"取消",variant:"danger"});break;case"monitoring":b.push({action:"complete",label:"汇总完成",variant:"primary"}),b.push({action:"cancel",label:"取消",variant:"danger"});break;case"completed":b.push({action:"reopen",label:"重新激活",variant:"secondary"});break;case"cancelled":b.push({action:"reopen",label:"重新激活",variant:"secondary"});break}return b});function O(x){x==="complete"||x==="fail"||x==="cancel"?(r.value=x,a.value="填写结论",l.value=x==="complete"?"请输入完成结论":x==="fail"?"请输入失败原因":"请输入取消原因",s.value=!0):F(x)}async function F(x,I){try{await o.transition(x,void 0,I)}catch{}}function L(x){r.value&&(F(r.value,x),r.value=null)}function R(){r.value=null}async function se(){if(o.selectedNodeId)try{await o.setFocus(o.selectedNodeId)}catch{}}function K(){o.selectedNodeId&&(u.value=!0)}async function H(){if(o.selectedNodeId)try{await o.deleteNode(o.selectedNodeId)}catch{}}function M(x){return x==="AI"?"ai":x==="Human"?"usr":"sys"}function oe(x){n("selectMemo",x)}return(x,I)=>c.value&&d.value?($(),D("div",Mh,[h("div",Ih,[h("div",Dh,[h("div",Th,[le(Qe,{type:c.value.type,status:c.value.status},null,8,["type","status"]),h("span",{class:"node-status","data-status":c.value.status},q(B(ba)[c.value.status].label),9,Ph),I[2]||(I[2]=h("span",{class:"header-sep"},"·",-1)),h("span",Ah,q(d.value.title),1),h("div",Oh,[h("span",{class:"type-badge","data-type":_.value},q(k.value?"PLAN":"EXEC"),9,zh),m.value?($(),D("span",{key:0,class:"role-badge",style:Ve({background:m.value.color,color:m.value.textColor})},q(m.value.label),5)):ue("",!0),c.value.isolate?($(),D("span",Bh," ISOLATED ")):ue("",!0)])]),h("div",Vh,"ID: "+q(c.value.id),1)]),w.value&&g.value?($(),D("div",Rh,[h("div",Hh,[I[3]||(I[3]=h("span",null,"Dispatch / 派发信息",-1)),le(bo,{status:w.value.status},null,8,["status"])]),h("div",Lh,[h("div",Fh,[I[4]||(I[4]=h("span",{class:"dispatch-label"},"状态:",-1)),h("span",Gh,q(g.value.description),1)]),h("div",Wh,[I[5]||(I[5]=h("span",{class:"dispatch-label"},"开始:",-1)),h("span",Yh,q(w.value.startMarker),1)]),w.value.endMarker?($(),D("div",Uh,[I[6]||(I[6]=h("span",{class:"dispatch-label"},"结束:",-1)),h("span",Xh,q(w.value.endMarker),1)])):ue("",!0)])])):ue("",!0),h("div",Zh,[I[7]||(I[7]=h("div",{class:"section-title"},"Requirement / 需求描述",-1)),h("div",Kh,[le(Nt,{content:d.value.requirement||"暂无描述"},null,8,["content"])])]),d.value.acceptanceCriteria?.length?($(),D("div",qh,[I[8]||(I[8]=h("div",{class:"section-title"},"Acceptance Criteria / 验收标准",-1)),h("div",{class:"acceptance-table",style:Ve({"--col-count":v.value.length})},[h("div",jh,[($(!0),D(Ne,null,Te(v.value,b=>($(),D("div",{key:b,class:"acceptance-col"},q(b.toUpperCase()),1))),128))]),h("div",Jh,[($(!0),D(Ne,null,Te(d.value.acceptanceCriteria,(b,A)=>($(),D("div",{key:A,class:"acceptance-row"},[($(!0),D(Ne,null,Te(v.value,V=>($(),D("div",{key:V,class:"acceptance-col"},[le(Nt,{content:b[V]||""},null,8,["content"])]))),128))]))),128))])],4)])):ue("",!0),d.value.docs?.length?($(),D("div",Qh,[I[9]||(I[9]=h("div",{class:"section-title"},"References / 文档引用",-1)),h("div",ev,[($(!0),D(Ne,null,Te(d.value.docs,b=>($(),D(Ne,{key:b.path},[b.memoMeta?($(),D("div",{key:0,class:"memo-ref-card",onClick:A=>oe(b.memoMeta.id)},[h("div",nv,[le(Qe,{type:"execution",status:"pending","is-memo":!0}),h("span",ov,q(b.memoMeta.title),1)]),b.memoMeta.summary||b.memoMeta.tags?.length?($(),D("div",iv,[b.memoMeta.summary?($(),D("div",sv,q(b.memoMeta.summary),1)):ue("",!0),b.memoMeta.tags?.length?($(),D("div",av,[($(!0),D(Ne,null,Te(b.memoMeta.tags,A=>($(),D("span",{key:A,class:"memo-mini-tag"},q(A),1))),128))])):ue("",!0)])):ue("",!0)],8,tv)):($(),D("div",lv,[h("div",rv,[h("span",uv,q(b.path),1),b.status==="expired"?($(),D("span",cv,"EXPIRED")):ue("",!0)]),h("span",dv,q(b.description),1)]))],64))),128))])])):ue("",!0),d.value.note?($(),D("div",fv,[I[10]||(I[10]=h("div",{class:"section-title"},"Note / 备注",-1)),h("div",hv,[le(Nt,{content:d.value.note},null,8,["content"])])])):ue("",!0),d.value.problem?($(),D("div",vv,[I[12]||(I[12]=h("div",{class:"section-title"},"Problem / 当前问题",-1)),h("div",pv,[I[11]||(I[11]=h("div",{class:"problem-title"},"[!] Blocking Issue",-1)),le(Nt,{content:d.value.problem},null,8,["content"])])])):ue("",!0),c.value.conclusion?($(),D("div",gv,[I[14]||(I[14]=h("div",{class:"section-title"},"Conclusion / 执行结论",-1)),h("div",mv,[I[13]||(I[13]=h("span",{class:"conclusion-badge"},"DONE",-1)),h("div",yv,[le(Nt,{content:c.value.conclusion},null,8,["content"])])])])):ue("",!0),k.value&&f.value?.childConclusions?.length?($(),D("div",_v,[I[15]||(I[15]=h("div",{class:"section-title"},"Child Conclusions / 子节点结论",-1)),h("div",wv,[($(!0),D(Ne,null,Te(f.value.childConclusions,b=>($(),D("div",{key:b.nodeId,class:Ce(["child-conclusion-item",{"is-incomplete":!b.conclusion}])},[h("div",bv,[h("span",{class:"child-node-icon","data-status":b.status,"data-incomplete":!b.conclusion},null,8,xv),Se(" "+q(b.title),1)]),b.conclusion?($(),D("div",Sv,[le(_h,{content:b.conclusion},null,8,["content"])])):($(),D("div",Ev,"-- waiting for completion --"))],2))),128))])])):ue("",!0),h("div",kv,[h("div",Nv,[I[16]||(I[16]=Se(" Log / 执行日志 ",-1)),h("span",$v,q(d.value.logEntries?.length||0),1)]),d.value.logEntries?.length?($(),D("div",Cv,[($(!0),D(Ne,null,Te(d.value.logEntries,(b,A)=>($(),D("div",{key:A,class:"log-item"},[h("span",Mv,q(b.timestamp),1),h("span",{class:Ce(["log-operator",M(b.operator)])},q(b.operator==="AI"?"AI":b.operator==="Human"?"USR":"SYS"),3),h("span",Iv,q(b.event),1)]))),128))])):($(),D("div",Dv,"暂无日志"))])]),h("div",Tv,[h("div",Pv,[($(!0),D(Ne,null,Te(C.value,b=>($(),Me(Be,{key:b.action,variant:b.variant,size:"sm",onClick:A=>O(b.action)},{default:xe(()=>[Se(q(b.label),1)]),_:2},1032,["variant","onClick"]))),128))]),h("div",Av,[le(Be,{variant:"secondary",size:"sm",onClick:se,disabled:B(i).currentFocus===c.value.id},{default:xe(()=>[...I[17]||(I[17]=[Se(" 设为焦点 ",-1)])]),_:1},8,["disabled"]),le(Be,{variant:"danger",size:"sm",onClick:K,disabled:c.value.id==="root"},{default:xe(()=>[...I[18]||(I[18]=[Se(" 删除 ",-1)])]),_:1},8,["disabled"])])]),le(Ch,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=b=>s.value=b),title:a.value,message:l.value,"confirm-text":"确定","cancel-text":"取消",onConfirm:L,onCancel:R},null,8,["modelValue","title","message"]),le(Oi,{modelValue:u.value,"onUpdate:modelValue":I[1]||(I[1]=b=>u.value=b),title:"删除确认",message:"确定要删除此节点吗?此操作不可撤销。","confirm-text":"删除","cancel-text":"取消",type:"danger",onConfirm:H},null,8,["modelValue"])])):ue("",!0)}}),zv=ze(Ov,[["__scopeId","data-v-587ff23a"]]),Bv={key:0,class:"memo-detail-wrapper"},Vv={class:"memo-detail-panel"},Rv={class:"detail-header"},Hv={class:"header-main"},Lv={class:"header-title"},Fv={class:"header-meta"},Gv={key:0,class:"detail-section"},Wv={class:"summary-box"},Yv={key:1,class:"detail-section"},Uv={class:"tags-container"},Xv={class:"detail-section"},Zv={class:"content-box"},Kv={class:"detail-section"},qv={class:"meta-info"},jv={class:"meta-row"},Jv={class:"meta-value"},Qv={class:"meta-row"},ep={class:"meta-value"},tp={class:"action-bar"},np={class:"action-group"},op={class:"action-group"},ip={key:1,class:"memo-loading"},sp={key:2,class:"memo-empty"},ap=pe({__name:"MemoDetail",props:{memoId:{}},emits:["deleted"],setup(e,{emit:t}){const n=e,o=t,i=wo(),s=ht(),a=nn(),l=G(()=>i.currentMemo),r=Y(!1);async function u(){if(!(!n.memoId||!s.currentWorkspace?.id))try{await i.fetchMemo(s.currentWorkspace.id,n.memoId)}catch{}}function c(){r.value=!0}async function f(){if(!(!n.memoId||!s.currentWorkspace?.id))try{await i.deleteMemo(s.currentWorkspace.id,n.memoId),o("deleted")}catch{}}Xe(()=>{u()}),Ee(()=>n.memoId,()=>{u()});function d(){if(!l.value)return"";const m=[];return m.push(`# ${l.value.title}`),m.push(""),l.value.summary&&(m.push(`> ${l.value.summary}`),m.push("")),l.value.tags&&l.value.tags.length>0&&(m.push(`标签: ${l.value.tags.join(", ")}`),m.push("")),m.push("---"),m.push(""),m.push(l.value.content||""),m.join(`
|
|
27
|
+
`)}function _(){if(!l.value)return"memo.md";const m=l.value.title.replace(/[/\\:*?"<>|]/g,"_"),w=new Date().toISOString().slice(0,10).replace(/-/g,"");return`${m}_${w}.md`}function k(){if(!l.value)return;const m=d(),w=_(),g=new Blob([m],{type:"text/markdown;charset=utf-8"}),v=URL.createObjectURL(g),C=document.createElement("a");C.href=v,C.download=w,C.click(),URL.revokeObjectURL(v),a.success("已下载")}async function p(){if(!l.value)return;const m=d();try{await navigator.clipboard.writeText(m),a.success("已复制到剪贴板")}catch{a.error("复制失败")}}return(m,w)=>l.value?($(),D("div",Bv,[h("div",Vv,[h("div",Rv,[h("div",Hv,[le(Qe,{type:"execution",status:"pending","is-memo":!0,"content-length":l.value.contentLength},null,8,["content-length"]),w[1]||(w[1]=h("span",{class:"memo-type"},"MEMO",-1)),w[2]||(w[2]=h("span",{class:"header-sep"},"·",-1)),h("span",Lv,q(l.value.title),1)]),h("div",Fv,"ID: "+q(l.value.id),1)]),l.value.summary?($(),D("div",Gv,[w[3]||(w[3]=h("div",{class:"section-title"},"Summary / 摘要",-1)),h("div",Wv,q(l.value.summary),1)])):ue("",!0),l.value.tags?.length?($(),D("div",Yv,[w[4]||(w[4]=h("div",{class:"section-title"},"Tags / 标签",-1)),h("div",Uv,[($(!0),D(Ne,null,Te(l.value.tags,g=>($(),D("span",{key:g,class:"tag-item"},q(g),1))),128))])])):ue("",!0),h("div",Xv,[w[5]||(w[5]=h("div",{class:"section-title"},"Content / 内容",-1)),h("div",Zv,[le(Nt,{content:l.value.content||"暂无内容"},null,8,["content"])])]),h("div",Kv,[w[8]||(w[8]=h("div",{class:"section-title"},"Metadata / 元信息",-1)),h("div",qv,[h("div",jv,[w[6]||(w[6]=h("span",{class:"meta-label"},"创建时间:",-1)),h("span",Jv,q(l.value.createdAt),1)]),h("div",Qv,[w[7]||(w[7]=h("span",{class:"meta-label"},"更新时间:",-1)),h("span",ep,q(l.value.updatedAt),1)])])])]),h("div",tp,[h("div",np,[le(Be,{variant:"secondary",size:"sm",onClick:k},{default:xe(()=>[...w[9]||(w[9]=[Se(" 下载 ",-1)])]),_:1}),le(Be,{variant:"secondary",size:"sm",onClick:p},{default:xe(()=>[...w[10]||(w[10]=[Se(" 复制 ",-1)])]),_:1})]),h("div",op,[le(Be,{variant:"danger",size:"sm",onClick:c},{default:xe(()=>[...w[11]||(w[11]=[Se(" 删除 ",-1)])]),_:1})])]),le(Oi,{modelValue:r.value,"onUpdate:modelValue":w[0]||(w[0]=g=>r.value=g),title:"删除确认",message:"确定要删除此备忘吗?此操作不可撤销。","confirm-text":"删除","cancel-text":"取消",type:"danger",onConfirm:f},null,8,["modelValue"])])):B(i).loading?($(),D("div",ip," 加载中... ")):($(),D("div",sp," 未找到备忘 "))}}),lp=ze(ap,[["__scopeId","data-v-75815f8d"]]),rp={class:"memo-drawer-detail"},up={class:"drawer-panel"},cp={class:"detail-header"},dp={class:"header-main"},fp={class:"header-title"},hp={class:"header-meta"},vp={key:0,class:"detail-section"},pp={class:"tags-container"},gp=["onMouseenter"],mp={class:"detail-section"},yp={class:"memo-list"},_p=["onClick"],wp={class:"memo-item-header"},bp={class:"memo-title"},xp={key:0,class:"memo-item-meta"},Sp={key:0,class:"memo-summary"},Ep={key:1,class:"memo-tags"},kp={key:1,class:"empty-state"},Np=pe({__name:"MemoDrawerDetail",emits:["selectMemo"],setup(e,{emit:t}){const n=wo(),o=ht(),i=t,s=G(()=>n.memos),a=G(()=>n.allTags),l=G(()=>s.value.length),r=Y(null);function u(c){i("selectMemo",c)}return(c,f)=>($(),D("div",rp,[h("div",up,[h("div",cp,[h("div",dp,[le(Qe,{type:"execution",status:"pending","is-memo":!0,"memo-count":l.value},null,8,["memo-count"]),f[1]||(f[1]=h("span",{class:"drawer-type"},"MEMO",-1)),f[2]||(f[2]=h("span",{class:"header-sep"},"·",-1)),h("span",fp,"草稿 ("+q(l.value)+")",1)]),h("div",hp,"工作区: "+q(B(o).currentWorkspace?.name),1)]),a.value.length>0?($(),D("div",vp,[f[3]||(f[3]=h("div",{class:"section-title"},"All Tags / 所有标签",-1)),h("div",pp,[($(!0),D(Ne,null,Te(a.value,d=>($(),D("span",{key:d,class:Ce(["tag-item",{"tag-hovered":r.value===d}]),onMouseenter:_=>r.value=d,onMouseleave:f[0]||(f[0]=_=>r.value=null)},q(d),43,gp))),128))])])):ue("",!0),h("div",mp,[f[4]||(f[4]=h("div",{class:"section-title"},"Memos / 备忘列表",-1)),h("div",yp,[($(!0),D(Ne,null,Te(s.value,d=>($(),D("div",{key:d.id,class:"memo-item",onClick:_=>u(d.id)},[h("div",wp,[le(Qe,{type:"execution",status:"pending","is-memo":!0,"content-length":d.contentLength},null,8,["content-length"]),h("span",bp,q(d.title),1)]),d.summary||d.tags?.length?($(),D("div",xp,[d.summary?($(),D("div",Sp,q(d.summary),1)):ue("",!0),d.tags?.length?($(),D("div",Ep,[($(!0),D(Ne,null,Te(d.tags,_=>($(),D("span",{key:_,class:Ce(["mini-tag",{"mini-tag-highlight":r.value===_}])},q(_),3))),128))])):ue("",!0)])):ue("",!0)],8,_p))),128))])]),s.value.length===0?($(),D("div",kp,[...f[5]||(f[5]=[h("div",{class:"empty-icon"},"[ ]",-1),h("span",{class:"empty-text"},"暂无备忘",-1)])])):ue("",!0)])]))}}),$p=ze(Np,[["__scopeId","data-v-c5456da1"]]),Cp={class:"enable-dispatch-content"},Mp={class:"mode-options"},Ip=pe({__name:"EnableDispatchDialog",props:{modelValue:{type:Boolean}},emits:["update:modelValue","success"],setup(e,{emit:t}){const n=e,o=t,i=ht(),s=nn(),a=Y(!1),l=Y(!1);Ee(()=>n.modelValue,c=>{c&&(a.value=!1)});async function r(){l.value=!0;try{await i.enableDispatch(a.value),s.success("派发模式已启用"),o("success"),o("update:modelValue",!1)}catch(c){s.error("启用派发失败",c instanceof Error?c.message:void 0)}finally{l.value=!1}}function u(){o("update:modelValue",!1)}return(c,f)=>($(),Me(Xt,{"model-value":e.modelValue,title:"启用派发模式",width:"500px","onUpdate:modelValue":f[2]||(f[2]=d=>o("update:modelValue",d))},{footer:xe(()=>[le(Be,{variant:"secondary",onClick:u},{default:xe(()=>[...f[6]||(f[6]=[Se("取消",-1)])]),_:1}),le(Be,{variant:"primary",loading:l.value,onClick:r},{default:xe(()=>[...f[7]||(f[7]=[Se(" 启用 ",-1)])]),_:1},8,["loading"])]),default:xe(()=>[h("div",Cp,[f[5]||(f[5]=h("div",{class:"section-label"},"选择模式:",-1)),h("div",Mp,[h("div",{class:Ce(["card-option",{selected:!a.value}]),onClick:f[0]||(f[0]=d=>a.value=!1)},[...f[3]||(f[3]=[h("div",{class:"card-option-title"},[h("span",null,"标准模式 (无 Git)")],-1),h("div",{class:"card-option-desc"}," 仅更新元数据,不影响代码。适合轻量级任务管理。 ",-1)])],2),h("div",{class:Ce(["card-option",{selected:a.value}]),onClick:f[1]||(f[1]=d=>a.value=!0)},[...f[4]||(f[4]=[h("div",{class:"card-option-title"},[h("span",null,"Git 模式 (实验功能)"),h("span",{class:"tag-experimental"},"Experimental")],-1),h("div",{class:"card-option-desc"}," 自动创建分支、提交、回滚。提供完整的代码版本控制能力。 ",-1)])],2)])])]),_:1},8,["model-value"]))}}),Dp=ze(Ip,[["__scopeId","data-v-0ce35816"]]),Tp={class:"disable-dispatch-content"},Pp={key:0,class:"loading-state"},Ap={key:1,class:"simple-confirm"},Op={key:2,class:"git-options"},zp={key:0,class:"info-box"},Bp={class:"form-section"},Vp={class:"strategy-options"},Rp=["onClick"],Hp={class:"card-option-title"},Lp={key:1,class:"form-section"},Fp={class:"form-section"},Gp={class:"checkbox-custom"},Wp={key:0,class:"branch-name"},Yp={class:"code-inline"},Up=["disabled"],Xp=pe({__name:"DisableDispatchDialog",props:{modelValue:{type:Boolean}},emits:["update:modelValue","success"],setup(e,{emit:t}){const n=e,o=t,i=ht(),s=nn(),a=Y(!1),l=Y(!1),r=Y(null),u=Y("squash"),c=Y(!1),f=Y(!1),d=Y("");async function _(){if(i.currentWorkspace){l.value=!0;try{r.value=await zi.queryDisableDispatch(i.currentWorkspace.id)}catch{s.error("获取派发状态失败"),o("update:modelValue",!1)}finally{l.value=!1}}}Ee(()=>n.modelValue,w=>{w&&(_(),u.value="squash",c.value=!1,f.value=!1,d.value="")});async function k(){a.value=!0;try{await i.disableDispatch({mergeStrategy:u.value,keepBackupBranch:c.value,keepProcessBranch:f.value,commitMessage:u.value==="squash"?d.value:void 0}),s.success("派发模式已关闭"),o("success"),o("update:modelValue",!1)}catch(w){s.error("关闭派发失败",w instanceof Error?w.message:void 0)}finally{a.value=!1}}function p(){o("update:modelValue",!1)}const m=[{value:"sequential",title:"按顺序合并 (保留历史)",desc:"保留所有提交记录"},{value:"squash",title:"Squash (压缩提交)",desc:"合并为单个提交"},{value:"cherry-pick",title:"Cherry-pick (遴选)",desc:"遴选到当前分支"},{value:"skip",title:"Drop (丢弃分支)",desc:"不合并,直接丢弃"}];return(w,g)=>($(),Me(Xt,{"model-value":e.modelValue,title:"关闭派发模式",width:"500px","onUpdate:modelValue":g[3]||(g[3]=v=>o("update:modelValue",v))},{footer:xe(()=>[le(Be,{variant:"secondary",onClick:p},{default:xe(()=>[...g[12]||(g[12]=[Se("取消",-1)])]),_:1}),le(Be,{variant:"primary",loading:a.value,disabled:l.value,onClick:k},{default:xe(()=>[...g[13]||(g[13]=[Se(" 确认关闭 ",-1)])]),_:1},8,["loading","disabled"])]),default:xe(()=>[h("div",Tp,[l.value?($(),D("div",Pp," 正在加载派发状态... ")):r.value&&!r.value.status.useGit?($(),D("div",Ap," 确定要关闭派发模式吗? ")):r.value&&r.value.status.useGit?($(),D("div",Op,[r.value.status.processCommits&&r.value.status.processCommits.length>0?($(),D("div",zp,[g[4]||(g[4]=Se(" 当前有 ",-1)),h("strong",null,q(r.value.status.processCommits.length),1),g[5]||(g[5]=Se(" 个提交待处理 ",-1))])):ue("",!0),h("div",Bp,[g[6]||(g[6]=h("div",{class:"section-label"},"合并策略:",-1)),h("div",Vp,[($(),D(Ne,null,Te(m,v=>h("div",{key:v.value,class:Ce(["card-option",{selected:u.value===v.value}]),onClick:C=>u.value=v.value},[h("div",Hp,q(v.title),1)],10,Rp)),64))])]),u.value==="squash"?($(),D("div",Lp,[g[7]||(g[7]=h("div",{class:"section-label"},"提交信息:",-1)),We(h("textarea",{"onUpdate:modelValue":g[0]||(g[0]=v=>d.value=v),class:"commit-input",placeholder:"feat: complete workspace task dispatch",rows:"3"},null,512),[[Ut,d.value]])])):ue("",!0),h("div",Fp,[h("label",Gp,[We(h("input",{type:"checkbox","onUpdate:modelValue":g[1]||(g[1]=v=>c.value=v)},null,512),[[Po,c.value]]),g[8]||(g[8]=h("span",{class:"checkbox-box"},null,-1)),g[9]||(g[9]=h("span",{class:"checkbox-text"},"保留备份分支",-1))]),c.value&&r.value.status.backupBranch?($(),D("div",Wp,[h("span",Yp,q(r.value.status.backupBranch),1)])):ue("",!0),h("label",{class:Ce(["checkbox-custom",{disabled:u.value==="skip"}])},[We(h("input",{type:"checkbox","onUpdate:modelValue":g[2]||(g[2]=v=>f.value=v),disabled:u.value==="skip"},null,8,Up),[[Po,f.value]]),g[10]||(g[10]=h("span",{class:"checkbox-box"},null,-1)),g[11]||(g[11]=h("span",{class:"checkbox-text"},"保留派发分支",-1))],2)])])):ue("",!0)])]),_:1},8,["model-value"]))}}),Zp=ze(Xp,[["__scopeId","data-v-fc0c6906"]]),Kp={class:"switch-mode-content"},qp={class:"mode-switch-viz"},jp={class:"switch-desc"},Jp=pe({__name:"SwitchDispatchModeDialog",props:{modelValue:{type:Boolean}},emits:["update:modelValue","success"],setup(e,{emit:t}){const n=t,o=ht(),i=nn(),s=Y(!1),a=G(()=>o.dispatchStatus==="enabled-git"?"git":"no-git"),l=G(()=>a.value==="git"?"no-git":"git"),r=G(()=>({git:"GIT 模式","no-git":"标准模式"}));async function u(){s.value=!0;try{const f=l.value==="git";await o.switchDispatchMode(f),i.success(`已切换到${r.value[l.value]}`),n("success"),n("update:modelValue",!1)}catch(f){i.error("切换派发模式失败",f instanceof Error?f.message:void 0)}finally{s.value=!1}}function c(){n("update:modelValue",!1)}return(f,d)=>($(),Me(Xt,{"model-value":e.modelValue,title:"切换派发模式",width:"500px","onUpdate:modelValue":d[0]||(d[0]=_=>n("update:modelValue",_))},{footer:xe(()=>[le(Be,{variant:"secondary",onClick:c},{default:xe(()=>[...d[9]||(d[9]=[Se("取消",-1)])]),_:1}),le(Be,{variant:"accent",loading:s.value,onClick:u},{default:xe(()=>[...d[10]||(d[10]=[Se(" 确认切换 ",-1)])]),_:1},8,["loading"])]),default:xe(()=>[h("div",Kp,[d[8]||(d[8]=h("div",{class:"warning-box"},[h("strong",null,"[!] 切换派发模式可能带来风险"),h("br"),Se(" - 确保当前没有正在执行的派发任务"),h("br"),Se(" - 切换后需重新启动派发流程 ")],-1)),h("div",qp,[h("div",{class:Ce(["mode-tag",a.value])},q(r.value[a.value]),3),d[1]||(d[1]=h("div",{class:"mode-arrow"},"→",-1)),h("div",{class:Ce(["mode-tag",l.value])},q(r.value[l.value]),3)]),h("div",jp,[l.value==="git"?($(),D(Ne,{key:0},[d[2]||(d[2]=Se(" 即将切换到",-1)),d[3]||(d[3]=h("strong",null,"Git 模式",-1)),d[4]||(d[4]=Se("。系统将自动创建分支、提交代码,并在失败时执行回滚。 ",-1))],64)):($(),D(Ne,{key:1},[d[5]||(d[5]=Se(" 即将切换到",-1)),d[6]||(d[6]=h("strong",null,"标准模式",-1)),d[7]||(d[7]=Se("。系统将不再自动创建 Git 分支或提交代码,仅维护任务元数据。 ",-1))],64))])])]),_:1},8,["model-value"]))}}),Qp=ze(Jp,[["__scopeId","data-v-35e07359"]]),eg={class:"workspace-view"},tg={class:"layout-header"},ng={class:"header-left"},og={class:"workspace-title"},ig={class:"header-right"},sg=["title"],ag={key:0,class:"icon-sun",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},lg={key:1,class:"icon-moon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},rg=["disabled"],ug=["disabled"],cg=["disabled"],dg={key:0,class:"layout-infobar"},fg={class:"info-item info-goal"},hg={class:"info-value"},vg={class:"info-item info-progress"},pg={class:"info-value progress-display"},gg={class:"progress-number"},mg={class:"progress-current"},yg={class:"progress-total"},_g={class:"progress-bar-wrapper"},wg={class:"progress-track"},bg={class:"info-item"},xg={class:"info-value"},Sg=["disabled"],Eg={key:0,class:"info-item"},kg={class:"info-value"},Ng={class:"main-content"},$g={class:"sidebar-header"},Cg={class:"view-toggle"},Mg={class:"sidebar-content"},Ig={class:"layout-content"},Dg={key:3,class:"empty-state"},Tg={class:"modal-header"},Pg={class:"modal-body"},Ag={class:"detail-section"},Og={class:"goal-content"},zg={key:0,class:"detail-section"},Bg={class:"section-title"},Vg={class:"count-badge"},Rg={class:"rules-list"},Hg={key:1,class:"detail-section"},Lg={class:"section-title"},Fg={class:"count-badge"},Gg={class:"docs-list"},Wg={class:"doc-path"},Yg={class:"doc-desc"},Ug={class:"detail-section"},Xg={class:"section-title"},Zg={class:"count-badge"},Kg={key:0,class:"log-container"},qg={class:"log-header"},jg={class:"log-time"},Jg={class:"log-content"},Qg={key:1,class:"empty-tip"},em={class:"create-form"},tm={class:"form-group"},nm={class:"radio-group"},om={class:"type-hint"},im={class:"form-group"},sm={class:"form-group"},am={class:"export-warning-content"},lm={class:"warning-list"},rm=300,um=200,cm=800,dm=450,fm=320,hm=800,vm=pe({__name:"WorkspaceView",setup(e){const t=nn();function n(){try{return JSON.parse(localStorage.getItem("zero-workspace-home-preferences")||"{}").theme||"light"}catch{return"light"}}const o=Y(n());document.documentElement.setAttribute("data-theme",o.value);function i(){o.value=o.value==="light"?"dark":"light",document.documentElement.setAttribute("data-theme",o.value);const z=JSON.parse(localStorage.getItem("zero-workspace-home-preferences")||"{}");z.theme=o.value,localStorage.setItem("zero-workspace-home-preferences",JSON.stringify(z))}function s(z,T="info"){T==="success"?t.success(z):T==="error"?t.error(z):t.info(z)}const a=Y(localStorage.getItem("zero-workspace-view-mode")||"list");function l(z){a.value=z,localStorage.setItem("zero-workspace-view-mode",z)}const r=Y(parseInt(localStorage.getItem("zero-workspace-sidebar-width")||"")||rm),u=Y(!1);function c(){u.value=!0,document.addEventListener("mousemove",f),document.addEventListener("mouseup",d),document.body.style.userSelect="none",document.body.style.cursor="col-resize"}function f(z){if(!u.value)return;const T=z.clientX;T>=um&&T<=cm&&(r.value=T)}function d(){u.value=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",d),document.body.style.userSelect="",document.body.style.cursor="",localStorage.setItem("zero-workspace-sidebar-width",r.value.toString())}Ii(()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",d)});const _=ca(),k=ha(),p=ht(),m=Bi(),w=ua(),g=wo(),v=G(()=>_.params.id),C=Y("node"),O=Y(null),F=G(()=>C.value==="node"?m.selectedNodeId:C.value==="memo-drawer"?"__memo_drawer__":O.value);async function L(){try{await p.fetchWorkspace(v.value),await m.fetchNodeTree(),await g.fetchMemos(v.value)}catch(z){const T=z instanceof Error?z.message:"未知错误";try{await zi.markError(v.value,T)}catch{}t.error("加载工作区失败",T),k.push("/")}}const R=Y(!1),se=Y(parseInt(localStorage.getItem("zero-workspace-drawer-width")||"")||dm),K=Y(!1);function H(z){z.preventDefault(),K.value=!0,document.addEventListener("mousemove",M),document.addEventListener("mouseup",oe),document.body.style.userSelect="none",document.body.style.cursor="ew-resize"}function M(z){if(!K.value)return;const T=window.innerWidth-z.clientX;T>=fm&&T<=hm&&(se.value=T)}function oe(){K.value=!1,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",oe),document.body.style.userSelect="",document.body.style.cursor="",localStorage.setItem("zero-workspace-drawer-width",se.value.toString())}const x=G(()=>p.currentRules.length>0||p.currentDocs.length>0),I=G(()=>{const z=p.currentStatus;return!z||z.totalNodes===0?0:Math.round(z.completedNodes/z.totalNodes*100)}),b=Y(!1);async function A(){b.value=!0;try{await L(),m.selectedNodeId&&await m.selectNode(m.selectedNodeId),O.value&&p.currentWorkspace?.id&&await g.fetchMemo(p.currentWorkspace.id,O.value),s("刷新成功","success")}catch(z){const T=z instanceof Error?z.message:"未知错误";t.error("刷新失败",T)}finally{b.value=!1}}const V=Y(!1);async function W(){V.value=!0;try{await p.fetchWorkspace(v.value),await m.fetchNodeTree();const z=p.currentFocus;z?(C.value="node",O.value=null,await m.selectNode(z),s("已定位到当前任务","success")):s("当前没有聚焦的任务","info")}catch(z){const T=z instanceof Error?z.message:"未知错误";t.error("定位失败",T)}finally{V.value=!1}}Ee(v,L),Xe(()=>{L();const z=va();z.connect(),z.on("node_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到节点更新,刷新数据"),m.fetchNodeTree(),p.fetchWorkspace(v.value),m.selectedNodeId&&C.value==="node"&&m.selectNode(m.selectedNodeId))}),z.on("log_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到日志更新,刷新数据"),p.fetchWorkspace(v.value))}),z.on("memo_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到 memo 更新,刷新数据"),g.fetchMemos(v.value),O.value&&C.value==="memo"&&g.fetchMemo(v.value,O.value))}),z.on("dispatch_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到派发更新,刷新数据"),p.fetchWorkspace(v.value),m.fetchNodeTree())}),z.on("context_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到上下文更新,刷新数据"),p.fetchWorkspace(v.value))}),z.on("reference_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到引用更新,刷新数据"),m.fetchNodeTree(),m.selectedNodeId&&m.selectNode(m.selectedNodeId))}),z.on("workspace_updated",T=>{T.workspaceId===v.value&&(console.log("[SSE] 收到工作区更新,刷新数据"),p.fetchWorkspace(v.value))})});function U(){p.clearCurrent(),m.clearAll(),k.push("/")}function te(z){C.value="node",O.value=null,m.selectNode(z)}function re(z){C.value="memo",O.value=z,m.clearSelection()}function fe(z){if(z==="__memo_drawer__"){ge();return}z.startsWith("memo-")?re(z):te(z)}function ge(){C.value="memo-drawer",O.value=null,m.clearSelection()}function j(z){re(z)}async function ne(){O.value=null,C.value="memo-drawer",p.currentWorkspace?.id&&await g.fetchMemos(p.currentWorkspace.id)}const ee=Y(!1),ce=Y({type:"execution",title:"",requirement:""});function me(){ce.value={type:"execution",title:"",requirement:""},ee.value=!0}async function _e(){const z=m.selectedNodeId||"root";if(!ce.value.title){s("请输入节点标题","error");return}try{await m.createNode({parentId:z,type:ce.value.type,title:ce.value.title,requirement:ce.value.requirement}),s("创建成功","success"),ee.value=!1}catch{s("创建失败","error")}}const ke=Y(!1),de=Y(!1),ve=Y(!1),E=Y(!1);async function y(){if(await w.loadSettings(),w.settings.defaultDispatchMode==="none")ke.value=!0;else{E.value=!0;try{await p.enableDispatch(),s("派发模式已启用","success"),await L()}catch(T){s(T instanceof Error?T.message:"启用派发失败","error")}finally{E.value=!1}}}function N(){ve.value=!0}async function S(){await L()}const P=Y(!1),Z=Y(!1),J=Y([]);async function Q(){if(v.value){P.value=!0;try{const z=await Oo.checkExportWorkspace(v.value);if(z.warnings.length>0){J.value=z.warnings,Z.value=!0,P.value=!1;return}await ie()}catch(z){const T=z instanceof Error?z.message:"导出失败";t.error("导出失败",T),P.value=!1}}}async function ie(){if(v.value){P.value=!0;try{const z=await Oo.exportWorkspace(v.value);s(`已导出: ${z.filename}`,"success")}catch(z){const T=z instanceof Error?z.message:"导出失败";t.error("导出失败",T)}finally{P.value=!1}}}async function he(){Z.value=!1,J.value=[],await ie()}function we(){Z.value=!1,J.value=[]}return(z,T)=>{const vt=da("loading");return We(($(),D("div",eg,[h("header",tg,[h("div",ng,[h("button",{class:"ws-btn text",onClick:U,title:"返回首页"},"<"),h("h2",og,q(B(p).currentWorkspace?.name),1),T[19]||(T[19]=h("span",{class:"header-sep"},"·",-1)),h("button",{class:"ws-btn text details-link",onClick:T[0]||(T[0]=ye=>R.value=!0)},[...T[18]||(T[18]=[Se("DETAILS",-1),h("span",{class:"blink-cursor"},"_",-1)])])]),h("div",ig,[h("button",{class:"theme-toggle",onClick:i,title:o.value==="light"?"切换到深色模式":"切换到浅色模式"},[o.value==="light"?($(),D("svg",ag,[...T[20]||(T[20]=[fa('<circle cx="12" cy="12" r="5" data-v-28d52b97></circle><line x1="12" y1="1" x2="12" y2="3" data-v-28d52b97></line><line x1="12" y1="21" x2="12" y2="23" data-v-28d52b97></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-28d52b97></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-28d52b97></line><line x1="1" y1="12" x2="3" y2="12" data-v-28d52b97></line><line x1="21" y1="12" x2="23" y2="12" data-v-28d52b97></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-28d52b97></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-28d52b97></line>',9)])])):($(),D("svg",lg,[...T[21]||(T[21]=[h("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},null,-1)])]))],8,sg),h("button",{class:"ws-btn",onClick:Q,disabled:P.value,title:"导出工作区"},"↓ EXPORT",8,rg),h("button",{class:"ws-btn",onClick:W,disabled:V.value,title:"聚焦当前任务"},"▶ FOCUS",8,ug),h("button",{class:"ws-btn",onClick:A,disabled:b.value,title:"刷新数据"},"⇄ SYNC",8,cg),h("button",{class:"ws-btn primary",onClick:me},"+ NEW")])]),B(p).currentStatus?($(),D("div",dg,[h("div",fg,[T[22]||(T[22]=h("span",{class:"info-label"},"Goal / 目标",-1)),h("span",hg,q(B(p).currentStatus.goal),1)]),h("div",vg,[T[24]||(T[24]=h("span",{class:"info-label"},"Progress / 进度",-1)),h("div",pg,[h("span",gg,[h("span",mg,q(B(p).currentStatus.completedNodes),1),T[23]||(T[23]=h("span",{class:"progress-sep"},"/",-1)),h("span",yg,q(B(p).currentStatus.totalNodes),1)]),h("div",_g,[h("div",wg,[h("div",{class:"progress-fill",style:Ve({width:I.value+"%"})},null,4)])])])]),h("div",bg,[T[25]||(T[25]=h("span",{class:"info-label"},"Dispatch / 派发",-1)),h("div",xg,[h("span",{class:Ce(["badge-status",B(p).dispatchStatus==="disabled"?"disabled":B(p).dispatchStatus==="enabled"?"enabled":"git"])},q(B(p).dispatchStatus==="disabled"?"OFF":B(p).dispatchStatus==="enabled"?"ON":"GIT"),3),B(p).dispatchStatus==="disabled"?($(),D("button",{key:0,class:"ws-btn config-btn",disabled:E.value,onClick:y},"ENABLE",8,Sg)):($(),D("button",{key:1,class:"ws-btn config-btn",onClick:N},"CONFIG"))])]),x.value?($(),D("div",Eg,[T[26]||(T[26]=h("span",{class:"info-label"},"Links / 引用",-1)),h("div",kg,[B(p).currentRules.length?($(),D("span",{key:0,class:"tag-outline",onClick:T[1]||(T[1]=ye=>R.value=!0)},q(B(p).currentRules.length)+" 规则 ",1)):ue("",!0),B(p).currentDocs.length?($(),D("span",{key:1,class:"tag-outline",onClick:T[2]||(T[2]=ye=>R.value=!0)},q(B(p).currentDocs.length)+" 文档 ",1)):ue("",!0)])])):ue("",!0)])):ue("",!0),h("div",Ng,[h("aside",{class:"layout-sidebar",style:Ve({width:r.value+"px"})},[h("div",$g,[T[27]||(T[27]=h("h3",null,"Task Tree",-1)),h("div",Cg,[h("button",{class:Ce(["ws-btn view-btn",{active:a.value==="list"}]),onClick:T[3]||(T[3]=ye=>l("list")),title:"列表视图"},"☰",2),h("button",{class:Ce(["ws-btn view-btn",{active:a.value==="graph"}]),onClick:T[4]||(T[4]=ye=>l("graph")),title:"图形视图"},"◇",2)])]),h("div",Mg,[a.value==="list"?($(),Me(Ga,{key:0,tree:B(m).nodeTree,"selected-id":F.value,"focus-id":B(p).currentFocus,memos:B(g).memos,onSelect:fe},null,8,["tree","selected-id","focus-id","memos"])):($(),Me(gh,{key:1,tree:B(m).nodeTree,"selected-id":F.value,"focus-id":B(p).currentFocus,memos:B(g).memos,onSelect:fe,onSelectMemo:ge},null,8,["tree","selected-id","focus-id","memos"]))])],4),h("div",{class:Ce(["resizer",{"is-resizing":u.value}]),onMousedown:c},null,34),h("main",Ig,[C.value==="node"&&B(m).selectedNodeId?($(),Me(zv,{key:0,onSelectMemo:j})):C.value==="memo"&&O.value?($(),Me(lp,{key:1,"memo-id":O.value,onDeleted:ne},null,8,["memo-id"])):C.value==="memo-drawer"?($(),Me($p,{key:2,onSelectMemo:j})):($(),D("div",Dg,[...T[28]||(T[28]=[h("div",{class:"empty-icon"},null,-1),h("p",{class:"empty-text"},"SELECT A NODE OR MEMO",-1),h("p",{class:"empty-hint"},"选择左侧节点或备忘查看详情",-1)])]))])]),le(Pi,{name:"drawer-fade"},{default:xe(()=>[R.value?($(),D("div",{key:0,class:"drawer-overlay",onClick:T[7]||(T[7]=ye=>R.value=!1)},[h("div",{class:"drawer-panel",style:Ve({width:se.value+"px"}),onClick:T[6]||(T[6]=Ai(()=>{},["stop"]))},[h("div",{class:"drawer-resizer",onMousedown:H},null,32),h("div",Tg,[T[29]||(T[29]=h("span",null,"工作区详情",-1)),h("button",{class:"modal-close",onClick:T[5]||(T[5]=ye=>R.value=!1)},"×")]),h("div",Pg,[h("div",Ag,[T[30]||(T[30]=h("div",{class:"section-title"},"Goal / 目标",-1)),h("div",Og,q(B(p).currentStatus?.goal||"暂无目标"),1)]),B(p).currentRules.length>0?($(),D("div",zg,[h("div",Bg,[T[31]||(T[31]=Se(" Rules / 规则 ",-1)),h("span",Vg,q(B(p).currentRules.length),1)]),h("ul",Rg,[($(!0),D(Ne,null,Te(B(p).currentRules,(ye,tt)=>($(),D("li",{key:tt},q(ye),1))),128))])])):ue("",!0),B(p).currentDocs.length>0?($(),D("div",Hg,[h("div",Lg,[T[32]||(T[32]=Se(" Docs / 文档 ",-1)),h("span",Fg,q(B(p).currentDocs.length),1)]),h("ul",Gg,[($(!0),D(Ne,null,Te(B(p).currentDocs,(ye,tt)=>($(),D("li",{key:tt},[h("span",Wg,q(ye.path),1),h("span",Yg,q(ye.description),1)]))),128))])])):ue("",!0),h("div",Ug,[h("div",Xg,[T[33]||(T[33]=Se(" Log / 工作区日志 ",-1)),h("span",Zg,q(B(p).currentLogs.length),1)]),B(p).currentLogs.length>0?($(),D("div",Kg,[($(!0),D(Ne,null,Te(B(p).currentLogs,(ye,tt)=>($(),D("div",{key:tt,class:"log-item"},[h("div",qg,[h("span",jg,q(ye.timestamp),1),h("span",{class:Ce(["log-operator",ye.operator==="AI"?"ai":ye.operator==="Human"?"usr":"sys"])},q(ye.operator==="AI"?"AI":ye.operator==="Human"?"USR":"SYS"),3)]),h("div",Jg,q(ye.event),1)]))),128))])):($(),D("div",Qg,"暂无日志记录"))])])],4)])):ue("",!0)]),_:1}),le(Xt,{modelValue:ee.value,"onUpdate:modelValue":T[13]||(T[13]=ye=>ee.value=ye),title:"新建节点"},{footer:xe(()=>[le(Be,{variant:"secondary",onClick:T[12]||(T[12]=ye=>ee.value=!1)},{default:xe(()=>[...T[39]||(T[39]=[Se("取消",-1)])]),_:1}),le(Be,{variant:"primary",onClick:_e,disabled:B(m).loading},{default:xe(()=>[...T[40]||(T[40]=[Se(" 创建 ",-1)])]),_:1},8,["disabled"])]),default:xe(()=>[h("div",em,[h("div",tm,[T[36]||(T[36]=h("label",{class:"form-label"},"类型 *",-1)),h("div",nm,[h("label",{class:Ce(["radio-option",{selected:ce.value.type==="execution"}])},[We(h("input",{type:"radio","onUpdate:modelValue":T[8]||(T[8]=ye=>ce.value.type=ye),value:"execution"},null,512),[[Ao,ce.value.type]]),T[34]||(T[34]=h("span",{class:"radio-label exec"},"执行节点",-1))],2),h("label",{class:Ce(["radio-option",{selected:ce.value.type==="planning"}])},[We(h("input",{type:"radio","onUpdate:modelValue":T[9]||(T[9]=ye=>ce.value.type=ye),value:"planning"},null,512),[[Ao,ce.value.type]]),T[35]||(T[35]=h("span",{class:"radio-label plan"},"规划节点",-1))],2)]),h("div",om,q(ce.value.type==="execution"?"具体执行任务,不能有子节点":"分析分解任务,可创建子节点"),1)]),h("div",im,[T[37]||(T[37]=h("label",{class:"form-label"},"标题 *",-1)),We(h("input",{"onUpdate:modelValue":T[10]||(T[10]=ye=>ce.value.title=ye),class:"form-input",placeholder:"输入节点标题"},null,512),[[Ut,ce.value.title]])]),h("div",sm,[T[38]||(T[38]=h("label",{class:"form-label"},"需求",-1)),We(h("textarea",{"onUpdate:modelValue":T[11]||(T[11]=ye=>ce.value.requirement=ye),class:"form-textarea",rows:"4",placeholder:"描述节点需求"},null,512),[[Ut,ce.value.requirement]])])])]),_:1},8,["modelValue"]),le(Dp,{modelValue:ke.value,"onUpdate:modelValue":T[14]||(T[14]=ye=>ke.value=ye),onSuccess:S},null,8,["modelValue"]),le(Zp,{modelValue:de.value,"onUpdate:modelValue":T[15]||(T[15]=ye=>de.value=ye),onSuccess:S},null,8,["modelValue"]),le(Qp,{modelValue:ve.value,"onUpdate:modelValue":T[16]||(T[16]=ye=>ve.value=ye),onSuccess:S},null,8,["modelValue"]),le(Xt,{modelValue:Z.value,"onUpdate:modelValue":T[17]||(T[17]=ye=>Z.value=ye),title:"导出警告"},{footer:xe(()=>[le(Be,{variant:"secondary",onClick:we},{default:xe(()=>[...T[43]||(T[43]=[Se("取消",-1)])]),_:1}),le(Be,{variant:"primary",onClick:he},{default:xe(()=>[...T[44]||(T[44]=[Se("继续导出",-1)])]),_:1})]),default:xe(()=>[h("div",am,[T[41]||(T[41]=h("p",{class:"warning-intro"},"检测到以下警告,是否继续导出?",-1)),h("ul",lm,[($(!0),D(Ne,null,Te(J.value,(ye,tt)=>($(),D("li",{key:tt},q(ye),1))),128))]),T[42]||(T[42]=h("p",{class:"warning-note"},"这些外部引用在导入时可能无法正确解析。",-1))])]),_:1},8,["modelValue"])])),[[vt,B(p).loading]])}}}),ym=ze(vm,[["__scopeId","data-v-28d52b97"]]);export{ym as default};
|