@legionworks/facet 1.9.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-APACHE +202 -0
- package/LICENSE-MIT +23 -0
- package/README.md +158 -0
- package/dist/gallery/chunk-4g8rem85.css +656 -0
- package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
- package/dist/gallery/frame/artifact.css +8424 -0
- package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
- package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
- package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
- package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
- package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
- package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
- package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
- package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
- package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
- package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
- package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
- package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
- package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
- package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
- package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
- package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
- package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
- package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
- package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
- package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
- package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
- package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
- package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
- package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
- package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
- package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
- package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
- package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
- package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
- package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
- package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
- package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
- package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
- package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
- package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
- package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
- package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
- package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
- package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
- package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
- package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
- package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
- package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
- package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
- package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
- package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
- package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
- package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
- package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
- package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
- package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
- package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
- package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
- package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
- package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
- package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
- package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
- package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
- package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
- package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
- package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
- package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
- package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
- package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
- package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
- package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
- package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
- package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
- package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
- package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
- package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
- package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
- package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
- package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
- package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
- package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
- package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
- package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
- package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
- package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
- package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
- package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
- package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
- package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
- package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
- package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
- package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
- package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
- package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
- package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
- package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
- package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
- package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
- package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
- package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
- package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
- package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
- package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
- package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
- package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
- package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
- package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
- package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
- package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
- package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
- package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
- package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
- package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
- package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
- package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
- package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
- package/dist/gallery/frame/frame.css +183 -0
- package/dist/gallery/frame/runtime/chart.js +42744 -0
- package/dist/gallery/frame/runtime/html.js +14 -0
- package/dist/gallery/frame/runtime/markdown.js +1403 -0
- package/dist/gallery/frame/runtime/mermaid.js +32 -0
- package/dist/gallery/frame/runtime/svg.js +14 -0
- package/dist/gallery/frame/runtime/tsx.js +52 -0
- package/dist/gallery/index.html +104 -0
- package/docs/reference/cli.md +163 -0
- package/docs/reference/export.md +106 -0
- package/docs/reference/html.md +215 -0
- package/docs/reference/http.md +85 -0
- package/docs/reference/mcp.md +78 -0
- package/docs/reference/security.md +119 -0
- package/docs/reference/storage.md +93 -0
- package/docs/reference/tsx.md +101 -0
- package/docs/reference/validation.md +212 -0
- package/package.json +89 -0
- package/scripts/build-gallery.ts +127 -0
- package/scripts/launch-netns.sh +67 -0
- package/skills/facet/SKILL.md +100 -0
- package/src/cli/client.ts +311 -0
- package/src/cli/commands/create.ts +49 -0
- package/src/cli/commands/doctor.ts +249 -0
- package/src/cli/commands/export.ts +179 -0
- package/src/cli/commands/instantiate.ts +35 -0
- package/src/cli/commands/list.ts +49 -0
- package/src/cli/commands/open.ts +75 -0
- package/src/cli/commands/pin.ts +39 -0
- package/src/cli/commands/promote.ts +49 -0
- package/src/cli/commands/publish.ts +122 -0
- package/src/cli/commands/read-back.ts +56 -0
- package/src/cli/commands/status.ts +114 -0
- package/src/cli/commands/watch.ts +146 -0
- package/src/cli/main.ts +522 -0
- package/src/cli/output.ts +106 -0
- package/src/cli/parser.ts +376 -0
- package/src/cli/presenter.ts +212 -0
- package/src/cli/service-metadata.ts +134 -0
- package/src/cli/spawn-service.ts +326 -0
- package/src/css.d.ts +4 -0
- package/src/gallery-web/app.ts +1581 -0
- package/src/gallery-web/export-menu.ts +121 -0
- package/src/gallery-web/export.ts +112 -0
- package/src/gallery-web/favicon.ts +54 -0
- package/src/gallery-web/frame/entries/chart.ts +6 -0
- package/src/gallery-web/frame/entries/html.ts +6 -0
- package/src/gallery-web/frame/entries/markdown.ts +6 -0
- package/src/gallery-web/frame/entries/mermaid.ts +6 -0
- package/src/gallery-web/frame/entries/svg.ts +6 -0
- package/src/gallery-web/frame/entries/tsx.ts +6 -0
- package/src/gallery-web/frame/frame-payload.ts +91 -0
- package/src/gallery-web/frame/renderer-validation.ts +13 -0
- package/src/gallery-web/frame/renderers/chart.ts +182 -0
- package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
- package/src/gallery-web/frame/renderers/html.ts +48 -0
- package/src/gallery-web/frame/renderers/markdown.ts +81 -0
- package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
- package/src/gallery-web/frame/renderers/registry.ts +260 -0
- package/src/gallery-web/frame/renderers/svg.ts +393 -0
- package/src/gallery-web/frame/renderers/tsx.ts +61 -0
- package/src/gallery-web/frame/runtime.ts +501 -0
- package/src/gallery-web/frame/styles/artifact.css +8424 -0
- package/src/gallery-web/frame/styles/frame.css +183 -0
- package/src/gallery-web/frame/styles/html-source.css +23 -0
- package/src/gallery-web/frame/view-box.ts +33 -0
- package/src/gallery-web/frame-html.ts +72 -0
- package/src/gallery-web/index.html +104 -0
- package/src/gallery-web/session.ts +107 -0
- package/src/gallery-web/sse-client.ts +212 -0
- package/src/gallery-web/styles/app.css +420 -0
- package/src/gallery-web/styles/tokens.css +112 -0
- package/src/gallery-web/styles/verdict.css +186 -0
- package/src/gallery-web/swap.ts +64 -0
- package/src/gallery-web/theme.ts +40 -0
- package/src/gallery-web/view-state.ts +93 -0
- package/src/harness-adapters/claude-code/README.md +10 -0
- package/src/harness-adapters/claude-code/facet.sh +4 -0
- package/src/harness-adapters/codex/README.md +10 -0
- package/src/harness-adapters/codex/facet.sh +4 -0
- package/src/harness-adapters/mcp/README.md +13 -0
- package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
- package/src/harness-adapters/mcp/main.ts +15 -0
- package/src/harness-adapters/mcp/server.ts +164 -0
- package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
- package/src/harness-adapters/opencode/README.md +10 -0
- package/src/harness-adapters/opencode/facet.sh +4 -0
- package/src/runtime/compiled-entrypoints.ts +69 -0
- package/src/service/dispatcher.ts +717 -0
- package/src/service/export.ts +218 -0
- package/src/service/http-utils.ts +55 -0
- package/src/service/lexical/expectations.ts +210 -0
- package/src/service/lifecycle/idle-controller.ts +125 -0
- package/src/service/lifecycle/orphan-cleanup.ts +128 -0
- package/src/service/lifecycle/process-lock.ts +235 -0
- package/src/service/main.ts +136 -0
- package/src/service/process.ts +240 -0
- package/src/service/router-guards.ts +239 -0
- package/src/service/router.ts +627 -0
- package/src/service/security/auth.ts +168 -0
- package/src/service/security/host-origin.ts +138 -0
- package/src/service/security/http-guards.ts +13 -0
- package/src/service/security/leases.ts +182 -0
- package/src/service/security/token-store.ts +138 -0
- package/src/service/server.ts +356 -0
- package/src/service/store/database.ts +61 -0
- package/src/service/store/evidence-retention.ts +234 -0
- package/src/service/store/migrations.ts +167 -0
- package/src/service/store/repository-lifecycle.ts +121 -0
- package/src/service/store/repository.ts +732 -0
- package/src/service/store/schema.ts +218 -0
- package/src/service/stored-verdict.ts +97 -0
- package/src/service/stream.ts +301 -0
- package/src/service/verdict-enrichment.ts +45 -0
- package/src/shared/build/frame-bundle-plugins.ts +61 -0
- package/src/shared/build-mode.ts +28 -0
- package/src/shared/config/evidence-read.ts +98 -0
- package/src/shared/config/limits.ts +56 -0
- package/src/shared/config/paths.ts +96 -0
- package/src/shared/contracts/artifact-types.ts +2 -0
- package/src/shared/contracts/artifact.ts +98 -0
- package/src/shared/contracts/commands/_shared.ts +59 -0
- package/src/shared/contracts/commands/guards.ts +86 -0
- package/src/shared/contracts/commands/index.ts +204 -0
- package/src/shared/contracts/commands/names.ts +35 -0
- package/src/shared/contracts/commands/requests.ts +149 -0
- package/src/shared/contracts/commands/results.ts +200 -0
- package/src/shared/contracts/envelope.ts +140 -0
- package/src/shared/contracts/events.ts +41 -0
- package/src/shared/contracts/observed-counts.ts +19 -0
- package/src/shared/contracts/renderers.ts +6 -0
- package/src/shared/contracts/validation.ts +296 -0
- package/src/shared/errors/facet-error.ts +127 -0
- package/src/shared/errors/store-error.ts +68 -0
- package/src/shared/evidence-image.ts +37 -0
- package/src/shared/export.ts +31 -0
- package/src/shared/html/policy.ts +108 -0
- package/src/shared/html/style-vocabulary.ts +352 -0
- package/src/shared/logging/logger.ts +108 -0
- package/src/shared/logging/redact.ts +49 -0
- package/src/shared/security/frozen-csp.ts +13 -0
- package/src/shared/storage-version.ts +2 -0
- package/src/shared/tsx/execution.ts +29 -0
- package/src/shared/tsx/import-policy.ts +94 -0
- package/src/shared/util/dir-permissions.ts +94 -0
- package/src/shared/util/mermaid-nodes.ts +230 -0
- package/src/shared/util/process.ts +67 -0
- package/src/shared/util/time.ts +21 -0
- package/src/shared/version.ts +3 -0
- package/src/validation/sandbox/limits.ts +41 -0
- package/src/validation/sandbox/netns.ts +177 -0
- package/src/validation/tier0/chart.ts +177 -0
- package/src/validation/tier0/dom-shim.ts +54 -0
- package/src/validation/tier0/html.ts +408 -0
- package/src/validation/tier0/markdown.ts +285 -0
- package/src/validation/tier0/mermaid.ts +98 -0
- package/src/validation/tier0/runner.ts +504 -0
- package/src/validation/tier0/svg.ts +321 -0
- package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
- package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
- package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
- package/src/validation/tier0/tsx/ast-policy.ts +181 -0
- package/src/validation/tier0/tsx/compiler.ts +156 -0
- package/src/validation/tier0/worker-dispatch.ts +211 -0
- package/src/validation/tier0/worker-entry.ts +96 -0
- package/src/validation/tier0/worker-input.ts +75 -0
- package/src/validation/tier1/browser-process.ts +147 -0
- package/src/validation/tier1/cdp-pipe.ts +281 -0
- package/src/validation/tier1/entries/chart.ts +5 -0
- package/src/validation/tier1/entries/html.ts +6 -0
- package/src/validation/tier1/entries/markdown.ts +5 -0
- package/src/validation/tier1/entries/mermaid.ts +5 -0
- package/src/validation/tier1/entries/svg.ts +5 -0
- package/src/validation/tier1/entries/tsx.ts +5 -0
- package/src/validation/tier1/frame-target.ts +162 -0
- package/src/validation/tier1/harness-entry.ts +261 -0
- package/src/validation/tier1/harness.ts +215 -0
- package/src/validation/tier1/isolated-probe.ts +94 -0
- package/src/validation/tier1/launcher.ts +177 -0
- package/src/validation/tier1/limits.ts +80 -0
- package/src/validation/tier1/nonce.ts +17 -0
- package/src/validation/tier1/protocol-probe.ts +519 -0
- package/src/validation/tier1/runner.ts +1122 -0
- package/src/validation/tier1/verdict.ts +246 -0
- package/src/validation/tier1/webp.ts +69 -0
- package/templates/README.md +88 -0
- package/templates/bar-compare.vl.json +63 -0
- package/templates/capacity-report.tsx +102 -0
- package/templates/decision-record.md +24 -0
- package/templates/deployment-state.mmd +40 -0
- package/templates/exemplar.md +91 -0
- package/templates/facet-story.tsx +799 -0
- package/templates/fleet-dashboard.html +141 -0
- package/templates/html-release-ledger.html +91 -0
- package/templates/html-status-report.html +114 -0
- package/templates/incident-console.tsx +147 -0
- package/templates/legion-boundaries.mmd +23 -0
- package/templates/legion-flow.mmd +15 -0
- package/templates/legion-sequence.mmd +14 -0
- package/templates/legion-state.mmd +7 -0
- package/templates/metric-card.svg +29 -0
- package/templates/observability-map.svg +101 -0
- package/templates/pipeline-audit.md +108 -0
- package/templates/release-metrics.vl.json +98 -0
- package/templates/service-topology.mmd +47 -0
- package/templates/status-report.md +32 -0
- package/templates/system-map.svg +53 -0
- package/templates/timeseries.vl.json +71 -0
- package/templates/tsx-interactive-counter.tsx +19 -0
- package/templates/tsx-status-report.tsx +31 -0
|
@@ -0,0 +1,1149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_dist
|
|
3
|
+
} from "./markdown-pzgd8z3s.js";
|
|
4
|
+
import {
|
|
5
|
+
assignWithDepth_default,
|
|
6
|
+
common_default,
|
|
7
|
+
detectType,
|
|
8
|
+
directiveRegex,
|
|
9
|
+
sanitizeDirective
|
|
10
|
+
} from "./markdown-92n37gd4.js";
|
|
11
|
+
import {
|
|
12
|
+
log,
|
|
13
|
+
select_default
|
|
14
|
+
} from "./markdown-xw8dsk8b.js";
|
|
15
|
+
import {
|
|
16
|
+
__name
|
|
17
|
+
} from "./markdown-1s5vwkf2.js";
|
|
18
|
+
import {
|
|
19
|
+
basisClosed_default,
|
|
20
|
+
basisOpen_default,
|
|
21
|
+
basis_default,
|
|
22
|
+
bumpX,
|
|
23
|
+
bumpY,
|
|
24
|
+
bundle_default,
|
|
25
|
+
cardinalClosed_default,
|
|
26
|
+
cardinalOpen_default,
|
|
27
|
+
cardinal_default,
|
|
28
|
+
catmullRomClosed_default,
|
|
29
|
+
catmullRomOpen_default,
|
|
30
|
+
catmullRom_default,
|
|
31
|
+
linearClosed_default,
|
|
32
|
+
linear_default,
|
|
33
|
+
monotoneX,
|
|
34
|
+
monotoneY,
|
|
35
|
+
natural_default,
|
|
36
|
+
stepAfter,
|
|
37
|
+
stepBefore,
|
|
38
|
+
step_default
|
|
39
|
+
} from "./markdown-dy5sgjhc.js";
|
|
40
|
+
import {
|
|
41
|
+
__toESM
|
|
42
|
+
} from "./markdown-809k7q41.js";
|
|
43
|
+
|
|
44
|
+
// node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
|
|
45
|
+
function isPrimitive(value) {
|
|
46
|
+
return value == null || typeof value !== "object" && typeof value !== "function";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
50
|
+
function getTag(value) {
|
|
51
|
+
if (value == null)
|
|
52
|
+
return value === undefined ? "[object Undefined]" : "[object Null]";
|
|
53
|
+
return Object.prototype.toString.call(value);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
57
|
+
var regexpTag = "[object RegExp]";
|
|
58
|
+
var stringTag = "[object String]";
|
|
59
|
+
var numberTag = "[object Number]";
|
|
60
|
+
var booleanTag = "[object Boolean]";
|
|
61
|
+
var argumentsTag = "[object Arguments]";
|
|
62
|
+
var symbolTag = "[object Symbol]";
|
|
63
|
+
var dateTag = "[object Date]";
|
|
64
|
+
var mapTag = "[object Map]";
|
|
65
|
+
var setTag = "[object Set]";
|
|
66
|
+
var arrayTag = "[object Array]";
|
|
67
|
+
var arrayBufferTag = "[object ArrayBuffer]";
|
|
68
|
+
var objectTag = "[object Object]";
|
|
69
|
+
var dataViewTag = "[object DataView]";
|
|
70
|
+
var uint8ArrayTag = "[object Uint8Array]";
|
|
71
|
+
var uint8ClampedArrayTag = "[object Uint8ClampedArray]";
|
|
72
|
+
var uint16ArrayTag = "[object Uint16Array]";
|
|
73
|
+
var uint32ArrayTag = "[object Uint32Array]";
|
|
74
|
+
var int8ArrayTag = "[object Int8Array]";
|
|
75
|
+
var int16ArrayTag = "[object Int16Array]";
|
|
76
|
+
var int32ArrayTag = "[object Int32Array]";
|
|
77
|
+
var float32ArrayTag = "[object Float32Array]";
|
|
78
|
+
var float64ArrayTag = "[object Float64Array]";
|
|
79
|
+
|
|
80
|
+
// node_modules/es-toolkit/dist/compat/predicate/isArray.mjs
|
|
81
|
+
function isArray(value) {
|
|
82
|
+
return Array.isArray(value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
86
|
+
function isTypedArray(x) {
|
|
87
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs
|
|
91
|
+
function isTypedArray2(x) {
|
|
92
|
+
return isTypedArray(x);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// node_modules/es-toolkit/dist/compat/object/clone.mjs
|
|
96
|
+
function clone(obj) {
|
|
97
|
+
if (isPrimitive(obj))
|
|
98
|
+
return obj;
|
|
99
|
+
const tag = getTag(obj);
|
|
100
|
+
if (!isCloneableObject(obj))
|
|
101
|
+
return {};
|
|
102
|
+
if (isArray(obj)) {
|
|
103
|
+
const result2 = Array.from(obj);
|
|
104
|
+
if (obj.length > 0 && typeof obj[0] === "string" && Object.hasOwn(obj, "index")) {
|
|
105
|
+
result2.index = obj.index;
|
|
106
|
+
result2.input = obj.input;
|
|
107
|
+
}
|
|
108
|
+
return result2;
|
|
109
|
+
}
|
|
110
|
+
if (isTypedArray2(obj)) {
|
|
111
|
+
const typedArray = obj;
|
|
112
|
+
const Ctor = typedArray.constructor;
|
|
113
|
+
return new Ctor(typedArray.buffer, typedArray.byteOffset, typedArray.length);
|
|
114
|
+
}
|
|
115
|
+
if (tag === "[object ArrayBuffer]")
|
|
116
|
+
return new ArrayBuffer(obj.byteLength);
|
|
117
|
+
if (tag === "[object DataView]") {
|
|
118
|
+
const dataView = obj;
|
|
119
|
+
const buffer = dataView.buffer;
|
|
120
|
+
const byteOffset = dataView.byteOffset;
|
|
121
|
+
const byteLength = dataView.byteLength;
|
|
122
|
+
const clonedBuffer = new ArrayBuffer(byteLength);
|
|
123
|
+
const srcView = new Uint8Array(buffer, byteOffset, byteLength);
|
|
124
|
+
new Uint8Array(clonedBuffer).set(srcView);
|
|
125
|
+
return new DataView(clonedBuffer);
|
|
126
|
+
}
|
|
127
|
+
if (tag === "[object Boolean]" || tag === "[object Number]" || tag === "[object String]") {
|
|
128
|
+
const Ctor = obj.constructor;
|
|
129
|
+
const clone2 = new Ctor(obj.valueOf());
|
|
130
|
+
if (tag === "[object String]")
|
|
131
|
+
cloneStringObjectProperties(clone2, obj);
|
|
132
|
+
else
|
|
133
|
+
copyOwnProperties(clone2, obj);
|
|
134
|
+
return clone2;
|
|
135
|
+
}
|
|
136
|
+
if (tag === "[object Date]")
|
|
137
|
+
return new Date(Number(obj));
|
|
138
|
+
if (tag === "[object RegExp]") {
|
|
139
|
+
const regExp = obj;
|
|
140
|
+
const clone2 = new RegExp(regExp.source, regExp.flags);
|
|
141
|
+
clone2.lastIndex = regExp.lastIndex;
|
|
142
|
+
return clone2;
|
|
143
|
+
}
|
|
144
|
+
if (tag === "[object Symbol]")
|
|
145
|
+
return Object(Symbol.prototype.valueOf.call(obj));
|
|
146
|
+
if (tag === "[object Map]") {
|
|
147
|
+
const map = obj;
|
|
148
|
+
const result2 = /* @__PURE__ */ new Map;
|
|
149
|
+
map.forEach((obj2, key) => {
|
|
150
|
+
result2.set(key, obj2);
|
|
151
|
+
});
|
|
152
|
+
return result2;
|
|
153
|
+
}
|
|
154
|
+
if (tag === "[object Set]") {
|
|
155
|
+
const set = obj;
|
|
156
|
+
const result2 = /* @__PURE__ */ new Set;
|
|
157
|
+
set.forEach((obj2) => {
|
|
158
|
+
result2.add(obj2);
|
|
159
|
+
});
|
|
160
|
+
return result2;
|
|
161
|
+
}
|
|
162
|
+
if (tag === "[object Arguments]") {
|
|
163
|
+
const args = obj;
|
|
164
|
+
const result2 = {};
|
|
165
|
+
copyOwnProperties(result2, args);
|
|
166
|
+
result2.length = args.length;
|
|
167
|
+
result2[Symbol.iterator] = args[Symbol.iterator];
|
|
168
|
+
return result2;
|
|
169
|
+
}
|
|
170
|
+
const result = {};
|
|
171
|
+
copyPrototype(result, obj);
|
|
172
|
+
copyOwnProperties(result, obj);
|
|
173
|
+
copySymbolProperties(result, obj);
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
function isCloneableObject(object) {
|
|
177
|
+
switch (getTag(object)) {
|
|
178
|
+
case argumentsTag:
|
|
179
|
+
case arrayTag:
|
|
180
|
+
case arrayBufferTag:
|
|
181
|
+
case dataViewTag:
|
|
182
|
+
case booleanTag:
|
|
183
|
+
case dateTag:
|
|
184
|
+
case float32ArrayTag:
|
|
185
|
+
case float64ArrayTag:
|
|
186
|
+
case int8ArrayTag:
|
|
187
|
+
case int16ArrayTag:
|
|
188
|
+
case int32ArrayTag:
|
|
189
|
+
case mapTag:
|
|
190
|
+
case numberTag:
|
|
191
|
+
case objectTag:
|
|
192
|
+
case regexpTag:
|
|
193
|
+
case setTag:
|
|
194
|
+
case stringTag:
|
|
195
|
+
case symbolTag:
|
|
196
|
+
case uint8ArrayTag:
|
|
197
|
+
case uint8ClampedArrayTag:
|
|
198
|
+
case uint16ArrayTag:
|
|
199
|
+
case uint32ArrayTag:
|
|
200
|
+
return true;
|
|
201
|
+
default:
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function copyOwnProperties(target, source) {
|
|
206
|
+
for (const key in source)
|
|
207
|
+
if (Object.hasOwn(source, key))
|
|
208
|
+
target[key] = source[key];
|
|
209
|
+
}
|
|
210
|
+
function copySymbolProperties(target, source) {
|
|
211
|
+
const symbols = Object.getOwnPropertySymbols(source);
|
|
212
|
+
for (let i = 0;i < symbols.length; i++) {
|
|
213
|
+
const symbol = symbols[i];
|
|
214
|
+
if (Object.prototype.propertyIsEnumerable.call(source, symbol))
|
|
215
|
+
target[symbol] = source[symbol];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function cloneStringObjectProperties(target, source) {
|
|
219
|
+
const stringLength = source.valueOf().length;
|
|
220
|
+
for (const key in source)
|
|
221
|
+
if (Object.hasOwn(source, key) && (Number.isNaN(Number(key)) || Number(key) >= stringLength))
|
|
222
|
+
target[key] = source[key];
|
|
223
|
+
}
|
|
224
|
+
function copyPrototype(target, source) {
|
|
225
|
+
const proto = Object.getPrototypeOf(source);
|
|
226
|
+
if (proto !== null) {
|
|
227
|
+
if (typeof source.constructor === "function")
|
|
228
|
+
Object.setPrototypeOf(target, proto);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// node_modules/es-toolkit/dist/compat/function/memoize.mjs
|
|
232
|
+
function memoize(func, resolver) {
|
|
233
|
+
if (typeof func !== "function" || resolver != null && typeof resolver !== "function")
|
|
234
|
+
throw new TypeError("Expected a function");
|
|
235
|
+
const memoized = function(...args) {
|
|
236
|
+
const key = resolver ? resolver.apply(this, args) : args[0];
|
|
237
|
+
const cache = memoized.cache;
|
|
238
|
+
if (cache.has(key))
|
|
239
|
+
return cache.get(key);
|
|
240
|
+
const result = func.apply(this, args);
|
|
241
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
242
|
+
return result;
|
|
243
|
+
};
|
|
244
|
+
memoized.cache = new (memoize.Cache || Map);
|
|
245
|
+
return memoized;
|
|
246
|
+
}
|
|
247
|
+
memoize.Cache = Map;
|
|
248
|
+
// node_modules/es-toolkit/dist/function/noop.mjs
|
|
249
|
+
function noop() {}
|
|
250
|
+
|
|
251
|
+
// node_modules/es-toolkit/dist/object/clone.mjs
|
|
252
|
+
function clone2(obj) {
|
|
253
|
+
if (isPrimitive(obj))
|
|
254
|
+
return obj;
|
|
255
|
+
if (Array.isArray(obj) || isTypedArray(obj) || obj instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && obj instanceof SharedArrayBuffer)
|
|
256
|
+
return obj.slice(0);
|
|
257
|
+
const prototype = Object.getPrototypeOf(obj);
|
|
258
|
+
if (prototype == null)
|
|
259
|
+
return Object.assign(Object.create(prototype), obj);
|
|
260
|
+
const Constructor = prototype.constructor;
|
|
261
|
+
if (obj instanceof Date || obj instanceof Map || obj instanceof Set)
|
|
262
|
+
return new Constructor(obj);
|
|
263
|
+
if (obj instanceof RegExp) {
|
|
264
|
+
const newRegExp = new Constructor(obj);
|
|
265
|
+
newRegExp.lastIndex = obj.lastIndex;
|
|
266
|
+
return newRegExp;
|
|
267
|
+
}
|
|
268
|
+
if (obj instanceof DataView)
|
|
269
|
+
return new Constructor(obj.buffer.slice(0));
|
|
270
|
+
if (obj instanceof Error) {
|
|
271
|
+
let newError;
|
|
272
|
+
if (obj instanceof AggregateError)
|
|
273
|
+
newError = new Constructor(obj.errors, obj.message, { cause: obj.cause });
|
|
274
|
+
else
|
|
275
|
+
newError = new Constructor(obj.message, { cause: obj.cause });
|
|
276
|
+
newError.stack = obj.stack;
|
|
277
|
+
Object.assign(newError, obj);
|
|
278
|
+
return newError;
|
|
279
|
+
}
|
|
280
|
+
if (typeof File !== "undefined" && obj instanceof File)
|
|
281
|
+
return new Constructor([obj], obj.name, {
|
|
282
|
+
type: obj.type,
|
|
283
|
+
lastModified: obj.lastModified
|
|
284
|
+
});
|
|
285
|
+
if (typeof obj === "object")
|
|
286
|
+
return Object.assign(Object.create(prototype), obj);
|
|
287
|
+
return obj;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
291
|
+
function getSymbols(object) {
|
|
292
|
+
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// node_modules/es-toolkit/dist/_internal/globalThis.mjs
|
|
296
|
+
var globalThis_ = typeof globalThis === "object" && globalThis || typeof window === "object" && window || typeof self === "object" && self || typeof global === "object" && global || function() {
|
|
297
|
+
return this;
|
|
298
|
+
}();
|
|
299
|
+
|
|
300
|
+
// node_modules/es-toolkit/dist/predicate/isBuffer.mjs
|
|
301
|
+
function isBuffer(x) {
|
|
302
|
+
return typeof globalThis_.Buffer !== "undefined" && globalThis_.Buffer.isBuffer(x);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
306
|
+
function isUnsafeProperty(key) {
|
|
307
|
+
return key === "__proto__";
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// node_modules/es-toolkit/dist/compat/predicate/isPlainObject.mjs
|
|
311
|
+
function isPlainObject(object) {
|
|
312
|
+
if (typeof object !== "object")
|
|
313
|
+
return false;
|
|
314
|
+
if (object == null)
|
|
315
|
+
return false;
|
|
316
|
+
if (Object.getPrototypeOf(object) === null)
|
|
317
|
+
return true;
|
|
318
|
+
if (Object.prototype.toString.call(object) !== "[object Object]") {
|
|
319
|
+
const tag = object[Symbol.toStringTag];
|
|
320
|
+
if (tag == null)
|
|
321
|
+
return false;
|
|
322
|
+
if (!Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable)
|
|
323
|
+
return false;
|
|
324
|
+
return object.toString() === `[object ${tag}]`;
|
|
325
|
+
}
|
|
326
|
+
let proto = object;
|
|
327
|
+
while (Object.getPrototypeOf(proto) !== null)
|
|
328
|
+
proto = Object.getPrototypeOf(proto);
|
|
329
|
+
return Object.getPrototypeOf(object) === proto;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
|
|
333
|
+
function cloneDeepWith(obj, cloneValue) {
|
|
334
|
+
return cloneDeepWithImpl(obj, undefined, obj, /* @__PURE__ */ new Map, cloneValue);
|
|
335
|
+
}
|
|
336
|
+
function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map, cloneValue = undefined) {
|
|
337
|
+
const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
|
|
338
|
+
if (cloned !== undefined)
|
|
339
|
+
return cloned;
|
|
340
|
+
if (isPrimitive(valueToClone))
|
|
341
|
+
return valueToClone;
|
|
342
|
+
if (stack.has(valueToClone))
|
|
343
|
+
return stack.get(valueToClone);
|
|
344
|
+
if (Array.isArray(valueToClone)) {
|
|
345
|
+
const result = new Array(valueToClone.length);
|
|
346
|
+
stack.set(valueToClone, result);
|
|
347
|
+
for (let i = 0;i < valueToClone.length; i++)
|
|
348
|
+
result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
349
|
+
if (Object.hasOwn(valueToClone, "index"))
|
|
350
|
+
result.index = valueToClone.index;
|
|
351
|
+
if (Object.hasOwn(valueToClone, "input"))
|
|
352
|
+
result.input = valueToClone.input;
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
355
|
+
if (valueToClone instanceof Date)
|
|
356
|
+
return new Date(valueToClone.getTime());
|
|
357
|
+
if (valueToClone instanceof RegExp) {
|
|
358
|
+
const result = new RegExp(valueToClone.source, valueToClone.flags);
|
|
359
|
+
result.lastIndex = valueToClone.lastIndex;
|
|
360
|
+
return result;
|
|
361
|
+
}
|
|
362
|
+
if (valueToClone instanceof Map) {
|
|
363
|
+
const result = /* @__PURE__ */ new Map;
|
|
364
|
+
stack.set(valueToClone, result);
|
|
365
|
+
for (const [key, value] of valueToClone)
|
|
366
|
+
result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
if (valueToClone instanceof Set) {
|
|
370
|
+
const result = /* @__PURE__ */ new Set;
|
|
371
|
+
stack.set(valueToClone, result);
|
|
372
|
+
for (const value of valueToClone)
|
|
373
|
+
result.add(cloneDeepWithImpl(value, undefined, objectToClone, stack, cloneValue));
|
|
374
|
+
return result;
|
|
375
|
+
}
|
|
376
|
+
if (isBuffer(valueToClone))
|
|
377
|
+
return valueToClone.subarray();
|
|
378
|
+
if (isTypedArray(valueToClone)) {
|
|
379
|
+
const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
|
|
380
|
+
stack.set(valueToClone, result);
|
|
381
|
+
for (let i = 0;i < valueToClone.length; i++)
|
|
382
|
+
result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
383
|
+
return result;
|
|
384
|
+
}
|
|
385
|
+
if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && valueToClone instanceof SharedArrayBuffer)
|
|
386
|
+
return valueToClone.slice(0);
|
|
387
|
+
if (valueToClone instanceof DataView) {
|
|
388
|
+
const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
|
|
389
|
+
stack.set(valueToClone, result);
|
|
390
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
391
|
+
return result;
|
|
392
|
+
}
|
|
393
|
+
if (typeof File !== "undefined" && valueToClone instanceof File) {
|
|
394
|
+
const result = new File([valueToClone], valueToClone.name, { type: valueToClone.type });
|
|
395
|
+
stack.set(valueToClone, result);
|
|
396
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
if (typeof Blob !== "undefined" && valueToClone instanceof Blob) {
|
|
400
|
+
const result = new Blob([valueToClone], { type: valueToClone.type });
|
|
401
|
+
stack.set(valueToClone, result);
|
|
402
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
403
|
+
return result;
|
|
404
|
+
}
|
|
405
|
+
if (valueToClone instanceof Error) {
|
|
406
|
+
const result = structuredClone(valueToClone);
|
|
407
|
+
stack.set(valueToClone, result);
|
|
408
|
+
result.message = valueToClone.message;
|
|
409
|
+
result.name = valueToClone.name;
|
|
410
|
+
result.stack = valueToClone.stack;
|
|
411
|
+
result.cause = valueToClone.cause;
|
|
412
|
+
result.constructor = valueToClone.constructor;
|
|
413
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
if (valueToClone instanceof Boolean) {
|
|
417
|
+
const result = new Boolean(valueToClone.valueOf());
|
|
418
|
+
stack.set(valueToClone, result);
|
|
419
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
420
|
+
return result;
|
|
421
|
+
}
|
|
422
|
+
if (valueToClone instanceof Number) {
|
|
423
|
+
const result = new Number(valueToClone.valueOf());
|
|
424
|
+
stack.set(valueToClone, result);
|
|
425
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
426
|
+
return result;
|
|
427
|
+
}
|
|
428
|
+
if (valueToClone instanceof String) {
|
|
429
|
+
const result = new String(valueToClone.valueOf());
|
|
430
|
+
stack.set(valueToClone, result);
|
|
431
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
432
|
+
return result;
|
|
433
|
+
}
|
|
434
|
+
if (typeof valueToClone === "object" && isCloneableObject2(valueToClone)) {
|
|
435
|
+
const result = Object.create(Object.getPrototypeOf(valueToClone));
|
|
436
|
+
stack.set(valueToClone, result);
|
|
437
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
438
|
+
return result;
|
|
439
|
+
}
|
|
440
|
+
return valueToClone;
|
|
441
|
+
}
|
|
442
|
+
function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
|
|
443
|
+
const keys = [...Object.keys(source), ...getSymbols(source)];
|
|
444
|
+
for (let i = 0;i < keys.length; i++) {
|
|
445
|
+
const key = keys[i];
|
|
446
|
+
const descriptor = Object.getOwnPropertyDescriptor(target, key);
|
|
447
|
+
if (descriptor == null || descriptor.writable)
|
|
448
|
+
target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function isCloneableObject2(object) {
|
|
452
|
+
switch (getTag(object)) {
|
|
453
|
+
case argumentsTag:
|
|
454
|
+
case arrayTag:
|
|
455
|
+
case arrayBufferTag:
|
|
456
|
+
case dataViewTag:
|
|
457
|
+
case booleanTag:
|
|
458
|
+
case dateTag:
|
|
459
|
+
case float32ArrayTag:
|
|
460
|
+
case float64ArrayTag:
|
|
461
|
+
case int8ArrayTag:
|
|
462
|
+
case int16ArrayTag:
|
|
463
|
+
case int32ArrayTag:
|
|
464
|
+
case mapTag:
|
|
465
|
+
case numberTag:
|
|
466
|
+
case objectTag:
|
|
467
|
+
case regexpTag:
|
|
468
|
+
case setTag:
|
|
469
|
+
case stringTag:
|
|
470
|
+
case symbolTag:
|
|
471
|
+
case uint8ArrayTag:
|
|
472
|
+
case uint8ClampedArrayTag:
|
|
473
|
+
case uint16ArrayTag:
|
|
474
|
+
case uint32ArrayTag:
|
|
475
|
+
return true;
|
|
476
|
+
default:
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs
|
|
482
|
+
function cloneDeepWith2(obj, customizer) {
|
|
483
|
+
return cloneDeepWith(obj, (value, key, object, stack) => {
|
|
484
|
+
const cloned = customizer?.(value, key, object, stack);
|
|
485
|
+
if (cloned !== undefined)
|
|
486
|
+
return cloned;
|
|
487
|
+
if (typeof obj !== "object")
|
|
488
|
+
return;
|
|
489
|
+
if (getTag(obj) === "[object Object]" && typeof obj.constructor !== "function") {
|
|
490
|
+
const result = {};
|
|
491
|
+
stack.set(obj, result);
|
|
492
|
+
copyProperties(result, obj, object, stack);
|
|
493
|
+
return result;
|
|
494
|
+
}
|
|
495
|
+
switch (Object.prototype.toString.call(obj)) {
|
|
496
|
+
case numberTag:
|
|
497
|
+
case stringTag:
|
|
498
|
+
case booleanTag: {
|
|
499
|
+
const result = new obj.constructor(obj?.valueOf());
|
|
500
|
+
copyProperties(result, obj);
|
|
501
|
+
return result;
|
|
502
|
+
}
|
|
503
|
+
case argumentsTag: {
|
|
504
|
+
const result = {};
|
|
505
|
+
copyProperties(result, obj);
|
|
506
|
+
result.length = obj.length;
|
|
507
|
+
result[Symbol.iterator] = obj[Symbol.iterator];
|
|
508
|
+
return result;
|
|
509
|
+
}
|
|
510
|
+
default:
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs
|
|
517
|
+
function cloneDeep(obj) {
|
|
518
|
+
return cloneDeepWith2(obj);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs
|
|
522
|
+
function isArguments(value) {
|
|
523
|
+
return value !== null && typeof value === "object" && getTag(value) === "[object Arguments]";
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs
|
|
527
|
+
function isObjectLike(value) {
|
|
528
|
+
return typeof value === "object" && value !== null;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// node_modules/es-toolkit/dist/predicate/isLength.mjs
|
|
532
|
+
function isLength(value) {
|
|
533
|
+
return Number.isSafeInteger(value) && value >= 0;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
|
|
537
|
+
function isArrayLike(value) {
|
|
538
|
+
return value != null && typeof value !== "function" && isLength(value.length);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.mjs
|
|
542
|
+
function isArrayLikeObject(value) {
|
|
543
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// node_modules/es-toolkit/dist/compat/object/mergeWith.mjs
|
|
547
|
+
function mergeWith(object, ...otherArgs) {
|
|
548
|
+
const sources = otherArgs.slice(0, -1);
|
|
549
|
+
const merge = otherArgs[otherArgs.length - 1];
|
|
550
|
+
let result = object;
|
|
551
|
+
for (let i = 0;i < sources.length; i++) {
|
|
552
|
+
const source = sources[i];
|
|
553
|
+
result = mergeWithDeep(result, source, merge, /* @__PURE__ */ new Map);
|
|
554
|
+
}
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
function mergeWithDeep(target, source, merge, stack) {
|
|
558
|
+
if (isPrimitive(target))
|
|
559
|
+
target = Object(target);
|
|
560
|
+
if (source == null || typeof source !== "object")
|
|
561
|
+
return target;
|
|
562
|
+
if (stack.has(source))
|
|
563
|
+
return clone2(stack.get(source));
|
|
564
|
+
stack.set(source, target);
|
|
565
|
+
if (Array.isArray(source)) {
|
|
566
|
+
source = source.slice();
|
|
567
|
+
for (let i = 0;i < source.length; i++)
|
|
568
|
+
source[i] = source[i] ?? undefined;
|
|
569
|
+
}
|
|
570
|
+
const sourceKeys = [...Object.keys(source), ...getSymbols(source)];
|
|
571
|
+
for (let i = 0;i < sourceKeys.length; i++) {
|
|
572
|
+
const key = sourceKeys[i];
|
|
573
|
+
if (isUnsafeProperty(key))
|
|
574
|
+
continue;
|
|
575
|
+
let sourceValue = source[key];
|
|
576
|
+
let targetValue = target[key];
|
|
577
|
+
if (isArguments(sourceValue))
|
|
578
|
+
sourceValue = { ...sourceValue };
|
|
579
|
+
if (isArguments(targetValue))
|
|
580
|
+
targetValue = { ...targetValue };
|
|
581
|
+
if (isBuffer(sourceValue))
|
|
582
|
+
sourceValue = cloneDeep(sourceValue);
|
|
583
|
+
if (Array.isArray(sourceValue))
|
|
584
|
+
if (Array.isArray(targetValue)) {
|
|
585
|
+
const cloned = [];
|
|
586
|
+
const targetKeys = Reflect.ownKeys(targetValue);
|
|
587
|
+
for (let i2 = 0;i2 < targetKeys.length; i2++) {
|
|
588
|
+
const targetKey = targetKeys[i2];
|
|
589
|
+
cloned[targetKey] = targetValue[targetKey];
|
|
590
|
+
}
|
|
591
|
+
targetValue = cloned;
|
|
592
|
+
} else if (isArrayLikeObject(targetValue)) {
|
|
593
|
+
const cloned = [];
|
|
594
|
+
for (let i2 = 0;i2 < targetValue.length; i2++)
|
|
595
|
+
cloned[i2] = targetValue[i2];
|
|
596
|
+
targetValue = cloned;
|
|
597
|
+
} else
|
|
598
|
+
targetValue = [];
|
|
599
|
+
const merged = merge(targetValue, sourceValue, key, target, source, stack);
|
|
600
|
+
if (merged !== undefined)
|
|
601
|
+
target[key] = merged;
|
|
602
|
+
else if (Array.isArray(sourceValue))
|
|
603
|
+
target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
|
|
604
|
+
else if (isObjectLike(targetValue) && isObjectLike(sourceValue) && (isPlainObject(targetValue) || isPlainObject(sourceValue) || isTypedArray2(targetValue) || isTypedArray2(sourceValue)))
|
|
605
|
+
target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
|
|
606
|
+
else if (targetValue == null && isPlainObject(sourceValue))
|
|
607
|
+
target[key] = mergeWithDeep({}, sourceValue, merge, stack);
|
|
608
|
+
else if (targetValue == null && isTypedArray2(sourceValue))
|
|
609
|
+
target[key] = cloneDeep(sourceValue);
|
|
610
|
+
else if (targetValue === undefined || sourceValue !== undefined)
|
|
611
|
+
target[key] = sourceValue;
|
|
612
|
+
}
|
|
613
|
+
return target;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// node_modules/es-toolkit/dist/compat/object/merge.mjs
|
|
617
|
+
function merge(object, ...sources) {
|
|
618
|
+
return mergeWith(object, ...sources, noop);
|
|
619
|
+
}
|
|
620
|
+
// node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs
|
|
621
|
+
function isPrototype(value) {
|
|
622
|
+
const constructor = value?.constructor;
|
|
623
|
+
return value === (typeof constructor === "function" ? constructor.prototype : Object.prototype);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs
|
|
627
|
+
function isEmpty(value) {
|
|
628
|
+
if (value == null)
|
|
629
|
+
return true;
|
|
630
|
+
if (isArrayLike(value)) {
|
|
631
|
+
if (typeof value.splice !== "function" && typeof value !== "string" && !isBuffer(value) && !isTypedArray2(value) && !isArguments(value))
|
|
632
|
+
return false;
|
|
633
|
+
return value.length === 0;
|
|
634
|
+
}
|
|
635
|
+
if (typeof value === "object" || typeof value === "function") {
|
|
636
|
+
if (value instanceof Map || value instanceof Set)
|
|
637
|
+
return value.size === 0;
|
|
638
|
+
const keys = Object.keys(value);
|
|
639
|
+
if (isPrototype(value))
|
|
640
|
+
return keys.filter((x) => x !== "constructor").length === 0;
|
|
641
|
+
return keys.length === 0;
|
|
642
|
+
}
|
|
643
|
+
return true;
|
|
644
|
+
}
|
|
645
|
+
// node_modules/mermaid/dist/chunks/mermaid.core/chunk-NSK5VX7P.mjs
|
|
646
|
+
var import_sanitize_url = __toESM(require_dist(), 1);
|
|
647
|
+
var ZERO_WIDTH_SPACE = "";
|
|
648
|
+
var d3CurveTypes = {
|
|
649
|
+
curveBasis: basis_default,
|
|
650
|
+
curveBasisClosed: basisClosed_default,
|
|
651
|
+
curveBasisOpen: basisOpen_default,
|
|
652
|
+
curveBumpX: bumpX,
|
|
653
|
+
curveBumpY: bumpY,
|
|
654
|
+
curveBundle: bundle_default,
|
|
655
|
+
curveCardinalClosed: cardinalClosed_default,
|
|
656
|
+
curveCardinalOpen: cardinalOpen_default,
|
|
657
|
+
curveCardinal: cardinal_default,
|
|
658
|
+
curveCatmullRomClosed: catmullRomClosed_default,
|
|
659
|
+
curveCatmullRomOpen: catmullRomOpen_default,
|
|
660
|
+
curveCatmullRom: catmullRom_default,
|
|
661
|
+
curveLinear: linear_default,
|
|
662
|
+
curveLinearClosed: linearClosed_default,
|
|
663
|
+
curveMonotoneX: monotoneX,
|
|
664
|
+
curveMonotoneY: monotoneY,
|
|
665
|
+
curveNatural: natural_default,
|
|
666
|
+
curveStep: step_default,
|
|
667
|
+
curveStepAfter: stepAfter,
|
|
668
|
+
curveStepBefore: stepBefore
|
|
669
|
+
};
|
|
670
|
+
var directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
|
671
|
+
var detectInit = /* @__PURE__ */ __name(function(text, config) {
|
|
672
|
+
const inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/);
|
|
673
|
+
let results = {};
|
|
674
|
+
if (Array.isArray(inits)) {
|
|
675
|
+
const args = inits.map((init) => init.args);
|
|
676
|
+
sanitizeDirective(args);
|
|
677
|
+
results = assignWithDepth_default(results, [...args]);
|
|
678
|
+
} else {
|
|
679
|
+
results = inits.args;
|
|
680
|
+
}
|
|
681
|
+
if (!results) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
let type = detectType(text, config);
|
|
685
|
+
const prop = "config";
|
|
686
|
+
if (results[prop] !== undefined) {
|
|
687
|
+
if (type === "flowchart-v2") {
|
|
688
|
+
type = "flowchart";
|
|
689
|
+
}
|
|
690
|
+
results[type] = results[prop];
|
|
691
|
+
delete results[prop];
|
|
692
|
+
}
|
|
693
|
+
return results;
|
|
694
|
+
}, "detectInit");
|
|
695
|
+
var detectDirective = /* @__PURE__ */ __name(function(text, type = null) {
|
|
696
|
+
try {
|
|
697
|
+
const commentWithoutDirectives = new RegExp(`[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
|
|
698
|
+
`, "ig");
|
|
699
|
+
text = text.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
|
|
700
|
+
log.debug(`Detecting diagram directive${type !== null ? " type:" + type : ""} based on the text:${text}`);
|
|
701
|
+
let match;
|
|
702
|
+
const result2 = [];
|
|
703
|
+
while ((match = directiveRegex.exec(text)) !== null) {
|
|
704
|
+
if (match.index === directiveRegex.lastIndex) {
|
|
705
|
+
directiveRegex.lastIndex++;
|
|
706
|
+
}
|
|
707
|
+
if (match && !type || type && match[1]?.match(type) || type && match[2]?.match(type)) {
|
|
708
|
+
const type2 = match[1] ? match[1] : match[2];
|
|
709
|
+
const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;
|
|
710
|
+
result2.push({ type: type2, args });
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
if (result2.length === 0) {
|
|
714
|
+
return { type: text, args: null };
|
|
715
|
+
}
|
|
716
|
+
return result2.length === 1 ? result2[0] : result2;
|
|
717
|
+
} catch (error) {
|
|
718
|
+
log.error(`ERROR: ${error.message} - Unable to parse directive type: '${type}' based on the text: '${text}'`);
|
|
719
|
+
return { type: undefined, args: null };
|
|
720
|
+
}
|
|
721
|
+
}, "detectDirective");
|
|
722
|
+
var removeDirectives = /* @__PURE__ */ __name(function(text) {
|
|
723
|
+
return text.replace(directiveRegex, "");
|
|
724
|
+
}, "removeDirectives");
|
|
725
|
+
var isSubstringInArray = /* @__PURE__ */ __name(function(str, arr) {
|
|
726
|
+
for (const [i, element] of arr.entries()) {
|
|
727
|
+
if (element.match(str)) {
|
|
728
|
+
return i;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
return -1;
|
|
732
|
+
}, "isSubstringInArray");
|
|
733
|
+
function interpolateToCurve(interpolate, defaultCurve) {
|
|
734
|
+
if (!interpolate) {
|
|
735
|
+
return defaultCurve;
|
|
736
|
+
}
|
|
737
|
+
const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
|
|
738
|
+
return d3CurveTypes[curveName] ?? defaultCurve;
|
|
739
|
+
}
|
|
740
|
+
__name(interpolateToCurve, "interpolateToCurve");
|
|
741
|
+
function formatUrl(linkStr, config) {
|
|
742
|
+
const url = linkStr.trim();
|
|
743
|
+
if (!url) {
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
if (config.securityLevel !== "loose") {
|
|
747
|
+
return import_sanitize_url.sanitizeUrl(url);
|
|
748
|
+
}
|
|
749
|
+
return url;
|
|
750
|
+
}
|
|
751
|
+
__name(formatUrl, "formatUrl");
|
|
752
|
+
var runFunc = /* @__PURE__ */ __name((functionName, ...params) => {
|
|
753
|
+
const arrPaths = functionName.split(".");
|
|
754
|
+
const len = arrPaths.length - 1;
|
|
755
|
+
const fnName = arrPaths[len];
|
|
756
|
+
let obj = window;
|
|
757
|
+
for (let i = 0;i < len; i++) {
|
|
758
|
+
obj = obj[arrPaths[i]];
|
|
759
|
+
if (!obj) {
|
|
760
|
+
log.error(`Function name: ${functionName} not found in window`);
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
obj[fnName](...params);
|
|
765
|
+
}, "runFunc");
|
|
766
|
+
function distance(p1, p2) {
|
|
767
|
+
if (!p1 || !p2) {
|
|
768
|
+
return 0;
|
|
769
|
+
}
|
|
770
|
+
return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
|
|
771
|
+
}
|
|
772
|
+
__name(distance, "distance");
|
|
773
|
+
function traverseEdge(points) {
|
|
774
|
+
let prevPoint;
|
|
775
|
+
let totalDistance = 0;
|
|
776
|
+
points.forEach((point) => {
|
|
777
|
+
totalDistance += distance(point, prevPoint);
|
|
778
|
+
prevPoint = point;
|
|
779
|
+
});
|
|
780
|
+
const remainingDistance = totalDistance / 2;
|
|
781
|
+
return calculatePoint(points, remainingDistance);
|
|
782
|
+
}
|
|
783
|
+
__name(traverseEdge, "traverseEdge");
|
|
784
|
+
function calcLabelPosition(points) {
|
|
785
|
+
if (points.length === 1) {
|
|
786
|
+
return points[0];
|
|
787
|
+
}
|
|
788
|
+
return traverseEdge(points);
|
|
789
|
+
}
|
|
790
|
+
__name(calcLabelPosition, "calcLabelPosition");
|
|
791
|
+
var roundNumber = /* @__PURE__ */ __name((num, precision = 2) => {
|
|
792
|
+
const factor = Math.pow(10, precision);
|
|
793
|
+
return Math.round(num * factor) / factor;
|
|
794
|
+
}, "roundNumber");
|
|
795
|
+
var calculatePoint = /* @__PURE__ */ __name((points, distanceToTraverse) => {
|
|
796
|
+
let prevPoint = undefined;
|
|
797
|
+
let remainingDistance = distanceToTraverse;
|
|
798
|
+
for (const point of points) {
|
|
799
|
+
if (prevPoint) {
|
|
800
|
+
const vectorDistance = distance(point, prevPoint);
|
|
801
|
+
if (vectorDistance === 0) {
|
|
802
|
+
return prevPoint;
|
|
803
|
+
}
|
|
804
|
+
if (vectorDistance < remainingDistance) {
|
|
805
|
+
remainingDistance -= vectorDistance;
|
|
806
|
+
} else {
|
|
807
|
+
const distanceRatio = remainingDistance / vectorDistance;
|
|
808
|
+
if (distanceRatio <= 0) {
|
|
809
|
+
return prevPoint;
|
|
810
|
+
}
|
|
811
|
+
if (distanceRatio >= 1) {
|
|
812
|
+
return { x: point.x, y: point.y };
|
|
813
|
+
}
|
|
814
|
+
if (distanceRatio > 0 && distanceRatio < 1) {
|
|
815
|
+
return {
|
|
816
|
+
x: roundNumber((1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, 5),
|
|
817
|
+
y: roundNumber((1 - distanceRatio) * prevPoint.y + distanceRatio * point.y, 5)
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
prevPoint = point;
|
|
823
|
+
}
|
|
824
|
+
throw new Error("Could not find a suitable point for the given distance");
|
|
825
|
+
}, "calculatePoint");
|
|
826
|
+
var calcCardinalityPosition = /* @__PURE__ */ __name((isRelationTypePresent, points, initialPosition) => {
|
|
827
|
+
log.info(`our points ${JSON.stringify(points)}`);
|
|
828
|
+
if (points[0] !== initialPosition) {
|
|
829
|
+
points = points.reverse();
|
|
830
|
+
}
|
|
831
|
+
const distanceToCardinalityPoint = 25;
|
|
832
|
+
const center = calculatePoint(points, distanceToCardinalityPoint);
|
|
833
|
+
const d = isRelationTypePresent ? 10 : 5;
|
|
834
|
+
const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
|
|
835
|
+
const cardinalityPosition = { x: 0, y: 0 };
|
|
836
|
+
cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
|
|
837
|
+
cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
|
|
838
|
+
return cardinalityPosition;
|
|
839
|
+
}, "calcCardinalityPosition");
|
|
840
|
+
function calcTerminalLabelPosition(terminalMarkerSize, position, _points) {
|
|
841
|
+
const points = structuredClone(_points);
|
|
842
|
+
log.info("our points", points);
|
|
843
|
+
if (position !== "start_left" && position !== "start_right") {
|
|
844
|
+
points.reverse();
|
|
845
|
+
}
|
|
846
|
+
const distanceToCardinalityPoint = 25 + terminalMarkerSize;
|
|
847
|
+
const center = calculatePoint(points, distanceToCardinalityPoint);
|
|
848
|
+
const d = 10 + terminalMarkerSize * 0.5;
|
|
849
|
+
const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
|
|
850
|
+
const cardinalityPosition = { x: 0, y: 0 };
|
|
851
|
+
if (position === "start_left") {
|
|
852
|
+
cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;
|
|
853
|
+
cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;
|
|
854
|
+
} else if (position === "end_right") {
|
|
855
|
+
cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;
|
|
856
|
+
cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;
|
|
857
|
+
} else if (position === "end_left") {
|
|
858
|
+
cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;
|
|
859
|
+
cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;
|
|
860
|
+
} else {
|
|
861
|
+
cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
|
|
862
|
+
cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
|
|
863
|
+
}
|
|
864
|
+
return cardinalityPosition;
|
|
865
|
+
}
|
|
866
|
+
__name(calcTerminalLabelPosition, "calcTerminalLabelPosition");
|
|
867
|
+
function getStylesFromArray(arr) {
|
|
868
|
+
let style = "";
|
|
869
|
+
let labelStyle = "";
|
|
870
|
+
for (const element of arr) {
|
|
871
|
+
if (element !== undefined) {
|
|
872
|
+
if (element.startsWith("color:") || element.startsWith("text-align:")) {
|
|
873
|
+
labelStyle = labelStyle + element + ";";
|
|
874
|
+
} else {
|
|
875
|
+
style = style + element + ";";
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
return { style, labelStyle };
|
|
880
|
+
}
|
|
881
|
+
__name(getStylesFromArray, "getStylesFromArray");
|
|
882
|
+
var cnt = 0;
|
|
883
|
+
var generateId = /* @__PURE__ */ __name(() => {
|
|
884
|
+
cnt++;
|
|
885
|
+
return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
|
|
886
|
+
}, "generateId");
|
|
887
|
+
function makeRandomHex(length) {
|
|
888
|
+
let result2 = "";
|
|
889
|
+
const characters = "0123456789abcdef";
|
|
890
|
+
const charactersLength = characters.length;
|
|
891
|
+
for (let i = 0;i < length; i++) {
|
|
892
|
+
result2 += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
893
|
+
}
|
|
894
|
+
return result2;
|
|
895
|
+
}
|
|
896
|
+
__name(makeRandomHex, "makeRandomHex");
|
|
897
|
+
var random2 = /* @__PURE__ */ __name((options) => {
|
|
898
|
+
return makeRandomHex(options.length);
|
|
899
|
+
}, "random");
|
|
900
|
+
var getTextObj = /* @__PURE__ */ __name(function() {
|
|
901
|
+
return {
|
|
902
|
+
x: 0,
|
|
903
|
+
y: 0,
|
|
904
|
+
fill: undefined,
|
|
905
|
+
anchor: "start",
|
|
906
|
+
style: "#666",
|
|
907
|
+
width: 100,
|
|
908
|
+
height: 100,
|
|
909
|
+
textMargin: 0,
|
|
910
|
+
rx: 0,
|
|
911
|
+
ry: 0,
|
|
912
|
+
valign: undefined,
|
|
913
|
+
text: ""
|
|
914
|
+
};
|
|
915
|
+
}, "getTextObj");
|
|
916
|
+
var drawSimpleText = /* @__PURE__ */ __name(function(elem, textData) {
|
|
917
|
+
const nText = textData.text.replace(common_default.lineBreakRegex, " ");
|
|
918
|
+
const [, _fontSizePx] = parseFontSize(textData.fontSize);
|
|
919
|
+
const textElem = elem.append("text");
|
|
920
|
+
textElem.attr("x", textData.x);
|
|
921
|
+
textElem.attr("y", textData.y);
|
|
922
|
+
textElem.style("text-anchor", textData.anchor);
|
|
923
|
+
textElem.style("font-family", textData.fontFamily);
|
|
924
|
+
textElem.style("font-size", _fontSizePx);
|
|
925
|
+
textElem.style("font-weight", textData.fontWeight);
|
|
926
|
+
textElem.attr("fill", textData.fill);
|
|
927
|
+
if (textData.class !== undefined) {
|
|
928
|
+
textElem.attr("class", textData.class);
|
|
929
|
+
}
|
|
930
|
+
const span = textElem.append("tspan");
|
|
931
|
+
span.attr("x", textData.x + textData.textMargin * 2);
|
|
932
|
+
span.attr("fill", textData.fill);
|
|
933
|
+
span.text(nText);
|
|
934
|
+
return textElem;
|
|
935
|
+
}, "drawSimpleText");
|
|
936
|
+
var wrapLabel = memoize((label, maxWidth, config) => {
|
|
937
|
+
if (!label) {
|
|
938
|
+
return label;
|
|
939
|
+
}
|
|
940
|
+
config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "<br/>" }, config);
|
|
941
|
+
if (common_default.lineBreakRegex.test(label)) {
|
|
942
|
+
return label;
|
|
943
|
+
}
|
|
944
|
+
const words2 = label.split(" ").filter(Boolean);
|
|
945
|
+
const completedLines = [];
|
|
946
|
+
let nextLine = "";
|
|
947
|
+
words2.forEach((word, index) => {
|
|
948
|
+
const wordLength = calculateTextWidth(`${word} `, config);
|
|
949
|
+
const nextLineLength = calculateTextWidth(nextLine, config);
|
|
950
|
+
if (wordLength > maxWidth) {
|
|
951
|
+
const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config);
|
|
952
|
+
completedLines.push(nextLine, ...hyphenatedStrings);
|
|
953
|
+
nextLine = remainingWord;
|
|
954
|
+
} else if (nextLineLength + wordLength >= maxWidth) {
|
|
955
|
+
completedLines.push(nextLine);
|
|
956
|
+
nextLine = word;
|
|
957
|
+
} else {
|
|
958
|
+
nextLine = [nextLine, word].filter(Boolean).join(" ");
|
|
959
|
+
}
|
|
960
|
+
const currentWord = index + 1;
|
|
961
|
+
const isLastWord = currentWord === words2.length;
|
|
962
|
+
if (isLastWord) {
|
|
963
|
+
completedLines.push(nextLine);
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
return completedLines.filter((line) => line !== "").join(config.joinWith);
|
|
967
|
+
}, (label, maxWidth, config) => `${label}${maxWidth}${config.fontSize}${config.fontWeight}${config.fontFamily}${config.joinWith}`);
|
|
968
|
+
var breakString = memoize((word, maxWidth, hyphenCharacter = "-", config) => {
|
|
969
|
+
config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 }, config);
|
|
970
|
+
const characters = [...word];
|
|
971
|
+
const lines = [];
|
|
972
|
+
let currentLine = "";
|
|
973
|
+
characters.forEach((character, index) => {
|
|
974
|
+
const nextLine = `${currentLine}${character}`;
|
|
975
|
+
const lineWidth = calculateTextWidth(nextLine, config);
|
|
976
|
+
if (lineWidth >= maxWidth) {
|
|
977
|
+
const currentCharacter = index + 1;
|
|
978
|
+
const isLastLine = characters.length === currentCharacter;
|
|
979
|
+
const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;
|
|
980
|
+
lines.push(isLastLine ? nextLine : hyphenatedNextLine);
|
|
981
|
+
currentLine = "";
|
|
982
|
+
} else {
|
|
983
|
+
currentLine = nextLine;
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
return { hyphenatedStrings: lines, remainingWord: currentLine };
|
|
987
|
+
}, (word, maxWidth, hyphenCharacter = "-", config) => `${word}${maxWidth}${hyphenCharacter}${config.fontSize}${config.fontWeight}${config.fontFamily}`);
|
|
988
|
+
function calculateTextHeight(text, config) {
|
|
989
|
+
return calculateTextDimensions(text, config).height;
|
|
990
|
+
}
|
|
991
|
+
__name(calculateTextHeight, "calculateTextHeight");
|
|
992
|
+
function calculateTextWidth(text, config) {
|
|
993
|
+
return calculateTextDimensions(text, config).width;
|
|
994
|
+
}
|
|
995
|
+
__name(calculateTextWidth, "calculateTextWidth");
|
|
996
|
+
var calculateTextDimensions = memoize((text, config) => {
|
|
997
|
+
const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config;
|
|
998
|
+
if (!text) {
|
|
999
|
+
return { width: 0, height: 0 };
|
|
1000
|
+
}
|
|
1001
|
+
const [, _fontSizePx] = parseFontSize(fontSize);
|
|
1002
|
+
const fontFamilies = ["sans-serif", fontFamily];
|
|
1003
|
+
const lines = text.split(common_default.lineBreakRegex);
|
|
1004
|
+
const dims = [];
|
|
1005
|
+
const body = select_default("body");
|
|
1006
|
+
if (!body.remove) {
|
|
1007
|
+
return { width: 0, height: 0, lineHeight: 0 };
|
|
1008
|
+
}
|
|
1009
|
+
const g = body.append("svg");
|
|
1010
|
+
for (const fontFamily2 of fontFamilies) {
|
|
1011
|
+
let cHeight = 0;
|
|
1012
|
+
const dim = { width: 0, height: 0, lineHeight: 0 };
|
|
1013
|
+
for (const line of lines) {
|
|
1014
|
+
const textObj = getTextObj();
|
|
1015
|
+
textObj.text = line || ZERO_WIDTH_SPACE;
|
|
1016
|
+
const textElem = drawSimpleText(g, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2);
|
|
1017
|
+
const bBox = (textElem._groups || textElem)[0][0].getBBox();
|
|
1018
|
+
if (bBox.width === 0 && bBox.height === 0) {
|
|
1019
|
+
throw new Error("svg element not in render tree");
|
|
1020
|
+
}
|
|
1021
|
+
dim.width = Math.round(Math.max(dim.width, bBox.width));
|
|
1022
|
+
cHeight = Math.round(bBox.height);
|
|
1023
|
+
dim.height += cHeight;
|
|
1024
|
+
dim.lineHeight = Math.round(Math.max(dim.lineHeight, cHeight));
|
|
1025
|
+
}
|
|
1026
|
+
dims.push(dim);
|
|
1027
|
+
}
|
|
1028
|
+
g.remove();
|
|
1029
|
+
const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;
|
|
1030
|
+
return dims[index];
|
|
1031
|
+
}, (text, config) => `${text}${config.fontSize}${config.fontWeight}${config.fontFamily}`);
|
|
1032
|
+
var InitIDGenerator = class {
|
|
1033
|
+
constructor(deterministic = false, seed) {
|
|
1034
|
+
this.count = 0;
|
|
1035
|
+
this.count = seed ? seed.length : 0;
|
|
1036
|
+
this.next = deterministic ? () => this.count++ : () => Date.now();
|
|
1037
|
+
}
|
|
1038
|
+
static {
|
|
1039
|
+
__name(this, "InitIDGenerator");
|
|
1040
|
+
}
|
|
1041
|
+
};
|
|
1042
|
+
var decoder;
|
|
1043
|
+
var entityDecode = /* @__PURE__ */ __name(function(html) {
|
|
1044
|
+
decoder = decoder || document.createElement("div");
|
|
1045
|
+
html = escape(html).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
|
|
1046
|
+
decoder.innerHTML = html;
|
|
1047
|
+
return unescape(decoder.textContent);
|
|
1048
|
+
}, "entityDecode");
|
|
1049
|
+
function isDetailedError(error) {
|
|
1050
|
+
return "str" in error;
|
|
1051
|
+
}
|
|
1052
|
+
__name(isDetailedError, "isDetailedError");
|
|
1053
|
+
var insertTitle = /* @__PURE__ */ __name((parent, cssClass, titleTopMargin, title) => {
|
|
1054
|
+
if (!title) {
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
const bounds = parent.node()?.getBBox();
|
|
1058
|
+
if (!bounds) {
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
parent.append("text").text(title).attr("text-anchor", "middle").attr("x", bounds.x + bounds.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
|
|
1062
|
+
}, "insertTitle");
|
|
1063
|
+
var parseFontSize = /* @__PURE__ */ __name((fontSize) => {
|
|
1064
|
+
if (typeof fontSize === "number") {
|
|
1065
|
+
return [fontSize, fontSize + "px"];
|
|
1066
|
+
}
|
|
1067
|
+
const fontSizeNumber = parseInt(fontSize ?? "", 10);
|
|
1068
|
+
if (Number.isNaN(fontSizeNumber)) {
|
|
1069
|
+
return [undefined, undefined];
|
|
1070
|
+
} else if (fontSize === String(fontSizeNumber)) {
|
|
1071
|
+
return [fontSizeNumber, fontSize + "px"];
|
|
1072
|
+
} else {
|
|
1073
|
+
return [fontSizeNumber, fontSize];
|
|
1074
|
+
}
|
|
1075
|
+
}, "parseFontSize");
|
|
1076
|
+
function cleanAndMerge(defaultData, data) {
|
|
1077
|
+
return merge({}, defaultData, data);
|
|
1078
|
+
}
|
|
1079
|
+
__name(cleanAndMerge, "cleanAndMerge");
|
|
1080
|
+
var utils_default = {
|
|
1081
|
+
assignWithDepth: assignWithDepth_default,
|
|
1082
|
+
wrapLabel,
|
|
1083
|
+
calculateTextHeight,
|
|
1084
|
+
calculateTextWidth,
|
|
1085
|
+
calculateTextDimensions,
|
|
1086
|
+
cleanAndMerge,
|
|
1087
|
+
detectInit,
|
|
1088
|
+
detectDirective,
|
|
1089
|
+
isSubstringInArray,
|
|
1090
|
+
interpolateToCurve,
|
|
1091
|
+
calcLabelPosition,
|
|
1092
|
+
calcCardinalityPosition,
|
|
1093
|
+
calcTerminalLabelPosition,
|
|
1094
|
+
formatUrl,
|
|
1095
|
+
getStylesFromArray,
|
|
1096
|
+
generateId,
|
|
1097
|
+
random: random2,
|
|
1098
|
+
runFunc,
|
|
1099
|
+
entityDecode,
|
|
1100
|
+
insertTitle,
|
|
1101
|
+
isLabelCoordinateInPath,
|
|
1102
|
+
parseFontSize,
|
|
1103
|
+
InitIDGenerator
|
|
1104
|
+
};
|
|
1105
|
+
var encodeEntities = /* @__PURE__ */ __name(function(text) {
|
|
1106
|
+
let txt = text;
|
|
1107
|
+
txt = txt.replace(/style.*:\S*#.*;/g, function(s) {
|
|
1108
|
+
return s.substring(0, s.length - 1);
|
|
1109
|
+
});
|
|
1110
|
+
txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) {
|
|
1111
|
+
return s.substring(0, s.length - 1);
|
|
1112
|
+
});
|
|
1113
|
+
txt = txt.replace(/#\w+;/g, function(s) {
|
|
1114
|
+
const innerTxt = s.substring(1, s.length - 1);
|
|
1115
|
+
const isInt = /^\+?\d+$/.test(innerTxt);
|
|
1116
|
+
if (isInt) {
|
|
1117
|
+
return "fl°°" + innerTxt + "¶ß";
|
|
1118
|
+
} else {
|
|
1119
|
+
return "fl°" + innerTxt + "¶ß";
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
return txt;
|
|
1123
|
+
}, "encodeEntities");
|
|
1124
|
+
var decodeEntities = /* @__PURE__ */ __name(function(text) {
|
|
1125
|
+
return text.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";");
|
|
1126
|
+
}, "decodeEntities");
|
|
1127
|
+
var getEdgeId = /* @__PURE__ */ __name((from, to, {
|
|
1128
|
+
counter = 0,
|
|
1129
|
+
prefix,
|
|
1130
|
+
suffix
|
|
1131
|
+
}, id) => {
|
|
1132
|
+
if (id) {
|
|
1133
|
+
return id;
|
|
1134
|
+
}
|
|
1135
|
+
return `${prefix ? `${prefix}_` : ""}${from}_${to}_${counter}${suffix ? `_${suffix}` : ""}`;
|
|
1136
|
+
}, "getEdgeId");
|
|
1137
|
+
function handleUndefinedAttr(attrValue) {
|
|
1138
|
+
return attrValue ?? null;
|
|
1139
|
+
}
|
|
1140
|
+
__name(handleUndefinedAttr, "handleUndefinedAttr");
|
|
1141
|
+
function isLabelCoordinateInPath(point, dAttr) {
|
|
1142
|
+
const roundedX = Math.round(point.x);
|
|
1143
|
+
const roundedY = Math.round(point.y);
|
|
1144
|
+
const sanitizedD = dAttr.replace(/(\d+\.\d+)/g, (match) => Math.round(parseFloat(match)).toString());
|
|
1145
|
+
return sanitizedD.includes(roundedX.toString()) || sanitizedD.includes(roundedY.toString());
|
|
1146
|
+
}
|
|
1147
|
+
__name(isLabelCoordinateInPath, "isLabelCoordinateInPath");
|
|
1148
|
+
|
|
1149
|
+
export { clone, isEmpty, ZERO_WIDTH_SPACE, removeDirectives, interpolateToCurve, getStylesFromArray, generateId, random2 as random, wrapLabel, calculateTextHeight, calculateTextWidth, calculateTextDimensions, isDetailedError, parseFontSize, cleanAndMerge, utils_default, encodeEntities, decodeEntities, getEdgeId, handleUndefinedAttr };
|