@zbigniewsobiecki/squint 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1065 -0
- package/bin/dev.js +5 -0
- package/bin/run.js +5 -0
- package/dist/commands/_shared/db-helper.d.ts +18 -0
- package/dist/commands/_shared/db-helper.d.ts.map +1 -0
- package/dist/commands/_shared/db-helper.js +72 -0
- package/dist/commands/_shared/db-helper.js.map +1 -0
- package/dist/commands/_shared/flags.d.ts +20 -0
- package/dist/commands/_shared/flags.d.ts.map +1 -0
- package/dist/commands/_shared/flags.js +38 -0
- package/dist/commands/_shared/flags.js.map +1 -0
- package/dist/commands/_shared/index.d.ts +6 -0
- package/dist/commands/_shared/index.d.ts.map +1 -0
- package/dist/commands/_shared/index.js +6 -0
- package/dist/commands/_shared/index.js.map +1 -0
- package/dist/commands/_shared/output.d.ts +22 -0
- package/dist/commands/_shared/output.d.ts.map +1 -0
- package/dist/commands/_shared/output.js +36 -0
- package/dist/commands/_shared/output.js.map +1 -0
- package/dist/commands/_shared/source-reader.d.ts +23 -0
- package/dist/commands/_shared/source-reader.d.ts.map +1 -0
- package/dist/commands/_shared/source-reader.js +45 -0
- package/dist/commands/_shared/source-reader.js.map +1 -0
- package/dist/commands/_shared/symbol-resolver.d.ts +35 -0
- package/dist/commands/_shared/symbol-resolver.d.ts.map +1 -0
- package/dist/commands/_shared/symbol-resolver.js +102 -0
- package/dist/commands/_shared/symbol-resolver.js.map +1 -0
- package/dist/commands/browse.d.ts +13 -0
- package/dist/commands/browse.d.ts.map +1 -0
- package/dist/commands/browse.js +106 -0
- package/dist/commands/browse.js.map +1 -0
- package/dist/commands/domains/create.d.ts +15 -0
- package/dist/commands/domains/create.d.ts.map +1 -0
- package/dist/commands/domains/create.js +34 -0
- package/dist/commands/domains/create.js.map +1 -0
- package/dist/commands/domains/delete.d.ts +14 -0
- package/dist/commands/domains/delete.d.ts.map +1 -0
- package/dist/commands/domains/delete.js +41 -0
- package/dist/commands/domains/delete.js.map +1 -0
- package/dist/commands/domains/index.d.ts +2 -0
- package/dist/commands/domains/index.d.ts.map +1 -0
- package/dist/commands/domains/index.js +2 -0
- package/dist/commands/domains/index.js.map +1 -0
- package/dist/commands/domains/list.d.ts +12 -0
- package/dist/commands/domains/list.d.ts.map +1 -0
- package/dist/commands/domains/list.js +67 -0
- package/dist/commands/domains/list.js.map +1 -0
- package/dist/commands/domains/merge.d.ts +14 -0
- package/dist/commands/domains/merge.d.ts.map +1 -0
- package/dist/commands/domains/merge.js +40 -0
- package/dist/commands/domains/merge.js.map +1 -0
- package/dist/commands/domains/rename.d.ts +14 -0
- package/dist/commands/domains/rename.d.ts.map +1 -0
- package/dist/commands/domains/rename.js +33 -0
- package/dist/commands/domains/rename.js.map +1 -0
- package/dist/commands/domains/show.d.ts +14 -0
- package/dist/commands/domains/show.d.ts.map +1 -0
- package/dist/commands/domains/show.js +47 -0
- package/dist/commands/domains/show.js.map +1 -0
- package/dist/commands/domains/sync.d.ts +11 -0
- package/dist/commands/domains/sync.d.ts.map +1 -0
- package/dist/commands/domains/sync.js +33 -0
- package/dist/commands/domains/sync.js.map +1 -0
- package/dist/commands/domains/update.d.ts +14 -0
- package/dist/commands/domains/update.d.ts.map +1 -0
- package/dist/commands/domains/update.js +28 -0
- package/dist/commands/domains/update.js.map +1 -0
- package/dist/commands/features/assign.d.ts +16 -0
- package/dist/commands/features/assign.d.ts.map +1 -0
- package/dist/commands/features/assign.js +51 -0
- package/dist/commands/features/assign.js.map +1 -0
- package/dist/commands/features/create.d.ts +15 -0
- package/dist/commands/features/create.d.ts.map +1 -0
- package/dist/commands/features/create.js +30 -0
- package/dist/commands/features/create.js.map +1 -0
- package/dist/commands/features/delete.d.ts +14 -0
- package/dist/commands/features/delete.d.ts.map +1 -0
- package/dist/commands/features/delete.js +37 -0
- package/dist/commands/features/delete.js.map +1 -0
- package/dist/commands/features/generate.d.ts +34 -0
- package/dist/commands/features/generate.d.ts.map +1 -0
- package/dist/commands/features/generate.js +178 -0
- package/dist/commands/features/generate.js.map +1 -0
- package/dist/commands/features/index.d.ts +2 -0
- package/dist/commands/features/index.d.ts.map +1 -0
- package/dist/commands/features/index.js +2 -0
- package/dist/commands/features/index.js.map +1 -0
- package/dist/commands/features/list.d.ts +11 -0
- package/dist/commands/features/list.d.ts.map +1 -0
- package/dist/commands/features/list.js +45 -0
- package/dist/commands/features/list.js.map +1 -0
- package/dist/commands/features/show.d.ts +15 -0
- package/dist/commands/features/show.d.ts.map +1 -0
- package/dist/commands/features/show.js +61 -0
- package/dist/commands/features/show.js.map +1 -0
- package/dist/commands/features/unassign.d.ts +16 -0
- package/dist/commands/features/unassign.d.ts.map +1 -0
- package/dist/commands/features/unassign.js +55 -0
- package/dist/commands/features/unassign.js.map +1 -0
- package/dist/commands/features/update.d.ts +16 -0
- package/dist/commands/features/update.d.ts.map +1 -0
- package/dist/commands/features/update.js +54 -0
- package/dist/commands/features/update.js.map +1 -0
- package/dist/commands/files/imported-by.d.ts +13 -0
- package/dist/commands/files/imported-by.d.ts.map +1 -0
- package/dist/commands/files/imported-by.js +40 -0
- package/dist/commands/files/imported-by.js.map +1 -0
- package/dist/commands/files/imports.d.ts +14 -0
- package/dist/commands/files/imports.d.ts.map +1 -0
- package/dist/commands/files/imports.js +48 -0
- package/dist/commands/files/imports.js.map +1 -0
- package/dist/commands/files/index.d.ts +2 -0
- package/dist/commands/files/index.d.ts.map +1 -0
- package/dist/commands/files/index.js +2 -0
- package/dist/commands/files/index.js.map +1 -0
- package/dist/commands/files/list.d.ts +11 -0
- package/dist/commands/files/list.d.ts.map +1 -0
- package/dist/commands/files/list.js +35 -0
- package/dist/commands/files/list.js.map +1 -0
- package/dist/commands/files/orphans.d.ts +12 -0
- package/dist/commands/files/orphans.d.ts.map +1 -0
- package/dist/commands/files/orphans.js +43 -0
- package/dist/commands/files/orphans.js.map +1 -0
- package/dist/commands/files/show.d.ts +14 -0
- package/dist/commands/files/show.d.ts.map +1 -0
- package/dist/commands/files/show.js +95 -0
- package/dist/commands/files/show.js.map +1 -0
- package/dist/commands/flows/add-step.d.ts +19 -0
- package/dist/commands/flows/add-step.d.ts.map +1 -0
- package/dist/commands/flows/add-step.js +46 -0
- package/dist/commands/flows/add-step.js.map +1 -0
- package/dist/commands/flows/create.d.ts +17 -0
- package/dist/commands/flows/create.d.ts.map +1 -0
- package/dist/commands/flows/create.js +39 -0
- package/dist/commands/flows/create.js.map +1 -0
- package/dist/commands/flows/delete.d.ts +14 -0
- package/dist/commands/flows/delete.d.ts.map +1 -0
- package/dist/commands/flows/delete.js +37 -0
- package/dist/commands/flows/delete.js.map +1 -0
- package/dist/commands/flows/generate.d.ts +50 -0
- package/dist/commands/flows/generate.d.ts.map +1 -0
- package/dist/commands/flows/generate.js +438 -0
- package/dist/commands/flows/generate.js.map +1 -0
- package/dist/commands/flows/index.d.ts +2 -0
- package/dist/commands/flows/index.d.ts.map +1 -0
- package/dist/commands/flows/index.js +2 -0
- package/dist/commands/flows/index.js.map +1 -0
- package/dist/commands/flows/list.d.ts +12 -0
- package/dist/commands/flows/list.d.ts.map +1 -0
- package/dist/commands/flows/list.js +98 -0
- package/dist/commands/flows/list.js.map +1 -0
- package/dist/commands/flows/remove-step.d.ts +18 -0
- package/dist/commands/flows/remove-step.d.ts.map +1 -0
- package/dist/commands/flows/remove-step.js +41 -0
- package/dist/commands/flows/remove-step.js.map +1 -0
- package/dist/commands/flows/show.d.ts +17 -0
- package/dist/commands/flows/show.d.ts.map +1 -0
- package/dist/commands/flows/show.js +136 -0
- package/dist/commands/flows/show.js.map +1 -0
- package/dist/commands/flows/trace.d.ts +22 -0
- package/dist/commands/flows/trace.d.ts.map +1 -0
- package/dist/commands/flows/trace.js +217 -0
- package/dist/commands/flows/trace.js.map +1 -0
- package/dist/commands/flows/update.d.ts +17 -0
- package/dist/commands/flows/update.d.ts.map +1 -0
- package/dist/commands/flows/update.js +60 -0
- package/dist/commands/flows/update.js.map +1 -0
- package/dist/commands/flows/verify.d.ts +21 -0
- package/dist/commands/flows/verify.d.ts.map +1 -0
- package/dist/commands/flows/verify.js +123 -0
- package/dist/commands/flows/verify.js.map +1 -0
- package/dist/commands/gaps.d.ts +14 -0
- package/dist/commands/gaps.d.ts.map +1 -0
- package/dist/commands/gaps.js +184 -0
- package/dist/commands/gaps.js.map +1 -0
- package/dist/commands/hierarchy/index.d.ts +20 -0
- package/dist/commands/hierarchy/index.d.ts.map +1 -0
- package/dist/commands/hierarchy/index.js +344 -0
- package/dist/commands/hierarchy/index.js.map +1 -0
- package/dist/commands/ingest.d.ts +23 -0
- package/dist/commands/ingest.d.ts.map +1 -0
- package/dist/commands/ingest.js +249 -0
- package/dist/commands/ingest.js.map +1 -0
- package/dist/commands/interactions/create.d.ts +16 -0
- package/dist/commands/interactions/create.d.ts.map +1 -0
- package/dist/commands/interactions/create.js +58 -0
- package/dist/commands/interactions/create.js.map +1 -0
- package/dist/commands/interactions/delete.d.ts +16 -0
- package/dist/commands/interactions/delete.d.ts.map +1 -0
- package/dist/commands/interactions/delete.js +28 -0
- package/dist/commands/interactions/delete.js.map +1 -0
- package/dist/commands/interactions/generate.d.ts +62 -0
- package/dist/commands/interactions/generate.d.ts.map +1 -0
- package/dist/commands/interactions/generate.js +870 -0
- package/dist/commands/interactions/generate.js.map +1 -0
- package/dist/commands/interactions/index.d.ts +2 -0
- package/dist/commands/interactions/index.d.ts.map +1 -0
- package/dist/commands/interactions/index.js +2 -0
- package/dist/commands/interactions/index.js.map +1 -0
- package/dist/commands/interactions/list.d.ts +15 -0
- package/dist/commands/interactions/list.d.ts.map +1 -0
- package/dist/commands/interactions/list.js +127 -0
- package/dist/commands/interactions/list.js.map +1 -0
- package/dist/commands/interactions/show.d.ts +17 -0
- package/dist/commands/interactions/show.d.ts.map +1 -0
- package/dist/commands/interactions/show.js +80 -0
- package/dist/commands/interactions/show.js.map +1 -0
- package/dist/commands/interactions/update.d.ts +20 -0
- package/dist/commands/interactions/update.d.ts.map +1 -0
- package/dist/commands/interactions/update.js +57 -0
- package/dist/commands/interactions/update.js.map +1 -0
- package/dist/commands/interactions/validate.d.ts +12 -0
- package/dist/commands/interactions/validate.d.ts.map +1 -0
- package/dist/commands/interactions/validate.js +94 -0
- package/dist/commands/interactions/validate.js.map +1 -0
- package/dist/commands/interactions/verify.d.ts +18 -0
- package/dist/commands/interactions/verify.d.ts.map +1 -0
- package/dist/commands/interactions/verify.js +127 -0
- package/dist/commands/interactions/verify.js.map +1 -0
- package/dist/commands/llm/_shared/base-llm-command.d.ts +44 -0
- package/dist/commands/llm/_shared/base-llm-command.d.ts.map +1 -0
- package/dist/commands/llm/_shared/base-llm-command.js +73 -0
- package/dist/commands/llm/_shared/base-llm-command.js.map +1 -0
- package/dist/commands/llm/_shared/coverage.d.ts +61 -0
- package/dist/commands/llm/_shared/coverage.d.ts.map +1 -0
- package/dist/commands/llm/_shared/coverage.js +161 -0
- package/dist/commands/llm/_shared/coverage.js.map +1 -0
- package/dist/commands/llm/_shared/csv-utils.d.ts +65 -0
- package/dist/commands/llm/_shared/csv-utils.d.ts.map +1 -0
- package/dist/commands/llm/_shared/csv-utils.js +231 -0
- package/dist/commands/llm/_shared/csv-utils.js.map +1 -0
- package/dist/commands/llm/_shared/csv.d.ts +44 -0
- package/dist/commands/llm/_shared/csv.d.ts.map +1 -0
- package/dist/commands/llm/_shared/csv.js +76 -0
- package/dist/commands/llm/_shared/csv.js.map +1 -0
- package/dist/commands/llm/_shared/entity-utils.d.ts +11 -0
- package/dist/commands/llm/_shared/entity-utils.d.ts.map +1 -0
- package/dist/commands/llm/_shared/entity-utils.js +87 -0
- package/dist/commands/llm/_shared/entity-utils.js.map +1 -0
- package/dist/commands/llm/_shared/flow-csv.d.ts +74 -0
- package/dist/commands/llm/_shared/flow-csv.d.ts.map +1 -0
- package/dist/commands/llm/_shared/flow-csv.js +198 -0
- package/dist/commands/llm/_shared/flow-csv.js.map +1 -0
- package/dist/commands/llm/_shared/flow-prompts.d.ts +61 -0
- package/dist/commands/llm/_shared/flow-prompts.d.ts.map +1 -0
- package/dist/commands/llm/_shared/flow-prompts.js +281 -0
- package/dist/commands/llm/_shared/flow-prompts.js.map +1 -0
- package/dist/commands/llm/_shared/flow-validation.d.ts +69 -0
- package/dist/commands/llm/_shared/flow-validation.d.ts.map +1 -0
- package/dist/commands/llm/_shared/flow-validation.js +176 -0
- package/dist/commands/llm/_shared/flow-validation.js.map +1 -0
- package/dist/commands/llm/_shared/llm-utils.d.ts +88 -0
- package/dist/commands/llm/_shared/llm-utils.d.ts.map +1 -0
- package/dist/commands/llm/_shared/llm-utils.js +256 -0
- package/dist/commands/llm/_shared/llm-utils.js.map +1 -0
- package/dist/commands/llm/_shared/module-csv.d.ts +76 -0
- package/dist/commands/llm/_shared/module-csv.d.ts.map +1 -0
- package/dist/commands/llm/_shared/module-csv.js +196 -0
- package/dist/commands/llm/_shared/module-csv.js.map +1 -0
- package/dist/commands/llm/_shared/module-prompts.d.ts +107 -0
- package/dist/commands/llm/_shared/module-prompts.d.ts.map +1 -0
- package/dist/commands/llm/_shared/module-prompts.js +395 -0
- package/dist/commands/llm/_shared/module-prompts.js.map +1 -0
- package/dist/commands/llm/_shared/process-utils.d.ts +52 -0
- package/dist/commands/llm/_shared/process-utils.d.ts.map +1 -0
- package/dist/commands/llm/_shared/process-utils.js +214 -0
- package/dist/commands/llm/_shared/process-utils.js.map +1 -0
- package/dist/commands/llm/_shared/prompts.d.ts +132 -0
- package/dist/commands/llm/_shared/prompts.d.ts.map +1 -0
- package/dist/commands/llm/_shared/prompts.js +391 -0
- package/dist/commands/llm/_shared/prompts.js.map +1 -0
- package/dist/commands/llm/_shared/pure-check.d.ts +10 -0
- package/dist/commands/llm/_shared/pure-check.d.ts.map +1 -0
- package/dist/commands/llm/_shared/pure-check.js +449 -0
- package/dist/commands/llm/_shared/pure-check.js.map +1 -0
- package/dist/commands/llm/_shared/verify/content-verifier.d.ts +40 -0
- package/dist/commands/llm/_shared/verify/content-verifier.d.ts.map +1 -0
- package/dist/commands/llm/_shared/verify/content-verifier.js +247 -0
- package/dist/commands/llm/_shared/verify/content-verifier.js.map +1 -0
- package/dist/commands/llm/_shared/verify/coverage-checker.d.ts +34 -0
- package/dist/commands/llm/_shared/verify/coverage-checker.d.ts.map +1 -0
- package/dist/commands/llm/_shared/verify/coverage-checker.js +1096 -0
- package/dist/commands/llm/_shared/verify/coverage-checker.js.map +1 -0
- package/dist/commands/llm/_shared/verify/verify-prompts.d.ts +30 -0
- package/dist/commands/llm/_shared/verify/verify-prompts.d.ts.map +1 -0
- package/dist/commands/llm/_shared/verify/verify-prompts.js +118 -0
- package/dist/commands/llm/_shared/verify/verify-prompts.js.map +1 -0
- package/dist/commands/llm/_shared/verify/verify-types.d.ts +47 -0
- package/dist/commands/llm/_shared/verify/verify-types.d.ts.map +1 -0
- package/dist/commands/llm/_shared/verify/verify-types.js +2 -0
- package/dist/commands/llm/_shared/verify/verify-types.js.map +1 -0
- package/dist/commands/llm/annotate.d.ts +7 -0
- package/dist/commands/llm/annotate.d.ts.map +1 -0
- package/dist/commands/llm/annotate.js +11 -0
- package/dist/commands/llm/annotate.js.map +1 -0
- package/dist/commands/llm/features/feature-grouper.d.ts +31 -0
- package/dist/commands/llm/features/feature-grouper.d.ts.map +1 -0
- package/dist/commands/llm/features/feature-grouper.js +223 -0
- package/dist/commands/llm/features/feature-grouper.js.map +1 -0
- package/dist/commands/llm/features/index.d.ts +6 -0
- package/dist/commands/llm/features/index.d.ts.map +1 -0
- package/dist/commands/llm/features/index.js +6 -0
- package/dist/commands/llm/features/index.js.map +1 -0
- package/dist/commands/llm/features/types.d.ts +10 -0
- package/dist/commands/llm/features/types.d.ts.map +1 -0
- package/dist/commands/llm/features/types.js +5 -0
- package/dist/commands/llm/features/types.js.map +1 -0
- package/dist/commands/llm/features.d.ts +7 -0
- package/dist/commands/llm/features.d.ts.map +1 -0
- package/dist/commands/llm/features.js +11 -0
- package/dist/commands/llm/features.js.map +1 -0
- package/dist/commands/llm/flows/atomic-flow-builder.d.ts +51 -0
- package/dist/commands/llm/flows/atomic-flow-builder.d.ts.map +1 -0
- package/dist/commands/llm/flows/atomic-flow-builder.js +247 -0
- package/dist/commands/llm/flows/atomic-flow-builder.js.map +1 -0
- package/dist/commands/llm/flows/dedup.d.ts +18 -0
- package/dist/commands/llm/flows/dedup.d.ts.map +1 -0
- package/dist/commands/llm/flows/dedup.js +76 -0
- package/dist/commands/llm/flows/dedup.js.map +1 -0
- package/dist/commands/llm/flows/entry-point-detector.d.ts +41 -0
- package/dist/commands/llm/flows/entry-point-detector.d.ts.map +1 -0
- package/dist/commands/llm/flows/entry-point-detector.js +388 -0
- package/dist/commands/llm/flows/entry-point-detector.js.map +1 -0
- package/dist/commands/llm/flows/flow-enhancer.d.ts +21 -0
- package/dist/commands/llm/flows/flow-enhancer.d.ts.map +1 -0
- package/dist/commands/llm/flows/flow-enhancer.js +166 -0
- package/dist/commands/llm/flows/flow-enhancer.js.map +1 -0
- package/dist/commands/llm/flows/flow-tracer.d.ts +50 -0
- package/dist/commands/llm/flows/flow-tracer.d.ts.map +1 -0
- package/dist/commands/llm/flows/flow-tracer.js +271 -0
- package/dist/commands/llm/flows/flow-tracer.js.map +1 -0
- package/dist/commands/llm/flows/flow-validator.d.ts +31 -0
- package/dist/commands/llm/flows/flow-validator.d.ts.map +1 -0
- package/dist/commands/llm/flows/flow-validator.js +262 -0
- package/dist/commands/llm/flows/flow-validator.js.map +1 -0
- package/dist/commands/llm/flows/gap-flow-generator.d.ts +13 -0
- package/dist/commands/llm/flows/gap-flow-generator.d.ts.map +1 -0
- package/dist/commands/llm/flows/gap-flow-generator.js +48 -0
- package/dist/commands/llm/flows/gap-flow-generator.js.map +1 -0
- package/dist/commands/llm/flows/index.d.ts +12 -0
- package/dist/commands/llm/flows/index.d.ts.map +1 -0
- package/dist/commands/llm/flows/index.js +12 -0
- package/dist/commands/llm/flows/index.js.map +1 -0
- package/dist/commands/llm/flows/types.d.ts +87 -0
- package/dist/commands/llm/flows/types.d.ts.map +1 -0
- package/dist/commands/llm/flows/types.js +5 -0
- package/dist/commands/llm/flows/types.js.map +1 -0
- package/dist/commands/llm/flows.d.ts +7 -0
- package/dist/commands/llm/flows.d.ts.map +1 -0
- package/dist/commands/llm/flows.js +11 -0
- package/dist/commands/llm/flows.js.map +1 -0
- package/dist/commands/llm/interactions.d.ts +7 -0
- package/dist/commands/llm/interactions.d.ts.map +1 -0
- package/dist/commands/llm/interactions.js +11 -0
- package/dist/commands/llm/interactions.js.map +1 -0
- package/dist/commands/llm/modules.d.ts +7 -0
- package/dist/commands/llm/modules.d.ts.map +1 -0
- package/dist/commands/llm/modules.js +11 -0
- package/dist/commands/llm/modules.js.map +1 -0
- package/dist/commands/llm/relationships.d.ts +7 -0
- package/dist/commands/llm/relationships.d.ts.map +1 -0
- package/dist/commands/llm/relationships.js +11 -0
- package/dist/commands/llm/relationships.js.map +1 -0
- package/dist/commands/modules/assign.d.ts +14 -0
- package/dist/commands/modules/assign.d.ts.map +1 -0
- package/dist/commands/modules/assign.js +54 -0
- package/dist/commands/modules/assign.js.map +1 -0
- package/dist/commands/modules/create.d.ts +16 -0
- package/dist/commands/modules/create.d.ts.map +1 -0
- package/dist/commands/modules/create.js +37 -0
- package/dist/commands/modules/create.js.map +1 -0
- package/dist/commands/modules/delete.d.ts +14 -0
- package/dist/commands/modules/delete.d.ts.map +1 -0
- package/dist/commands/modules/delete.js +54 -0
- package/dist/commands/modules/delete.js.map +1 -0
- package/dist/commands/modules/generate.d.ts +84 -0
- package/dist/commands/modules/generate.d.ts.map +1 -0
- package/dist/commands/modules/generate.js +1234 -0
- package/dist/commands/modules/generate.js.map +1 -0
- package/dist/commands/modules/index.d.ts +2 -0
- package/dist/commands/modules/index.d.ts.map +1 -0
- package/dist/commands/modules/index.js +2 -0
- package/dist/commands/modules/index.js.map +1 -0
- package/dist/commands/modules/list.d.ts +13 -0
- package/dist/commands/modules/list.d.ts.map +1 -0
- package/dist/commands/modules/list.js +92 -0
- package/dist/commands/modules/list.js.map +1 -0
- package/dist/commands/modules/prune.d.ts +10 -0
- package/dist/commands/modules/prune.d.ts.map +1 -0
- package/dist/commands/modules/prune.js +23 -0
- package/dist/commands/modules/prune.js.map +1 -0
- package/dist/commands/modules/show.d.ts +15 -0
- package/dist/commands/modules/show.d.ts.map +1 -0
- package/dist/commands/modules/show.js +95 -0
- package/dist/commands/modules/show.js.map +1 -0
- package/dist/commands/modules/unassign.d.ts +13 -0
- package/dist/commands/modules/unassign.d.ts.map +1 -0
- package/dist/commands/modules/unassign.js +49 -0
- package/dist/commands/modules/unassign.js.map +1 -0
- package/dist/commands/modules/update.d.ts +15 -0
- package/dist/commands/modules/update.d.ts.map +1 -0
- package/dist/commands/modules/update.js +50 -0
- package/dist/commands/modules/update.js.map +1 -0
- package/dist/commands/modules/verify.d.ts +18 -0
- package/dist/commands/modules/verify.d.ts.map +1 -0
- package/dist/commands/modules/verify.js +114 -0
- package/dist/commands/modules/verify.js.map +1 -0
- package/dist/commands/overview.d.ts +12 -0
- package/dist/commands/overview.d.ts.map +1 -0
- package/dist/commands/overview.js +219 -0
- package/dist/commands/overview.js.map +1 -0
- package/dist/commands/parse.d.ts +30 -0
- package/dist/commands/parse.d.ts.map +1 -0
- package/dist/commands/parse.js +211 -0
- package/dist/commands/parse.js.map +1 -0
- package/dist/commands/process-groups/index.d.ts +2 -0
- package/dist/commands/process-groups/index.d.ts.map +1 -0
- package/dist/commands/process-groups/index.js +2 -0
- package/dist/commands/process-groups/index.js.map +1 -0
- package/dist/commands/process-groups/list.d.ts +11 -0
- package/dist/commands/process-groups/list.d.ts.map +1 -0
- package/dist/commands/process-groups/list.js +98 -0
- package/dist/commands/process-groups/list.js.map +1 -0
- package/dist/commands/relationships/annotate.d.ts +27 -0
- package/dist/commands/relationships/annotate.d.ts.map +1 -0
- package/dist/commands/relationships/annotate.js +453 -0
- package/dist/commands/relationships/annotate.js.map +1 -0
- package/dist/commands/relationships/index.d.ts +2 -0
- package/dist/commands/relationships/index.d.ts.map +1 -0
- package/dist/commands/relationships/index.js +2 -0
- package/dist/commands/relationships/index.js.map +1 -0
- package/dist/commands/relationships/list.d.ts +18 -0
- package/dist/commands/relationships/list.d.ts.map +1 -0
- package/dist/commands/relationships/list.js +147 -0
- package/dist/commands/relationships/list.js.map +1 -0
- package/dist/commands/relationships/next.d.ts +17 -0
- package/dist/commands/relationships/next.d.ts.map +1 -0
- package/dist/commands/relationships/next.js +178 -0
- package/dist/commands/relationships/next.js.map +1 -0
- package/dist/commands/relationships/set.d.ts +19 -0
- package/dist/commands/relationships/set.d.ts.map +1 -0
- package/dist/commands/relationships/set.js +65 -0
- package/dist/commands/relationships/set.js.map +1 -0
- package/dist/commands/relationships/show.d.ts +13 -0
- package/dist/commands/relationships/show.d.ts.map +1 -0
- package/dist/commands/relationships/show.js +59 -0
- package/dist/commands/relationships/show.js.map +1 -0
- package/dist/commands/relationships/unset.d.ts +16 -0
- package/dist/commands/relationships/unset.d.ts.map +1 -0
- package/dist/commands/relationships/unset.js +62 -0
- package/dist/commands/relationships/unset.js.map +1 -0
- package/dist/commands/relationships/verify.d.ts +24 -0
- package/dist/commands/relationships/verify.d.ts.map +1 -0
- package/dist/commands/relationships/verify.js +328 -0
- package/dist/commands/relationships/verify.js.map +1 -0
- package/dist/commands/stats.d.ts +11 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +207 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/symbols/annotate.d.ts +32 -0
- package/dist/commands/symbols/annotate.d.ts.map +1 -0
- package/dist/commands/symbols/annotate.js +862 -0
- package/dist/commands/symbols/annotate.js.map +1 -0
- package/dist/commands/symbols/deps.d.ts +18 -0
- package/dist/commands/symbols/deps.d.ts.map +1 -0
- package/dist/commands/symbols/deps.js +104 -0
- package/dist/commands/symbols/deps.js.map +1 -0
- package/dist/commands/symbols/index.d.ts +2 -0
- package/dist/commands/symbols/index.d.ts.map +1 -0
- package/dist/commands/symbols/index.js +2 -0
- package/dist/commands/symbols/index.js.map +1 -0
- package/dist/commands/symbols/list.d.ts +17 -0
- package/dist/commands/symbols/list.d.ts.map +1 -0
- package/dist/commands/symbols/list.js +136 -0
- package/dist/commands/symbols/list.js.map +1 -0
- package/dist/commands/symbols/next.d.ts +15 -0
- package/dist/commands/symbols/next.d.ts.map +1 -0
- package/dist/commands/symbols/next.js +147 -0
- package/dist/commands/symbols/next.js.map +1 -0
- package/dist/commands/symbols/prereqs.d.ts +18 -0
- package/dist/commands/symbols/prereqs.d.ts.map +1 -0
- package/dist/commands/symbols/prereqs.js +107 -0
- package/dist/commands/symbols/prereqs.js.map +1 -0
- package/dist/commands/symbols/ready.d.ts +17 -0
- package/dist/commands/symbols/ready.d.ts.map +1 -0
- package/dist/commands/symbols/ready.js +126 -0
- package/dist/commands/symbols/ready.js.map +1 -0
- package/dist/commands/symbols/set.d.ts +27 -0
- package/dist/commands/symbols/set.d.ts.map +1 -0
- package/dist/commands/symbols/set.js +241 -0
- package/dist/commands/symbols/set.js.map +1 -0
- package/dist/commands/symbols/show.d.ts +19 -0
- package/dist/commands/symbols/show.d.ts.map +1 -0
- package/dist/commands/symbols/show.js +182 -0
- package/dist/commands/symbols/show.js.map +1 -0
- package/dist/commands/symbols/understood.d.ts +15 -0
- package/dist/commands/symbols/understood.d.ts.map +1 -0
- package/dist/commands/symbols/understood.js +101 -0
- package/dist/commands/symbols/understood.js.map +1 -0
- package/dist/commands/symbols/unset.d.ts +16 -0
- package/dist/commands/symbols/unset.d.ts.map +1 -0
- package/dist/commands/symbols/unset.js +48 -0
- package/dist/commands/symbols/unset.js.map +1 -0
- package/dist/commands/symbols/verify.d.ts +25 -0
- package/dist/commands/symbols/verify.d.ts.map +1 -0
- package/dist/commands/symbols/verify.js +360 -0
- package/dist/commands/symbols/verify.js.map +1 -0
- package/dist/db/connection.d.ts +14 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +37 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/database-facade.d.ts +125 -0
- package/dist/db/database-facade.d.ts.map +1 -0
- package/dist/db/database-facade.js +347 -0
- package/dist/db/database-facade.js.map +1 -0
- package/dist/db/database.d.ts +9 -0
- package/dist/db/database.d.ts.map +1 -0
- package/dist/db/database.js +11 -0
- package/dist/db/database.js.map +1 -0
- package/dist/db/index.d.ts +7 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +11 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/repositories/_shared/call-graph-query.d.ts +10 -0
- package/dist/db/repositories/_shared/call-graph-query.d.ts.map +1 -0
- package/dist/db/repositories/_shared/call-graph-query.js +59 -0
- package/dist/db/repositories/_shared/call-graph-query.js.map +1 -0
- package/dist/db/repositories/call-graph-service.d.ts +28 -0
- package/dist/db/repositories/call-graph-service.d.ts.map +1 -0
- package/dist/db/repositories/call-graph-service.js +223 -0
- package/dist/db/repositories/call-graph-service.js.map +1 -0
- package/dist/db/repositories/definition-repository.d.ts +99 -0
- package/dist/db/repositories/definition-repository.d.ts.map +1 -0
- package/dist/db/repositories/definition-repository.js +317 -0
- package/dist/db/repositories/definition-repository.js.map +1 -0
- package/dist/db/repositories/dependency-repository.d.ts +78 -0
- package/dist/db/repositories/dependency-repository.d.ts.map +1 -0
- package/dist/db/repositories/dependency-repository.js +446 -0
- package/dist/db/repositories/dependency-repository.js.map +1 -0
- package/dist/db/repositories/domain-repository.d.ts +97 -0
- package/dist/db/repositories/domain-repository.d.ts.map +1 -0
- package/dist/db/repositories/domain-repository.js +261 -0
- package/dist/db/repositories/domain-repository.js.map +1 -0
- package/dist/db/repositories/feature-repository.d.ts +64 -0
- package/dist/db/repositories/feature-repository.d.ts.map +1 -0
- package/dist/db/repositories/feature-repository.js +189 -0
- package/dist/db/repositories/feature-repository.js.map +1 -0
- package/dist/db/repositories/file-repository.d.ts +67 -0
- package/dist/db/repositories/file-repository.d.ts.map +1 -0
- package/dist/db/repositories/file-repository.js +179 -0
- package/dist/db/repositories/file-repository.js.map +1 -0
- package/dist/db/repositories/flow-repository.d.ts +172 -0
- package/dist/db/repositories/flow-repository.d.ts.map +1 -0
- package/dist/db/repositories/flow-repository.js +599 -0
- package/dist/db/repositories/flow-repository.js.map +1 -0
- package/dist/db/repositories/graph-repository.d.ts +93 -0
- package/dist/db/repositories/graph-repository.d.ts.map +1 -0
- package/dist/db/repositories/graph-repository.js +413 -0
- package/dist/db/repositories/graph-repository.js.map +1 -0
- package/dist/db/repositories/index.d.ts +20 -0
- package/dist/db/repositories/index.d.ts.map +1 -0
- package/dist/db/repositories/index.js +15 -0
- package/dist/db/repositories/index.js.map +1 -0
- package/dist/db/repositories/interaction-analysis.d.ts +78 -0
- package/dist/db/repositories/interaction-analysis.d.ts.map +1 -0
- package/dist/db/repositories/interaction-analysis.js +340 -0
- package/dist/db/repositories/interaction-analysis.js.map +1 -0
- package/dist/db/repositories/interaction-repository.d.ts +145 -0
- package/dist/db/repositories/interaction-repository.d.ts.map +1 -0
- package/dist/db/repositories/interaction-repository.js +395 -0
- package/dist/db/repositories/interaction-repository.js.map +1 -0
- package/dist/db/repositories/metadata-repository.d.ts +110 -0
- package/dist/db/repositories/metadata-repository.d.ts.map +1 -0
- package/dist/db/repositories/metadata-repository.js +294 -0
- package/dist/db/repositories/metadata-repository.js.map +1 -0
- package/dist/db/repositories/module-repository.d.ts +162 -0
- package/dist/db/repositories/module-repository.d.ts.map +1 -0
- package/dist/db/repositories/module-repository.js +519 -0
- package/dist/db/repositories/module-repository.js.map +1 -0
- package/dist/db/repositories/relationship-repository.d.ts +98 -0
- package/dist/db/repositories/relationship-repository.d.ts.map +1 -0
- package/dist/db/repositories/relationship-repository.js +421 -0
- package/dist/db/repositories/relationship-repository.js.map +1 -0
- package/dist/db/schema-manager.d.ts +31 -0
- package/dist/db/schema-manager.d.ts.map +1 -0
- package/dist/db/schema-manager.js +398 -0
- package/dist/db/schema-manager.js.map +1 -0
- package/dist/db/schema.d.ts +404 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +234 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/db/utils/tree-builder.d.ts +25 -0
- package/dist/db/utils/tree-builder.d.ts.map +1 -0
- package/dist/db/utils/tree-builder.js +38 -0
- package/dist/db/utils/tree-builder.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/ast-parser.d.ts +23 -0
- package/dist/parser/ast-parser.d.ts.map +1 -0
- package/dist/parser/ast-parser.js +65 -0
- package/dist/parser/ast-parser.js.map +1 -0
- package/dist/parser/definition-extractor.d.ts +29 -0
- package/dist/parser/definition-extractor.d.ts.map +1 -0
- package/dist/parser/definition-extractor.js +379 -0
- package/dist/parser/definition-extractor.js.map +1 -0
- package/dist/parser/reference-extractor.d.ts +72 -0
- package/dist/parser/reference-extractor.d.ts.map +1 -0
- package/dist/parser/reference-extractor.js +759 -0
- package/dist/parser/reference-extractor.js.map +1 -0
- package/dist/utils/file-scanner.d.ts +6 -0
- package/dist/utils/file-scanner.d.ts.map +1 -0
- package/dist/utils/file-scanner.js +33 -0
- package/dist/utils/file-scanner.js.map +1 -0
- package/dist/web/api-transforms.d.ts +4 -0
- package/dist/web/api-transforms.d.ts.map +1 -0
- package/dist/web/api-transforms.js +4 -0
- package/dist/web/api-transforms.js.map +1 -0
- package/dist/web/server.d.ts +16 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +229 -0
- package/dist/web/server.js.map +1 -0
- package/dist/web/server.test.d.ts +2 -0
- package/dist/web/server.test.d.ts.map +1 -0
- package/dist/web/server.test.js +505 -0
- package/dist/web/server.test.js.map +1 -0
- package/dist/web/transforms/flow-transforms.d.ts +117 -0
- package/dist/web/transforms/flow-transforms.d.ts.map +1 -0
- package/dist/web/transforms/flow-transforms.js +202 -0
- package/dist/web/transforms/flow-transforms.js.map +1 -0
- package/dist/web/transforms/index.d.ts +4 -0
- package/dist/web/transforms/index.d.ts.map +1 -0
- package/dist/web/transforms/index.js +4 -0
- package/dist/web/transforms/index.js.map +1 -0
- package/dist/web/transforms/module-transforms.d.ts +42 -0
- package/dist/web/transforms/module-transforms.d.ts.map +1 -0
- package/dist/web/transforms/module-transforms.js +64 -0
- package/dist/web/transforms/module-transforms.js.map +1 -0
- package/dist/web/transforms/symbol-transforms.d.ts +31 -0
- package/dist/web/transforms/symbol-transforms.d.ts.map +1 -0
- package/dist/web/transforms/symbol-transforms.js +95 -0
- package/dist/web/transforms/symbol-transforms.js.map +1 -0
- package/package.json +96 -0
- package/ui/dist/assets/index-DP3dRMlh.js +268 -0
- package/ui/dist/assets/index-DP3dRMlh.js.map +1 -0
- package/ui/dist/assets/index-Db204Xn1.css +1 -0
- package/ui/dist/index.html +67 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function ei(t=""){async function e(n){const r=await fetch(`${t}${n}`);if(!r.ok)throw new Error(`API error: ${r.status} ${r.statusText}`);return r.json()}return{getStats(){return e("/api/stats")},getSymbolGraph(){return e("/api/graph/symbols")},getModules(){return e("/api/modules")},getFlows(){return e("/api/flows")},getFlowsDag(){return e("/api/flows/dag")},getInteractions(){return e("/api/interactions")}}}function ni(){let t={graphData:null,modulesData:null,flowsData:null,flowsDagData:null,interactionsData:null,currentView:"symbols",selectedGrouping:"structure",selectedFlowId:null,selectedFlows:new Set,expandedModules:new Set,sidebarCollapsed:!1,selectedSymbolId:null,symbolSearchQuery:"",loading:!0,error:null};const e=new Set;function n(){for(const r of e)r(t)}return{getState(){return t},setState(r){t={...t,...r},n()},subscribe(r){return e.add(r),()=>{e.delete(r)}}}}function or(t,e){const n=e?new Set([e]):new Set;t.setState({selectedFlowId:e,selectedFlows:n})}function Je(t,e){t.setState({selectedSymbolId:e})}function ri(t,e){t.setState({symbolSearchQuery:e})}function ii(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var si={value:()=>{}};function Qt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ue(n)}function ue(t){this._=t}function ai(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ue.prototype=Qt.prototype={constructor:ue,on:function(t,e){var n=this._,r=ai(t+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(t=r[s]).type)&&(i=oi(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(i=(t=r[s]).type)n[i]=vn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=vn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ue(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(e,n)}};function oi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function vn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=si,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Oe="http://www.w3.org/1999/xhtml";const xn={svg:"http://www.w3.org/2000/svg",xhtml:Oe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Me(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),xn.hasOwnProperty(e)?{space:xn[e],local:t}:t}function li(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Oe&&e.documentElement.namespaceURI===Oe?e.createElement(t):e.createElementNS(n,t)}}function ci(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lr(t){var e=Me(t);return(e.local?ci:li)(e)}function ui(){}function tn(t){return t==null?ui:function(){return this.querySelector(t)}}function fi(t){typeof t!="function"&&(t=tn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=r[i]=new Array(a),u,o,c=0;c<a;++c)(u=s[c])&&(o=t.call(u,u.__data__,c,s))&&("__data__"in u&&(o.__data__=u.__data__),l[c]=o);return new G(r,this._parents)}function cr(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function di(){return[]}function ur(t){return t==null?di:function(){return this.querySelectorAll(t)}}function hi(t){return function(){return cr(t.apply(this,arguments))}}function pi(t){typeof t=="function"?t=hi(t):t=ur(t);for(var e=this._groups,n=e.length,r=[],i=[],s=0;s<n;++s)for(var a=e[s],l=a.length,u,o=0;o<l;++o)(u=a[o])&&(r.push(t.call(u,u.__data__,o,a)),i.push(u));return new G(r,i)}function fr(t){return function(){return this.matches(t)}}function dr(t){return function(e){return e.matches(t)}}var gi=Array.prototype.find;function mi(t){return function(){return gi.call(this.children,t)}}function yi(){return this.firstElementChild}function vi(t){return this.select(t==null?yi:mi(typeof t=="function"?t:dr(t)))}var xi=Array.prototype.filter;function wi(){return Array.from(this.children)}function bi(t){return function(){return xi.call(this.children,t)}}function _i(t){return this.selectAll(t==null?wi:bi(typeof t=="function"?t:dr(t)))}function $i(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=r[i]=[],u,o=0;o<a;++o)(u=s[o])&&t.call(u,u.__data__,o,s)&&l.push(u);return new G(r,this._parents)}function hr(t){return new Array(t.length)}function Mi(){return new G(this._enter||this._groups.map(hr),this._parents)}function ge(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ge.prototype={constructor:ge,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ki(t){return function(){return t}}function Ai(t,e,n,r,i,s){for(var a=0,l,u=e.length,o=s.length;a<o;++a)(l=e[a])?(l.__data__=s[a],r[a]=l):n[a]=new ge(t,s[a]);for(;a<u;++a)(l=e[a])&&(i[a]=l)}function Si(t,e,n,r,i,s,a){var l,u,o=new Map,c=e.length,p=s.length,f=new Array(c),h;for(l=0;l<c;++l)(u=e[l])&&(f[l]=h=a.call(u,u.__data__,l,e)+"",o.has(h)?i[l]=u:o.set(h,u));for(l=0;l<p;++l)h=a.call(t,s[l],l,s)+"",(u=o.get(h))?(r[l]=u,u.__data__=s[l],o.delete(h)):n[l]=new ge(t,s[l]);for(l=0;l<c;++l)(u=e[l])&&o.get(f[l])===u&&(i[l]=u)}function Ei(t){return t.__data__}function Ii(t,e){if(!arguments.length)return Array.from(this,Ei);var n=e?Si:Ai,r=this._parents,i=this._groups;typeof t!="function"&&(t=ki(t));for(var s=i.length,a=new Array(s),l=new Array(s),u=new Array(s),o=0;o<s;++o){var c=r[o],p=i[o],f=p.length,h=Ni(t.call(c,c&&c.__data__,o,r)),w=h.length,y=l[o]=new Array(w),m=a[o]=new Array(w),g=u[o]=new Array(f);n(c,p,y,m,g,h,e);for(var _=0,A=0,x,N;_<w;++_)if(x=y[_]){for(_>=A&&(A=_+1);!(N=m[A])&&++A<w;);x._next=N||null}}return a=new G(a,r),a._enter=l,a._exit=u,a}function Ni(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ti(){return new G(this._exit||this._groups.map(hr),this._parents)}function Ci(t,e,n){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Li(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,s=r.length,a=Math.min(i,s),l=new Array(i),u=0;u<a;++u)for(var o=n[u],c=r[u],p=o.length,f=l[u]=new Array(p),h,w=0;w<p;++w)(h=o[w]||c[w])&&(f[w]=h);for(;u<i;++u)l[u]=n[u];return new G(l,this._parents)}function Di(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function zi(t){t||(t=Pi);function e(p,f){return p&&f?t(p.__data__,f.__data__):!p-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],l=a.length,u=i[s]=new Array(l),o,c=0;c<l;++c)(o=a[c])&&(u[c]=o);u.sort(e)}return new G(i,this._parents).order()}function Pi(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ri(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Hi(){return Array.from(this)}function qi(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function Bi(){let t=0;for(const e of this)++t;return t}function Fi(){return!this.node()}function Oi(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&t.call(l,l.__data__,s,i);return this}function Xi(t){return function(){this.removeAttribute(t)}}function Vi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Yi(t,e){return function(){this.setAttribute(t,e)}}function Gi(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Wi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Ui(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ki(t,e){var n=Me(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Vi:Xi:typeof e=="function"?n.local?Ui:Wi:n.local?Gi:Yi)(n,e))}function pr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ji(t){return function(){this.style.removeProperty(t)}}function Qi(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Zi(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ji(t,e,n){return arguments.length>1?this.each((e==null?ji:typeof e=="function"?Zi:Qi)(t,e,n??"")):Ct(this.node(),t)}function Ct(t,e){return t.style.getPropertyValue(e)||pr(t).getComputedStyle(t,null).getPropertyValue(e)}function ts(t){return function(){delete this[t]}}function es(t,e){return function(){this[t]=e}}function ns(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function rs(t,e){return arguments.length>1?this.each((e==null?ts:typeof e=="function"?ns:es)(t,e)):this.node()[t]}function gr(t){return t.trim().split(/^|\s+/)}function en(t){return t.classList||new mr(t)}function mr(t){this._node=t,this._names=gr(t.getAttribute("class")||"")}mr.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function yr(t,e){for(var n=en(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function vr(t,e){for(var n=en(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function is(t){return function(){yr(this,t)}}function ss(t){return function(){vr(this,t)}}function as(t,e){return function(){(e.apply(this,arguments)?yr:vr)(this,t)}}function os(t,e){var n=gr(t+"");if(arguments.length<2){for(var r=en(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?as:e?is:ss)(n,e))}function ls(){this.textContent=""}function cs(t){return function(){this.textContent=t}}function us(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function fs(t){return arguments.length?this.each(t==null?ls:(typeof t=="function"?us:cs)(t)):this.node().textContent}function ds(){this.innerHTML=""}function hs(t){return function(){this.innerHTML=t}}function ps(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function gs(t){return arguments.length?this.each(t==null?ds:(typeof t=="function"?ps:hs)(t)):this.node().innerHTML}function ms(){this.nextSibling&&this.parentNode.appendChild(this)}function ys(){return this.each(ms)}function vs(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xs(){return this.each(vs)}function ws(t){var e=typeof t=="function"?t:lr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function bs(){return null}function _s(t,e){var n=typeof t=="function"?t:lr(t),r=e==null?bs:typeof e=="function"?e:tn(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function $s(){var t=this.parentNode;t&&t.removeChild(this)}function Ms(){return this.each($s)}function ks(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function As(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ss(t){return this.select(t?As:ks)}function Es(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Is(t){return function(e){t.call(this,e,this.__data__)}}function Ns(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Ts(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function Cs(t,e,n){return function(){var r=this.__on,i,s=Is(e);if(r){for(var a=0,l=r.length;a<l;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Ls(t,e,n){var r=Ns(t+""),i,s=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,o=l.length,c;u<o;++u)for(i=0,c=l[u];i<s;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(l=e?Cs:Ts,i=0;i<s;++i)this.each(l(r[i],e,n));return this}function xr(t,e,n){var r=pr(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Ds(t,e){return function(){return xr(this,t,e)}}function zs(t,e){return function(){return xr(this,t,e.apply(this,arguments))}}function Ps(t,e){return this.each((typeof e=="function"?zs:Ds)(t,e))}function*Rs(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var nn=[null];function G(t,e){this._groups=t,this._parents=e}function Zt(){return new G([[document.documentElement]],nn)}function Hs(){return this}G.prototype=Zt.prototype={constructor:G,select:fi,selectAll:pi,selectChild:vi,selectChildren:_i,filter:$i,data:Ii,enter:Mi,exit:Ti,join:Ci,merge:Li,selection:Hs,order:Di,sort:zi,call:Ri,nodes:Hi,node:qi,size:Bi,empty:Fi,each:Oi,attr:Ki,style:Ji,property:rs,classed:os,text:fs,html:gs,raise:ys,lower:xs,append:ws,insert:_s,remove:Ms,clone:Ss,datum:Es,on:Ls,dispatch:Ps,[Symbol.iterator]:Rs};function F(t){return typeof t=="string"?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],nn)}function qs(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ct(t,e){if(t=qs(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function wr(t){return typeof t=="string"?new G([document.querySelectorAll(t)],[document.documentElement]):new G([cr(t)],nn)}const Bs={passive:!1},Ot={capture:!0,passive:!1};function Ie(t){t.stopImmediatePropagation()}function Nt(t){t.preventDefault(),t.stopImmediatePropagation()}function br(t){var e=t.document.documentElement,n=F(t).on("dragstart.drag",Nt,Ot);"onselectstart"in e?n.on("selectstart.drag",Nt,Ot):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function _r(t,e){var n=t.document.documentElement,r=F(t).on("dragstart.drag",null);e&&(r.on("click.drag",Nt,Ot),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ee=t=>()=>t;function Xe(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:s,x:a,y:l,dx:u,dy:o,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,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:u,enumerable:!0,configurable:!0},dy:{value:o,enumerable:!0,configurable:!0},_:{value:c}})}Xe.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Fs(t){return!t.ctrlKey&&!t.button}function Os(){return this.parentNode}function Xs(t,e){return e??{x:t.x,y:t.y}}function Vs(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ys(){var t=Fs,e=Os,n=Xs,r=Vs,i={},s=Qt("start","drag","end"),a=0,l,u,o,c,p=0;function f(x){x.on("mousedown.drag",h).filter(r).on("touchstart.drag",m).on("touchmove.drag",g,Bs).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(x,N){if(!(c||!t.call(this,x,N))){var M=A(this,e.call(this,x,N),x,N,"mouse");M&&(F(x.view).on("mousemove.drag",w,Ot).on("mouseup.drag",y,Ot),br(x.view),Ie(x),o=!1,l=x.clientX,u=x.clientY,M("start",x))}}function w(x){if(Nt(x),!o){var N=x.clientX-l,M=x.clientY-u;o=N*N+M*M>p}i.mouse("drag",x)}function y(x){F(x.view).on("mousemove.drag mouseup.drag",null),_r(x.view,o),Nt(x),i.mouse("end",x)}function m(x,N){if(t.call(this,x,N)){var M=x.changedTouches,I=e.call(this,x,N),T=M.length,D,b;for(D=0;D<T;++D)(b=A(this,I,x,N,M[D].identifier,M[D]))&&(Ie(x),b("start",x,M[D]))}}function g(x){var N=x.changedTouches,M=N.length,I,T;for(I=0;I<M;++I)(T=i[N[I].identifier])&&(Nt(x),T("drag",x,N[I]))}function _(x){var N=x.changedTouches,M=N.length,I,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),I=0;I<M;++I)(T=i[N[I].identifier])&&(Ie(x),T("end",x,N[I]))}function A(x,N,M,I,T,D){var b=s.copy(),$=ct(D||M,N),C,k,d;if((d=n.call(x,new Xe("beforestart",{sourceEvent:M,target:f,identifier:T,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:b}),I))!=null)return C=d.x-$[0]||0,k=d.y-$[1]||0,function S(v,E,L){var z=$,P;switch(v){case"start":i[T]=S,P=a++;break;case"end":delete i[T],--a;case"drag":$=ct(L||E,N),P=a;break}b.call(v,x,new Xe(v,{sourceEvent:E,subject:d,target:f,identifier:T,active:P,x:$[0]+C,y:$[1]+k,dx:$[0]-z[0],dy:$[1]-z[1],dispatch:b}),I)}}return f.filter=function(x){return arguments.length?(t=typeof x=="function"?x:ee(!!x),f):t},f.container=function(x){return arguments.length?(e=typeof x=="function"?x:ee(x),f):e},f.subject=function(x){return arguments.length?(n=typeof x=="function"?x:ee(x),f):n},f.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:ee(!!x),f):r},f.on=function(){var x=s.on.apply(s,arguments);return x===s?f:x},f.clickDistance=function(x){return arguments.length?(p=(x=+x)*x,f):Math.sqrt(p)},f}function rn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $r(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Jt(){}var Xt=.7,me=1/Xt,Tt="\\s*([+-]?\\d+)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",at="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gs=/^#([0-9a-f]{3,8})$/,Ws=new RegExp(`^rgb\\(${Tt},${Tt},${Tt}\\)$`),Us=new RegExp(`^rgb\\(${at},${at},${at}\\)$`),Ks=new RegExp(`^rgba\\(${Tt},${Tt},${Tt},${Vt}\\)$`),js=new RegExp(`^rgba\\(${at},${at},${at},${Vt}\\)$`),Qs=new RegExp(`^hsl\\(${Vt},${at},${at}\\)$`),Zs=new RegExp(`^hsla\\(${Vt},${at},${at},${Vt}\\)$`),wn={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};rn(Jt,Yt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:bn,formatHex:bn,formatHex8:Js,formatHsl:ta,formatRgb:_n,toString:_n});function bn(){return this.rgb().formatHex()}function Js(){return this.rgb().formatHex8()}function ta(){return Mr(this).formatHsl()}function _n(){return this.rgb().formatRgb()}function Yt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gs.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$n(e):n===3?new K(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ne(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ne(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ws.exec(t))?new K(e[1],e[2],e[3],1):(e=Us.exec(t))?new K(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ks.exec(t))?ne(e[1],e[2],e[3],e[4]):(e=js.exec(t))?ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Qs.exec(t))?An(e[1],e[2]/100,e[3]/100,1):(e=Zs.exec(t))?An(e[1],e[2]/100,e[3]/100,e[4]):wn.hasOwnProperty(t)?$n(wn[t]):t==="transparent"?new K(NaN,NaN,NaN,0):null}function $n(t){return new K(t>>16&255,t>>8&255,t&255,1)}function ne(t,e,n,r){return r<=0&&(t=e=n=NaN),new K(t,e,n,r)}function ea(t){return t instanceof Jt||(t=Yt(t)),t?(t=t.rgb(),new K(t.r,t.g,t.b,t.opacity)):new K}function Ve(t,e,n,r){return arguments.length===1?ea(t):new K(t,e,n,r??1)}function K(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}rn(K,Ve,$r(Jt,{brighter(t){return t=t==null?me:Math.pow(me,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Xt:Math.pow(Xt,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new K(bt(this.r),bt(this.g),bt(this.b),ye(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:Mn,formatHex:Mn,formatHex8:na,formatRgb:kn,toString:kn}));function Mn(){return`#${xt(this.r)}${xt(this.g)}${xt(this.b)}`}function na(){return`#${xt(this.r)}${xt(this.g)}${xt(this.b)}${xt((isNaN(this.opacity)?1:this.opacity)*255)}`}function kn(){const t=ye(this.opacity);return`${t===1?"rgb(":"rgba("}${bt(this.r)}, ${bt(this.g)}, ${bt(this.b)}${t===1?")":`, ${t})`}`}function ye(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function bt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xt(t){return t=bt(t),(t<16?"0":"")+t.toString(16)}function An(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new tt(t,e,n,r)}function Mr(t){if(t instanceof tt)return new tt(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=Yt(t)),!t)return new tt;if(t instanceof tt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),a=NaN,l=s-i,u=(s+i)/2;return l?(e===s?a=(n-r)/l+(n<r)*6:n===s?a=(r-e)/l+2:a=(e-n)/l+4,l/=u<.5?s+i:2-s-i,a*=60):l=u>0&&u<1?0:a,new tt(a,l,u,t.opacity)}function ra(t,e,n,r){return arguments.length===1?Mr(t):new tt(t,e,n,r??1)}function tt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}rn(tt,ra,$r(Jt,{brighter(t){return t=t==null?me:Math.pow(me,t),new tt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xt:Math.pow(Xt,t),new tt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new K(Ne(t>=240?t-240:t+120,i,r),Ne(t,i,r),Ne(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new tt(Sn(this.h),re(this.s),re(this.l),ye(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 t=ye(this.opacity);return`${t===1?"hsl(":"hsla("}${Sn(this.h)}, ${re(this.s)*100}%, ${re(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Sn(t){return t=(t||0)%360,t<0?t+360:t}function re(t){return Math.max(0,Math.min(1,t||0))}function Ne(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const kr=t=>()=>t;function ia(t,e){return function(n){return t+n*e}}function sa(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function aa(t){return(t=+t)==1?Ar:function(e,n){return n-e?sa(e,n,t):kr(isNaN(e)?n:e)}}function Ar(t,e){var n=e-t;return n?ia(t,n):kr(isNaN(t)?e:t)}const En=(function t(e){var n=aa(e);function r(i,s){var a=n((i=Ve(i)).r,(s=Ve(s)).r),l=n(i.g,s.g),u=n(i.b,s.b),o=Ar(i.opacity,s.opacity);return function(c){return i.r=a(c),i.g=l(c),i.b=u(c),i.opacity=o(c),i+""}}return r.gamma=t,r})(1);function dt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Ye=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Te=new RegExp(Ye.source,"g");function oa(t){return function(){return t}}function la(t){return function(e){return t(e)+""}}function ca(t,e){var n=Ye.lastIndex=Te.lastIndex=0,r,i,s,a=-1,l=[],u=[];for(t=t+"",e=e+"";(r=Ye.exec(t))&&(i=Te.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(r=r[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,u.push({i:a,x:dt(r,i)})),n=Te.lastIndex;return n<e.length&&(s=e.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?u[0]?la(u[0].x):oa(e):(e=u.length,function(o){for(var c=0,p;c<e;++c)l[(p=u[c]).i]=p.x(o);return l.join("")})}var In=180/Math.PI,Ge={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sr(t,e,n,r,i,s){var a,l,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*In,skewX:Math.atan(u)*In,scaleX:a,scaleY:l}}var ie;function ua(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ge:Sr(e.a,e.b,e.c,e.d,e.e,e.f)}function fa(t){return t==null||(ie||(ie=document.createElementNS("http://www.w3.org/2000/svg","g")),ie.setAttribute("transform",t),!(t=ie.transform.baseVal.consolidate()))?Ge:(t=t.matrix,Sr(t.a,t.b,t.c,t.d,t.e,t.f))}function Er(t,e,n,r){function i(o){return o.length?o.pop()+" ":""}function s(o,c,p,f,h,w){if(o!==p||c!==f){var y=h.push("translate(",null,e,null,n);w.push({i:y-4,x:dt(o,p)},{i:y-2,x:dt(c,f)})}else(p||f)&&h.push("translate("+p+e+f+n)}function a(o,c,p,f){o!==c?(o-c>180?c+=360:c-o>180&&(o+=360),f.push({i:p.push(i(p)+"rotate(",null,r)-2,x:dt(o,c)})):c&&p.push(i(p)+"rotate("+c+r)}function l(o,c,p,f){o!==c?f.push({i:p.push(i(p)+"skewX(",null,r)-2,x:dt(o,c)}):c&&p.push(i(p)+"skewX("+c+r)}function u(o,c,p,f,h,w){if(o!==p||c!==f){var y=h.push(i(h)+"scale(",null,",",null,")");w.push({i:y-4,x:dt(o,p)},{i:y-2,x:dt(c,f)})}else(p!==1||f!==1)&&h.push(i(h)+"scale("+p+","+f+")")}return function(o,c){var p=[],f=[];return o=t(o),c=t(c),s(o.translateX,o.translateY,c.translateX,c.translateY,p,f),a(o.rotate,c.rotate,p,f),l(o.skewX,c.skewX,p,f),u(o.scaleX,o.scaleY,c.scaleX,c.scaleY,p,f),o=c=null,function(h){for(var w=-1,y=f.length,m;++w<y;)p[(m=f[w]).i]=m.x(h);return p.join("")}}}var da=Er(ua,"px, ","px)","deg)"),ha=Er(fa,", ",")",")"),pa=1e-12;function Nn(t){return((t=Math.exp(t))+1/t)/2}function ga(t){return((t=Math.exp(t))-1/t)/2}function ma(t){return((t=Math.exp(2*t))-1)/(t+1)}const Ir=(function t(e,n,r){function i(s,a){var l=s[0],u=s[1],o=s[2],c=a[0],p=a[1],f=a[2],h=c-l,w=p-u,y=h*h+w*w,m,g;if(y<pa)g=Math.log(f/o)/e,m=function(I){return[l+I*h,u+I*w,o*Math.exp(e*I*g)]};else{var _=Math.sqrt(y),A=(f*f-o*o+r*y)/(2*o*n*_),x=(f*f-o*o-r*y)/(2*f*n*_),N=Math.log(Math.sqrt(A*A+1)-A),M=Math.log(Math.sqrt(x*x+1)-x);g=(M-N)/e,m=function(I){var T=I*g,D=Nn(N),b=o/(n*_)*(D*ma(e*T+N)-ga(N));return[l+b*h,u+b*w,o*D/Nn(e*T+N)]}}return m.duration=g*1e3*e/Math.SQRT2,m}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a,u=l*l;return t(a,l,u)},i})(Math.SQRT2,2,4);var Lt=0,Ht=0,Dt=0,Nr=1e3,ve,qt,xe=0,$t=0,ke=0,Gt=typeof performance=="object"&&performance.now?performance:Date,Tr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function sn(){return $t||(Tr(ya),$t=Gt.now()+ke)}function ya(){$t=0}function we(){this._call=this._time=this._next=null}we.prototype=an.prototype={constructor:we,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?sn():+n)+(e==null?0:+e),!this._next&&qt!==this&&(qt?qt._next=this:ve=this,qt=this),this._call=t,this._time=n,We()},stop:function(){this._call&&(this._call=null,this._time=1/0,We())}};function an(t,e,n){var r=new we;return r.restart(t,e,n),r}function va(){sn(),++Lt;for(var t=ve,e;t;)(e=$t-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Lt}function Tn(){$t=(xe=Gt.now())+ke,Lt=Ht=0;try{va()}finally{Lt=0,wa(),$t=0}}function xa(){var t=Gt.now(),e=t-xe;e>Nr&&(ke-=e,xe=t)}function wa(){for(var t,e=ve,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ve=n);qt=t,We(r)}function We(t){if(!Lt){Ht&&(Ht=clearTimeout(Ht));var e=t-$t;e>24?(t<1/0&&(Ht=setTimeout(Tn,t-Gt.now()-ke)),Dt&&(Dt=clearInterval(Dt))):(Dt||(xe=Gt.now(),Dt=setInterval(xa,Nr)),Lt=1,Tr(Tn))}}function Cn(t,e,n){var r=new we;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var ba=Qt("start","end","cancel","interrupt"),_a=[],Cr=0,Ln=1,Ue=2,fe=3,Dn=4,Ke=5,de=6;function Ae(t,e,n,r,i,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;$a(t,n,{name:e,index:r,group:i,on:ba,tween:_a,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Cr})}function on(t,e){var n=et(t,e);if(n.state>Cr)throw new Error("too late; already scheduled");return n}function ot(t,e){var n=et(t,e);if(n.state>fe)throw new Error("too late; already running");return n}function et(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function $a(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=an(s,0,n.time);function s(o){n.state=Ln,n.timer.restart(a,n.delay,n.time),n.delay<=o&&a(o-n.delay)}function a(o){var c,p,f,h;if(n.state!==Ln)return u();for(c in r)if(h=r[c],h.name===n.name){if(h.state===fe)return Cn(a);h.state===Dn?(h.state=de,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[c]):+c<e&&(h.state=de,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[c])}if(Cn(function(){n.state===fe&&(n.state=Dn,n.timer.restart(l,n.delay,n.time),l(o))}),n.state=Ue,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ue){for(n.state=fe,i=new Array(f=n.tween.length),c=0,p=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=h);i.length=p+1}}function l(o){for(var c=o<n.duration?n.ease.call(null,o/n.duration):(n.timer.restart(u),n.state=Ke,1),p=-1,f=i.length;++p<f;)i[p].call(t,c);n.state===Ke&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=de,n.timer.stop(),delete r[e];for(var o in r)return;delete t.__transition}}function he(t,e){var n=t.__transition,r,i,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){s=!1;continue}i=r.state>Ue&&r.state<Ke,r.state=de,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}s&&delete t.__transition}}function Ma(t){return this.each(function(){he(this,t)})}function ka(t,e){var n,r;return function(){var i=ot(this,t),s=i.tween;if(s!==n){r=n=s;for(var a=0,l=r.length;a<l;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Aa(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=ot(this,t),a=s.tween;if(a!==r){i=(r=a).slice();for(var l={name:e,value:n},u=0,o=i.length;u<o;++u)if(i[u].name===e){i[u]=l;break}u===o&&i.push(l)}s.tween=i}}function Sa(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=et(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?ka:Aa)(n,t,e))}function ln(t,e,n){var r=t._id;return t.each(function(){var i=ot(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return et(i,r).value[e]}}function Lr(t,e){var n;return(typeof e=="number"?dt:e instanceof Yt?En:(n=Yt(e))?(e=n,En):ca)(t,e)}function Ea(t){return function(){this.removeAttribute(t)}}function Ia(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Na(t,e,n){var r,i=n+"",s;return function(){var a=this.getAttribute(t);return a===i?null:a===r?s:s=e(r=a,n)}}function Ta(t,e,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?s:s=e(r=a,n)}}function Ca(t,e,n){var r,i,s;return function(){var a,l=n(this),u;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=l+"",a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,l)))}}function La(t,e,n){var r,i,s;return function(){var a,l=n(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=l+"",a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,l)))}}function Da(t,e){var n=Me(t),r=n==="transform"?ha:Lr;return this.attrTween(t,typeof e=="function"?(n.local?La:Ca)(n,r,ln(this,"attr."+t,e)):e==null?(n.local?Ia:Ea)(n):(n.local?Ta:Na)(n,r,e))}function za(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Pa(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ra(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&Pa(t,s)),n}return i._value=e,i}function Ha(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&za(t,s)),n}return i._value=e,i}function qa(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Me(t);return this.tween(n,(r.local?Ra:Ha)(r,e))}function Ba(t,e){return function(){on(this,t).delay=+e.apply(this,arguments)}}function Fa(t,e){return e=+e,function(){on(this,t).delay=e}}function Oa(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ba:Fa)(e,t)):et(this.node(),e).delay}function Xa(t,e){return function(){ot(this,t).duration=+e.apply(this,arguments)}}function Va(t,e){return e=+e,function(){ot(this,t).duration=e}}function Ya(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xa:Va)(e,t)):et(this.node(),e).duration}function Ga(t,e){if(typeof e!="function")throw new Error;return function(){ot(this,t).ease=e}}function Wa(t){var e=this._id;return arguments.length?this.each(Ga(e,t)):et(this.node(),e).ease}function Ua(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ot(this,t).ease=n}}function Ka(t){if(typeof t!="function")throw new Error;return this.each(Ua(this._id,t))}function ja(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=r[i]=[],u,o=0;o<a;++o)(u=s[o])&&t.call(u,u.__data__,o,s)&&l.push(u);return new ft(r,this._parents,this._name,this._id)}function Qa(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var u=e[l],o=n[l],c=u.length,p=a[l]=new Array(c),f,h=0;h<c;++h)(f=u[h]||o[h])&&(p[h]=f);for(;l<r;++l)a[l]=e[l];return new ft(a,this._parents,this._name,this._id)}function Za(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Ja(t,e,n){var r,i,s=Za(e)?on:ot;return function(){var a=s(this,t),l=a.on;l!==r&&(i=(r=l).copy()).on(e,n),a.on=i}}function to(t,e){var n=this._id;return arguments.length<2?et(this.node(),n).on.on(t):this.each(Ja(n,t,e))}function eo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function no(){return this.on("end.remove",eo(this._id))}function ro(t){var e=this._name,n=this._id;typeof t!="function"&&(t=tn(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var l=r[a],u=l.length,o=s[a]=new Array(u),c,p,f=0;f<u;++f)(c=l[f])&&(p=t.call(c,c.__data__,f,l))&&("__data__"in c&&(p.__data__=c.__data__),o[f]=p,Ae(o[f],e,n,f,o,et(c,n)));return new ft(s,this._parents,e,n)}function io(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ur(t));for(var r=this._groups,i=r.length,s=[],a=[],l=0;l<i;++l)for(var u=r[l],o=u.length,c,p=0;p<o;++p)if(c=u[p]){for(var f=t.call(c,c.__data__,p,u),h,w=et(c,n),y=0,m=f.length;y<m;++y)(h=f[y])&&Ae(h,e,n,y,f,w);s.push(f),a.push(c)}return new ft(s,a,e,n)}var so=Zt.prototype.constructor;function ao(){return new so(this._groups,this._parents)}function oo(t,e){var n,r,i;return function(){var s=Ct(this,t),a=(this.style.removeProperty(t),Ct(this,t));return s===a?null:s===n&&a===r?i:i=e(n=s,r=a)}}function Dr(t){return function(){this.style.removeProperty(t)}}function lo(t,e,n){var r,i=n+"",s;return function(){var a=Ct(this,t);return a===i?null:a===r?s:s=e(r=a,n)}}function co(t,e,n){var r,i,s;return function(){var a=Ct(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),Ct(this,t))),a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,l))}}function uo(t,e){var n,r,i,s="style."+e,a="end."+s,l;return function(){var u=ot(this,t),o=u.on,c=u.value[s]==null?l||(l=Dr(e)):void 0;(o!==n||i!==c)&&(r=(n=o).copy()).on(a,i=c),u.on=r}}function fo(t,e,n){var r=(t+="")=="transform"?da:Lr;return e==null?this.styleTween(t,oo(t,r)).on("end.style."+t,Dr(t)):typeof e=="function"?this.styleTween(t,co(t,r,ln(this,"style."+t,e))).each(uo(this._id,t)):this.styleTween(t,lo(t,r,e),n).on("end.style."+t,null)}function ho(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function po(t,e,n){var r,i;function s(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&ho(t,a,n)),r}return s._value=e,s}function go(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,po(t,e,n??""))}function mo(t){return function(){this.textContent=t}}function yo(t){return function(){var e=t(this);this.textContent=e??""}}function vo(t){return this.tween("text",typeof t=="function"?yo(ln(this,"text",t)):mo(t==null?"":t+""))}function xo(t){return function(e){this.textContent=t.call(this,e)}}function wo(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&xo(i)),e}return r._value=t,r}function bo(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,wo(t))}function _o(){for(var t=this._name,e=this._id,n=zr(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,u,o=0;o<l;++o)if(u=a[o]){var c=et(u,e);Ae(u,t,n,o,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ft(r,this._parents,t,n)}function $o(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},u={value:function(){--i===0&&s()}};n.each(function(){var o=ot(this,r),c=o.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),o.on=e}),i===0&&s()})}var Mo=0;function ft(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function zr(){return++Mo}var lt=Zt.prototype;ft.prototype={constructor:ft,select:ro,selectAll:io,selectChild:lt.selectChild,selectChildren:lt.selectChildren,filter:ja,merge:Qa,selection:ao,transition:_o,call:lt.call,nodes:lt.nodes,node:lt.node,size:lt.size,empty:lt.empty,each:lt.each,on:to,attr:Da,attrTween:qa,style:fo,styleTween:go,text:vo,textTween:bo,remove:no,tween:Sa,delay:Oa,duration:Ya,ease:Wa,easeVarying:Ka,end:$o,[Symbol.iterator]:lt[Symbol.iterator]};function ko(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ao={time:null,delay:0,duration:250,ease:ko};function So(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Eo(t){var e,n;t instanceof ft?(e=t._id,t=t._name):(e=zr(),(n=Ao).time=sn(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,u,o=0;o<l;++o)(u=a[o])&&Ae(u,t,e,o,a,n||So(u,e));return new ft(r,this._parents,t,e)}Zt.prototype.interrupt=Ma;Zt.prototype.transition=Eo;var zn=Math.abs,Mt=Math.cos,kt=Math.sin,Pr=Math.PI,se=Pr/2,Pn=Pr*2,Rn=Math.max,Ce=1e-12;function Hn(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function Io(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function No(){return To(!0)}function To(t,e){var n=0,r=null,i=null,s=null;function a(l){var u=l.length,o=new Array(u),c=Hn(0,u),p=new Array(u*u),f=new Array(u),h=0,w;l=Float64Array.from({length:u*u},(y,m)=>l[m/u|0][m%u]);for(let y=0;y<u;++y){let m=0;for(let g=0;g<u;++g)m+=l[y*u+g]+t*l[g*u+y];h+=o[y]=m}h=Rn(0,Pn-n*u)/h,w=h?n:Pn/u;{let y=0;r&&c.sort((m,g)=>r(o[m],o[g]));for(const m of c){const g=y;{const _=Hn(~u+1,u).filter(A=>A<0?l[~A*u+m]:l[m*u+A]);i&&_.sort((A,x)=>i(A<0?-l[~A*u+m]:l[m*u+A],x<0?-l[~x*u+m]:l[m*u+x]));for(const A of _)if(A<0){const x=p[~A*u+m]||(p[~A*u+m]={source:null,target:null});x.target={index:m,startAngle:y,endAngle:y+=l[~A*u+m]*h,value:l[~A*u+m]}}else{const x=p[m*u+A]||(p[m*u+A]={source:null,target:null});x.source={index:m,startAngle:y,endAngle:y+=l[m*u+A]*h,value:l[m*u+A]}}f[m]={index:m,startAngle:g,endAngle:y,value:o[m]}}y+=w}}return p=Object.values(p),p.groups=f,s?p.sort(s):p}return a.padAngle=function(l){return arguments.length?(n=Rn(0,l),a):n},a.sortGroups=function(l){return arguments.length?(r=l,a):r},a.sortSubgroups=function(l){return arguments.length?(i=l,a):i},a.sortChords=function(l){return arguments.length?(l==null?s=null:(s=Io(l))._=l,a):s&&s._},a}const je=Math.PI,Qe=2*je,yt=1e-6,Co=Qe-yt;function Rr(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Lo(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Rr;const n=10**e;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class cn{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Rr:Lo(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,s,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(e,n,r,i,s){if(e=+e,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,l=this._y1,u=r-e,o=i-n,c=a-e,p=l-n,f=c*c+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>yt)if(!(Math.abs(p*u-o*c)>yt)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,w=i-l,y=u*u+o*o,m=h*h+w*w,g=Math.sqrt(y),_=Math.sqrt(f),A=s*Math.tan((je-Math.acos((y+f-m)/(2*g*_)))/2),x=A/_,N=A/g;Math.abs(x-1)>yt&&this._append`L${e+x*c},${n+x*p}`,this._append`A${s},${s},0,0,${+(p*h>c*w)},${this._x1=e+N*u},${this._y1=n+N*o}`}}arc(e,n,r,i,s,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),u=r*Math.sin(i),o=e+l,c=n+u,p=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${o},${c}`:(Math.abs(this._x1-o)>yt||Math.abs(this._y1-c)>yt)&&this._append`L${o},${c}`,r&&(f<0&&(f=f%Qe+Qe),f>Co?this._append`A${r},${r},0,1,${p},${e-l},${n-u}A${r},${r},0,1,${p},${this._x1=o},${this._y1=c}`:f>yt&&this._append`A${r},${r},0,${+(f>=je)},${p},${this._x1=e+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Hr(){return new cn}Hr.prototype=cn.prototype;var Do=Array.prototype.slice;function gt(t){return function(){return t}}function zo(t){return t.source}function Po(t){return t.target}function qn(t){return t.radius}function Ro(t){return t.startAngle}function Ho(t){return t.endAngle}function qo(){return 0}function Bo(){return 10}function Fo(t){var e=zo,n=Po,r=qn,i=qn,s=Ro,a=Ho,l=qo,u=null;function o(){var c,p=e.apply(this,arguments),f=n.apply(this,arguments),h=l.apply(this,arguments)/2,w=Do.call(arguments),y=+r.apply(this,(w[0]=p,w)),m=s.apply(this,w)-se,g=a.apply(this,w)-se,_=+i.apply(this,(w[0]=f,w)),A=s.apply(this,w)-se,x=a.apply(this,w)-se;if(u||(u=c=Hr()),h>Ce&&(zn(g-m)>h*2+Ce?g>m?(m+=h,g-=h):(m-=h,g+=h):m=g=(m+g)/2,zn(x-A)>h*2+Ce?x>A?(A+=h,x-=h):(A-=h,x+=h):A=x=(A+x)/2),u.moveTo(y*Mt(m),y*kt(m)),u.arc(0,0,y,m,g),m!==A||g!==x)if(t){var N=+t.apply(this,arguments),M=_-N,I=(A+x)/2;u.quadraticCurveTo(0,0,M*Mt(A),M*kt(A)),u.lineTo(_*Mt(I),_*kt(I)),u.lineTo(M*Mt(x),M*kt(x))}else u.quadraticCurveTo(0,0,_*Mt(A),_*kt(A)),u.arc(0,0,_,A,x);if(u.quadraticCurveTo(0,0,y*Mt(m),y*kt(m)),u.closePath(),c)return u=null,c+""||null}return t&&(o.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:gt(+c),o):t}),o.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:gt(+c),o):r},o.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:gt(+c),o):r},o.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:gt(+c),o):i},o.startAngle=function(c){return arguments.length?(s=typeof c=="function"?c:gt(+c),o):s},o.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:gt(+c),o):a},o.padAngle=function(c){return arguments.length?(l=typeof c=="function"?c:gt(+c),o):l},o.source=function(c){return arguments.length?(e=c,o):e},o.target=function(c){return arguments.length?(n=c,o):n},o.context=function(c){return arguments.length?(u=c??null,o):u},o}function Oo(){return Fo(Bo)}function Xo(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var s,a=n.length,l,u=0,o=0;for(s=0;s<a;++s)l=n[s],u+=l.x,o+=l.y;for(u=(u/a-t)*r,o=(o/a-e)*r,s=0;s<a;++s)l=n[s],l.x-=u,l.y-=o}return i.initialize=function(s){n=s},i.x=function(s){return arguments.length?(t=+s,i):t},i.y=function(s){return arguments.length?(e=+s,i):e},i.strength=function(s){return arguments.length?(r=+s,i):r},i}function Vo(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return qr(this.cover(e,n),e,n,t)}function qr(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,s=t._root,a={data:r},l=t._x0,u=t._y0,o=t._x1,c=t._y1,p,f,h,w,y,m,g,_;if(!s)return t._root=a,t;for(;s.length;)if((y=e>=(p=(l+o)/2))?l=p:o=p,(m=n>=(f=(u+c)/2))?u=f:c=f,i=s,!(s=s[g=m<<1|y]))return i[g]=a,t;if(h=+t._x.call(null,s.data),w=+t._y.call(null,s.data),e===h&&n===w)return a.next=s,i?i[g]=a:t._root=a,t;do i=i?i[g]=new Array(4):t._root=new Array(4),(y=e>=(p=(l+o)/2))?l=p:o=p,(m=n>=(f=(u+c)/2))?u=f:c=f;while((g=m<<1|y)===(_=(w>=f)<<1|h>=p));return i[_]=s,i[g]=a,t}function Yo(t){var e,n,r=t.length,i,s,a=new Array(r),l=new Array(r),u=1/0,o=1/0,c=-1/0,p=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(s=+this._y.call(null,e))||(a[n]=i,l[n]=s,i<u&&(u=i),i>c&&(c=i),s<o&&(o=s),s>p&&(p=s));if(u>c||o>p)return this;for(this.cover(u,o).cover(c,p),n=0;n<r;++n)qr(this,a[n],l[n],t[n]);return this}function Go(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,s=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,s=(r=Math.floor(e))+1;else{for(var a=i-n||1,l=this._root,u,o;n>t||t>=i||r>e||e>=s;)switch(o=(e<r)<<1|t<n,u=new Array(4),u[o]=l,l=u,a*=2,o){case 0:i=n+a,s=r+a;break;case 1:n=i-a,s=r+a;break;case 2:i=n+a,r=s-a;break;case 3:n=i-a,r=s-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=s,this}function Wo(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function Uo(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Y(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Ko(t,e,n){var r,i=this._x0,s=this._y0,a,l,u,o,c=this._x1,p=this._y1,f=[],h=this._root,w,y;for(h&&f.push(new Y(h,i,s,c,p)),n==null?n=1/0:(i=t-n,s=e-n,c=t+n,p=e+n,n*=n);w=f.pop();)if(!(!(h=w.node)||(a=w.x0)>c||(l=w.y0)>p||(u=w.x1)<i||(o=w.y1)<s))if(h.length){var m=(a+u)/2,g=(l+o)/2;f.push(new Y(h[3],m,g,u,o),new Y(h[2],a,g,m,o),new Y(h[1],m,l,u,g),new Y(h[0],a,l,m,g)),(y=(e>=g)<<1|t>=m)&&(w=f[f.length-1],f[f.length-1]=f[f.length-1-y],f[f.length-1-y]=w)}else{var _=t-+this._x.call(null,h.data),A=e-+this._y.call(null,h.data),x=_*_+A*A;if(x<n){var N=Math.sqrt(n=x);i=t-N,s=e-N,c=t+N,p=e+N,r=h.data}}return r}function jo(t){if(isNaN(c=+this._x.call(null,t))||isNaN(p=+this._y.call(null,t)))return this;var e,n=this._root,r,i,s,a=this._x0,l=this._y0,u=this._x1,o=this._y1,c,p,f,h,w,y,m,g;if(!n)return this;if(n.length)for(;;){if((w=c>=(f=(a+u)/2))?a=f:u=f,(y=p>=(h=(l+o)/2))?l=h:o=h,e=n,!(n=n[m=y<<1|w]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,g=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,i?(s?i.next=s:delete i.next,this):e?(s?e[m]=s:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[g]=n:this._root=n),this):(this._root=s,this)}function Qo(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function Zo(){return this._root}function Jo(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function tl(t){var e=[],n,r=this._root,i,s,a,l,u;for(r&&e.push(new Y(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,s=n.x0,a=n.y0,l=n.x1,u=n.y1)&&r.length){var o=(s+l)/2,c=(a+u)/2;(i=r[3])&&e.push(new Y(i,o,c,l,u)),(i=r[2])&&e.push(new Y(i,s,c,o,u)),(i=r[1])&&e.push(new Y(i,o,a,l,c)),(i=r[0])&&e.push(new Y(i,s,a,o,c))}return this}function el(t){var e=[],n=[],r;for(this._root&&e.push(new Y(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var s,a=r.x0,l=r.y0,u=r.x1,o=r.y1,c=(a+u)/2,p=(l+o)/2;(s=i[0])&&e.push(new Y(s,a,l,c,p)),(s=i[1])&&e.push(new Y(s,c,l,u,p)),(s=i[2])&&e.push(new Y(s,a,p,c,o)),(s=i[3])&&e.push(new Y(s,c,p,u,o))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function nl(t){return t[0]}function rl(t){return arguments.length?(this._x=t,this):this._x}function il(t){return t[1]}function sl(t){return arguments.length?(this._y=t,this):this._y}function un(t,e,n){var r=new fn(e??nl,n??il,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function fn(t,e,n,r,i,s){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=s,this._root=void 0}function Bn(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var W=un.prototype=fn.prototype;W.copy=function(){var t=new fn(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=Bn(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=Bn(r));return t};W.add=Vo;W.addAll=Yo;W.cover=Go;W.data=Wo;W.extent=Uo;W.find=Ko;W.remove=jo;W.removeAll=Qo;W.root=Zo;W.size=Jo;W.visit=tl;W.visitAfter=el;W.x=rl;W.y=sl;function _t(t){return function(){return t}}function ht(t){return(t()-.5)*1e-6}function al(t){return t.x+t.vx}function ol(t){return t.y+t.vy}function ll(t){var e,n,r,i=1,s=1;typeof t!="function"&&(t=_t(t==null?1:+t));function a(){for(var o,c=e.length,p,f,h,w,y,m,g=0;g<s;++g)for(p=un(e,al,ol).visitAfter(l),o=0;o<c;++o)f=e[o],y=n[f.index],m=y*y,h=f.x+f.vx,w=f.y+f.vy,p.visit(_);function _(A,x,N,M,I){var T=A.data,D=A.r,b=y+D;if(T){if(T.index>f.index){var $=h-T.x-T.vx,C=w-T.y-T.vy,k=$*$+C*C;k<b*b&&($===0&&($=ht(r),k+=$*$),C===0&&(C=ht(r),k+=C*C),k=(b-(k=Math.sqrt(k)))/k*i,f.vx+=($*=k)*(b=(D*=D)/(m+D)),f.vy+=(C*=k)*b,T.vx-=$*(b=1-b),T.vy-=C*b)}return}return x>h+b||M<h-b||N>w+b||I<w-b}}function l(o){if(o.data)return o.r=n[o.data.index];for(var c=o.r=0;c<4;++c)o[c]&&o[c].r>o.r&&(o.r=o[c].r)}function u(){if(e){var o,c=e.length,p;for(n=new Array(c),o=0;o<c;++o)p=e[o],n[p.index]=+t(p,o,e)}}return a.initialize=function(o,c){e=o,r=c,u()},a.iterations=function(o){return arguments.length?(s=+o,a):s},a.strength=function(o){return arguments.length?(i=+o,a):i},a.radius=function(o){return arguments.length?(t=typeof o=="function"?o:_t(+o),u(),a):t},a}function cl(t){return t.index}function Fn(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function ul(t){var e=cl,n=p,r,i=_t(30),s,a,l,u,o,c=1;t==null&&(t=[]);function p(m){return 1/Math.min(l[m.source.index],l[m.target.index])}function f(m){for(var g=0,_=t.length;g<c;++g)for(var A=0,x,N,M,I,T,D,b;A<_;++A)x=t[A],N=x.source,M=x.target,I=M.x+M.vx-N.x-N.vx||ht(o),T=M.y+M.vy-N.y-N.vy||ht(o),D=Math.sqrt(I*I+T*T),D=(D-s[A])/D*m*r[A],I*=D,T*=D,M.vx-=I*(b=u[A]),M.vy-=T*b,N.vx+=I*(b=1-b),N.vy+=T*b}function h(){if(a){var m,g=a.length,_=t.length,A=new Map(a.map((N,M)=>[e(N,M,a),N])),x;for(m=0,l=new Array(g);m<_;++m)x=t[m],x.index=m,typeof x.source!="object"&&(x.source=Fn(A,x.source)),typeof x.target!="object"&&(x.target=Fn(A,x.target)),l[x.source.index]=(l[x.source.index]||0)+1,l[x.target.index]=(l[x.target.index]||0)+1;for(m=0,u=new Array(_);m<_;++m)x=t[m],u[m]=l[x.source.index]/(l[x.source.index]+l[x.target.index]);r=new Array(_),w(),s=new Array(_),y()}}function w(){if(a)for(var m=0,g=t.length;m<g;++m)r[m]=+n(t[m],m,t)}function y(){if(a)for(var m=0,g=t.length;m<g;++m)s[m]=+i(t[m],m,t)}return f.initialize=function(m,g){a=m,o=g,h()},f.links=function(m){return arguments.length?(t=m,h(),f):t},f.id=function(m){return arguments.length?(e=m,f):e},f.iterations=function(m){return arguments.length?(c=+m,f):c},f.strength=function(m){return arguments.length?(n=typeof m=="function"?m:_t(+m),w(),f):n},f.distance=function(m){return arguments.length?(i=typeof m=="function"?m:_t(+m),y(),f):i},f}const fl=1664525,dl=1013904223,On=4294967296;function hl(){let t=1;return()=>(t=(fl*t+dl)%On)/On}function pl(t){return t.x}function gl(t){return t.y}var ml=10,yl=Math.PI*(3-Math.sqrt(5));function vl(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),s=0,a=.6,l=new Map,u=an(p),o=Qt("tick","end"),c=hl();t==null&&(t=[]);function p(){f(),o.call("tick",e),n<r&&(u.stop(),o.call("end",e))}function f(y){var m,g=t.length,_;y===void 0&&(y=1);for(var A=0;A<y;++A)for(n+=(s-n)*i,l.forEach(function(x){x(n)}),m=0;m<g;++m)_=t[m],_.fx==null?_.x+=_.vx*=a:(_.x=_.fx,_.vx=0),_.fy==null?_.y+=_.vy*=a:(_.y=_.fy,_.vy=0);return e}function h(){for(var y=0,m=t.length,g;y<m;++y){if(g=t[y],g.index=y,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var _=ml*Math.sqrt(.5+y),A=y*yl;g.x=_*Math.cos(A),g.y=_*Math.sin(A)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function w(y){return y.initialize&&y.initialize(t,c),y}return h(),e={tick:f,restart:function(){return u.restart(p),e},stop:function(){return u.stop(),e},nodes:function(y){return arguments.length?(t=y,h(),l.forEach(w),e):t},alpha:function(y){return arguments.length?(n=+y,e):n},alphaMin:function(y){return arguments.length?(r=+y,e):r},alphaDecay:function(y){return arguments.length?(i=+y,e):+i},alphaTarget:function(y){return arguments.length?(s=+y,e):s},velocityDecay:function(y){return arguments.length?(a=1-y,e):1-a},randomSource:function(y){return arguments.length?(c=y,l.forEach(w),e):c},force:function(y,m){return arguments.length>1?(m==null?l.delete(y):l.set(y,w(m)),e):l.get(y)},find:function(y,m,g){var _=0,A=t.length,x,N,M,I,T;for(g==null?g=1/0:g*=g,_=0;_<A;++_)I=t[_],x=y-I.x,N=m-I.y,M=x*x+N*N,M<g&&(T=I,g=M);return T},on:function(y,m){return arguments.length>1?(o.on(y,m),e):o.on(y)}}}function xl(){var t,e,n,r,i=_t(-30),s,a=1,l=1/0,u=.81;function o(h){var w,y=t.length,m=un(t,pl,gl).visitAfter(p);for(r=h,w=0;w<y;++w)e=t[w],m.visit(f)}function c(){if(t){var h,w=t.length,y;for(s=new Array(w),h=0;h<w;++h)y=t[h],s[y.index]=+i(y,h,t)}}function p(h){var w=0,y,m,g=0,_,A,x;if(h.length){for(_=A=x=0;x<4;++x)(y=h[x])&&(m=Math.abs(y.value))&&(w+=y.value,g+=m,_+=m*y.x,A+=m*y.y);h.x=_/g,h.y=A/g}else{y=h,y.x=y.data.x,y.y=y.data.y;do w+=s[y.data.index];while(y=y.next)}h.value=w}function f(h,w,y,m){if(!h.value)return!0;var g=h.x-e.x,_=h.y-e.y,A=m-w,x=g*g+_*_;if(A*A/u<x)return x<l&&(g===0&&(g=ht(n),x+=g*g),_===0&&(_=ht(n),x+=_*_),x<a&&(x=Math.sqrt(a*x)),e.vx+=g*h.value*r/x,e.vy+=_*h.value*r/x),!0;if(h.length||x>=l)return;(h.data!==e||h.next)&&(g===0&&(g=ht(n),x+=g*g),_===0&&(_=ht(n),x+=_*_),x<a&&(x=Math.sqrt(a*x)));do h.data!==e&&(A=s[h.data.index]*r/x,e.vx+=g*A,e.vy+=_*A);while(h=h.next)}return o.initialize=function(h,w){t=h,n=w,c()},o.strength=function(h){return arguments.length?(i=typeof h=="function"?h:_t(+h),c(),o):i},o.distanceMin=function(h){return arguments.length?(a=h*h,o):Math.sqrt(a)},o.distanceMax=function(h){return arguments.length?(l=h*h,o):Math.sqrt(l)},o.theta=function(h){return arguments.length?(u=h*h,o):Math.sqrt(u)},o}function wl(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function bl(){return this.eachAfter(wl)}function _l(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function $l(t,e){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function Ml(t,e){for(var n=this,r=[n],i=[],s,a,l,u=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,l=s.length;a<l;++a)r.push(s[a]);for(;n=i.pop();)t.call(e,n,++u,this);return this}function kl(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function Al(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function Sl(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function El(t){for(var e=this,n=Il(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function Il(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function Nl(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Tl(){return Array.from(this)}function Cl(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Ll(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*Dl(){var t=this,e,n=[t],r,i,s;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function te(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=Rl)):e===void 0&&(e=Pl);for(var n=new Wt(t),r,i=[n],s,a,l,u;r=i.pop();)if((a=e(r.data))&&(u=(a=Array.from(a)).length))for(r.children=a,l=u-1;l>=0;--l)i.push(s=a[l]=new Wt(a[l])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(ql)}function zl(){return te(this).eachBefore(Hl)}function Pl(t){return t.children}function Rl(t){return Array.isArray(t)?t[1]:null}function Hl(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function ql(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Wt(t){this.data=t,this.depth=this.height=0,this.parent=null}Wt.prototype=te.prototype={constructor:Wt,count:bl,each:_l,eachAfter:Ml,eachBefore:$l,find:kl,sum:Al,sort:Sl,path:El,ancestors:Nl,descendants:Tl,leaves:Cl,links:Ll,copy:zl,[Symbol.iterator]:Dl};function Bl(t){return t==null?null:Br(t)}function Br(t){if(typeof t!="function")throw new Error;return t}function vt(){return 0}function St(t){return function(){return t}}const Fl=1664525,Ol=1013904223,Xn=4294967296;function Xl(){let t=1;return()=>(t=(Fl*t+Ol)%Xn)/Xn}function Vl(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Yl(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function Gl(t,e){for(var n=0,r=(t=Yl(Array.from(t),e)).length,i=[],s,a;n<r;)s=t[n],a&&Fr(a,s)?++n:(a=Ul(i=Wl(i,s)),n=0);return a}function Wl(t,e){var n,r;if(Le(e,t))return[e];for(n=0;n<t.length;++n)if(ae(e,t[n])&&Le(Bt(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(ae(Bt(t[n],t[r]),e)&&ae(Bt(t[n],e),t[r])&&ae(Bt(t[r],e),t[n])&&Le(Or(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function ae(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function Fr(t,e){var n=t.r-e.r+Math.max(t.r,e.r,1)*1e-9,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Le(t,e){for(var n=0;n<e.length;++n)if(!Fr(t,e[n]))return!1;return!0}function Ul(t){switch(t.length){case 1:return Kl(t[0]);case 2:return Bt(t[0],t[1]);case 3:return Or(t[0],t[1],t[2])}}function Kl(t){return{x:t.x,y:t.y,r:t.r}}function Bt(t,e){var n=t.x,r=t.y,i=t.r,s=e.x,a=e.y,l=e.r,u=s-n,o=a-r,c=l-i,p=Math.sqrt(u*u+o*o);return{x:(n+s+u/p*c)/2,y:(r+a+o/p*c)/2,r:(p+i+l)/2}}function Or(t,e,n){var r=t.x,i=t.y,s=t.r,a=e.x,l=e.y,u=e.r,o=n.x,c=n.y,p=n.r,f=r-a,h=r-o,w=i-l,y=i-c,m=u-s,g=p-s,_=r*r+i*i-s*s,A=_-a*a-l*l+u*u,x=_-o*o-c*c+p*p,N=h*w-f*y,M=(w*x-y*A)/(N*2)-r,I=(y*m-w*g)/N,T=(h*A-f*x)/(N*2)-i,D=(f*g-h*m)/N,b=I*I+D*D-1,$=2*(s+M*I+T*D),C=M*M+T*T-s*s,k=-(Math.abs(b)>1e-6?($+Math.sqrt($*$-4*b*C))/(2*b):C/$);return{x:r+M+I*k,y:i+T+D*k,r:k}}function Vn(t,e,n){var r=t.x-e.x,i,s,a=t.y-e.y,l,u,o=r*r+a*a;o?(s=e.r+n.r,s*=s,u=t.r+n.r,u*=u,s>u?(i=(o+u-s)/(2*o),l=Math.sqrt(Math.max(0,u/o-i*i)),n.x=t.x-i*r-l*a,n.y=t.y-i*a+l*r):(i=(o+s-u)/(2*o),l=Math.sqrt(Math.max(0,s/o-i*i)),n.x=e.x+i*r-l*a,n.y=e.y+i*a+l*r)):(n.x=e.x+n.r,n.y=e.y)}function Yn(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Gn(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,s=(e.y*n.r+n.y*e.r)/r;return i*i+s*s}function oe(t){this._=t,this.next=null,this.previous=null}function jl(t,e){if(!(s=(t=Vl(t)).length))return 0;var n,r,i,s,a,l,u,o,c,p,f;if(n=t[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;Vn(r,n,i=t[2]),n=new oe(n),r=new oe(r),i=new oe(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<s;++u){Vn(n._,r._,i=t[u]),i=new oe(i),o=r.next,c=n.previous,p=r._.r,f=n._.r;do if(p<=f){if(Yn(o._,i._)){r=o,n.next=r,r.previous=n,--u;continue t}p+=o._.r,o=o.next}else{if(Yn(c._,i._)){n=c,n.next=r,r.previous=n,--u;continue t}f+=c._.r,c=c.previous}while(o!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Gn(n);(i=i.next)!==r;)(l=Gn(i))<a&&(n=i,a=l);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Gl(n,e),u=0;u<s;++u)n=t[u],n.x-=i.x,n.y-=i.y;return i.r}function Ql(t){return Math.sqrt(t.value)}function Zl(){var t=null,e=1,n=1,r=vt;function i(s){const a=Xl();return s.x=e/2,s.y=n/2,t?s.eachBefore(Wn(t)).eachAfter(De(r,.5,a)).eachBefore(Un(1)):s.eachBefore(Wn(Ql)).eachAfter(De(vt,1,a)).eachAfter(De(r,s.r/Math.min(e,n),a)).eachBefore(Un(Math.min(e,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(t=Bl(s),i):t},i.size=function(s){return arguments.length?(e=+s[0],n=+s[1],i):[e,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:St(+s),i):r},i}function Wn(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function De(t,e,n){return function(r){if(i=r.children){var i,s,a=i.length,l=t(r)*e||0,u;if(l)for(s=0;s<a;++s)i[s].r+=l;if(u=jl(i,n),l)for(s=0;s<a;++s)i[s].r-=l;r.r=u+l}}}function Un(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function Jl(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function tc(t,e,n,r,i){for(var s=t.children,a,l=-1,u=s.length,o=t.value&&(r-e)/t.value;++l<u;)a=s[l],a.y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*o}function ec(t,e){return t.parent===e.parent?1:2}function ze(t){var e=t.children;return e?e[0]:t.t}function Pe(t){var e=t.children;return e?e[e.length-1]:t.t}function nc(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function rc(t){for(var e=0,n=0,r=t.children,i=r.length,s;--i>=0;)s=r[i],s.z+=e,s.m+=e,e+=s.s+(n+=s.c)}function ic(t,e,n){return t.a.parent===e.parent?t.a:n}function pe(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}pe.prototype=Object.create(Wt.prototype);function sc(t){for(var e=new pe(t,0),n,r=[e],i,s,a,l;n=r.pop();)if(s=n._.children)for(n.children=new Array(l=s.length),a=l-1;a>=0;--a)r.push(i=n.children[a]=new pe(s[a],a)),i.parent=n;return(e.parent=new pe(null,0)).children=[e],e}function ac(){var t=ec,e=1,n=1,r=null;function i(o){var c=sc(o);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(a),r)o.eachBefore(u);else{var p=o,f=o,h=o;o.eachBefore(function(_){_.x<p.x&&(p=_),_.x>f.x&&(f=_),_.depth>h.depth&&(h=_)});var w=p===f?1:t(p,f)/2,y=w-p.x,m=e/(f.x+w+y),g=n/(h.depth||1);o.eachBefore(function(_){_.x=(_.x+y)*m,_.y=_.depth*g})}return o}function s(o){var c=o.children,p=o.parent.children,f=o.i?p[o.i-1]:null;if(c){rc(o);var h=(c[0].z+c[c.length-1].z)/2;f?(o.z=f.z+t(o._,f._),o.m=o.z-h):o.z=h}else f&&(o.z=f.z+t(o._,f._));o.parent.A=l(o,f,o.parent.A||p[0])}function a(o){o._.x=o.z+o.parent.m,o.m+=o.parent.m}function l(o,c,p){if(c){for(var f=o,h=o,w=c,y=f.parent.children[0],m=f.m,g=h.m,_=w.m,A=y.m,x;w=Pe(w),f=ze(f),w&&f;)y=ze(y),h=Pe(h),h.a=o,x=w.z+_-f.z-m+t(w._,f._),x>0&&(nc(ic(w,o,p),o,x),m+=x,g+=x),_+=w.m,m+=f.m,A+=y.m,g+=h.m;w&&!Pe(h)&&(h.t=w,h.m+=_-g),f&&!ze(y)&&(y.t=f,y.m+=m-A,p=o)}return p}function u(o){o.x*=e,o.y=o.depth*n}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function oc(t,e,n,r,i){for(var s=t.children,a,l=-1,u=s.length,o=t.value&&(i-n)/t.value;++l<u;)a=s[l],a.x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*o}var lc=(1+Math.sqrt(5))/2;function cc(t,e,n,r,i,s){for(var a=[],l=e.children,u,o,c=0,p=0,f=l.length,h,w,y=e.value,m,g,_,A,x,N,M;c<f;){h=i-n,w=s-r;do m=l[p++].value;while(!m&&p<f);for(g=_=m,N=Math.max(w/h,h/w)/(y*t),M=m*m*N,x=Math.max(_/M,M/g);p<f;++p){if(m+=o=l[p].value,o<g&&(g=o),o>_&&(_=o),M=m*m*N,A=Math.max(_/M,M/g),A>x){m-=o;break}x=A}a.push(u={value:m,dice:h<w,children:l.slice(c,p)}),u.dice?tc(u,n,r,i,y?r+=w*m/y:s):oc(u,n,r,y?n+=h*m/y:i,s),y-=m,c=p}return a}const Xr=(function t(e){function n(r,i,s,a,l){cc(e,r,i,s,a,l)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(lc);function uc(){var t=Xr,e=!1,n=1,r=1,i=[0],s=vt,a=vt,l=vt,u=vt,o=vt;function c(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(p),i=[0],e&&f.eachBefore(Jl),f}function p(f){var h=i[f.depth],w=f.x0+h,y=f.y0+h,m=f.x1-h,g=f.y1-h;m<w&&(w=m=(w+m)/2),g<y&&(y=g=(y+g)/2),f.x0=w,f.y0=y,f.x1=m,f.y1=g,f.children&&(h=i[f.depth+1]=s(f)/2,w+=o(f)-h,y+=a(f)-h,m-=l(f)-h,g-=u(f)-h,m<w&&(w=m=(w+m)/2),g<y&&(y=g=(y+g)/2),t(f,w,y,m,g))}return c.round=function(f){return arguments.length?(e=!!f,c):e},c.size=function(f){return arguments.length?(n=+f[0],r=+f[1],c):[n,r]},c.tile=function(f){return arguments.length?(t=Br(f),c):t},c.padding=function(f){return arguments.length?c.paddingInner(f).paddingOuter(f):c.paddingInner()},c.paddingInner=function(f){return arguments.length?(s=typeof f=="function"?f:St(+f),c):s},c.paddingOuter=function(f){return arguments.length?c.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):c.paddingTop()},c.paddingTop=function(f){return arguments.length?(a=typeof f=="function"?f:St(+f),c):a},c.paddingRight=function(f){return arguments.length?(l=typeof f=="function"?f:St(+f),c):l},c.paddingBottom=function(f){return arguments.length?(u=typeof f=="function"?f:St(+f),c):u},c.paddingLeft=function(f){return arguments.length?(o=typeof f=="function"?f:St(+f),c):o},c}function rt(t){return function(){return t}}const Kn=Math.abs,X=Math.atan2,mt=Math.cos,fc=Math.max,Re=Math.min,nt=Math.sin,It=Math.sqrt,U=1e-12,Ut=Math.PI,be=Ut/2,dc=2*Ut;function hc(t){return t>1?0:t<-1?Ut:Math.acos(t)}function jn(t){return t>=1?be:t<=-1?-be:Math.asin(t)}function Vr(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new cn(e)}function pc(t){return t.innerRadius}function gc(t){return t.outerRadius}function mc(t){return t.startAngle}function yc(t){return t.endAngle}function vc(t){return t&&t.padAngle}function xc(t,e,n,r,i,s,a,l){var u=n-t,o=r-e,c=a-i,p=l-s,f=p*u-c*o;if(!(f*f<U))return f=(c*(e-s)-p*(t-i))/f,[t+f*u,e+f*o]}function le(t,e,n,r,i,s,a){var l=t-n,u=e-r,o=(a?s:-s)/It(l*l+u*u),c=o*u,p=-o*l,f=t+c,h=e+p,w=n+c,y=r+p,m=(f+w)/2,g=(h+y)/2,_=w-f,A=y-h,x=_*_+A*A,N=i-s,M=f*y-w*h,I=(A<0?-1:1)*It(fc(0,N*N*x-M*M)),T=(M*A-_*I)/x,D=(-M*_-A*I)/x,b=(M*A+_*I)/x,$=(-M*_+A*I)/x,C=T-m,k=D-g,d=b-m,S=$-g;return C*C+k*k>d*d+S*S&&(T=b,D=$),{cx:T,cy:D,x01:-c,y01:-p,x11:T*(i/N-1),y11:D*(i/N-1)}}function wc(){var t=pc,e=gc,n=rt(0),r=null,i=mc,s=yc,a=vc,l=null,u=Vr(o);function o(){var c,p,f=+t.apply(this,arguments),h=+e.apply(this,arguments),w=i.apply(this,arguments)-be,y=s.apply(this,arguments)-be,m=Kn(y-w),g=y>w;if(l||(l=c=u()),h<f&&(p=h,h=f,f=p),!(h>U))l.moveTo(0,0);else if(m>dc-U)l.moveTo(h*mt(w),h*nt(w)),l.arc(0,0,h,w,y,!g),f>U&&(l.moveTo(f*mt(y),f*nt(y)),l.arc(0,0,f,y,w,g));else{var _=w,A=y,x=w,N=y,M=m,I=m,T=a.apply(this,arguments)/2,D=T>U&&(r?+r.apply(this,arguments):It(f*f+h*h)),b=Re(Kn(h-f)/2,+n.apply(this,arguments)),$=b,C=b,k,d;if(D>U){var S=jn(D/f*nt(T)),v=jn(D/h*nt(T));(M-=S*2)>U?(S*=g?1:-1,x+=S,N-=S):(M=0,x=N=(w+y)/2),(I-=v*2)>U?(v*=g?1:-1,_+=v,A-=v):(I=0,_=A=(w+y)/2)}var E=h*mt(_),L=h*nt(_),z=f*mt(N),P=f*nt(N);if(b>U){var R=h*mt(A),H=h*nt(A),O=f*mt(x),q=f*nt(x),B;if(m<Ut)if(B=xc(E,L,O,q,R,H,z,P)){var j=E-B[0],V=L-B[1],Q=R-B[0],pt=H-B[1],mn=1/nt(hc((j*Q+V*pt)/(It(j*j+V*V)*It(Q*Q+pt*pt)))/2),yn=It(B[0]*B[0]+B[1]*B[1]);$=Re(b,(f-yn)/(mn-1)),C=Re(b,(h-yn)/(mn+1))}else $=C=0}I>U?C>U?(k=le(O,q,E,L,h,C,g),d=le(R,H,z,P,h,C,g),l.moveTo(k.cx+k.x01,k.cy+k.y01),C<b?l.arc(k.cx,k.cy,C,X(k.y01,k.x01),X(d.y01,d.x01),!g):(l.arc(k.cx,k.cy,C,X(k.y01,k.x01),X(k.y11,k.x11),!g),l.arc(0,0,h,X(k.cy+k.y11,k.cx+k.x11),X(d.cy+d.y11,d.cx+d.x11),!g),l.arc(d.cx,d.cy,C,X(d.y11,d.x11),X(d.y01,d.x01),!g))):(l.moveTo(E,L),l.arc(0,0,h,_,A,!g)):l.moveTo(E,L),!(f>U)||!(M>U)?l.lineTo(z,P):$>U?(k=le(z,P,R,H,f,-$,g),d=le(E,L,O,q,f,-$,g),l.lineTo(k.cx+k.x01,k.cy+k.y01),$<b?l.arc(k.cx,k.cy,$,X(k.y01,k.x01),X(d.y01,d.x01),!g):(l.arc(k.cx,k.cy,$,X(k.y01,k.x01),X(k.y11,k.x11),!g),l.arc(0,0,f,X(k.cy+k.y11,k.cx+k.x11),X(d.cy+d.y11,d.cx+d.x11),g),l.arc(d.cx,d.cy,$,X(d.y11,d.x11),X(d.y01,d.x01),!g))):l.arc(0,0,f,N,x,g)}if(l.closePath(),c)return l=null,c+""||null}return o.centroid=function(){var c=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,p=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Ut/2;return[mt(p)*c,nt(p)*c]},o.innerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),o):t},o.outerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),o):e},o.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:rt(+c),o):n},o.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:rt(+c),o):r},o.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:rt(+c),o):i},o.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:rt(+c),o):s},o.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:rt(+c),o):a},o.context=function(c){return arguments.length?(l=c??null,o):l},o}var bc=Array.prototype.slice;function _c(t){return t[0]}function $c(t){return t[1]}class Mc{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function kc(t){return new Mc(t,!0)}function Ac(t){return t.source}function Sc(t){return t.target}function Ec(t){let e=Ac,n=Sc,r=_c,i=$c,s=null,a=null,l=Vr(u);function u(){let o;const c=bc.call(arguments),p=e.apply(this,c),f=n.apply(this,c);if(s==null&&(a=t(o=l())),a.lineStart(),c[0]=p,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),o)return a=null,o+""||null}return u.source=function(o){return arguments.length?(e=o,u):e},u.target=function(o){return arguments.length?(n=o,u):n},u.x=function(o){return arguments.length?(r=typeof o=="function"?o:rt(+o),u):r},u.y=function(o){return arguments.length?(i=typeof o=="function"?o:rt(+o),u):i},u.context=function(o){return arguments.length?(o==null?s=a=null:a=t(s=o),u):s},u}function Ic(){return Ec(kc)}const ce=t=>()=>t;function Nc(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ut(t,e,n){this.k=t,this.x=e,this.y=n}ut.prototype={constructor:ut,scale:function(t){return t===1?this:new ut(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ut(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Se=new ut(1,0,0);ut.prototype;function He(t){t.stopImmediatePropagation()}function zt(t){t.preventDefault(),t.stopImmediatePropagation()}function Tc(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Cc(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Qn(){return this.__zoom||Se}function Lc(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Dc(){return navigator.maxTouchPoints||"ontouchstart"in this}function zc(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function dn(){var t=Tc,e=Cc,n=zc,r=Lc,i=Dc,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Ir,o=Qt("start","zoom","end"),c,p,f,h=500,w=150,y=0,m=10;function g(d){d.property("__zoom",Qn).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",b).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(d,S,v,E){var L=d.selection?d.selection():d;L.property("__zoom",Qn),d!==L?N(d,S,v,E):L.interrupt().each(function(){M(this,arguments).event(E).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},g.scaleBy=function(d,S,v,E){g.scaleTo(d,function(){var L=this.__zoom.k,z=typeof S=="function"?S.apply(this,arguments):S;return L*z},v,E)},g.scaleTo=function(d,S,v,E){g.transform(d,function(){var L=e.apply(this,arguments),z=this.__zoom,P=v==null?x(L):typeof v=="function"?v.apply(this,arguments):v,R=z.invert(P),H=typeof S=="function"?S.apply(this,arguments):S;return n(A(_(z,H),P,R),L,a)},v,E)},g.translateBy=function(d,S,v,E){g.transform(d,function(){return n(this.__zoom.translate(typeof S=="function"?S.apply(this,arguments):S,typeof v=="function"?v.apply(this,arguments):v),e.apply(this,arguments),a)},null,E)},g.translateTo=function(d,S,v,E,L){g.transform(d,function(){var z=e.apply(this,arguments),P=this.__zoom,R=E==null?x(z):typeof E=="function"?E.apply(this,arguments):E;return n(Se.translate(R[0],R[1]).scale(P.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof v=="function"?-v.apply(this,arguments):-v),z,a)},E,L)};function _(d,S){return S=Math.max(s[0],Math.min(s[1],S)),S===d.k?d:new ut(S,d.x,d.y)}function A(d,S,v){var E=S[0]-v[0]*d.k,L=S[1]-v[1]*d.k;return E===d.x&&L===d.y?d:new ut(d.k,E,L)}function x(d){return[(+d[0][0]+ +d[1][0])/2,(+d[0][1]+ +d[1][1])/2]}function N(d,S,v,E){d.on("start.zoom",function(){M(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(E).end()}).tween("zoom",function(){var L=this,z=arguments,P=M(L,z).event(E),R=e.apply(L,z),H=v==null?x(R):typeof v=="function"?v.apply(L,z):v,O=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),q=L.__zoom,B=typeof S=="function"?S.apply(L,z):S,j=u(q.invert(H).concat(O/q.k),B.invert(H).concat(O/B.k));return function(V){if(V===1)V=B;else{var Q=j(V),pt=O/Q[2];V=new ut(pt,H[0]-Q[0]*pt,H[1]-Q[1]*pt)}P.zoom(null,V)}})}function M(d,S,v){return!v&&d.__zooming||new I(d,S)}function I(d,S){this.that=d,this.args=S,this.active=0,this.sourceEvent=null,this.extent=e.apply(d,S),this.taps=0}I.prototype={event:function(d){return d&&(this.sourceEvent=d),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(d,S){return this.mouse&&d!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&d!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&d!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(d){var S=F(this.that).datum();o.call(d,this.that,new Nc(d,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:o}),S)}};function T(d,...S){if(!t.apply(this,arguments))return;var v=M(this,S).event(d),E=this.__zoom,L=Math.max(s[0],Math.min(s[1],E.k*Math.pow(2,r.apply(this,arguments)))),z=ct(d);if(v.wheel)(v.mouse[0][0]!==z[0]||v.mouse[0][1]!==z[1])&&(v.mouse[1]=E.invert(v.mouse[0]=z)),clearTimeout(v.wheel);else{if(E.k===L)return;v.mouse=[z,E.invert(z)],he(this),v.start()}zt(d),v.wheel=setTimeout(P,w),v.zoom("mouse",n(A(_(E,L),v.mouse[0],v.mouse[1]),v.extent,a));function P(){v.wheel=null,v.end()}}function D(d,...S){if(f||!t.apply(this,arguments))return;var v=d.currentTarget,E=M(this,S,!0).event(d),L=F(d.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",O,!0),z=ct(d,v),P=d.clientX,R=d.clientY;br(d.view),He(d),E.mouse=[z,this.__zoom.invert(z)],he(this),E.start();function H(q){if(zt(q),!E.moved){var B=q.clientX-P,j=q.clientY-R;E.moved=B*B+j*j>y}E.event(q).zoom("mouse",n(A(E.that.__zoom,E.mouse[0]=ct(q,v),E.mouse[1]),E.extent,a))}function O(q){L.on("mousemove.zoom mouseup.zoom",null),_r(q.view,E.moved),zt(q),E.event(q).end()}}function b(d,...S){if(t.apply(this,arguments)){var v=this.__zoom,E=ct(d.changedTouches?d.changedTouches[0]:d,this),L=v.invert(E),z=v.k*(d.shiftKey?.5:2),P=n(A(_(v,z),E,L),e.apply(this,S),a);zt(d),l>0?F(this).transition().duration(l).call(N,P,E,d):F(this).call(g.transform,P,E,d)}}function $(d,...S){if(t.apply(this,arguments)){var v=d.touches,E=v.length,L=M(this,S,d.changedTouches.length===E).event(d),z,P,R,H;for(He(d),P=0;P<E;++P)R=v[P],H=ct(R,this),H=[H,this.__zoom.invert(H),R.identifier],L.touch0?!L.touch1&&L.touch0[2]!==H[2]&&(L.touch1=H,L.taps=0):(L.touch0=H,z=!0,L.taps=1+!!c);c&&(c=clearTimeout(c)),z&&(L.taps<2&&(p=H[0],c=setTimeout(function(){c=null},h)),he(this),L.start())}}function C(d,...S){if(this.__zooming){var v=M(this,S).event(d),E=d.changedTouches,L=E.length,z,P,R,H;for(zt(d),z=0;z<L;++z)P=E[z],R=ct(P,this),v.touch0&&v.touch0[2]===P.identifier?v.touch0[0]=R:v.touch1&&v.touch1[2]===P.identifier&&(v.touch1[0]=R);if(P=v.that.__zoom,v.touch1){var O=v.touch0[0],q=v.touch0[1],B=v.touch1[0],j=v.touch1[1],V=(V=B[0]-O[0])*V+(V=B[1]-O[1])*V,Q=(Q=j[0]-q[0])*Q+(Q=j[1]-q[1])*Q;P=_(P,Math.sqrt(V/Q)),R=[(O[0]+B[0])/2,(O[1]+B[1])/2],H=[(q[0]+j[0])/2,(q[1]+j[1])/2]}else if(v.touch0)R=v.touch0[0],H=v.touch0[1];else return;v.zoom("touch",n(A(P,R,H),v.extent,a))}}function k(d,...S){if(this.__zooming){var v=M(this,S).event(d),E=d.changedTouches,L=E.length,z,P;for(He(d),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),z=0;z<L;++z)P=E[z],v.touch0&&v.touch0[2]===P.identifier?delete v.touch0:v.touch1&&v.touch1[2]===P.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(P=ct(P,this),Math.hypot(p[0]-P[0],p[1]-P[1])<m)){var R=F(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return g.wheelDelta=function(d){return arguments.length?(r=typeof d=="function"?d:ce(+d),g):r},g.filter=function(d){return arguments.length?(t=typeof d=="function"?d:ce(!!d),g):t},g.touchable=function(d){return arguments.length?(i=typeof d=="function"?d:ce(!!d),g):i},g.extent=function(d){return arguments.length?(e=typeof d=="function"?d:ce([[+d[0][0],+d[0][1]],[+d[1][0],+d[1][1]]]),g):e},g.scaleExtent=function(d){return arguments.length?(s[0]=+d[0],s[1]=+d[1],g):[s[0],s[1]]},g.translateExtent=function(d){return arguments.length?(a[0][0]=+d[0][0],a[1][0]=+d[1][0],a[0][1]=+d[0][1],a[1][1]=+d[1][1],g):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},g.constrain=function(d){return arguments.length?(n=d,g):n},g.duration=function(d){return arguments.length?(l=+d,g):l},g.interpolate=function(d){return arguments.length?(u=d,g):u},g.on=function(){var d=o.on.apply(o,arguments);return d===o?g:d},g.clickDistance=function(d){return arguments.length?(y=(d=+d)*d,g):Math.sqrt(y)},g.tapDistance=function(d){return arguments.length?(m=+d,g):m},g}function Pc(t){if(t.length===0)return{prefix:"",stripped:new Map};const e=t.map(a=>a.split("/").filter(Boolean)),n=Math.min(...e.map(a=>a.length));let r=0;for(let a=0;a<n-1;a++){const l=e[0][a];if(e.every(u=>u[a]===l))r=a+1;else break}const i=r>0?e[0].slice(0,r).join("/"):"",s=new Map;for(const a of t){const l=a.split("/").filter(Boolean);s.set(a,l.slice(r).join("/"))}return{prefix:i,stripped:s}}function Rc(t){const e=new Map;for(const i of t){const s=e.get(i.filePath);s?(s.lines+=i.lines,s.symbols+=1):e.set(i.filePath,{lines:i.lines,symbols:1})}const{stripped:n}=Pc([...e.keys()]),r={name:"root",children:[]};for(const[i,s]of e){const l=(n.get(i)??i).split("/").filter(Boolean);let u=r;for(let o=0;o<l.length;o++){const c=l[o];if(o===l.length-1)u.children.push({name:c,value:s.lines||1,fullPath:i,symbolCount:s.symbols});else{let f=u.children.find(h=>h.children&&h.name===c);f||(f={name:c,children:[]},u.children.push(f)),u=f}}}return Yr(r),Gr(r),r}function Yr(t){if(!t.children)return;for(const n of t.children)Yr(n);let e=t.children;for(;e&&e.length===1&&e[0].children;){const n=e[0];t.name=t.name==="root"?n.name:`${t.name}/${n.name}`,t.children=n.children,e=t.children}}function Gr(t){if(!t.children)return t.symbolCount??0;let e=0;for(const n of t.children)e+=Gr(n);return t.symbolCount=e,e}function Hc(t,e,n,r){const i={navigateTo(){}};if(!document.querySelector(e))return i;const a=document.querySelector(t),l=a.clientWidth,u=a.clientHeight;if(l===0||u===0)return i;const o=F(t);o.selectAll("*").remove(),o.attr("viewBox",`0 0 ${l} ${u}`);const c=F("#tooltip"),p=[{h:210,s:45},{h:160,s:38},{h:280,s:35},{h:35,s:45},{h:120,s:35},{h:350,s:38},{h:195,s:40},{h:55,s:42},{h:310,s:32},{h:85,s:35}];function f(M){var T;const I=[];for(const D of M.children??[])if((T=D.children)!=null&&T.some(b=>b.children))for(const b of D.children)I.push(b);else I.push(D);return I}function h(M){const I=new Map,T=f(M);for(let D=0;D<T.length;D++)w(T[D],D%p.length,I);return I}function w(M,I,T){T.set(M.name,I);for(const D of M.children??[])w(D,I,T)}function y(M,I){const{h:T,s:D}=p[M%p.length],b=Math.min(18+(I-1)*3,30);return`hsl(${T}, ${D}%, ${b}%)`}function m(M,I){const{h:T,s:D}=p[M%p.length],b=Math.min(32+(I-1)*3,45);return`hsl(${T}, ${D}%, ${b}%)`}const g=[],_=[];function A(M){const I=te(M).sum(T=>T.value??0).sort((T,D)=>(D.value??0)-(T.value??0));return uc().tile(Xr).size([l,u]).paddingOuter(3).paddingTop(19).paddingInner(1).round(!0)(I),I}function x(){const M=g.length>0?g[g.length-1]:n;o.selectAll("*").remove();const I=h(M);function T(d){if(d.depth===0)return"var(--bg-primary)";const S=I.get(d.data.name);return S===void 0?"hsl(0, 0%, 14%)":y(S,d.depth)}function D(d){if(d.depth===0)return"var(--border-primary)";const S=I.get(d.data.name);return S===void 0?"hsl(0, 0%, 28%)":m(S,d.depth)}const $=A(M).descendants();o.append("rect").attr("width",l).attr("height",u).attr("fill","transparent").on("click",()=>{g.length>0&&(g.pop(),_.pop(),x(),r==null||r([..._]))});const C=o.selectAll("g.treemap-cell").data($.filter(d=>d.depth>0)).join("g").attr("class",d=>d.children?"treemap-cell treemap-dir":"treemap-cell treemap-file").attr("transform",d=>`translate(${d.x0},${d.y0})`);C.append("rect").attr("width",d=>Math.max(0,d.x1-d.x0)).attr("height",d=>Math.max(0,d.y1-d.y0)).attr("fill",d=>T(d)).attr("stroke",d=>D(d)).attr("stroke-width",d=>d.children?1:.5).attr("rx",2),C.filter(d=>!!d.children&&d.x1-d.x0>40).append("text").attr("class","treemap-dir-label").attr("x",4).attr("y",13).text(d=>d.data.name).each(function(d){const S=d.x1-d.x0-8,v=this;if(v.getComputedTextLength()>S){let E=d.data.name;for(;E.length>1&&v.getComputedTextLength()>S;)E=E.slice(0,-1),v.textContent=`${E}…`}});const k=C.filter(d=>!d.children&&d.x1-d.x0>40&&d.y1-d.y0>20);k.append("text").attr("class","treemap-file-label").attr("x",4).attr("y",13).text(d=>d.data.name).each(function(d){const S=d.x1-d.x0-8,v=this;if(v.getComputedTextLength()>S){let E=d.data.name;for(;E.length>1&&v.getComputedTextLength()>S;)E=E.slice(0,-1),v.textContent=`${E}…`}}),k.filter(d=>d.y1-d.y0>32).append("text").attr("class","treemap-file-lines").attr("x",4).attr("y",25).text(d=>`${d.data.value??0} lines`),C.filter(d=>!!d.children).style("cursor","pointer").on("click",(d,S)=>{d.stopPropagation();const v=[];let E=S;for(;E&&E.depth>0;)v.unshift(E),E=E.parent;for(const L of v)g.push(L.data),_.push(L.data.name);x(),r==null||r([..._])}),C.on("mouseover",(d,S)=>{const v=S.data.fullPath??S.data.name,E=S.value??0,L=S.data.symbolCount??0,z=S.children?"Directory":"File";c.style("display","block").html(`
|
|
2
|
+
<div class="name">${v}</div>
|
|
3
|
+
<span class="kind">${z}</span>
|
|
4
|
+
<span class="lines">${E} lines</span>
|
|
5
|
+
<div class="location">${L} symbol${L!==1?"s":""}</div>
|
|
6
|
+
`)}).on("mousemove",d=>{c.style("left",`${d.pageX+10}px`).style("top",`${d.pageY-10}px`)}).on("mouseout",()=>{c.style("display","none")})}function N(M){for(;g.length>M;)g.pop(),_.pop();x(),r==null||r([..._])}return x(),r==null||r([]),{navigateTo:N}}function qc(t,e){const r=t.getState().graphData;if(!r||r.nodes.length===0){Bc();return}Fc(t)}function Bc(){const t=document.getElementById("graph-container");t&&(t.innerHTML=`
|
|
7
|
+
<div class="empty-state">
|
|
8
|
+
<h2>No symbol data found</h2>
|
|
9
|
+
<p>Index a codebase to see the file treemap</p>
|
|
10
|
+
</div>
|
|
11
|
+
`)}function Fc(t){const n=t.getState().graphData;if(!n)return;const r=document.getElementById("graph-container");if(!r)return;const i=Rc(n.nodes);r.innerHTML=`
|
|
12
|
+
<div class="files-treemap-container" id="files-treemap-main">
|
|
13
|
+
<div class="treemap-breadcrumb" id="treemap-breadcrumb">
|
|
14
|
+
<span class="breadcrumb-segment breadcrumb-root">root</span>
|
|
15
|
+
</div>
|
|
16
|
+
<svg id="files-treemap-svg"></svg>
|
|
17
|
+
<div class="keyboard-hint">
|
|
18
|
+
<kbd>Click</kbd> directory to zoom in <kbd>Click</kbd> background or breadcrumb to zoom out
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
`;let s=null;function a(l){const u=document.getElementById("treemap-breadcrumb");if(!u)return;let o='<span class="breadcrumb-segment breadcrumb-root breadcrumb-clickable" data-depth="0">root</span>';for(let c=0;c<l.length;c++)o+=`<span class="breadcrumb-sep">/</span><span class="breadcrumb-segment breadcrumb-clickable" data-depth="${c+1}">${Oc(l[c])}</span>`;u.innerHTML=o,u.querySelectorAll(".breadcrumb-clickable").forEach(c=>{c.addEventListener("click",()=>{const p=Number.parseInt(c.dataset.depth??"0",10);s==null||s.navigateTo(p)})})}s=Hc("#files-treemap-svg","#files-treemap-main",i,a)}function Oc(t){const e=document.createElement("span");return e.textContent=t,e.innerHTML}const Wr={function:"#3d5a80",class:"#5a3d80",interface:"#3d8050",type:"#806a3d",variable:"#803d3d",const:"#803d3d",enum:"#3d6880",method:"#4a6670"},Zn={directory:"#2d4a5a",file:"#3d4a5a"},Jn=["#4fc1ff","#ce9178","#6a9955","#c586c0","#dcdcaa","#9cdcfe","#d7ba7d","#b5cea8"];function Ur(t){return Jn[t%Jn.length]}function _e(t){return Wr[t]||"#666"}function Xc(t){return t.data.data?Wr[t.data.data.kind]||"#666":t.data.isFile?Zn.file:t.data.isDirectory?Zn.directory:"#2d2d2d"}function Vc(t){var e;return(e=t.data.data)!=null&&e.hasAnnotations?"#6a9955":"#3c3c3c"}function Et(t,e=5,n=25,r=300){const i=Math.sqrt(Math.min(t,r))/Math.sqrt(r);return e+i*(n-e)}const tr=[{hue:210,fillSat:35,strokeSat:45},{hue:175,fillSat:30,strokeSat:40},{hue:270,fillSat:30,strokeSat:40},{hue:35,fillSat:35,strokeSat:45},{hue:140,fillSat:30,strokeSat:40},{hue:350,fillSat:30,strokeSat:40}];function Kt(t,e){if(t===0)return{fill:"hsl(0, 0%, 12%)",stroke:"hsl(0, 0%, 30%)"};const n=tr[(e||0)%tr.length],r=14+(t-1)*3,i=32+(t-1)*3;return{fill:`hsl(${n.hue}, ${n.fillSat}%, ${r}%)`,stroke:`hsl(${n.hue}, ${n.strokeSat}%, ${i}%)`}}function Kr(t){const e=t.children.reduce((n,r)=>n+Kr(r),0);return t._value=t.memberCount+e,t._value===0&&(t._value=1),t._value}function Yc(t,e,n,r){const i=new Map;if(!document.querySelector(e))return null;const a=F(t),l=document.querySelector(t),u=l.clientWidth,o=l.clientHeight;if(a.selectAll("*").remove(),n.length===0)return null;const c=new Map;for(const v of n)c.set(v.id,{...v,children:[]});let p=null;for(const v of n){const E=c.get(v.id);if(v.parentId===null)p=E;else{const L=c.get(v.parentId);L&&L.children.push(E)}}p||(p=c.get(n[0].id)),Kr(p);const f=Math.min(u,o),h=te(p).sum(v=>v.children.length===0?v._value??1:0).sort((v,E)=>(E.value??0)-(v.value??0)),y=Zl().size([f,f]).padding(3)(h);function m(v){return Kt(v.depth,v.data.colorIndex??0).fill}function g(v){return Kt(v.depth,v.data.colorIndex??0).stroke}const _=a.append("g");for(const v of y.descendants())i.set(v.data.id,{x:v.x-v.r,y:v.y-v.r,width:v.r*2,height:v.r*2});const A=_.append("g").attr("class","circle-layer"),x=_.append("g").attr("class","label-layer").style("pointer-events","none"),N=y.descendants(),M=A.selectAll("g").data(N).join("g").attr("class",v=>{const E=["module-circle"];return v.children||E.push("leaf"),E.join(" ")}).attr("data-module-id",v=>v.data.id),I=M.append("circle").attr("fill",v=>m(v)).attr("stroke",v=>g(v)),T=x.selectAll("g").data(N).join("g"),D=T.append("text").attr("class","module-circle-label").style("display",v=>v.parent===y?"inline":"none").style("fill-opacity",v=>v.parent===y?1:0).text(v=>v.data.name),b=T.filter(v=>v!==y&&(v.data._value??0)>0).append("text").attr("class","module-circle-count").style("display",v=>v.parent===y?"inline":"none").style("fill-opacity",v=>v.parent===y?1:0).attr("dy","1.2em").text(v=>`${v.data._value??0} symbols`);let $=y,C=[y.x,y.y,y.r*2];function k(v){const E=f/v[2];C=v;const L=z=>`translate(${(z.x-v[0])*E+u/2},${(z.y-v[1])*E+o/2})`;M.attr("transform",L),T.attr("transform",L),I.attr("r",z=>z.r*E)}function d(v,E){$=E;const L=a.transition().duration(750).tween("zoom",()=>{const z=Ir(C,[$.x,$.y,$.r*2]);return P=>k(z(P))});D.filter(function(z){return z.parent===$||this.style.display==="inline"}).transition(L).style("fill-opacity",z=>z.parent===$?1:0).on("start",function(z){z.parent===$&&(this.style.display="inline")}).on("end",function(z){z.parent!==$&&(this.style.display="none")}),b.filter(function(z){return z.parent===$||this.style.display==="inline"}).transition(L).style("fill-opacity",z=>z.parent===$?1:0).on("start",function(z){z.parent===$&&(this.style.display="inline")}).on("end",function(z){z.parent!==$&&(this.style.display="none")})}function S(v){M.classed("module-selected",E=>E.data.id===v)}return M.on("click",(v,E)=>{E.children&&$!==E?d(v,E):!E.children&&E.parent&&E.parent!==$&&d(v,E.parent),S(E.data.id),r==null||r(E.data.id),v.stopPropagation()}),a.on("click",()=>{d(null,y),S(null),r==null||r(null)}),k([y.x,y.y,y.r*2]),{modulePositions:i,zoomGroup:_,svg:a}}let $e=null;const Z=130,Pt=40,Rt=48,er=60,nr=80,qe=30,rr=30;function Gc(t,e){const r=t.getState().flowsDagData;if(!r||r.modules.length===0){Wc();return}Uc(t)}function Wc(){const t=document.getElementById("graph-container");t&&(t.innerHTML=`
|
|
22
|
+
<div class="empty-state">
|
|
23
|
+
<h2>No modules found</h2>
|
|
24
|
+
<p>Run 'squint llm modules' to detect modules first</p>
|
|
25
|
+
</div>
|
|
26
|
+
`)}function Uc(t){const e=t.getState(),n=e.flowsDagData;if(!n)return;const r=document.getElementById("graph-container");if(!r)return;const i={0:"Atomic",1:"Operations",2:"Journeys"},s=[1,2];let a="",l=0;const u=new Map;for(const o of n.flows)u.set(o.id,l++);for(const o of s){const c=n.flows.filter(g=>g.tier===o);if(c.length===0)continue;const p=new Map;if(n.features&&n.features.length>0)for(const g of n.features)for(const _ of g.flowIds)p.set(_,g.name);const f=p.size>0,h=new Map;for(const g of c){const _=f?p.get(g.id)||"Uncategorized":g.stakeholder||"Uncategorized";h.has(_)||h.set(_,[]),h.get(_).push(g)}const w=i[o]??`Tier ${o}`,y=o===0;a+=`
|
|
27
|
+
<div class="flow-tier-group${y?" collapsed":""}" data-tier="${o}">
|
|
28
|
+
<div class="flow-tier-header" data-tier="${o}">
|
|
29
|
+
<span class="tier-toggle">${y?"▶":"▼"}</span>
|
|
30
|
+
<span class="tier-label">${w}</span>
|
|
31
|
+
<span class="tier-count">${c.length}</span>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="flow-tier-content">
|
|
34
|
+
`;const m=[...h.keys()].sort((g,_)=>g==="Uncategorized"?1:_==="Uncategorized"?-1:g.localeCompare(_));for(const g of m){const _=h.get(g);a+=`
|
|
35
|
+
<div class="flow-domain-group">
|
|
36
|
+
<div class="flow-domain-header">${g}</div>
|
|
37
|
+
${_.map(A=>{const x=u.get(A.id)??0,N=Ur(x);return`
|
|
38
|
+
<div class="flow-item${e.selectedFlows.has(A.id)?" selected":""}" data-flow-id="${A.id}">
|
|
39
|
+
<span class="flow-color-dot" style="background: ${N};"></span>
|
|
40
|
+
<div class="flow-item-content">
|
|
41
|
+
<span class="flow-name" title="${A.name}">${A.name}</span>
|
|
42
|
+
${A.description?`<span class="flow-description">${A.description}</span>`:""}
|
|
43
|
+
</div>
|
|
44
|
+
<span class="flow-step-count">${A.stepCount}</span>
|
|
45
|
+
</div>
|
|
46
|
+
`}).join("")}
|
|
47
|
+
</div>
|
|
48
|
+
`}a+=`
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`}r.innerHTML=`
|
|
52
|
+
<div class="flows-dag-container">
|
|
53
|
+
<div class="flows-sidebar" id="flows-sidebar">
|
|
54
|
+
<div class="flows-sidebar-header">
|
|
55
|
+
<h3>Flows</h3>
|
|
56
|
+
<button class="sidebar-toggle-btn" id="sidebar-collapse-btn" title="Collapse sidebar">◀</button>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="flows-sidebar-content">
|
|
59
|
+
${a||'<div style="padding: 16px; color: #858585;">No flows found</div>'}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="flows-dag-main" id="flows-dag-main">
|
|
63
|
+
<button class="sidebar-expand-btn" id="sidebar-expand-btn" title="Expand sidebar">▶</button>
|
|
64
|
+
<svg id="flows-dag-svg"></svg>
|
|
65
|
+
<div class="keyboard-hint">
|
|
66
|
+
<kbd>Ctrl</kbd>+<kbd>S</kbd> Toggle sidebar
|
|
67
|
+
<kbd>Esc</kbd> Deselect all
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
`,jt(),jr(t),Jc(t)}function jt(){const t=F("#flows-dag-svg");t.selectAll("*").remove();const e=document.getElementById("flows-dag-main");if(!e)return;const n=e.clientWidth,r=e.clientHeight;t.append("text").attr("class","seq-placeholder").attr("x",n/2).attr("y",r/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Select a flow to view its sequence diagram")}function Kc(t){const e=t.getState(),n=e.flowsDagData;if(!n)return;const r=e.selectedFlowId;if(!r){jt();return}const i=n.flows.find(M=>M.id===r);if(!i||i.steps.length===0){jt();return}let s=0;for(const M of n.flows){if(M.id===r)break;s++}const a=Ur(s),l=document.getElementById("flows-dag-main");if(!l)return;const u=F("#flows-dag-svg");u.selectAll("*").remove();const o=new Map;for(const M of n.modules)o.set(M.id,M);const c=[],p=new Set;for(const M of i.steps)p.has(M.fromModuleId)||(p.add(M.fromModuleId),c.push(M.fromModuleId)),p.has(M.toModuleId)||(p.add(M.toModuleId),c.push(M.toModuleId));const f=new Map;for(let M=0;M<c.length;M++)f.set(c[M],M);const h=c.length*(Z+Pt)-Pt,w=u.append("g");u.append("defs").append("marker").attr("id","seq-arrowhead").attr("viewBox","0 -5 10 10").attr("refX",10).attr("refY",0).attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M0,-4L10,0L0,4").attr("fill",a);const m=dn().scaleExtent([.2,4]).on("zoom",M=>{w.attr("transform",M.transform.toString())});u.call(m);const g=l.clientWidth,_=Math.max(20,(g-h)/2);u.call(m.transform,Se.translate(_,20));function x(M){const I=o.get(M),T=(I==null?void 0:I.depth)??1,D=(I==null?void 0:I.colorIndex)||0;return Kt(T,D)}w.append("g").attr("class","seq-title").append("text").attr("class","seq-title-text").attr("x",h/2).attr("y",-20).attr("text-anchor","middle").text(i.name);for(let M=0;M<c.length;M++){const I=c[M],T=o.get(I),D=(T==null?void 0:T.name)||`Module ${I}`,b=M*(Z+Pt),$=w.append("g").attr("class","seq-participant");$.append("rect").attr("x",b).attr("y",0).attr("width",Z).attr("height",Rt).attr("rx",6).attr("ry",6).attr("fill",x(I).fill).attr("stroke",x(I).stroke).attr("stroke-width",1.5);const C=jc(D,16),k=$.append("text").attr("x",b+Z/2).attr("text-anchor","middle");C.length===1?k.attr("y",Rt/2).attr("dominant-baseline","central").text(C[0]):(k.append("tspan").attr("x",b+Z/2).attr("y",Rt/2-7).text(C[0]),k.append("tspan").attr("x",b+Z/2).attr("y",Rt/2+7).text(C[1])),k.append("title").text(D);const d=nr+i.steps.length*er+20;w.append("line").attr("class","seq-lifeline").attr("x1",b+Z/2).attr("y1",Rt).attr("x2",b+Z/2).attr("y2",d)}for(let M=0;M<i.steps.length;M++){const I=i.steps[M],T=f.get(I.fromModuleId),D=f.get(I.toModuleId);if(T===void 0||D===void 0)continue;const b=nr+M*er,$=T*(Z+Pt)+Z/2,C=D*(Z+Pt)+Z/2,k=w.append("g").attr("class","seq-message").attr("data-step-idx",M),d=I.fromModuleId===I.toModuleId;if(d){const v=`M${$},${b} h${qe} v${rr} h${-qe}`;k.append("path").attr("d",v).attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("marker-end","url(#seq-arrowhead)"),k.append("text").attr("class","seq-message-label").attr("x",$+qe+8).attr("y",b+rr/2).attr("dominant-baseline","central").text(I.semantic||I.toDefName||`Step ${M+1}`)}else{const E=$+(T<D?2:-2),L=C+(T<D?-2:2);k.append("line").attr("x1",E).attr("y1",b).attr("x2",L).attr("y2",b).attr("stroke",a).attr("stroke-width",2).attr("marker-end","url(#seq-arrowhead)");const z=($+C)/2;k.append("text").attr("class","seq-message-label").attr("x",z).attr("y",b-10).attr("text-anchor","middle").text(I.semantic||I.toDefName||`Step ${M+1}`)}const S=$+-16;k.append("circle").attr("class","seq-step-badge-circle").attr("cx",S).attr("cy",b).attr("r",10),k.append("text").attr("class","seq-step-badge").attr("x",S).attr("y",b).attr("text-anchor","middle").attr("dominant-baseline","central").text(M+1)}}function jc(t,e){if(t.length<=e)return[t];const n=Math.ceil(t.length/2);let r=t.lastIndexOf(" ",n);return r<=0&&(r=t.indexOf(" ",n)),r<=0&&(r=n),[t.slice(0,r).trim(),t.slice(r).trim()]}function Qc(t,e){wr(".seq-message").classed("dimmed",function(){return Number.parseInt(F(this).attr("data-step-idx")||"-1")!==e})}function Zc(){wr(".seq-message").classed("dimmed",!1)}function jr(t){var e,n;(e=document.getElementById("sidebar-collapse-btn"))==null||e.addEventListener("click",()=>{var r;(r=document.getElementById("flows-sidebar"))==null||r.classList.add("collapsed"),t.setState({sidebarCollapsed:!0})}),(n=document.getElementById("sidebar-expand-btn"))==null||n.addEventListener("click",()=>{var r;(r=document.getElementById("flows-sidebar"))==null||r.classList.remove("collapsed"),t.setState({sidebarCollapsed:!1})}),document.querySelectorAll(".flow-tier-header").forEach(r=>{r.addEventListener("click",()=>{const i=r.closest(".flow-tier-group");if(i){i.classList.toggle("collapsed");const s=r.querySelector(".tier-toggle");s&&(s.textContent=i.classList.contains("collapsed")?"▶":"▼")}})}),document.querySelectorAll(".flow-item").forEach(r=>{r.addEventListener("click",()=>{const i=Number.parseInt(r.getAttribute("data-flow-id")||"0");or(t,i),document.querySelectorAll(".flow-item").forEach(s=>{s.classList.toggle("selected",s.getAttribute("data-flow-id")===String(i))}),tu(t,i),Kc(t)})})}function Jc(t){document.addEventListener("keydown",e=>{if(e.ctrlKey&&e.key==="s"){e.preventDefault();const n=document.getElementById("flows-sidebar");n==null||n.classList.toggle("collapsed"),t.setState({sidebarCollapsed:(n==null?void 0:n.classList.contains("collapsed"))||!1})}e.key==="Escape"&&(t.getState().selectedFlowId!==null?Qr(t):(t.setState({selectedFlows:new Set}),document.querySelectorAll(".flow-item").forEach(r=>{r.classList.remove("selected")}),jt()))})}function tu(t,e){var a,l;const n=t.getState(),r=(a=n.flowsDagData)==null?void 0:a.flows.find(u=>u.id===e);if(!r)return;const i=document.querySelector(".flows-sidebar-content");if(!i)return;$e||($e=i.innerHTML);const s=r.steps.map((u,o)=>{var f,h;const c=(f=n.flowsDagData)==null?void 0:f.modules.find(w=>w.id===u.fromModuleId),p=(h=n.flowsDagData)==null?void 0:h.modules.find(w=>w.id===u.toModuleId);return`
|
|
72
|
+
<div class="step-item step-tree" data-step-idx="${o}">
|
|
73
|
+
<div class="step-tree-header">
|
|
74
|
+
<span class="step-number">${o+1}</span>
|
|
75
|
+
<span class="step-semantic">${u.semantic||u.toDefName||`Step ${o+1}`}</span>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="step-tree-path">
|
|
78
|
+
<span class="step-module from">${u.fromDefName||(c==null?void 0:c.name)||"Unknown"}</span>
|
|
79
|
+
<span class="step-arrow">→</span>
|
|
80
|
+
<span class="step-module to">${u.toDefName||(p==null?void 0:p.name)||"Unknown"}</span>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
`}).join("");i.innerHTML=`
|
|
84
|
+
<div class="steps-back-btn" id="steps-back-btn">
|
|
85
|
+
<span class="back-icon">←</span>
|
|
86
|
+
<span>Back to flows</span>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="steps-flow-title">${r.name}</div>
|
|
89
|
+
${r.description?`<div class="steps-flow-description">${r.description}</div>`:""}
|
|
90
|
+
<div class="steps-list">
|
|
91
|
+
${s||'<div style="padding: 16px; color: #858585;">No steps</div>'}
|
|
92
|
+
</div>
|
|
93
|
+
`,(l=document.getElementById("steps-back-btn"))==null||l.addEventListener("click",()=>{Qr(t)}),document.querySelectorAll(".step-item").forEach(u=>{u.addEventListener("mouseenter",()=>{const o=Number.parseInt(u.getAttribute("data-step-idx")||"0");Qc(t,o)}),u.addEventListener("mouseleave",()=>{Zc()})})}function Qr(t){const e=document.querySelector(".flows-sidebar-content");!e||!$e||(e.innerHTML=$e,or(t,null),jr(t),jt())}function ir(t){return t.replace(/^project\./,"")}function eu(t){const e=new Map;for(const l of t)l.fromModuleId!==l.toModuleId&&(l.weight<=0||(e.has(l.fromModuleId)||e.set(l.fromModuleId,{id:l.fromModuleId,name:ir(l.fromModulePath),fullPath:l.fromModulePath}),e.has(l.toModuleId)||e.set(l.toModuleId,{id:l.toModuleId,name:ir(l.toModulePath),fullPath:l.toModulePath})));const n=[...e.values()].sort((l,u)=>l.fullPath.localeCompare(u.fullPath)),r=new Map;for(let l=0;l<n.length;l++)r.set(n[l].id,l);const i=n.length,s=Array.from({length:i},()=>Array(i).fill(0)),a=new Map;for(const l of t){if(l.fromModuleId===l.toModuleId||l.weight<=0)continue;const u=r.get(l.fromModuleId),o=r.get(l.toModuleId);if(u===void 0||o===void 0)continue;s[u][o]+=l.weight;const c=`${u}->${o}`;if(a.has(c)||a.set(c,[]),a.get(c).push(l),l.direction==="bi"){s[o][u]+=l.weight;const p=`${o}->${u}`;a.has(p)||a.set(p,[]),a.get(p).push(l)}}return{modules:n,matrix:s,interactionsByKey:a}}function Be(t){return Kt(1,t).stroke}function nu(t){return Kt(1,t).fill}function ru(t,e,n,r,i){if(!document.querySelector(e))return;const a=document.querySelector(t);if(!a)return;const l=a.clientWidth,u=a.clientHeight;if(l===0||u===0)return;const{modules:o,matrix:c,interactionsByKey:p}=eu(n);if(o.length===0)return;function f(k){if(!i)return k;const d=o[k];return i.get(d.id)??k}const h=F(t);h.selectAll("*").remove(),h.attr("viewBox",`0 0 ${l} ${u}`);const w=Math.min(l,u)/2-80,y=w-20,m=h.append("g").attr("transform",`translate(${l/2},${u/2})`),g=F("#tooltip"),A=No().padAngle(.04).sortSubgroups(ii)(c),x=wc().innerRadius(y).outerRadius(w),N=Oo().radius(y).headRadius(y*.05);function M(k){const d=`${k.source.index}->${k.target.index}`,S=p.get(d);return!S||S.length===0?null:S[0].pattern}function I(k){const d=new Set,S=[];for(const[v,E]of p){const[L,z]=v.split("->");if(Number(L)===k||Number(z)===k)for(const P of E)d.has(P.id)||(d.add(P.id),S.push(P))}return S}let T=null;function D(k,d,S){k==="module"?($.style("fill-opacity",v=>v.source.index===d||v.target.index===d?.7:.05),C.style("opacity",v=>v.index===d||A.some(L=>L.source.index===d&&L.target.index===v.index||L.target.index===d&&L.source.index===v.index)?1:.3)):k==="ribbon"&&S!==void 0&&($.style("fill-opacity",v=>v.source.index===d&&v.target.index===S?.8:.05),C.style("opacity",v=>v.index===d||v.index===S?1:.3))}function b(){$.style("fill-opacity",null),C.style("opacity",null)}const $=m.append("g").attr("class","chord-ribbons").selectAll("path").data(A).join("path").attr("class",k=>M(k)==="business"?"chord-ribbon chord-ribbon-business":"chord-ribbon chord-ribbon-utility").attr("d",k=>N(k)).attr("fill",k=>nu(f(k.source.index))).attr("stroke",k=>M(k)==="utility"?Be(f(k.source.index)):"none").attr("stroke-width",k=>M(k)==="utility"?.8:0);$.on("mouseover",(k,d)=>{var H,O;if(T)return;D("ribbon",d.source.index,d.target.index);const S=o[d.source.index],v=o[d.target.index],E=`${d.source.index}->${d.target.index}`,L=p.get(E)??[],z=L.reduce((q,B)=>q+B.weight,0),P=((H=L[0])==null?void 0:H.pattern)??"unknown",R=((O=L[0])==null?void 0:O.semantic)??"";g.style("display","block").html(`
|
|
94
|
+
<div class="name">${S.name} → ${v.name}</div>
|
|
95
|
+
<div class="location">${S.fullPath} → ${v.fullPath}</div>
|
|
96
|
+
<span class="kind">${P}</span>
|
|
97
|
+
<span class="lines">weight: ${z}</span>
|
|
98
|
+
${R?`<div class="location" style="margin-top: 4px; font-style: italic;">${R}</div>`:""}
|
|
99
|
+
`)}).on("mousemove",k=>{g.style("left",`${k.pageX+10}px`).style("top",`${k.pageY-10}px`)}).on("mouseout",()=>{g.style("display","none"),T||b()}).on("click",(k,d)=>{const S=`${d.source.index}->${d.target.index}`,v=p.get(S)??[];T={kind:"ribbon",source:d.source.index,target:d.target.index},D("ribbon",d.source.index,d.target.index),r==null||r({kind:"ribbon",from:o[d.source.index],to:o[d.target.index],interactions:v})});const C=m.append("g").attr("class","chord-arcs").selectAll("g").data(A.groups).join("g").attr("class","chord-arc");C.append("path").attr("d",k=>x(k)).attr("fill",(k,d)=>Be(f(d))).attr("stroke",(k,d)=>Be(f(d))),C.on("mouseover",(k,d)=>{if(T)return;const S=d.index;D("module",S);const v=o[S];let E=0,L=0;for(let z=0;z<o.length;z++)E+=c[S][z],L+=c[z][S];g.style("display","block").html(`
|
|
100
|
+
<div class="name">${v.name}</div>
|
|
101
|
+
<div class="location">${v.fullPath}</div>
|
|
102
|
+
<span class="kind">outgoing: ${E}</span>
|
|
103
|
+
<span class="lines">incoming: ${L}</span>
|
|
104
|
+
`)}).on("mousemove",k=>{g.style("left",`${k.pageX+10}px`).style("top",`${k.pageY-10}px`)}).on("mouseout",()=>{g.style("display","none"),T||b()}).on("click",(k,d)=>{const S=d.index;T={kind:"module",index:S},D("module",S),r==null||r({kind:"module",moduleIndex:S,module:o[S],interactions:I(S)})}),h.on("click",k=>{k.target===a&&(T=null,b(),r==null||r(null))}),m.append("g").attr("class","chord-labels").selectAll("text").data(A.groups).join("text").attr("class","chord-label").each(function(k){const d=(k.startAngle+k.endAngle)/2,S=d>Math.PI,v=w+8;F(this).attr("transform",`rotate(${d*180/Math.PI-90}) translate(${v},0)${S?" rotate(180)":""}`).attr("text-anchor",S?"end":"start").attr("dominant-baseline","central")}).text((k,d)=>o[d].name)}function iu(t,e){const n=t.getState(),r=n.interactionsData;if(!r||r.interactions.length===0){au();return}const i=document.getElementById("graph-container");if(!i)return;const s=r.processGroups,a=s&&s.groupCount>=2?`<div class="process-group-summary">${s.groupCount} process groups: ${s.groups.map(o=>o.label).join(", ")}</div>`:"";i.innerHTML=`
|
|
105
|
+
${a}
|
|
106
|
+
<div class="chord-container" id="chord-main">
|
|
107
|
+
<svg id="chord-svg"></svg>
|
|
108
|
+
<div class="chord-sidebar hidden" id="chord-sidebar"></div>
|
|
109
|
+
</div>
|
|
110
|
+
`;const l=new Map,u=n.flowsDagData;if(u)for(const o of u.modules)l.set(o.id,o.colorIndex??0);ru("#chord-svg","#chord-main",r.interactions,su,l)}function su(t){const e=document.getElementById("chord-sidebar");if(e){if(t===null){e.classList.add("hidden");return}if(t.kind==="module"){const n=t.module;e.innerHTML=`
|
|
111
|
+
<div class="chord-sidebar-header">
|
|
112
|
+
<h3>${it(n.name)}</h3>
|
|
113
|
+
<span class="chord-sidebar-path">${it(n.fullPath)}</span>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="chord-sidebar-list">
|
|
116
|
+
<div class="chord-sidebar-list-title">${t.interactions.length} interaction${t.interactions.length!==1?"s":""}</div>
|
|
117
|
+
<div class="chord-sidebar-list-items">
|
|
118
|
+
${t.interactions.map(r=>sr(r)).join("")}
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
`}else e.innerHTML=`
|
|
122
|
+
<div class="chord-sidebar-header">
|
|
123
|
+
<h3>${it(t.from.name)} → ${it(t.to.name)}</h3>
|
|
124
|
+
<span class="chord-sidebar-path">${it(t.from.fullPath)} → ${it(t.to.fullPath)}</span>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="chord-sidebar-list">
|
|
127
|
+
<div class="chord-sidebar-list-title">${t.interactions.length} interaction${t.interactions.length!==1?"s":""}</div>
|
|
128
|
+
<div class="chord-sidebar-list-items">
|
|
129
|
+
${t.interactions.map(n=>sr(n)).join("")}
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
`;e.classList.remove("hidden")}}function sr(t){const e=t.fromModulePath.split(".").pop()||t.fromModulePath,n=t.toModulePath.split(".").pop()||t.toModulePath,r=t.pattern==="business"?"business":"utility",i=t.direction==="bi"?"↔":"→",s=t.symbols?t.symbols.split(",").map(u=>u.trim()):[],a=t.source==="llm-inferred"?"inferred":"ast",l=t.source==="llm-inferred"?"inferred":"ast";return`
|
|
133
|
+
<div class="chord-sidebar-item">
|
|
134
|
+
<div class="chord-sidebar-item-header">
|
|
135
|
+
<span class="chord-sidebar-module">${it(e)}</span>
|
|
136
|
+
<span class="chord-sidebar-arrow">${i}</span>
|
|
137
|
+
<span class="chord-sidebar-module">${it(n)}</span>
|
|
138
|
+
<span class="chord-sidebar-badge ${r}">${t.pattern||"utility"}</span>
|
|
139
|
+
<span class="chord-sidebar-badge weight">×${t.weight}</span>
|
|
140
|
+
<span class="chord-sidebar-badge ${l}">${a}</span>
|
|
141
|
+
</div>
|
|
142
|
+
${t.semantic?`<div class="chord-sidebar-semantic">${it(t.semantic)}</div>`:""}
|
|
143
|
+
${s.length>0?`<div class="chord-sidebar-symbols">${s.map(u=>`<span class="chord-sidebar-symbol">${it(u)}</span>`).join("")}</div>`:""}
|
|
144
|
+
</div>
|
|
145
|
+
`}function au(){const t=document.getElementById("graph-container");t&&(t.innerHTML=`
|
|
146
|
+
<div class="empty-state">
|
|
147
|
+
<h2>No interactions found</h2>
|
|
148
|
+
<p>Run 'squint llm interactions' to detect interactions first</p>
|
|
149
|
+
</div>
|
|
150
|
+
`)}function it(t){const e=document.createElement("span");return e.textContent=t,e.innerHTML}function ou(t,e){const r=t.getState().flowsDagData;if(!r||r.modules.length===0){lu();return}cu(t)}function lu(){const t=document.getElementById("graph-container");t&&(t.innerHTML=`
|
|
151
|
+
<div class="empty-state">
|
|
152
|
+
<h2>No modules found</h2>
|
|
153
|
+
<p>Run 'squint llm modules' to detect modules</p>
|
|
154
|
+
</div>
|
|
155
|
+
`)}function cu(t){const e=t.getState(),n=e.flowsDagData;if(!n)return;const r=document.getElementById("graph-container");if(!r)return;const i=e.modulesData,s=new Map;if(i)for(const c of i.modules)s.set(c.id,c);const a=new Map;for(const c of n.modules)if(c.parentId!==null){const p=a.get(c.parentId)??[];p.push(c.id),a.set(c.parentId,p)}function l(c){const p=[c],f=a.get(c)??[];for(const h of f)p.push(...l(h));return p}const u=n.modules.find(c=>c.parentId===null)??n.modules[0];r.innerHTML=`
|
|
156
|
+
<div class="modules-dag-container" id="modules-dag-main">
|
|
157
|
+
<svg id="modules-dag-svg"></svg>
|
|
158
|
+
<div class="modules-sidebar hidden" id="modules-sidebar"></div>
|
|
159
|
+
<div class="keyboard-hint">
|
|
160
|
+
<kbd>Click</kbd> circle to zoom in <kbd>Click</kbd> background to zoom out
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
`;function o(c){var x;const p=document.getElementById("modules-sidebar");if(!p)return;const f=c??u.id,h=n.modules.find(N=>N.id===f);if(!h)return;const w=s.get(f),y=(w==null?void 0:w.description)??null,m=l(f);let g=0,_="";for(const N of m){const M=s.get(N);if(!((x=M==null?void 0:M.members)!=null&&x.length))continue;const I=N===f?h.name:M.name;_+=`<div class="modules-sidebar-section">${At(I)}</div>`;for(const T of M.members)_+=`
|
|
164
|
+
<div class="modules-sidebar-member">
|
|
165
|
+
<span class="member-kind">${At(T.kind)}</span>
|
|
166
|
+
<span class="member-name">${At(T.name)}</span>
|
|
167
|
+
</div>`,g++}_||(_='<div class="modules-sidebar-empty">No symbols assigned</div>');const A=y?`<div class="modules-sidebar-desc">${At(y)}</div>`:"";p.innerHTML=`
|
|
168
|
+
<div class="modules-sidebar-header">
|
|
169
|
+
<h3>${At(h.name)}</h3>
|
|
170
|
+
<span class="modules-sidebar-path">${At(h.fullPath)}</span>
|
|
171
|
+
</div>
|
|
172
|
+
${A}
|
|
173
|
+
<div class="modules-sidebar-members">
|
|
174
|
+
<div class="modules-sidebar-members-title">${g} symbol${g!==1?"s":""}</div>
|
|
175
|
+
<div class="modules-sidebar-members-list">
|
|
176
|
+
${_}
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
`,p.classList.remove("hidden")}Yc("#modules-dag-svg","#modules-dag-main",n.modules,o),o(u.id)}function At(t){const e=document.createElement("span");return e.textContent=t,e.innerHTML}function uu(t){const e=(t||"").toLowerCase();return e.includes("extend")?"extends":e.includes("implement")?"implements":e.includes("call")?"calls":e.includes("import")?"imports":(e.includes("use"),"uses")}function fu(t){var n,r;const e={name:"root",children:[],isRoot:!0};for(const i of t){const s=i.filePath.split("/").filter(o=>o);let a=e;for(let o=0;o<s.length-1;o++){let c=(n=a.children)==null?void 0:n.find(p=>p.name===s[o]&&!p.data);c||(c={name:s[o],children:[],isDirectory:!0,depth:o+1},a.children=a.children||[],a.children.push(c)),a=c}const l=s[s.length-1];let u=(r=a.children)==null?void 0:r.find(o=>o.name===l&&!o.data);u||(u={name:l,children:[],isFile:!0,depth:s.length},a.children=a.children||[],a.children.push(u)),u.children=u.children||[],u.children.push({name:i.name,value:Math.max(i.lines,1),data:i})}return e}function du(t,e,n){const r=new Map(t.map(f=>[f.id,f])),i=e.filter(f=>uu(f.semantic)===n),s=new Map,a=new Set;for(const f of i)!r.has(f.source)||!r.has(f.target)||(s.has(f.target)||s.set(f.target,[]),s.get(f.target).push(f.source),a.add(f.source));const l=new Set;for(const f of i)r.has(f.source)&&l.add(f.source),r.has(f.target)&&l.add(f.target);const u=[...l].filter(f=>!a.has(f)),o=new Set;function c(f,h=0){if(o.has(f))return null;o.add(f);const w=r.get(f);if(!w)return null;const y=(s.get(f)||[]).map(m=>c(m,h+1)).filter(m=>m!==null);return{name:w.name,value:Math.max(w.lines,1),data:w,children:y.length>0?y:void 0}}const p=u.map(f=>c(f)).filter(f=>f!==null);return p.length===0?{name:"root",children:[{name:`No "${n}" relationships found`,children:[]}],isRoot:!0}:{name:"root",children:p,isRoot:!0}}function hu(t,e){const r=t.getState().graphData;if(!r||r.nodes.length===0){gu();return}pu(),mu(t)}function pu(){const t=document.getElementById("loading");t&&(t.style.display="none")}function gu(){const t=document.getElementById("graph-container");t&&(t.innerHTML=`
|
|
180
|
+
<div class="empty-state">
|
|
181
|
+
<h2>No symbols found</h2>
|
|
182
|
+
<p>Index a codebase to see the symbol graph</p>
|
|
183
|
+
</div>
|
|
184
|
+
`)}function mu(t){const e=t.getState(),n=e.graphData;if(!n)return;const r=document.getElementById("graph-container");if(!r)return;const i=r.clientWidth,s=r.clientHeight,a=F("#graph-svg");a.selectAll("*").remove();const l=e.selectedGrouping,u=l==="structure"?fu(n.nodes):du(n.nodes,n.edges,l),o=te(u);o.count(),o.sort(($,C)=>(C.value||0)-($.value||0));const c=20,p=Math.max(120,i/(o.height+1));ac().nodeSize([c,p]).separation(($,C)=>$.parent===C.parent?1:1.5)(o);let h=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,y=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;o.each($=>{$.x!==void 0&&$.y!==void 0&&($.x<h&&(h=$.x),$.x>w&&(w=$.x),$.y<y&&(y=$.y),$.y>m&&(m=$.y))});const g=w-h+c*2,_=m-y+p,A=a.append("g"),x=dn().scaleExtent([.1,4]).on("zoom",$=>{A.attr("transform",$.transform.toString())});a.call(x);const N=Math.min((i-100)/_,(s-100)/g,1),M=50-y*N,I=s/2-(h+w)/2*N;a.call(x.transform,Se.translate(M,I).scale(N));const T=Ic().x($=>$.y).y($=>$.x);A.selectAll(".tree-link").data(o.links()).enter().append("path").attr("class","tree-link").attr("d",T);const D=A.selectAll(".tree-node").data(o.descendants()).enter().append("g").attr("class",$=>{let C="tree-node";return $.children&&$.data.isDirectory&&(C+=" has-children"),C}).attr("transform",$=>`translate(${$.y},${$.x})`);D.append("circle").attr("r",$=>{if($.data.data){const C=$.data.data.lines||1;return Et(C,4,12,300)}return $.data.isFile?5:$.data.isRoot?8:6}).attr("fill",$=>Xc($)).attr("stroke",$=>Vc($)).attr("stroke-width",$=>{var C;return(C=$.data.data)!=null&&C.hasAnnotations?2:1}),D.append("text").attr("dy","0.31em").attr("x",$=>$.children?-10:10).attr("text-anchor",$=>$.children?"end":"start").text($=>{const C=$.data.name;return C.length>25?`${C.substring(0,22)}...`:C}).clone(!0).lower().attr("stroke","#1e1e1e").attr("stroke-width",3);const b=F("#tooltip");D.on("mouseover",($,C)=>{if(C.data.data){const k=C.data.data,d=k.domain?`<div class="domains">${k.domain.map(E=>`<span class="domain-tag">${E}</span>`).join("")}</div>`:"",S=k.pure!==void 0?`<div class="pure ${k.pure?"is-pure":"has-side-effects"}">${k.pure?"Pure function":"Has side effects"}</div>`:"",v=k.purpose?`<div class="purpose">${k.purpose}</div>`:"";b.style("display","block").html(`
|
|
185
|
+
<div class="name">${k.name}</div>
|
|
186
|
+
<span class="kind kind-${k.kind}">${k.kind}</span>
|
|
187
|
+
<span class="lines">${k.lines} lines</span>
|
|
188
|
+
${d}
|
|
189
|
+
${S}
|
|
190
|
+
${v}
|
|
191
|
+
<div class="location">${k.filePath.split("/").slice(-2).join("/")}</div>
|
|
192
|
+
`)}else if(!C.data.isRoot){const k=C.descendants().filter(v=>v.data.data).length,d=C.descendants().filter(v=>v.data.data).reduce((v,E)=>{var L;return v+(((L=E.data.data)==null?void 0:L.lines)||0)},0),S=C.data.isFile?"file":"directory";b.style("display","block").html(`
|
|
193
|
+
<div class="name">${C.data.name}</div>
|
|
194
|
+
<span class="kind kind-type">${S}</span>
|
|
195
|
+
<span class="lines">${d} lines</span>
|
|
196
|
+
<div class="location">${k} symbols</div>
|
|
197
|
+
`)}}).on("mousemove",$=>{b.style("left",`${$.pageX+10}px`).style("top",`${$.pageY-10}px`)}).on("mouseout",()=>{b.style("display","none")})}function yu(t,e,n={}){const{scaleExtent:r=[.1,4],onZoom:i}=n,s=dn().scaleExtent(r).on("zoom",a=>{e.attr("transform",a.transform.toString()),i==null||i(a.transform)});return t.call(s),s}let J=null,Fe=null;function vu(t,e){const r=t.getState().graphData;if(!r||r.nodes.length===0){wu();return}xu(),bu(t)}function xu(){const t=document.getElementById("loading");t&&(t.style.display="none")}function wu(){const t=document.getElementById("graph-container");t&&(t.innerHTML=`
|
|
198
|
+
<div class="empty-state">
|
|
199
|
+
<h2>No symbols found</h2>
|
|
200
|
+
<p>Index a codebase to see the symbol graph</p>
|
|
201
|
+
</div>
|
|
202
|
+
`)}function bu(t){const e=document.getElementById("graph-container");if(!e)return;const n=t.getState();e.innerHTML=`
|
|
203
|
+
<div class="symbols-container">
|
|
204
|
+
<div class="symbols-sidebar${n.sidebarCollapsed?" collapsed":""}" id="symbols-sidebar">
|
|
205
|
+
<div class="symbols-sidebar-header">
|
|
206
|
+
<h3>Symbols</h3>
|
|
207
|
+
<button class="sidebar-toggle-btn" id="symbols-collapse-btn" title="Collapse sidebar">◀</button>
|
|
208
|
+
</div>
|
|
209
|
+
<div class="symbols-search">
|
|
210
|
+
<input type="text" id="symbols-search-input" placeholder="Search symbols..." value="${st(n.symbolSearchQuery)}" />
|
|
211
|
+
</div>
|
|
212
|
+
<div class="symbols-sidebar-content" id="symbols-list"></div>
|
|
213
|
+
</div>
|
|
214
|
+
<div class="symbols-main">
|
|
215
|
+
<button class="sidebar-expand-btn" id="symbols-expand-btn" title="Expand sidebar">▶</button>
|
|
216
|
+
<div class="symbols-detail" id="symbols-detail"></div>
|
|
217
|
+
<svg id="symbols-force-svg"></svg>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
`,Zr(t),_u(t),n.selectedSymbolId!==null?(hn(t,n.selectedSymbolId),pn(t,n.selectedSymbolId)):ti()}function Zr(t){const e=t.getState(),n=e.graphData;if(!n)return;const r=document.getElementById("symbols-list");if(!r)return;const i=e.symbolSearchQuery.toLowerCase(),s=i?n.nodes.filter(o=>o.name.toLowerCase().includes(i)||o.filePath.toLowerCase().includes(i)||o.kind.toLowerCase().includes(i)):n.nodes,a=new Map;for(const o of s){const c=o.kind;a.has(c)||a.set(c,[]),a.get(c).push(o)}const l=[...a.keys()].sort();let u="";for(const o of l){const c=a.get(o);c.sort((p,f)=>p.name.localeCompare(f.name)),u+=`<div class="symbol-kind-header">${o} (${c.length})</div>`;for(const p of c){const h=p.filePath.split("/").slice(-2).join("/"),w=p.id===e.selectedSymbolId;u+=`
|
|
221
|
+
<div class="symbol-item${w?" selected":""}" data-symbol-id="${p.id}">
|
|
222
|
+
<span class="symbol-item-kind kind-${o}" style="background: ${_e(o)}; color: #fff;">${o}</span>
|
|
223
|
+
<span class="symbol-item-name">${st(p.name)}</span>
|
|
224
|
+
<span class="symbol-item-file" title="${st(p.filePath)}">${st(h)}</span>
|
|
225
|
+
</div>
|
|
226
|
+
`}}s.length===0&&(u='<div style="padding: 16px; color: var(--text-dimmed); text-align: center; font-size: 12px;">No symbols match your search</div>'),r.innerHTML=u,r.querySelectorAll(".symbol-item").forEach(o=>{o.addEventListener("click",()=>{const c=Number(o.dataset.symbolId);Je(t,c),Jr(c),hn(t,c),pn(t,c)})})}function Jr(t){document.querySelectorAll(".symbol-item").forEach(e=>{e.classList.toggle("selected",Number(e.dataset.symbolId)===t)})}function _u(t){const e=document.getElementById("symbols-search-input");e&&e.addEventListener("input",()=>{Fe&&clearTimeout(Fe),Fe=setTimeout(()=>{ri(t,e.value),Zr(t)},150)});const n=document.getElementById("symbols-collapse-btn");n&&n.addEventListener("click",()=>{const a=document.getElementById("symbols-sidebar");a&&(a.classList.add("collapsed"),t.setState({sidebarCollapsed:!0}))});const r=document.getElementById("symbols-expand-btn");r&&r.addEventListener("click",()=>{const a=document.getElementById("symbols-sidebar");a&&(a.classList.remove("collapsed"),t.setState({sidebarCollapsed:!1}))});const i=a=>{if(a.key==="Escape"){Je(t,null),document.querySelectorAll(".symbol-item").forEach(u=>u.classList.remove("selected"));const l=document.getElementById("symbols-detail");l&&l.classList.remove("visible"),Ze(),ti()}};document.addEventListener("keydown",i);const s=document.getElementById("graph-container");if(s){const a=new MutationObserver(()=>{document.getElementById("symbols-sidebar")||(document.removeEventListener("keydown",i),Ze(),a.disconnect())});a.observe(s,{childList:!0})}}function hn(t,e){const r=t.getState().graphData;if(!r)return;const i=r.nodes.find(p=>p.id===e);if(!i)return;const s=document.getElementById("symbols-detail");if(!s)return;const a=r.edges.filter(p=>p.target===e).length,l=r.edges.filter(p=>p.source===e).length,o=i.filePath.split("/").slice(-2).join("/");let c=`
|
|
227
|
+
<div class="symbol-detail-header">
|
|
228
|
+
<span class="symbol-detail-name">${st(i.name)}</span>
|
|
229
|
+
<span class="symbol-detail-kind kind-${i.kind}" style="background: ${_e(i.kind)}; color: #fff;">${i.kind}</span>
|
|
230
|
+
</div>
|
|
231
|
+
<div class="symbol-detail-meta">
|
|
232
|
+
<span title="${st(i.filePath)}">${st(o)}</span>
|
|
233
|
+
<span>${i.lines} lines</span>
|
|
234
|
+
${i.moduleName?`<span>Module: ${st(i.moduleName)}</span>`:""}
|
|
235
|
+
</div>
|
|
236
|
+
`;i.pure!==void 0&&(c+=`<span class="symbol-detail-badge ${i.pure?"is-pure":"has-side-effects"}">${i.pure?"Pure function":"Has side effects"}</span>`),i.purpose&&(c+=`<div class="symbol-detail-purpose">${st(i.purpose)}</div>`),i.domain&&i.domain.length>0&&(c+=`<div class="symbol-detail-domains">${i.domain.map(p=>`<span class="domain-tag">${st(p)}</span>`).join("")}</div>`),c+=`<div class="symbol-detail-connections"><span>${a}</span> incoming, <span>${l}</span> outgoing connections</div>`,s.innerHTML=c,s.classList.add("visible")}function pn(t,e){const r=t.getState().graphData;if(!r)return;Ze();const i=document.querySelector(".symbols-placeholder");i&&i.remove();const s=F("#symbols-force-svg");s.selectAll("*").remove();const a=s.node();if(!a)return;const l=a.getBoundingClientRect(),u=l.width,o=l.height;if(u===0||o===0)return;const c=r.edges.filter(b=>b.source===e||b.target===e),p=new Set;p.add(e);for(const b of c)p.add(b.source),p.add(b.target);const f=new Map(r.nodes.map(b=>[b.id,b])),h=[...p].map(b=>f.get(b)).filter(b=>b!==void 0).map(b=>{const $={...b};return b.id===e&&($.fx=u/2,$.fy=o/2),$}),w=new Set(h.map(b=>b.id)),y=c.filter(b=>w.has(b.source)&&w.has(b.target)).map(b=>({source:b.source,target:b.target,semantic:b.semantic}));if(h.length===0)return;s.append("defs").append("marker").attr("id","nb-arrowhead").attr("viewBox","-0 -5 10 10").attr("refX",20).attr("refY",0).attr("orient","auto").attr("markerWidth",6).attr("markerHeight",6).append("path").attr("d","M 0,-5 L 10,0 L 0,5").attr("fill","#4a4a4a"),J=vl(h).force("link",ul(y).id(b=>b.id).distance(120)).force("charge",xl().strength(-200)).force("center",Xo(u/2,o/2)).force("collision",ll().radius(b=>Et(b.lines)+10));const m=s.append("g");yu(s,m);const g=m.append("g").attr("class","links").selectAll("line").data(y).enter().append("line").attr("class","link").attr("stroke","#4a4a4a").attr("stroke-width",1.5).attr("marker-end","url(#nb-arrowhead)"),_=m.append("g").attr("class","link-labels").selectAll("text").data(y).enter().append("text").attr("class","link-label").text(b=>b.semantic||""),A=m.append("g").attr("class","nodes").selectAll(".node").data(h).enter().append("g").attr("class",b=>`node${b.hasAnnotations?"":" greyed-out"}`).call(Ys().on("start",I).on("drag",T).on("end",D));A.append("circle").attr("r",b=>b.id===e?Et(b.lines)*1.5:Et(b.lines)).attr("fill",b=>_e(b.kind)).attr("stroke",b=>b.id===e?"var(--accent-blue)":b.hasAnnotations?"#6a9955":"#3c3c3c").attr("stroke-width",b=>b.id===e?3:b.hasAnnotations?2:1.5),A.append("text").attr("dx",b=>b.id===e?Et(b.lines)*1.5+4:Et(b.lines)+4).attr("dy",4).text(b=>b.name);const x=F("#tooltip");A.on("mouseover",(b,$)=>{const C=$.domain?`<div class="domains">${$.domain.map(S=>`<span class="domain-tag">${S}</span>`).join("")}</div>`:"",k=$.pure!==void 0?`<div class="pure ${$.pure?"is-pure":"has-side-effects"}">${$.pure?"Pure function":"Has side effects"}</div>`:"",d=$.purpose?`<div class="purpose">${$.purpose}</div>`:"";x.style("display","block").html(`
|
|
237
|
+
<div class="name">${$.name}</div>
|
|
238
|
+
<span class="kind kind-${$.kind}">${$.kind}</span>
|
|
239
|
+
<span class="lines">${$.lines} lines</span>
|
|
240
|
+
${C}
|
|
241
|
+
${k}
|
|
242
|
+
${d}
|
|
243
|
+
<div class="location">${$.filePath.split("/").slice(-2).join("/")}</div>
|
|
244
|
+
`)}).on("mousemove",b=>{x.style("left",`${b.pageX+10}px`).style("top",`${b.pageY-10}px`)}).on("mouseout",()=>{x.style("display","none")}),A.on("click",(b,$)=>{if(x.style("display","none"),$.id!==e){Je(t,$.id),Jr($.id),hn(t,$.id),pn(t,$.id);const C=document.querySelector(`.symbol-item[data-symbol-id="${$.id}"]`);C&&C.scrollIntoView({block:"nearest"})}}),g.on("mouseover",(b,$)=>{const C=typeof $.source=="object"?$.source:f.get($.source),k=typeof $.target=="object"?$.target:f.get($.target);x.style("display","block").html(`
|
|
245
|
+
<div class="name">${(C==null?void 0:C.name)||$.source} → ${(k==null?void 0:k.name)||$.target}</div>
|
|
246
|
+
<div class="semantic">${$.semantic}</div>
|
|
247
|
+
`)}).on("mousemove",b=>{x.style("left",`${b.pageX+10}px`).style("top",`${b.pageY-10}px`)}).on("mouseout",()=>{x.style("display","none")});const N=m.append("g").attr("class","legend-inline").attr("transform",`translate(20, ${o-20})`);[...new Set(h.map(b=>b.kind))].sort().forEach((b,$)=>{const C=N.append("g").attr("transform",`translate(${$*90}, 0)`);C.append("circle").attr("r",5).attr("fill",_e(b)).attr("cy",-2),C.append("text").attr("x",10).attr("y",2).attr("font-size","10px").attr("fill","var(--text-muted)").text(b)}),J.on("tick",()=>{g.attr("x1",b=>b.source.x).attr("y1",b=>b.source.y).attr("x2",b=>b.target.x).attr("y2",b=>b.target.y),_.attr("x",b=>(b.source.x+b.target.x)/2).attr("y",b=>(b.source.y+b.target.y)/2),A.attr("transform",b=>`translate(${b.x},${b.y})`)});function I(b){b.active||J==null||J.alphaTarget(.3).restart(),b.subject.fx=b.subject.x,b.subject.fy=b.subject.y}function T(b){b.subject.fx=b.x,b.subject.fy=b.y}function D(b){b.active||J==null||J.alphaTarget(0),b.subject.id!==e&&(b.subject.fx=null,b.subject.fy=null)}}function ti(){F("#symbols-force-svg").selectAll("*").remove();const e=document.getElementById("symbols-detail");e&&e.classList.remove("visible");const n=document.querySelector(".symbols-main");if(n&&!n.querySelector(".symbols-placeholder")){const r=document.createElement("div");r.className="symbols-placeholder",r.textContent="Select a symbol to view its neighborhood graph",n.insertBefore(r,n.querySelector("svg"))}}function Ze(){J&&(J.stop(),J=null)}function st(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const wt=ni(),Ft=ei(),$u={symbols:vu,sunburst:hu,modules:ou,flows:Gc,interactions:iu,files:qc};let Ee="symbols";function Mu(){document.querySelectorAll(".view-btn").forEach(t=>{t.addEventListener("click",()=>{const e=t.dataset.view;e&&e!==Ee&&ku(e)})})}function ku(t){document.querySelectorAll(".view-btn").forEach(n=>{n.classList.toggle("active",n.dataset.view===t)});const e=document.getElementById("relationship-filters");e&&e.classList.toggle("visible",t==="sunburst"),Au(t),Ee=t,gn()}function Au(t){var r,i,s,a,l,u,o,c,p,f;const e=document.getElementById("stats");if(!e)return;const n=wt.getState();if(t==="modules"){const h=((r=n.modulesData)==null?void 0:r.stats.moduleCount)??((i=n.flowsDagData)==null?void 0:i.modules.length)??"-",w=((s=n.modulesData)==null?void 0:s.stats.assigned)??"-",y=((a=n.modulesData)==null?void 0:a.stats.unassigned)??"-";e.innerHTML=`
|
|
248
|
+
<span class="stat">Modules: <span class="stat-value" id="stat-modules">${h}</span></span>
|
|
249
|
+
<span class="stat">Assigned: <span class="stat-value annotated" id="stat-assigned">${w}</span></span>
|
|
250
|
+
<span class="stat">Unassigned: <span class="stat-value" id="stat-unassigned">${y}</span></span>
|
|
251
|
+
`}else if(t==="flows")e.innerHTML=`
|
|
252
|
+
<span class="stat">Flows: <span class="stat-value" id="stat-flows">${((l=n.flowsDagData)==null?void 0:l.flows.length)??"-"}</span></span>
|
|
253
|
+
<span class="stat">Modules: <span class="stat-value" id="stat-modules">${((u=n.flowsDagData)==null?void 0:u.modules.length)??"-"}</span></span>
|
|
254
|
+
`;else if(t==="interactions"){const h=n.interactionsData;h&&(e.innerHTML=`
|
|
255
|
+
<span class="stat">Interactions: <span class="stat-value">${h.stats.totalCount}</span></span>
|
|
256
|
+
<span class="stat">Business: <span class="stat-value annotated">${h.stats.businessCount}</span></span>
|
|
257
|
+
<span class="stat">Utility: <span class="stat-value">${h.stats.utilityCount}</span></span>
|
|
258
|
+
<span class="stat">Coverage: <span class="stat-value">${h.relationshipCoverage.coveragePercent.toFixed(0)}%</span></span>
|
|
259
|
+
`)}else if(t==="files"){const h=((o=n.graphData)==null?void 0:o.nodes)??[],w=new Set(h.map(m=>m.filePath)).size,y=h.reduce((m,g)=>m+g.lines,0);e.innerHTML=`
|
|
260
|
+
<span class="stat">Files: <span class="stat-value">${w}</span></span>
|
|
261
|
+
<span class="stat">Total Lines: <span class="stat-value annotated">${y.toLocaleString()}</span></span>
|
|
262
|
+
<span class="stat">Symbols: <span class="stat-value">${h.length}</span></span>
|
|
263
|
+
`}else e.innerHTML=`
|
|
264
|
+
<span class="stat">Symbols: <span class="stat-value" id="stat-symbols">${((c=n.graphData)==null?void 0:c.stats.totalSymbols)??"-"}</span></span>
|
|
265
|
+
<span class="stat">Annotated: <span class="stat-value annotated" id="stat-annotated">${((p=n.graphData)==null?void 0:p.stats.annotatedSymbols)??"-"}</span></span>
|
|
266
|
+
<span class="stat">Relationships: <span class="stat-value" id="stat-relationships">${((f=n.graphData)==null?void 0:f.stats.totalRelationships)??"-"}</span></span>
|
|
267
|
+
`}function gn(){const t=document.getElementById("graph-container");if(!t)return;t.innerHTML='<svg id="graph-svg"></svg>';const e=document.createElement("div");e.className="loading",e.id="loading",e.textContent="Loading...",t.appendChild(e);const n=$u[Ee];n&&n(wt,Ft)}async function Su(){try{const t=await Ft.getSymbolGraph();wt.setState({graphData:t}),document.getElementById("stat-symbols").textContent=String(t.stats.totalSymbols),document.getElementById("stat-annotated").textContent=String(t.stats.annotatedSymbols),document.getElementById("stat-relationships").textContent=String(t.stats.totalRelationships);const e=await Ft.getModules();wt.setState({modulesData:e});const n=await Ft.getFlowsDag();wt.setState({flowsDagData:n});const r=await Ft.getInteractions();wt.setState({interactionsData:r}),gn()}catch(t){console.error("Failed to load data:",t);const e=document.getElementById("loading");e&&(e.textContent="Failed to load data. Is the API server running?")}}function Eu(){document.querySelectorAll(".filter-chip").forEach(t=>{t.addEventListener("click",()=>{const e=t.dataset.type;e&&(document.querySelectorAll(".filter-chip").forEach(n=>{n.classList.remove("active"),n.classList.add("inactive")}),t.classList.remove("inactive"),t.classList.add("active"),wt.setState({selectedGrouping:e}),Ee==="sunburst"&&gn())})})}function ar(){Mu(),Eu(),Su()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ar):ar();
|
|
268
|
+
//# sourceMappingURL=index-DP3dRMlh.js.map
|