@aiquants/markdown 5.0.0 → 6.1.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/README.md +176 -14
- package/dist/{abnfDiagram-VRR7QNED-DeHJ63Vu.js → abnfDiagram-VRR7QNED-0ow9i3L-.js} +3 -3
- package/dist/{abnfDiagram-VRR7QNED-CfVjEUzG.cjs → abnfDiagram-VRR7QNED-DRNsVB-u.cjs} +1 -1
- package/dist/{arc-XFFLkHkK.cjs → arc-BWR9_qMf.cjs} +1 -1
- package/dist/arc-Bh12k776.js +83 -0
- package/dist/{architectureDiagram-ZJ3FMSHR-CQ1m3MUB.js → architectureDiagram-ZJ3FMSHR-CsFXQcxx.js} +123 -123
- package/dist/{architectureDiagram-ZJ3FMSHR-7xJ6YYGu.cjs → architectureDiagram-ZJ3FMSHR-DtrqDlxV.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-CJOFqwiW.cjs → blockDiagram-677ZJIJ3-CoZEeE0C.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-BPC3se0e.js → blockDiagram-677ZJIJ3-CqQ43viF.js} +166 -166
- package/dist/{c4Diagram-LMCZKHZV-D8ytYGhR.cjs → c4Diagram-LMCZKHZV-DGA2gxp-.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-BEIrp4t6.js → c4Diagram-LMCZKHZV-QPgNg4El.js} +2 -2
- package/dist/{channel-CJQcZr8o.cjs → channel-Jkgg7NV4.cjs} +1 -1
- package/dist/channel-PnA15jK3.js +5 -0
- package/dist/{chunk-2Q5K7J3B-BbMQR3Sm.cjs → chunk-2Q5K7J3B-1iQ5h7FK.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-l8ly7Yjr.js → chunk-2Q5K7J3B-DOWfHP5s.js} +1 -1
- package/dist/{chunk-32BRIVSS-BhQJBlVw.js → chunk-32BRIVSS-94iTIA-u.js} +1 -1
- package/dist/{chunk-32BRIVSS-BwDfmprN.cjs → chunk-32BRIVSS-XUAL4SUU.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-CqDQlS7v.cjs → chunk-5VM5RSS4-CKgpuXOS.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-Bfis-x7E.js → chunk-5VM5RSS4-OANQKmQE.js} +1 -1
- package/dist/{chunk-EX3LRPZG-DUTbzwDM.js → chunk-EX3LRPZG-BQDQ1MdS.js} +50 -50
- package/dist/{chunk-EX3LRPZG-9aDULZwJ.cjs → chunk-EX3LRPZG-BrRRbskW.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-5cM5nFf6.cjs → chunk-JWPE2WC7-Bz9dXsLZ.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-DpcSSOP5.js → chunk-JWPE2WC7-Djg6Qi23.js} +1 -1
- package/dist/{chunk-MOJQB5TN-D_h6bolU.js → chunk-MOJQB5TN-1pZNp2Wl.js} +9 -9
- package/dist/{chunk-MOJQB5TN-Cw864mUL.cjs → chunk-MOJQB5TN-DUk2Jy4_.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-yLvT3c9x.cjs → chunk-PUDLZKDR-CVedetzB.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-B0wZjmzv.js → chunk-PUDLZKDR-G5JYyEiR.js} +22 -22
- package/dist/{chunk-RYQCIY6F-DTKYsCgk.js → chunk-RYQCIY6F-Crmt36sO.js} +6 -6
- package/dist/{chunk-RYQCIY6F-hj9dRWMT.cjs → chunk-RYQCIY6F-D0y50t5B.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-COa9uddv.js → chunk-V7JOEXUC-BNo-X7NC.js} +5 -5
- package/dist/{chunk-V7JOEXUC-DIQ8n1AN.cjs → chunk-V7JOEXUC-DXSQM1ea.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-B72PxPVm.js → chunk-VR4S4FIN-BGGITgpQ.js} +3 -3
- package/dist/{chunk-VR4S4FIN-Cy-2mZJB.cjs → chunk-VR4S4FIN-Bc567umS.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-DmoUE7-y.cjs → chunk-XXDRQBXY-DOuLpiJ4.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-D2Sgptl-.js → chunk-XXDRQBXY-Drnpl-KK.js} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-Dah4_VL7.js → classDiagram-OUVF2IWQ-Cneye7qT.js} +2 -2
- package/dist/{classDiagram-OUVF2IWQ-GjsCEuKI.cjs → classDiagram-OUVF2IWQ-mmjBEYmN.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-Dah4_VL7.js → classDiagram-v2-EOCWNBFH-Cneye7qT.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-GjsCEuKI.cjs → classDiagram-v2-EOCWNBFH-mmjBEYmN.cjs} +1 -1
- package/dist/components/MarkdownRenderer.d.ts +5 -2
- package/dist/components/MarkdownViewer.d.ts +3 -2
- package/dist/components/NodesRenderer.d.ts +1 -5
- package/dist/components/embeds/ClientFrame.d.ts +13 -0
- package/dist/components/embeds/LinkCard.d.ts +20 -0
- package/dist/components/embeds/ProviderEmbed.d.ts +11 -0
- package/dist/components/embeds/embedLabels.d.ts +12 -0
- package/dist/components/embeds/frameMessages.d.ts +7 -0
- package/dist/components/embeds/markdownEmbeds.d.ts +2 -0
- package/dist/components/embeds/requestQueue.d.ts +16 -0
- package/dist/components/embeds.d.ts +0 -8
- package/dist/components/htmlSanitizer.d.ts +4 -0
- package/dist/components/mdastNodes/HTMLBlockContainerNode.d.ts +1 -2
- package/dist/components/rawHtml.d.ts +6 -3
- package/dist/components/viewerLabels.d.ts +3 -1
- package/dist/{cose-bilkent-JH36ORCC-Pi0l3C5o.js → cose-bilkent-JH36ORCC-BQWfGE1G.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-Vi9pHFwc.cjs → cose-bilkent-JH36ORCC-BaEdcRlX.cjs} +1 -1
- package/dist/css/zenn-content.css +0 -40
- package/dist/{cynefinDiagram-TSTJHNR4-CIh03JTU.js → cynefinDiagram-TSTJHNR4-CTDDSUz7.js} +47 -47
- package/dist/{cynefinDiagram-TSTJHNR4-BQ2k9Z6b.cjs → cynefinDiagram-TSTJHNR4-DPQl09kC.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-cINcPwV3.js → dagre-VKFMJZFB-BMRdJgZy.js} +27 -27
- package/dist/{dagre-VKFMJZFB-DI2wSrAy.cjs → dagre-VKFMJZFB-DZ4E-Szs.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-BonrBTG_.js → diagram-FQU43EPY-CmEpNw5i.js} +42 -42
- package/dist/{diagram-FQU43EPY-B6iUH2l5.cjs → diagram-FQU43EPY-mK9YHIy1.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-CY6mWS2R.cjs → diagram-G47NLZAW-BX8Lj_uD.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-5N876QQA.js → diagram-G47NLZAW-eJRQFjAg.js} +83 -83
- package/dist/{diagram-NH7WQ7WH-x3SaRfd6.cjs → diagram-NH7WQ7WH-3r1_3TrC.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-LFuTbHxY.js → diagram-NH7WQ7WH-BOOj_4-N.js} +18 -18
- package/dist/{diagram-OA4YK3LP-B9mVw8cB.cjs → diagram-OA4YK3LP-CkDJzLOy.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-Cinpbl0B.js → diagram-OA4YK3LP-DnDIHtcW.js} +61 -61
- package/dist/{diagram-WEI45ONY-HPCHpafe.js → diagram-WEI45ONY-BHpuPTt-.js} +21 -21
- package/dist/{diagram-WEI45ONY-BRYVUhRr.cjs → diagram-WEI45ONY-BpCCo_Ty.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-oLOdtH39.js → ebnfDiagram-CCIWWBDH-BDLB-AVF.js} +5 -5
- package/dist/{ebnfDiagram-CCIWWBDH-DhFlIi0a.cjs → ebnfDiagram-CCIWWBDH-CfdalXdM.cjs} +1 -1
- package/dist/embeds/frames.d.ts +4 -0
- package/dist/embeds/linkCards.d.ts +48 -0
- package/dist/embeds/placeholder.d.ts +15 -0
- package/dist/embeds/providers.d.ts +73 -0
- package/dist/embeds/testing.cjs +1 -0
- package/dist/embeds/testing.d.ts +7 -0
- package/dist/embeds/testing.js +67 -0
- package/dist/embeds.cjs +1 -0
- package/dist/embeds.d.ts +4 -0
- package/dist/embeds.js +73 -0
- package/dist/{erDiagram-Q63AITRT-DCCFR1Ai.cjs → erDiagram-Q63AITRT-CviOyQsx.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-CCtzpK78.js → erDiagram-Q63AITRT-DZlcgZfp.js} +9 -9
- package/dist/{extractHeadings-CGJexznE.js → extractHeadings-CtiYkq2z.js} +5482 -5431
- package/dist/extractHeadings-D1A8WzVy.cjs +311 -0
- package/dist/flowDiagram-23GEKE2U-C_FW0q38.js +7 -0
- package/dist/flowDiagram-23GEKE2U-Cb0U58EU.cjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-C9RPyo4r.cjs → ganttDiagram-NO4QXBWP-CJa-hKPU.cjs} +1 -1
- package/dist/{ganttDiagram-NO4QXBWP-Dfi3nINO.js → ganttDiagram-NO4QXBWP-DO0HAbYg.js} +69 -69
- package/dist/{gitGraphDiagram-IHSO6WYX-CjAqPhww.js → gitGraphDiagram-IHSO6WYX-CXStgPQs.js} +38 -38
- package/dist/{gitGraphDiagram-IHSO6WYX-mT3NNT7T.cjs → gitGraphDiagram-IHSO6WYX-CXcPHbkt.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +1 -10
- package/dist/index.client.js +41 -49
- package/dist/index.js +41 -49
- package/dist/index.server.cjs +1 -1
- package/dist/index.server.d.ts +1 -2
- package/dist/index.server.js +593 -191
- package/dist/{infoDiagram-FWYZ7A6U-0Co9BitR.cjs → infoDiagram-FWYZ7A6U-BByoHihL.cjs} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-BXWQ9Vy4.js → infoDiagram-FWYZ7A6U-K0__ySEG.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-CZp5P1WE.js → ishikawaDiagram-FXEZZL3T-C8QlwQP1.js} +35 -35
- package/dist/{ishikawaDiagram-FXEZZL3T-BKqUBw1i.cjs → ishikawaDiagram-FXEZZL3T-DZOMdeTI.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-DYVTgOOE.js → journeyDiagram-5HDEW3XC-CZ9PFNNN.js} +39 -39
- package/dist/{journeyDiagram-5HDEW3XC-CeumPQ1I.cjs → journeyDiagram-5HDEW3XC-RvC77rKo.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-Cg5KnsE9.cjs → kanban-definition-HUTT4EX6-BL1jihGl.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-CnleRy80.js → kanban-definition-HUTT4EX6-Q12F4vHx.js} +123 -123
- package/dist/{linear-Cf8i6Rsk.js → linear-LWjATjog.js} +32 -32
- package/dist/{linear-qqwu6T0F.cjs → linear-lDvPoqlB.cjs} +1 -1
- package/dist/linkCardServer/addressGuard.server.d.ts +25 -0
- package/dist/linkCardServer/htmlEncoding.server.d.ts +6 -0
- package/dist/linkCardServer/linkCardHandler.server.d.ts +7 -0
- package/dist/linkCardServer/metadataCache.server.d.ts +5 -0
- package/dist/linkCardServer/pageFetch.server.d.ts +37 -0
- package/dist/linkCardServer/pageMetadata.server.d.ts +11 -0
- package/dist/linkCards-1JxY8wdm.js +48 -0
- package/dist/linkCards-Bjd_vW39.cjs +1 -0
- package/dist/markdown.css +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-lBin9VOm.js → mindmap-definition-LN4V7U3C-CM1XvwJX.js} +33 -33
- package/dist/{mindmap-definition-LN4V7U3C-DfFWeFph.cjs → mindmap-definition-LN4V7U3C-TVYKONRm.cjs} +1 -1
- package/dist/{pegDiagram-2B236MQR-BiD21lOj.js → pegDiagram-2B236MQR-Dlrnikqd.js} +5 -5
- package/dist/{pegDiagram-2B236MQR-Cf1f-3yi.cjs → pegDiagram-2B236MQR-a9Up0ERY.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-jwhVsZgX.cjs → pieDiagram-ENE6RG2P-ClakmSma.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-BqZb6gaV.js → pieDiagram-ENE6RG2P-WYrEJp8U.js} +58 -58
- package/dist/providers-Bxr2Wb-j.cjs +1 -0
- package/dist/providers-Drq7MT_K.js +209 -0
- package/dist/{quadrantDiagram-ABIIQ3AL-CNe9fRLO.js → quadrantDiagram-ABIIQ3AL-BkgMVDaX.js} +48 -48
- package/dist/{quadrantDiagram-ABIIQ3AL-sO_sIA7b.cjs → quadrantDiagram-ABIIQ3AL-Cb01YcqR.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-Dkc8k3e9.cjs → railroadDiagram-RFXS5EU6-Bob4WSMz.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-53YTkJrs.js → railroadDiagram-RFXS5EU6-RfCtZGUR.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-C0GMlJO4.cjs → requirementDiagram-TGXJPOKE-BP5h9mCj.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-D8Gz7jzA.js → requirementDiagram-TGXJPOKE-C1yJPMp1.js} +3 -3
- package/dist/{sankeyDiagram-HTMAVEWB-CEC0GaCg.js → sankeyDiagram-HTMAVEWB-D5G9Dcmr.js} +67 -67
- package/dist/{sankeyDiagram-HTMAVEWB-Bw9J2Ay2.cjs → sankeyDiagram-HTMAVEWB-shq9WK4t.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-CKb4m3I0.js → sequenceDiagram-DBY2YBRQ-8EJMQxiB.js} +47 -47
- package/dist/{sequenceDiagram-DBY2YBRQ-BuqPCreB.cjs → sequenceDiagram-DBY2YBRQ-BRxcK5-5.cjs} +1 -1
- package/dist/{simple-logger-DZxBpX7v.cjs → simple-logger-9yf7ypyB.cjs} +1 -1
- package/dist/{simple-logger-i94ikRyH.js → simple-logger-DwH1YQvq.js} +3 -1
- package/dist/{sizeCapture-X5ZJPWSS-Dm3rsxXw.cjs → sizeCapture-X5ZJPWSS-BtBRJO2R.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-CotnTNAA.js → sizeCapture-X5ZJPWSS-DJG85IuR.js} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-GWEIP-C9.js → stateDiagram-2N3HPSRC-CAd-NU-f.js} +22 -22
- package/dist/{stateDiagram-2N3HPSRC-5Y-OlePe.cjs → stateDiagram-2N3HPSRC-Czgkv_ey.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-v77D3Qyf.cjs → stateDiagram-v2-6OUMAXLB-BNP5Lx0Y.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-BZFV8swJ.js → stateDiagram-v2-6OUMAXLB-x_Zps-d5.js} +2 -2
- package/dist/styles/markdown.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-B1hLl8Ph.cjs → swimlanes-5IMT3BWC-CfdkDd3q.cjs} +1 -1
- package/dist/{swimlanes-5IMT3BWC-DujAOwAt.js → swimlanes-5IMT3BWC-D8brzzxb.js} +313 -313
- package/dist/{swimlanesDiagram-G3AALYLV-B-5z3jDg.js → swimlanesDiagram-G3AALYLV-Bc9-lR2e.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-Cklgsxbg.cjs → swimlanesDiagram-G3AALYLV-dvJpSdGV.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-B2m-aQLI.cjs → timeline-definition-FHXFAJF6-BSqACati.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-Fmzt_lvR.js → timeline-definition-FHXFAJF6-CKW3NJOF.js} +34 -34
- package/dist/utils/simple-logger.d.ts +1 -0
- package/dist/{vennDiagram-L72KCM5P-rL7UDYbl.cjs → vennDiagram-L72KCM5P-ChKxsFyJ.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-zIXK42Cx.js → vennDiagram-L72KCM5P-vPmq984y.js} +92 -92
- package/dist/{wardleyDiagram-EHGQE667-pTeeZ0uM.js → wardleyDiagram-EHGQE667-CwN9zwBX.js} +11 -11
- package/dist/{wardleyDiagram-EHGQE667-CNLieFen.cjs → wardleyDiagram-EHGQE667-CxzlR7km.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-B6UdSSVZ.js → xychartDiagram-FW5EYKEG-DBSKTLuc.js} +37 -37
- package/dist/{xychartDiagram-FW5EYKEG-CD5ik4HK.cjs → xychartDiagram-FW5EYKEG-wJqYRInm.cjs} +1 -1
- package/package.json +25 -9
- package/dist/arc-DH6k2JIR.js +0 -83
- package/dist/channel-DoH_tsOQ.js +0 -5
- package/dist/components/mdastNodes/BlockLinkNode.d.ts +0 -5
- package/dist/components/mdastNodes/RichLinkCard.d.ts +0 -8
- package/dist/components/mdastNodes/TwitterEmbedNode.d.ts +0 -25
- package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +0 -6
- package/dist/extractHeadings-lDHB2sBb.cjs +0 -310
- package/dist/flowDiagram-23GEKE2U-ORytlvmX.js +0 -7
- package/dist/flowDiagram-23GEKE2U-h2WZTCCn.cjs +0 -1
- package/dist/plugins/createIntentTweetLink.d.ts +0 -10
- package/dist/plugins/extractYouTubeVideoId.d.ts +0 -5
- package/dist/plugins/fetchSiteMetadata.d.ts +0 -9
- package/dist/plugins/remark-auto-heading-id.d.ts +0 -2
- package/dist/plugins/remark-block-link-metadata.d.ts +0 -23
- package/dist/plugins/remark-block-link.d.ts +0 -12
- package/dist/plugins/remark-twitter-embed.d.ts +0 -20
- package/dist/plugins/remark-youtube-embed.d.ts +0 -14
- package/dist/utils/getFaviconUrl.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
1
|
+
import { c as Tr } from "./chunk-RYQCIY6F-Crmt36sO.js";
|
|
2
|
+
import { a_ as Er, a$ as wr, b0 as Ar, b1 as Rr, O as Ke, J as Nr, aS as Or, aR as Pr, aT as Br, b5 as kr, b7 as Fr, af as _r, b4 as Dr, b8 as Hr, a4 as Oe, b9 as Ye, _ as d, ba as Ao } from "./extractHeadings-CtiYkq2z.js";
|
|
3
3
|
import { G as Xr } from "./graph-DAHC4kPm.js";
|
|
4
4
|
async function Fo(t, e) {
|
|
5
5
|
const n = new Xr({
|
|
@@ -22,7 +22,7 @@ async function Fo(t, e) {
|
|
|
22
22
|
for (const I of o)
|
|
23
23
|
n.setEdge(I.start, I.end, { ...I }, I.id), e.edges.some((p) => p.id === I.id) || e.edges.push(I);
|
|
24
24
|
if (globalThis.mermaidCaptureSizes) {
|
|
25
|
-
const { captureNodeSizes: I } = await import("./sizeCapture-X5ZJPWSS-
|
|
25
|
+
const { captureNodeSizes: I } = await import("./sizeCapture-X5ZJPWSS-DJG85IuR.js");
|
|
26
26
|
I(t, e);
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
@@ -164,13 +164,13 @@ function Go(t, e, n) {
|
|
|
164
164
|
const g = i[l], x = Math.hypot(g.b.x - g.a.x, g.b.y - g.a.y), I = x === 0 ? 0 : (g.b.x - g.a.x) / x, u = x === 0 ? 0 : (g.b.y - g.a.y) / x, p = Ho(g);
|
|
165
165
|
let f = 0;
|
|
166
166
|
if (r && l > 0) {
|
|
167
|
-
const
|
|
167
|
+
const T = Ln(
|
|
168
168
|
s[l - 1],
|
|
169
169
|
s[l],
|
|
170
170
|
s[l + 1] ?? s[l],
|
|
171
171
|
Ro
|
|
172
172
|
);
|
|
173
|
-
|
|
173
|
+
T && (f = T.cutLen);
|
|
174
174
|
}
|
|
175
175
|
let y = x, v = null;
|
|
176
176
|
r && l < i.length - 1 && (v = Ln(
|
|
@@ -179,18 +179,18 @@ function Go(t, e, n) {
|
|
|
179
179
|
s[l + 2] ?? s[l + 1],
|
|
180
180
|
Ro
|
|
181
181
|
), v && (y = x - v.cutLen));
|
|
182
|
-
const M = [...c.get(l) ?? []].sort((
|
|
183
|
-
for (const
|
|
184
|
-
|
|
185
|
-
for (let
|
|
186
|
-
const
|
|
187
|
-
if (M[
|
|
188
|
-
const m =
|
|
189
|
-
M[
|
|
182
|
+
const M = [...c.get(l) ?? []].sort((T, E) => T.t - E.t);
|
|
183
|
+
for (const T of M)
|
|
184
|
+
T.r = Math.min(T.r, T.d - f, y - T.d);
|
|
185
|
+
for (let T = 0; T < M.length - 1; T++) {
|
|
186
|
+
const E = M[T + 1].d - M[T].d;
|
|
187
|
+
if (M[T].r + M[T + 1].r > E) {
|
|
188
|
+
const m = E / 2;
|
|
189
|
+
M[T].r = Math.min(M[T].r, m), M[T + 1].r = Math.min(M[T + 1].r, m);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
for (const
|
|
193
|
-
|
|
192
|
+
for (const T of M)
|
|
193
|
+
T.r < Yr || a.push(...Yo(T, I, u, p, n.jumpStyle));
|
|
194
194
|
r && v ? (a.push(`L${re(v.startX)},${re(v.startY)}`), a.push(
|
|
195
195
|
`Q${re(v.ctrlX)},${re(v.ctrlY)} ${re(v.endX)},${re(v.endY)}`
|
|
196
196
|
)) : a.push(`L${we(g.b)}`);
|
|
@@ -259,15 +259,15 @@ function jo(t, e, n) {
|
|
|
259
259
|
if (!u)
|
|
260
260
|
continue;
|
|
261
261
|
if (I === void 0) {
|
|
262
|
-
const
|
|
263
|
-
if (!$o(
|
|
262
|
+
const T = u.getAttribute("d") ?? "";
|
|
263
|
+
if (!$o(T))
|
|
264
264
|
continue;
|
|
265
265
|
}
|
|
266
266
|
const p = u.getAttribute("style") ?? "", f = /stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(
|
|
267
267
|
p
|
|
268
268
|
), y = f ? Number.parseFloat(f[1]) : null, v = f ? Number.parseFloat(f[2]) : null, M = Go(l, g, n);
|
|
269
269
|
if (u.setAttribute("d", M), y !== null && v !== null && typeof u.getTotalLength == "function") {
|
|
270
|
-
const
|
|
270
|
+
const T = u.getTotalLength(), E = Math.max(0, T - y - v), m = `0 ${y} ${E} ${v}`, S = p.replace(/stroke-dasharray\s*:[^;]*;?/g, `stroke-dasharray: ${m};`).replace(/;\s*;+/g, ";");
|
|
271
271
|
u.setAttribute("style", S);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
@@ -374,10 +374,10 @@ function Wo(t, e) {
|
|
|
374
374
|
}
|
|
375
375
|
d(Wo, "positionEdgeLabel");
|
|
376
376
|
var Mn = "__swimlane_default__", Gr = 21, No = 20;
|
|
377
|
-
function
|
|
377
|
+
function Tn(t) {
|
|
378
378
|
return Math.max(t.padding ?? No, No);
|
|
379
379
|
}
|
|
380
|
-
d(
|
|
380
|
+
d(Tn, "topLaneHorizontalPadding");
|
|
381
381
|
function Ko(t) {
|
|
382
382
|
const { x: e, y: n, width: o, height: s } = t, r = t.swimlaneContentTop;
|
|
383
383
|
if (typeof e != "number" || typeof n != "number" || typeof o != "number" || typeof s != "number" || typeof r != "number" || !Number.isFinite(e) || !Number.isFinite(n) || !Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(r) || o <= 0 || s <= 0) {
|
|
@@ -455,13 +455,13 @@ function Zo(t, e, n, o) {
|
|
|
455
455
|
const u = l.filter((M) => M.parentId === I.id);
|
|
456
456
|
let p = 1 / 0, f = -1 / 0, y = 1 / 0, v = -1 / 0;
|
|
457
457
|
for (const M of u) {
|
|
458
|
-
const
|
|
459
|
-
|
|
458
|
+
const T = M.x ?? n.x[M.id], E = M.y ?? n.y[M.id], m = M.width ?? 0, S = M.height ?? 0;
|
|
459
|
+
T != null && E != null && (p = Math.min(p, T - m / 2), f = Math.max(f, T + m / 2), y = Math.min(y, E - S / 2), v = Math.max(v, E + S / 2));
|
|
460
460
|
}
|
|
461
461
|
if (p === 1 / 0 || y === 1 / 0)
|
|
462
462
|
I.x = I.x ?? 0, I.y = I.y ?? 0, I.width = I.width ?? 0, I.height = I.height ?? 0;
|
|
463
463
|
else {
|
|
464
|
-
const M = I.padding ?? 20,
|
|
464
|
+
const M = I.padding ?? 20, T = I.parentId ? M : 2 * Tn(I), E = M, m = Math.max(0, f - p) + T, S = Math.max(0, v - y) + E, A = (p + f) / 2, R = (y + v) / 2;
|
|
465
465
|
I.x = A, I.y = R, I.width = m, I.height = S, g.set(I.id, { minX: p, maxX: f, minY: y, maxY: v });
|
|
466
466
|
}
|
|
467
467
|
}
|
|
@@ -474,18 +474,18 @@ function Zo(t, e, n, o) {
|
|
|
474
474
|
v && (I = Math.min(I, v.minY), u = Math.max(u, v.maxY));
|
|
475
475
|
}
|
|
476
476
|
if (I !== 1 / 0 && u !== -1 / 0) {
|
|
477
|
-
const f = Math.max(0, u - I), v = Math.max(p, 36), M = f + 2 * v,
|
|
477
|
+
const f = Math.max(0, u - I), v = Math.max(p, 36), M = f + 2 * v, T = (I + u) / 2;
|
|
478
478
|
for (const k of x)
|
|
479
|
-
k.y =
|
|
480
|
-
const
|
|
479
|
+
k.y = T, k.height = M, k.swimlaneContentTop = I;
|
|
480
|
+
const E = [...x].sort((k, O) => {
|
|
481
481
|
const F = k.x ?? 0, H = O.x ?? 0;
|
|
482
482
|
return F - H;
|
|
483
483
|
}), m = [], S = [], A = [];
|
|
484
|
-
for (const k of
|
|
484
|
+
for (const k of E) {
|
|
485
485
|
const O = g.get(k.id);
|
|
486
486
|
if (!O)
|
|
487
487
|
continue;
|
|
488
|
-
const F = Math.max(0, O.maxX - O.minX) + 2 *
|
|
488
|
+
const F = Math.max(0, O.maxX - O.minX) + 2 * Tn(k), H = (O.minX + O.maxX) / 2;
|
|
489
489
|
m.push(k.id), S.push(H), A.push(F);
|
|
490
490
|
}
|
|
491
491
|
const R = m.length;
|
|
@@ -605,10 +605,10 @@ function ht(t, e, n = _t) {
|
|
|
605
605
|
return Math.abs(t.y - e.y) < n;
|
|
606
606
|
}
|
|
607
607
|
d(ht, "sameY");
|
|
608
|
-
function
|
|
608
|
+
function Et(t, e, n = _t) {
|
|
609
609
|
return ht(t, e, n) && Math.abs(t.x - e.x) > n;
|
|
610
610
|
}
|
|
611
|
-
d(
|
|
611
|
+
d(Et, "isHorizontalSegment");
|
|
612
612
|
function wt(t, e, n = _t) {
|
|
613
613
|
return ft(t, e, n) && Math.abs(t.y - e.y) > n;
|
|
614
614
|
}
|
|
@@ -627,7 +627,7 @@ d(ce, "sameAxisSegmentOverlapLength");
|
|
|
627
627
|
function Re(t, e = _t) {
|
|
628
628
|
const n = [];
|
|
629
629
|
for (let o = 0; o < t.length - 1; o++) {
|
|
630
|
-
const s = t[o], r = t[o + 1], i =
|
|
630
|
+
const s = t[o], r = t[o + 1], i = Et(s, r, e), c = wt(s, r, e);
|
|
631
631
|
(i || c) && n.push({ index: o, a: s, b: r, horizontal: i, vertical: c });
|
|
632
632
|
}
|
|
633
633
|
return n;
|
|
@@ -654,7 +654,7 @@ function ro(t, e = _t) {
|
|
|
654
654
|
if (!t || t.length !== 4)
|
|
655
655
|
return;
|
|
656
656
|
const [n, o, s, r] = t;
|
|
657
|
-
return
|
|
657
|
+
return Et(n, o, e) && wt(o, s, e) && Et(s, r, e) ? { kind: "HVH", p0: n, p1: o, p2: s, p3: r } : wt(n, o, e) && Et(o, s, e) && wt(s, r, e) ? { kind: "VHV", p0: n, p1: o, p2: s, p3: r } : void 0;
|
|
658
658
|
}
|
|
659
659
|
d(ro, "classifyThreeSegmentRoute");
|
|
660
660
|
function cn(t, e, n, o = 0) {
|
|
@@ -674,7 +674,7 @@ function Je(t, e) {
|
|
|
674
674
|
return t.left < e.right && t.right > e.left && t.top < e.bottom && t.bottom > e.top;
|
|
675
675
|
}
|
|
676
676
|
d(Je, "rectsOverlap");
|
|
677
|
-
function
|
|
677
|
+
function En(t, e) {
|
|
678
678
|
return {
|
|
679
679
|
left: t.left - e,
|
|
680
680
|
right: t.right + e,
|
|
@@ -682,7 +682,7 @@ function Tn(t, e) {
|
|
|
682
682
|
bottom: t.bottom + e
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
d(
|
|
685
|
+
d(En, "inflateRect");
|
|
686
686
|
function Ae(t, e, n, o) {
|
|
687
687
|
return {
|
|
688
688
|
left: t - n / 2,
|
|
@@ -819,8 +819,8 @@ function fo(t, e, n, o, s = _t, r = 1e-6) {
|
|
|
819
819
|
const g = i ? { a: t, b: e } : { a: n, b: o }, x = c ? { a: t, b: e } : { a: n, b: o }, I = g.a.y, u = Math.min(g.a.x, g.b.x), p = Math.max(g.a.x, g.b.x), f = x.a.x, y = Math.min(x.a.y, x.b.y), v = Math.max(x.a.y, x.b.y);
|
|
820
820
|
if (f < u || f > p || I < y || I > v)
|
|
821
821
|
return !1;
|
|
822
|
-
const M = Math.abs(f - g.a.x) < r && Math.abs(I - g.a.y) < r || Math.abs(f - g.b.x) < r && Math.abs(I - g.b.y) < r,
|
|
823
|
-
return !(M &&
|
|
822
|
+
const M = Math.abs(f - g.a.x) < r && Math.abs(I - g.a.y) < r || Math.abs(f - g.b.x) < r && Math.abs(I - g.b.y) < r, T = Math.abs(f - x.a.x) < r && Math.abs(I - x.a.y) < r || Math.abs(f - x.b.x) < r && Math.abs(I - x.b.y) < r;
|
|
823
|
+
return !(M && T);
|
|
824
824
|
}
|
|
825
825
|
d(fo, "orthogonalSegmentsCross");
|
|
826
826
|
function ns(t, e, n, o, s = _t) {
|
|
@@ -1311,19 +1311,19 @@ function ms(t, e = "LR") {
|
|
|
1311
1311
|
G > y && (y = G);
|
|
1312
1312
|
}
|
|
1313
1313
|
const v = [];
|
|
1314
|
-
let M = 1 / 0,
|
|
1314
|
+
let M = 1 / 0, T = -1 / 0;
|
|
1315
1315
|
for (const P of u) {
|
|
1316
1316
|
const G = f.get(P.id) ?? [], j = po(G);
|
|
1317
|
-
j && (M = Math.min(M, j.minX),
|
|
1317
|
+
j && (M = Math.min(M, j.minX), T = Math.max(T, j.maxX), v.push({
|
|
1318
1318
|
lane: P,
|
|
1319
1319
|
contentTop: j.minY,
|
|
1320
1320
|
contentBottom: j.maxY,
|
|
1321
1321
|
centerY: (j.minY + j.maxY) / 2
|
|
1322
1322
|
}));
|
|
1323
1323
|
}
|
|
1324
|
-
if (M === 1 / 0 ||
|
|
1324
|
+
if (M === 1 / 0 || T === -1 / 0)
|
|
1325
1325
|
return !0;
|
|
1326
|
-
const
|
|
1326
|
+
const E = Math.max(0, T - M), m = Math.max(y, 10), S = E + 2 * m, A = c + S, O = (M + T) / 2 - S / 2 - c, F = O + A / 2, H = Math.max(y, c);
|
|
1327
1327
|
v.sort((P, G) => P.centerY - G.centerY);
|
|
1328
1328
|
for (let P = 0; P < v.length; P++) {
|
|
1329
1329
|
const G = v[P];
|
|
@@ -1366,30 +1366,30 @@ function ys(t, e) {
|
|
|
1366
1366
|
let y;
|
|
1367
1367
|
const v = I.rect;
|
|
1368
1368
|
for (const M of jr) {
|
|
1369
|
-
let
|
|
1369
|
+
let T, E, m;
|
|
1370
1370
|
if (a) {
|
|
1371
1371
|
const F = u.cy > I.cy ? v.bottom : v.top, H = I.cx + M;
|
|
1372
1372
|
if (H <= v.left + se || H >= v.right - se)
|
|
1373
1373
|
continue;
|
|
1374
|
-
|
|
1374
|
+
T = { x: H, y: F }, E = { x: H, y: c.y }, m = { x: c.x, y: c.y };
|
|
1375
1375
|
} else {
|
|
1376
1376
|
const F = u.cx > I.cx ? v.right : v.left, H = I.cy + M;
|
|
1377
1377
|
if (H <= v.top + se || H >= v.bottom - se)
|
|
1378
1378
|
continue;
|
|
1379
|
-
|
|
1379
|
+
T = { x: F, y: H }, E = { x: c.x, y: H }, m = { x: c.x, y: c.y };
|
|
1380
1380
|
}
|
|
1381
|
-
const S = oe(
|
|
1382
|
-
if (S && A || !S && At(
|
|
1381
|
+
const S = oe(T, E, se), A = oe(E, m, se);
|
|
1382
|
+
if (S && A || !S && At(T, E, o, [g], 1) || !A && At(E, m, o, [x], 1))
|
|
1383
1383
|
continue;
|
|
1384
|
-
const R = !S && Ze(
|
|
1384
|
+
const R = !S && Ze(T, E, t, s, {
|
|
1385
1385
|
epsilon: se,
|
|
1386
1386
|
skipDegenerateOther: !0
|
|
1387
|
-
}), k = !A && Ze(
|
|
1387
|
+
}), k = !A && Ze(E, m, t, s, {
|
|
1388
1388
|
epsilon: se,
|
|
1389
1389
|
skipDegenerateOther: !0
|
|
1390
1390
|
});
|
|
1391
1391
|
if (!(R || k)) {
|
|
1392
|
-
S ? y = [
|
|
1392
|
+
S ? y = [E, m] : A ? y = [T, E] : y = [T, E, m];
|
|
1393
1393
|
break;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
@@ -1416,8 +1416,8 @@ function xs(t, e) {
|
|
|
1416
1416
|
const v = I.x - u.x, M = I.y - u.y;
|
|
1417
1417
|
if (Math.hypot(v, M) < 1e-3)
|
|
1418
1418
|
continue;
|
|
1419
|
-
const
|
|
1420
|
-
if (!(
|
|
1419
|
+
const E = Et(I, x, 1e-3), m = wt(I, x, 1e-3), S = Et(u, I, 1e-3), A = wt(u, I, 1e-3);
|
|
1420
|
+
if (!(E && A || m && S))
|
|
1421
1421
|
continue;
|
|
1422
1422
|
const R = c.end, k = c.start, O = R ? e.get(R) : void 0;
|
|
1423
1423
|
if (!O)
|
|
@@ -1488,8 +1488,8 @@ var Z = 1e-3, Ft = 8, it = Re, In = /* @__PURE__ */ d((t, e) => ft(t, e, Z) || h
|
|
|
1488
1488
|
function bs(t, e) {
|
|
1489
1489
|
const s = /* @__PURE__ */ d((u, p) => {
|
|
1490
1490
|
const f = u.x ?? 0, y = u.y ?? 0, v = p.x - f, M = p.y - y;
|
|
1491
|
-
let
|
|
1492
|
-
return Math.abs(M) *
|
|
1491
|
+
let T = (u.width ?? 0) / 2, E = (u.height ?? 0) / 2;
|
|
1492
|
+
return Math.abs(M) * T > Math.abs(v) * E ? (M < 0 && (E = -E), { x: f + (M === 0 ? 0 : E * v / M), y: y + E }) : (v < 0 && (T = -T), { x: f + T, y: y + (v === 0 ? 0 : T * M / v) });
|
|
1493
1493
|
}, "rectIntersect"), r = /* @__PURE__ */ d((u, p) => {
|
|
1494
1494
|
const f = pt(u.points ?? []);
|
|
1495
1495
|
if (f.length < 2)
|
|
@@ -1497,9 +1497,9 @@ function bs(t, e) {
|
|
|
1497
1497
|
const y = p ? u.start : u.end, v = y ? e.get(y) : void 0, M = v ? qt(v) : void 0;
|
|
1498
1498
|
if (!v || !y || !M)
|
|
1499
1499
|
return;
|
|
1500
|
-
const
|
|
1501
|
-
let S =
|
|
1502
|
-
if (In(
|
|
1500
|
+
const T = p ? f[0] : f[f.length - 1], E = p ? f[1] : f[f.length - 2], m = s(v, T);
|
|
1501
|
+
let S = T;
|
|
1502
|
+
if (In(E, m) && (S = E), ft(m, S, Z))
|
|
1503
1503
|
return {
|
|
1504
1504
|
edge: u,
|
|
1505
1505
|
edgeId: String(u.id ?? ""),
|
|
@@ -1546,18 +1546,18 @@ function bs(t, e) {
|
|
|
1546
1546
|
const S = f.length > 1 && oe(f[1], u.railEnd, Z), A = f.slice(S ? 2 : 1), R = A[0];
|
|
1547
1547
|
return R && !In(R, v) ? void 0 : [y, v, ...A];
|
|
1548
1548
|
}
|
|
1549
|
-
const
|
|
1549
|
+
const T = f.length > 1 && oe(f[f.length - 2], u.railEnd, Z), E = f.slice(0, T ? -2 : -1), m = E[E.length - 1];
|
|
1550
1550
|
if (!(m && !In(m, v)))
|
|
1551
|
-
return [...
|
|
1551
|
+
return [...E, v, y];
|
|
1552
1552
|
}, "shiftedCandidate"), x = /* @__PURE__ */ d((u) => {
|
|
1553
1553
|
const p = u.edge, f = pt(p.points ?? []);
|
|
1554
1554
|
if (f.length !== 2)
|
|
1555
1555
|
return !1;
|
|
1556
|
-
const y = p.start, v = p.end, M = y ? e.get(y) : void 0,
|
|
1557
|
-
if (!M || !
|
|
1556
|
+
const y = p.start, v = p.end, M = y ? e.get(y) : void 0, T = v ? e.get(v) : void 0;
|
|
1557
|
+
if (!M || !T)
|
|
1558
1558
|
return !1;
|
|
1559
|
-
const
|
|
1560
|
-
return ht(R, k, Z) && Math.abs(m - A) < 1 && Math.abs(
|
|
1559
|
+
const E = M.x ?? 0, m = M.y ?? 0, S = T.x ?? 0, A = T.y ?? 0, [R, k] = f;
|
|
1560
|
+
return ht(R, k, Z) && Math.abs(m - A) < 1 && Math.abs(E - S) > 1 || ft(R, k, Z) && Math.abs(E - S) < 1 && Math.abs(m - A) > 1;
|
|
1561
1561
|
}, "laneIsStraightCollinearConnector"), I = [
|
|
1562
1562
|
-7,
|
|
1563
1563
|
7,
|
|
@@ -1571,10 +1571,10 @@ function bs(t, e) {
|
|
|
1571
1571
|
let f = !1;
|
|
1572
1572
|
for (let y = 0; y < p.length && !f; y++)
|
|
1573
1573
|
for (let v = y + 1; v < p.length && !f; v++) {
|
|
1574
|
-
const M = p[y],
|
|
1575
|
-
if (M.edge ===
|
|
1574
|
+
const M = p[y], T = p[v];
|
|
1575
|
+
if (M.edge === T.edge || !(a(M, T) || l(M, T)))
|
|
1576
1576
|
continue;
|
|
1577
|
-
const
|
|
1577
|
+
const E = !a(M, T), m = [M, T].sort((S, A) => {
|
|
1578
1578
|
const R = x(S), k = x(A);
|
|
1579
1579
|
return R !== k ? Number(R) - Number(k) : +!A.atStart - +!S.atStart;
|
|
1580
1580
|
});
|
|
@@ -1585,7 +1585,7 @@ function bs(t, e) {
|
|
|
1585
1585
|
continue;
|
|
1586
1586
|
const k = r({ ...S.edge, points: R }, S.atStart);
|
|
1587
1587
|
if (!(!k || p.some(
|
|
1588
|
-
(O) => O.edge !== S.edge && (a(k, O) ||
|
|
1588
|
+
(O) => O.edge !== S.edge && (a(k, O) || E && l(k, O))
|
|
1589
1589
|
))) {
|
|
1590
1590
|
S.edge.points = R, f = !0;
|
|
1591
1591
|
break;
|
|
@@ -1632,12 +1632,12 @@ function Ms(t, e) {
|
|
|
1632
1632
|
}, "candidateIsSafe"), i = /* @__PURE__ */ d((c, a) => {
|
|
1633
1633
|
if (a + 4 >= c.length)
|
|
1634
1634
|
return;
|
|
1635
|
-
const l = c[a], g = c[a + 1], x = c[a + 2], I = c[a + 3], u = c[a + 4], p =
|
|
1635
|
+
const l = c[a], g = c[a + 1], x = c[a + 2], I = c[a + 3], u = c[a + 4], p = Et(l, g) && wt(g, x) && Et(x, I) && wt(I, u) && ft(l, I, Z) && ft(l, u, Z) && ft(g, x, Z) && (g.x - l.x) * (I.x - x.x) < 0, f = wt(l, g) && Et(g, x) && wt(x, I) && Et(I, u) && ht(l, I, Z) && ht(l, u, Z) && ht(g, x, Z) && (g.y - l.y) * (I.y - x.y) < 0;
|
|
1636
1636
|
if (p || f)
|
|
1637
1637
|
return pt([...c.slice(0, a + 1), u, ...c.slice(a + 5)]);
|
|
1638
1638
|
if (a + 5 >= c.length)
|
|
1639
1639
|
return;
|
|
1640
|
-
const y = c[a + 5], v = wt(l, g) &&
|
|
1640
|
+
const y = c[a + 5], v = wt(l, g) && Et(g, x) && wt(x, I) && Et(I, u) && wt(u, y) && ft(l, u, Z) && ft(l, y, Z) && ft(x, I, Z) && (x.x - g.x) * (u.x - I.x) < 0, M = Et(l, g) && wt(g, x) && Et(x, I) && wt(I, u) && Et(u, y) && ht(l, u, Z) && ht(l, y, Z) && ht(x, I, Z) && (x.y - g.y) * (u.y - I.y) < 0;
|
|
1641
1641
|
if (!(!v && !M))
|
|
1642
1642
|
return pt([...c.slice(0, a + 1), y, ...c.slice(a + 6)]);
|
|
1643
1643
|
}, "withoutDogleg");
|
|
@@ -1671,12 +1671,12 @@ function Xn(t, e) {
|
|
|
1671
1671
|
let y = 0;
|
|
1672
1672
|
for (let v = 0; v < c.length; v++) {
|
|
1673
1673
|
const M = it(a(c[v], p, f));
|
|
1674
|
-
for (let
|
|
1675
|
-
const
|
|
1676
|
-
a(c[
|
|
1674
|
+
for (let T = v + 1; T < c.length; T++) {
|
|
1675
|
+
const E = it(
|
|
1676
|
+
a(c[T], p, f)
|
|
1677
1677
|
);
|
|
1678
1678
|
for (const m of M)
|
|
1679
|
-
for (const S of
|
|
1679
|
+
for (const S of E)
|
|
1680
1680
|
le(
|
|
1681
1681
|
m.a,
|
|
1682
1682
|
m.b,
|
|
@@ -1710,7 +1710,7 @@ function Xn(t, e) {
|
|
|
1710
1710
|
return f.horizontal ? zt(f.a.x, f.b.x, M.left, M.right) >= Ft && f.a.y >= M.top - 2 && f.a.y <= M.bottom + 2 : zt(f.a.y, f.b.y, M.top, M.bottom) >= Ft && f.a.x >= M.left - 2 && f.a.x <= M.right + 2;
|
|
1711
1711
|
});
|
|
1712
1712
|
}, "blockingRectsFor"), I = /* @__PURE__ */ d((p, f, y) => {
|
|
1713
|
-
const v = p.map((
|
|
1713
|
+
const v = p.map((T) => ({ ...T }));
|
|
1714
1714
|
if (f.horizontal)
|
|
1715
1715
|
v[f.index].y = y, v[f.index + 1].y = y;
|
|
1716
1716
|
else if (f.vertical)
|
|
@@ -1721,18 +1721,18 @@ function Xn(t, e) {
|
|
|
1721
1721
|
return it(M).length === M.length - 1 ? M : void 0;
|
|
1722
1722
|
}, "candidateByMovingRail"), u = /* @__PURE__ */ d((p, f, y) => {
|
|
1723
1723
|
const v = [p.start, p.end].filter(
|
|
1724
|
-
(
|
|
1724
|
+
(T) => !!T
|
|
1725
1725
|
), M = it(f);
|
|
1726
1726
|
if (M.length !== f.length - 1)
|
|
1727
1727
|
return !1;
|
|
1728
|
-
for (const
|
|
1729
|
-
if (At(
|
|
1728
|
+
for (const T of M)
|
|
1729
|
+
if (At(T.a, T.b, r, v, -2) || At(T.a, T.b, i, [], -2))
|
|
1730
1730
|
return !1;
|
|
1731
|
-
for (const
|
|
1732
|
-
if (
|
|
1733
|
-
for (const
|
|
1734
|
-
for (const m of it(a(
|
|
1735
|
-
if (ce(
|
|
1731
|
+
for (const T of c)
|
|
1732
|
+
if (T !== p) {
|
|
1733
|
+
for (const E of M)
|
|
1734
|
+
for (const m of it(a(T)))
|
|
1735
|
+
if (ce(E, m, 0.5) >= Ft)
|
|
1736
1736
|
return !1;
|
|
1737
1737
|
}
|
|
1738
1738
|
return l(p, f) <= y;
|
|
@@ -1741,21 +1741,21 @@ function Xn(t, e) {
|
|
|
1741
1741
|
const f = l();
|
|
1742
1742
|
let y = !1;
|
|
1743
1743
|
for (const v of c) {
|
|
1744
|
-
const M = a(v),
|
|
1745
|
-
if (!
|
|
1744
|
+
const M = a(v), T = g(M);
|
|
1745
|
+
if (!T)
|
|
1746
1746
|
continue;
|
|
1747
|
-
const
|
|
1748
|
-
if (
|
|
1747
|
+
const E = x(v, T.segment);
|
|
1748
|
+
if (E.length === 0)
|
|
1749
1749
|
continue;
|
|
1750
|
-
const m =
|
|
1751
|
-
Math.min(...
|
|
1752
|
-
Math.max(...
|
|
1750
|
+
const m = T.horizontal ? [
|
|
1751
|
+
Math.min(...E.map((S) => S.rect.top)) - 20,
|
|
1752
|
+
Math.max(...E.map((S) => S.rect.bottom)) + 20
|
|
1753
1753
|
] : [
|
|
1754
|
-
Math.min(...
|
|
1755
|
-
Math.max(...
|
|
1754
|
+
Math.min(...E.map((S) => S.rect.left)) - 20,
|
|
1755
|
+
Math.max(...E.map((S) => S.rect.right)) + 20
|
|
1756
1756
|
];
|
|
1757
1757
|
for (const S of m) {
|
|
1758
|
-
const A = I(M,
|
|
1758
|
+
const A = I(M, T.segment, S);
|
|
1759
1759
|
if (!(!A || !u(v, A, f))) {
|
|
1760
1760
|
v.points = A, y = !0;
|
|
1761
1761
|
break;
|
|
@@ -1874,12 +1874,12 @@ function Is(t, e) {
|
|
|
1874
1874
|
for (let y = 0; y < s.length; y++) {
|
|
1875
1875
|
const v = it(r(s[y], p));
|
|
1876
1876
|
for (let M = y + 1; M < s.length; M++) {
|
|
1877
|
-
const
|
|
1878
|
-
for (const
|
|
1879
|
-
for (const m of
|
|
1877
|
+
const T = it(r(s[M], p));
|
|
1878
|
+
for (const E of v)
|
|
1879
|
+
for (const m of T)
|
|
1880
1880
|
le(
|
|
1881
|
-
|
|
1882
|
-
|
|
1881
|
+
E.a,
|
|
1882
|
+
E.b,
|
|
1883
1883
|
m.a,
|
|
1884
1884
|
m.b,
|
|
1885
1885
|
Z
|
|
@@ -1895,24 +1895,24 @@ function Is(t, e) {
|
|
|
1895
1895
|
if (f.length < 4)
|
|
1896
1896
|
return;
|
|
1897
1897
|
const y = f[f.length - 2], v = f[f.length - 1];
|
|
1898
|
-
if (!(!
|
|
1898
|
+
if (!(!Et(y, v, Z) && !wt(y, v, Z)))
|
|
1899
1899
|
return { tailStart: y, terminal: v };
|
|
1900
1900
|
}, "terminalTailFor"), l = /* @__PURE__ */ d((p, f) => {
|
|
1901
1901
|
const y = r(p);
|
|
1902
1902
|
if (y.length < 3)
|
|
1903
1903
|
return;
|
|
1904
1904
|
const v = y[0], M = y[1];
|
|
1905
|
-
let
|
|
1906
|
-
if (
|
|
1907
|
-
|
|
1905
|
+
let T;
|
|
1906
|
+
if (Et(v, M, Z))
|
|
1907
|
+
T = { x: M.x, y: f.tailStart.y };
|
|
1908
1908
|
else if (wt(v, M, Z))
|
|
1909
|
-
|
|
1909
|
+
T = { x: f.tailStart.x, y: M.y };
|
|
1910
1910
|
else
|
|
1911
1911
|
return;
|
|
1912
|
-
const
|
|
1913
|
-
pt([v, M,
|
|
1912
|
+
const E = ae(
|
|
1913
|
+
pt([v, M, T, f.tailStart, f.terminal])
|
|
1914
1914
|
);
|
|
1915
|
-
return it(
|
|
1915
|
+
return it(E).length === E.length - 1 ? E : void 0;
|
|
1916
1916
|
}, "candidateWithDestinationTail"), g = /* @__PURE__ */ d((p, f) => {
|
|
1917
1917
|
const y = [p.start, p.end].filter(
|
|
1918
1918
|
(v) => !!v
|
|
@@ -1925,8 +1925,8 @@ function Is(t, e) {
|
|
|
1925
1925
|
for (const v of s)
|
|
1926
1926
|
if (v !== p) {
|
|
1927
1927
|
for (const M of it(f))
|
|
1928
|
-
for (const
|
|
1929
|
-
if (ce(M,
|
|
1928
|
+
for (const T of it(r(v, y)))
|
|
1929
|
+
if (ce(M, T, 0.5) >= Ft)
|
|
1930
1930
|
return !0;
|
|
1931
1931
|
}
|
|
1932
1932
|
return !1;
|
|
@@ -1946,11 +1946,11 @@ function Is(t, e) {
|
|
|
1946
1946
|
if (f === 0)
|
|
1947
1947
|
return;
|
|
1948
1948
|
const y = c();
|
|
1949
|
-
let v, M = f,
|
|
1950
|
-
for (const
|
|
1951
|
-
for (let m = 0; m <
|
|
1952
|
-
for (let S = m + 1; S <
|
|
1953
|
-
const A =
|
|
1949
|
+
let v, M = f, T = y;
|
|
1950
|
+
for (const E of u().values())
|
|
1951
|
+
for (let m = 0; m < E.length; m++)
|
|
1952
|
+
for (let S = m + 1; S < E.length; S++) {
|
|
1953
|
+
const A = E[m], R = E[S], k = a(A), O = a(R);
|
|
1954
1954
|
if (!k || !O)
|
|
1955
1955
|
continue;
|
|
1956
1956
|
const F = l(A, O), H = l(R, k);
|
|
@@ -1963,26 +1963,26 @@ function Is(t, e) {
|
|
|
1963
1963
|
if (!I(A, F, P) || !I(R, H, P))
|
|
1964
1964
|
continue;
|
|
1965
1965
|
const G = i(P), j = c(P);
|
|
1966
|
-
G >= f || G > M || G === M && j >=
|
|
1966
|
+
G >= f || G > M || G === M && j >= T || (v = P, M = G, T = j);
|
|
1967
1967
|
}
|
|
1968
1968
|
if (!v)
|
|
1969
1969
|
return;
|
|
1970
|
-
for (const [
|
|
1971
|
-
|
|
1970
|
+
for (const [E, m] of v)
|
|
1971
|
+
E.points = m;
|
|
1972
1972
|
}
|
|
1973
1973
|
}
|
|
1974
1974
|
d(Is, "swapDestinationTerminalTailsToReduceCrossings");
|
|
1975
1975
|
function Ss(t, e) {
|
|
1976
1976
|
const { realNodeRects: r, labelNodeRects: i } = me(
|
|
1977
1977
|
e.values()
|
|
1978
|
-
), c = t.filter((
|
|
1979
|
-
m.get(
|
|
1980
|
-
), "replacementPointsFor"), l = /* @__PURE__ */ d((
|
|
1978
|
+
), c = t.filter((E) => !E.isLayoutOnly), a = /* @__PURE__ */ d((E, m = /* @__PURE__ */ new Map()) => pt(
|
|
1979
|
+
m.get(E) ?? E.points ?? []
|
|
1980
|
+
), "replacementPointsFor"), l = /* @__PURE__ */ d((E = /* @__PURE__ */ new Map()) => {
|
|
1981
1981
|
let m = 0;
|
|
1982
1982
|
for (let S = 0; S < c.length; S++) {
|
|
1983
|
-
const A = it(a(c[S],
|
|
1983
|
+
const A = it(a(c[S], E));
|
|
1984
1984
|
for (let R = S + 1; R < c.length; R++) {
|
|
1985
|
-
const k = it(a(c[R],
|
|
1985
|
+
const k = it(a(c[R], E));
|
|
1986
1986
|
for (const O of A)
|
|
1987
1987
|
for (const F of k)
|
|
1988
1988
|
le(
|
|
@@ -1995,21 +1995,21 @@ function Ss(t, e) {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
}
|
|
1997
1997
|
return m;
|
|
1998
|
-
}, "strictCrossingCount"), g = /* @__PURE__ */ d((
|
|
1999
|
-
(m, S) => m + Qt(a(S,
|
|
1998
|
+
}, "strictCrossingCount"), g = /* @__PURE__ */ d((E = /* @__PURE__ */ new Map()) => c.reduce(
|
|
1999
|
+
(m, S) => m + Qt(a(S, E)),
|
|
2000
2000
|
0
|
|
2001
|
-
), "totalBends"), x = /* @__PURE__ */ d((
|
|
2002
|
-
const m =
|
|
2001
|
+
), "totalBends"), x = /* @__PURE__ */ d((E) => {
|
|
2002
|
+
const m = E.start, S = E.end, A = m ? e.get(m) : void 0, R = S ? e.get(S) : void 0, k = A ? qt(A) : void 0, O = R ? qt(R) : void 0;
|
|
2003
2003
|
return k && O ? { src: k, dst: O } : void 0;
|
|
2004
|
-
}, "endpointRectsFor"), I = /* @__PURE__ */ d((
|
|
2004
|
+
}, "endpointRectsFor"), I = /* @__PURE__ */ d((E, m, S) => {
|
|
2005
2005
|
if (S.index <= 0 || S.index + 1 >= m.length - 1)
|
|
2006
2006
|
return;
|
|
2007
|
-
const A = x(
|
|
2007
|
+
const A = x(E);
|
|
2008
2008
|
if (A) {
|
|
2009
2009
|
if (S.vertical) {
|
|
2010
2010
|
const R = S.a.x, k = Math.min(A.src.left, A.dst.left), O = Math.max(A.src.right, A.dst.right), F = R < k - Z ? "left" : R > O + Z ? "right" : void 0;
|
|
2011
2011
|
return F ? {
|
|
2012
|
-
edge:
|
|
2012
|
+
edge: E,
|
|
2013
2013
|
points: m,
|
|
2014
2014
|
segmentIndex: S.index,
|
|
2015
2015
|
axis: "vertical",
|
|
@@ -2022,7 +2022,7 @@ function Ss(t, e) {
|
|
|
2022
2022
|
if (S.horizontal) {
|
|
2023
2023
|
const R = S.a.y, k = Math.min(A.src.top, A.dst.top), O = Math.max(A.src.bottom, A.dst.bottom), F = R < k - Z ? "top" : R > O + Z ? "bottom" : void 0;
|
|
2024
2024
|
return F ? {
|
|
2025
|
-
edge:
|
|
2025
|
+
edge: E,
|
|
2026
2026
|
points: m,
|
|
2027
2027
|
segmentIndex: S.index,
|
|
2028
2028
|
axis: "horizontal",
|
|
@@ -2034,46 +2034,46 @@ function Ss(t, e) {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
2036
|
}, "externalRailForSegment"), u = /* @__PURE__ */ d(() => {
|
|
2037
|
-
const
|
|
2037
|
+
const E = [];
|
|
2038
2038
|
for (const m of c) {
|
|
2039
2039
|
const S = a(m);
|
|
2040
2040
|
for (const A of it(S)) {
|
|
2041
2041
|
const R = I(m, S, A);
|
|
2042
|
-
R &&
|
|
2042
|
+
R && E.push(R);
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
|
-
return
|
|
2046
|
-
}, "collectExternalRails"), p = /* @__PURE__ */ d((
|
|
2045
|
+
return E;
|
|
2046
|
+
}, "collectExternalRails"), p = /* @__PURE__ */ d((E, m) => E.edge !== m.edge && E.axis === m.axis && E.side === m.side && zt(E.min, E.max, m.min, m.max) >= Ft, "railsInteract"), f = /* @__PURE__ */ d((E) => {
|
|
2047
2047
|
const m = [], S = /* @__PURE__ */ new Set();
|
|
2048
|
-
for (const A of
|
|
2048
|
+
for (const A of E) {
|
|
2049
2049
|
if (S.has(A))
|
|
2050
2050
|
continue;
|
|
2051
2051
|
const R = [A], k = [];
|
|
2052
2052
|
for (S.add(A); R.length > 0; ) {
|
|
2053
2053
|
const O = R.pop();
|
|
2054
2054
|
k.push(O);
|
|
2055
|
-
for (const F of
|
|
2055
|
+
for (const F of E)
|
|
2056
2056
|
!S.has(F) && p(O, F) && (S.add(F), R.push(F));
|
|
2057
2057
|
}
|
|
2058
2058
|
k.length > 1 && m.push(k);
|
|
2059
2059
|
}
|
|
2060
2060
|
return m;
|
|
2061
|
-
}, "connectedComponents"), y = /* @__PURE__ */ d((
|
|
2061
|
+
}, "connectedComponents"), y = /* @__PURE__ */ d((E) => {
|
|
2062
2062
|
const m = [];
|
|
2063
|
-
for (const S of
|
|
2063
|
+
for (const S of E)
|
|
2064
2064
|
m.some((A) => Math.abs(A - S.coord) < Z) || m.push(S.coord);
|
|
2065
|
-
for (; m.length <
|
|
2066
|
-
const S = Math.min(...m), A = Math.max(...m), R =
|
|
2065
|
+
for (; m.length < E.length; ) {
|
|
2066
|
+
const S = Math.min(...m), A = Math.max(...m), R = E[0].side;
|
|
2067
2067
|
m.push(
|
|
2068
|
-
R === "left" || R === "top" ? S - 12 * (
|
|
2068
|
+
R === "left" || R === "top" ? S - 12 * (E.length - m.length) : A + 12 * (E.length - m.length)
|
|
2069
2069
|
);
|
|
2070
2070
|
}
|
|
2071
2071
|
return m;
|
|
2072
|
-
}, "uniqueCoordsFor"), v = /* @__PURE__ */ d((
|
|
2073
|
-
const m =
|
|
2074
|
-
if (
|
|
2072
|
+
}, "uniqueCoordsFor"), v = /* @__PURE__ */ d((E) => {
|
|
2073
|
+
const m = E.map((R) => R.coord), S = y(E), A = [];
|
|
2074
|
+
if (E.length <= 6) {
|
|
2075
2075
|
const R = new Array(S.length).fill(!1), k = [], O = /* @__PURE__ */ d(() => {
|
|
2076
|
-
if (k.length ===
|
|
2076
|
+
if (k.length === E.length) {
|
|
2077
2077
|
k.some((F, H) => Math.abs(F - m[H]) >= Z) && A.push([...k]);
|
|
2078
2078
|
return;
|
|
2079
2079
|
}
|
|
@@ -2088,9 +2088,9 @@ function Ss(t, e) {
|
|
|
2088
2088
|
[O[R], O[k]] = [O[k], O[R]], A.push(O);
|
|
2089
2089
|
}
|
|
2090
2090
|
return A;
|
|
2091
|
-
}, "coordinateAssignmentsFor"), M = /* @__PURE__ */ d((
|
|
2091
|
+
}, "coordinateAssignmentsFor"), M = /* @__PURE__ */ d((E, m) => {
|
|
2092
2092
|
const S = /* @__PURE__ */ new Map();
|
|
2093
|
-
for (const [R, k] of
|
|
2093
|
+
for (const [R, k] of E.entries()) {
|
|
2094
2094
|
const O = m[R], F = S.get(k.edge) ?? k.points.map((H) => ({ x: H.x, y: H.y }));
|
|
2095
2095
|
k.axis === "vertical" ? (F[k.segmentIndex].x = O, F[k.segmentIndex + 1].x = O) : (F[k.segmentIndex].y = O, F[k.segmentIndex + 1].y = O), S.set(k.edge, F);
|
|
2096
2096
|
}
|
|
@@ -2102,8 +2102,8 @@ function Ss(t, e) {
|
|
|
2102
2102
|
A.set(R, O);
|
|
2103
2103
|
}
|
|
2104
2104
|
return A;
|
|
2105
|
-
}, "replacementsForAssignment"),
|
|
2106
|
-
for (const [m, S] of
|
|
2105
|
+
}, "replacementsForAssignment"), T = /* @__PURE__ */ d((E) => {
|
|
2106
|
+
for (const [m, S] of E) {
|
|
2107
2107
|
const A = [
|
|
2108
2108
|
m.start,
|
|
2109
2109
|
m.end
|
|
@@ -2113,12 +2113,12 @@ function Ss(t, e) {
|
|
|
2113
2113
|
return !1;
|
|
2114
2114
|
}
|
|
2115
2115
|
for (let m = 0; m < c.length; m++) {
|
|
2116
|
-
const S = c[m], A =
|
|
2116
|
+
const S = c[m], A = E.has(S), R = it(a(S, E));
|
|
2117
2117
|
for (let k = m + 1; k < c.length; k++) {
|
|
2118
2118
|
const O = c[k];
|
|
2119
|
-
if (!A && !
|
|
2119
|
+
if (!A && !E.has(O))
|
|
2120
2120
|
continue;
|
|
2121
|
-
const F = it(a(O,
|
|
2121
|
+
const F = it(a(O, E));
|
|
2122
2122
|
for (const H of R)
|
|
2123
2123
|
for (const P of F)
|
|
2124
2124
|
if (ce(H, P, 0.5) >= Ft)
|
|
@@ -2127,7 +2127,7 @@ function Ss(t, e) {
|
|
|
2127
2127
|
}
|
|
2128
2128
|
return !0;
|
|
2129
2129
|
}, "candidateIsSafe");
|
|
2130
|
-
for (let
|
|
2130
|
+
for (let E = 0; E < 4; E++) {
|
|
2131
2131
|
const m = l();
|
|
2132
2132
|
if (m === 0)
|
|
2133
2133
|
return;
|
|
@@ -2135,7 +2135,7 @@ function Ss(t, e) {
|
|
|
2135
2135
|
for (const O of f(u()))
|
|
2136
2136
|
for (const F of v(O)) {
|
|
2137
2137
|
const H = M(O, F);
|
|
2138
|
-
if (!H || !
|
|
2138
|
+
if (!H || !T(H))
|
|
2139
2139
|
continue;
|
|
2140
2140
|
const P = l(H);
|
|
2141
2141
|
if (P >= m)
|
|
@@ -2166,14 +2166,14 @@ function Cs(t, e) {
|
|
|
2166
2166
|
for (let y = 0; y < r.length; y++) {
|
|
2167
2167
|
const v = it(i(r[y], u, p));
|
|
2168
2168
|
for (let M = y + 1; M < r.length; M++) {
|
|
2169
|
-
const
|
|
2169
|
+
const T = it(
|
|
2170
2170
|
i(r[M], u, p)
|
|
2171
2171
|
);
|
|
2172
|
-
for (const
|
|
2173
|
-
for (const m of
|
|
2172
|
+
for (const E of v)
|
|
2173
|
+
for (const m of T)
|
|
2174
2174
|
le(
|
|
2175
|
-
|
|
2176
|
-
|
|
2175
|
+
E.a,
|
|
2176
|
+
E.b,
|
|
2177
2177
|
m.a,
|
|
2178
2178
|
m.b,
|
|
2179
2179
|
Z
|
|
@@ -2203,10 +2203,10 @@ function Cs(t, e) {
|
|
|
2203
2203
|
}, "endpointRectsFor"), x = /* @__PURE__ */ d((u, p) => {
|
|
2204
2204
|
if (p + 3 >= u.length)
|
|
2205
2205
|
return [];
|
|
2206
|
-
const f = u[p], y = u[p + 1], v = u[p + 2], M = u[p + 3],
|
|
2207
|
-
if (!
|
|
2206
|
+
const f = u[p], y = u[p + 1], v = u[p + 2], M = u[p + 3], T = Et(f, y, Z) && wt(y, v, Z) && Et(v, M, Z), E = wt(f, y, Z) && Et(y, v, Z) && wt(v, M, Z);
|
|
2207
|
+
if (!T && !E)
|
|
2208
2208
|
return [];
|
|
2209
|
-
if (!(
|
|
2209
|
+
if (!(T ? Math.sign(y.x - f.x) !== Math.sign(M.x - v.x) : Math.sign(y.y - f.y) !== Math.sign(M.y - v.y)))
|
|
2210
2210
|
return [];
|
|
2211
2211
|
const S = ft(f, M, Z) || ht(f, M, Z) ? [] : [
|
|
2212
2212
|
{ x: f.x, y: M.y },
|
|
@@ -2227,29 +2227,29 @@ function Cs(t, e) {
|
|
|
2227
2227
|
(M) => !!M
|
|
2228
2228
|
), v = g(u);
|
|
2229
2229
|
for (const M of it(p))
|
|
2230
|
-
if (At(M.a, M.b, o, y, -2) || At(M.a, M.b, s, [], -2) || v.some((
|
|
2230
|
+
if (At(M.a, M.b, o, y, -2) || At(M.a, M.b, s, [], -2) || v.some((T) => l(M, T)))
|
|
2231
2231
|
return !1;
|
|
2232
2232
|
for (const M of r)
|
|
2233
2233
|
if (M !== u) {
|
|
2234
|
-
for (const
|
|
2235
|
-
for (const
|
|
2236
|
-
if (ce(
|
|
2234
|
+
for (const T of it(p))
|
|
2235
|
+
for (const E of it(i(M)))
|
|
2236
|
+
if (ce(T, E, 0.5) >= Ft)
|
|
2237
2237
|
return !1;
|
|
2238
2238
|
}
|
|
2239
2239
|
return a(u, p) <= f;
|
|
2240
2240
|
}, "candidateIsSafe");
|
|
2241
2241
|
for (let u = 0; u < 8; u++) {
|
|
2242
2242
|
const p = a();
|
|
2243
|
-
let f, y, v = p, M = Number.POSITIVE_INFINITY,
|
|
2244
|
-
for (const
|
|
2245
|
-
const m = i(
|
|
2243
|
+
let f, y, v = p, M = Number.POSITIVE_INFINITY, T = Number.POSITIVE_INFINITY;
|
|
2244
|
+
for (const E of r) {
|
|
2245
|
+
const m = i(E), S = Qt(m, Z), A = c(m);
|
|
2246
2246
|
for (let R = 0; R <= m.length - 4; R++)
|
|
2247
2247
|
for (const k of x(m, R)) {
|
|
2248
2248
|
const O = Qt(k, Z), F = c(k);
|
|
2249
|
-
if (!(O < S || O === S && F < A - Z) || !I(
|
|
2249
|
+
if (!(O < S || O === S && F < A - Z) || !I(E, k, p))
|
|
2250
2250
|
continue;
|
|
2251
|
-
const P = a(
|
|
2252
|
-
P > v || P === v && (O > M || O === M && F >=
|
|
2251
|
+
const P = a(E, k);
|
|
2252
|
+
P > v || P === v && (O > M || O === M && F >= T) || (f = E, y = k, v = P, M = O, T = F);
|
|
2253
2253
|
}
|
|
2254
2254
|
}
|
|
2255
2255
|
if (!f || !y)
|
|
@@ -2337,7 +2337,7 @@ function vs(t, e) {
|
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
2339
2339
|
return N.count - V + h;
|
|
2340
|
-
}, "crossingCountWithReplacements"),
|
|
2340
|
+
}, "crossingCountWithReplacements"), T = /* @__PURE__ */ d((N) => {
|
|
2341
2341
|
const _ = /* @__PURE__ */ new Map();
|
|
2342
2342
|
for (const h of N.pairs) {
|
|
2343
2343
|
const b = _.get(h.first) ?? /* @__PURE__ */ new Set();
|
|
@@ -2359,14 +2359,14 @@ function vs(t, e) {
|
|
|
2359
2359
|
C.sort((L, w) => (I.get(L) ?? 0) - (I.get(w) ?? 0)), C.length > 1 && D.push(C);
|
|
2360
2360
|
}
|
|
2361
2361
|
return D;
|
|
2362
|
-
}, "crossingComponents"),
|
|
2362
|
+
}, "crossingComponents"), E = /* @__PURE__ */ d((N) => [N.start, N.end].filter(
|
|
2363
2363
|
(_) => !!_
|
|
2364
2364
|
), "endpointIdsFor"), m = /* @__PURE__ */ d((N) => {
|
|
2365
2365
|
const _ = [];
|
|
2366
|
-
for (const D of
|
|
2367
|
-
const V = new Set(D), h = new Set(D.flatMap((C) =>
|
|
2366
|
+
for (const D of T(N)) {
|
|
2367
|
+
const V = new Set(D), h = new Set(D.flatMap((C) => E(C))), b = [...D];
|
|
2368
2368
|
for (const C of x)
|
|
2369
|
-
V.has(C) ||
|
|
2369
|
+
V.has(C) || E(C).some((L) => h.has(L)) && b.push(C);
|
|
2370
2370
|
b.sort((C, L) => (I.get(C) ?? 0) - (I.get(L) ?? 0)), _.push(b);
|
|
2371
2371
|
}
|
|
2372
2372
|
return _;
|
|
@@ -2538,7 +2538,7 @@ function vs(t, e) {
|
|
|
2538
2538
|
if (h.length < 4)
|
|
2539
2539
|
return [];
|
|
2540
2540
|
const b = h[0], C = h[1], L = [];
|
|
2541
|
-
return wt(b, C, Z) ? et(L, b, C, V) :
|
|
2541
|
+
return wt(b, C, Z) ? et(L, b, C, V) : Et(b, C, Z) && at(L, b, C, V), L;
|
|
2542
2542
|
}, "terminalPreservingOuterTrackCandidates"), xt = /* @__PURE__ */ d((N) => {
|
|
2543
2543
|
const _ = N.start, D = N.end, V = _ ? c.get(_) : void 0, h = D ? c.get(D) : void 0;
|
|
2544
2544
|
if (!V || !h)
|
|
@@ -2723,27 +2723,27 @@ function Ls(t, e) {
|
|
|
2723
2723
|
left: Math.min(...o.map((f) => f.rect.left)) - r,
|
|
2724
2724
|
right: Math.max(...o.map((f) => f.rect.right)) + r
|
|
2725
2725
|
}, c = /* @__PURE__ */ d((f, y, v, M) => {
|
|
2726
|
-
const
|
|
2727
|
-
return
|
|
2726
|
+
const T = [], E = co(f, y, v, M, r, pe);
|
|
2727
|
+
return E && T.push(E), y === M && T.push(ao(f, y, v, i[y])), T;
|
|
2728
2728
|
}, "buildOrthogonalPathCandidates"), a = /* @__PURE__ */ d((f, y) => {
|
|
2729
2729
|
for (let v = 0; v < f.length - 1; v++) {
|
|
2730
|
-
const M = f[v],
|
|
2731
|
-
if (At(M,
|
|
2730
|
+
const M = f[v], T = f[v + 1];
|
|
2731
|
+
if (At(M, T, o, y, 1))
|
|
2732
2732
|
return !0;
|
|
2733
2733
|
}
|
|
2734
2734
|
return !1;
|
|
2735
2735
|
}, "pathHitsNode"), l = /* @__PURE__ */ d((f, y, v = !1) => {
|
|
2736
2736
|
let M = 0;
|
|
2737
|
-
const
|
|
2737
|
+
const T = Re(f, pe), E = y.start, m = y.end;
|
|
2738
2738
|
for (const S of t) {
|
|
2739
2739
|
if (S === y || S.isLayoutOnly)
|
|
2740
2740
|
continue;
|
|
2741
2741
|
const A = S.start, R = S.end;
|
|
2742
|
-
if (!v &&
|
|
2742
|
+
if (!v && E && m && (A === E || A === m || R === E || R === m))
|
|
2743
2743
|
continue;
|
|
2744
2744
|
const k = S.points;
|
|
2745
2745
|
if (!(!k || k.length < 2))
|
|
2746
|
-
for (const O of
|
|
2746
|
+
for (const O of T)
|
|
2747
2747
|
for (const F of Re(k, pe)) {
|
|
2748
2748
|
if (fo(
|
|
2749
2749
|
O.a,
|
|
@@ -2761,9 +2761,9 @@ function Ls(t, e) {
|
|
|
2761
2761
|
}
|
|
2762
2762
|
return M;
|
|
2763
2763
|
}, "pathConflictCount"), g = 4, x = /* @__PURE__ */ d((f, y) => {
|
|
2764
|
-
const v = Math.abs(f.y - y.rect.top), M = Math.abs(f.y - y.rect.bottom),
|
|
2764
|
+
const v = Math.abs(f.y - y.rect.top), M = Math.abs(f.y - y.rect.bottom), T = Math.abs(f.x - y.rect.left), E = Math.abs(f.x - y.rect.right);
|
|
2765
2765
|
let m = "top", S = v;
|
|
2766
|
-
return M < S && (m = "bottom", S = M),
|
|
2766
|
+
return M < S && (m = "bottom", S = M), T < S && (m = "left", S = T), E < S && (m = "right", S = E), m;
|
|
2767
2767
|
}, "nearestSideOfRect"), I = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ d((f, y, v) => {
|
|
2768
2768
|
const M = I.get(f) ?? [];
|
|
2769
2769
|
M.push({ side: y, edgeId: v }), I.set(f, M);
|
|
@@ -2774,14 +2774,14 @@ function Ls(t, e) {
|
|
|
2774
2774
|
const y = f.points ?? [];
|
|
2775
2775
|
if (y.length < 1)
|
|
2776
2776
|
continue;
|
|
2777
|
-
const v = f.id ?? "", M = f.start,
|
|
2777
|
+
const v = f.id ?? "", M = f.start, T = f.end;
|
|
2778
2778
|
if (M) {
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2779
|
+
const E = n.get(M);
|
|
2780
|
+
E && u(M, x(y[0], E), v);
|
|
2781
2781
|
}
|
|
2782
|
-
if (
|
|
2783
|
-
const
|
|
2784
|
-
|
|
2782
|
+
if (T) {
|
|
2783
|
+
const E = n.get(T);
|
|
2784
|
+
E && u(T, x(y[y.length - 1], E), v);
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
2787
|
const p = /* @__PURE__ */ d((f, y, v) => I.get(f)?.some((M) => M.edgeId !== v && M.side === y) ?? !1, "faceIsClaimed");
|
|
@@ -2794,24 +2794,24 @@ function Ls(t, e) {
|
|
|
2794
2794
|
const v = Qt(y, pe);
|
|
2795
2795
|
if (v < g)
|
|
2796
2796
|
continue;
|
|
2797
|
-
const M = f.start,
|
|
2798
|
-
if (!M || !
|
|
2797
|
+
const M = f.start, T = f.end;
|
|
2798
|
+
if (!M || !T)
|
|
2799
2799
|
continue;
|
|
2800
|
-
const
|
|
2801
|
-
if (!
|
|
2800
|
+
const E = n.get(M), m = n.get(T);
|
|
2801
|
+
if (!E || !m)
|
|
2802
2802
|
continue;
|
|
2803
2803
|
const S = f.id ?? "", A = l(y, f, !0), R = l(y, f);
|
|
2804
2804
|
let k, O = A, F = v;
|
|
2805
2805
|
for (const H of s) {
|
|
2806
2806
|
if (p(M, H, S))
|
|
2807
2807
|
continue;
|
|
2808
|
-
const P = Ie(
|
|
2808
|
+
const P = Ie(E, H);
|
|
2809
2809
|
for (const G of s) {
|
|
2810
|
-
if (p(
|
|
2810
|
+
if (p(T, G, S))
|
|
2811
2811
|
continue;
|
|
2812
2812
|
const j = Ie(m, G);
|
|
2813
2813
|
for (const J of c(P, H, j, G)) {
|
|
2814
|
-
if (a(J, [M,
|
|
2814
|
+
if (a(J, [M, T]))
|
|
2815
2815
|
continue;
|
|
2816
2816
|
const dt = Qt(J, pe);
|
|
2817
2817
|
if (A > 0) {
|
|
@@ -2832,11 +2832,11 @@ function Ls(t, e) {
|
|
|
2832
2832
|
M,
|
|
2833
2833
|
H.filter((G) => G.edgeId !== S)
|
|
2834
2834
|
);
|
|
2835
|
-
const P = I.get(
|
|
2835
|
+
const P = I.get(T);
|
|
2836
2836
|
P && I.set(
|
|
2837
|
-
|
|
2837
|
+
T,
|
|
2838
2838
|
P.filter((G) => G.edgeId !== S)
|
|
2839
|
-
), u(M, x(k[0],
|
|
2839
|
+
), u(M, x(k[0], E), S), u(T, x(k[k.length - 1], m), S);
|
|
2840
2840
|
}
|
|
2841
2841
|
}
|
|
2842
2842
|
}
|
|
@@ -2875,7 +2875,7 @@ function $n(t, e) {
|
|
|
2875
2875
|
}
|
|
2876
2876
|
}
|
|
2877
2877
|
d($n, "markerClearanceRectFor");
|
|
2878
|
-
function
|
|
2878
|
+
function Ts(t) {
|
|
2879
2879
|
return {
|
|
2880
2880
|
left: Math.min(t.left, t.right),
|
|
2881
2881
|
right: Math.max(t.left, t.right),
|
|
@@ -2883,11 +2883,11 @@ function Es(t) {
|
|
|
2883
2883
|
bottom: Math.max(t.top, t.bottom)
|
|
2884
2884
|
};
|
|
2885
2885
|
}
|
|
2886
|
-
d(
|
|
2886
|
+
d(Ts, "normalizeRect");
|
|
2887
2887
|
function zn(t, e) {
|
|
2888
2888
|
const n = pt(e), o = $n(n, !0), s = $n(n, !1);
|
|
2889
2889
|
return [o, s].some(
|
|
2890
|
-
(r) => r && Je(t,
|
|
2890
|
+
(r) => r && Je(t, Ts(r))
|
|
2891
2891
|
);
|
|
2892
2892
|
}
|
|
2893
2893
|
d(zn, "labelOverlapsOwnMarker");
|
|
@@ -2921,13 +2921,13 @@ function Ue(t, e) {
|
|
|
2921
2921
|
});
|
|
2922
2922
|
}
|
|
2923
2923
|
const r = 3, i = 1, c = 12, a = /* @__PURE__ */ d((p, f) => {
|
|
2924
|
-
const y =
|
|
2924
|
+
const y = En(f, r);
|
|
2925
2925
|
for (const { nodeId: v, rect: M } of o)
|
|
2926
2926
|
if (v !== p && Je(y, M))
|
|
2927
2927
|
return !0;
|
|
2928
2928
|
return !1;
|
|
2929
2929
|
}, "labelOverlapsForeignNode"), l = /* @__PURE__ */ d((p, f) => {
|
|
2930
|
-
const y =
|
|
2930
|
+
const y = En(f, r);
|
|
2931
2931
|
for (const v of n)
|
|
2932
2932
|
if (v.edgeId !== p && cn(v.p1, v.p2, y))
|
|
2933
2933
|
return !0;
|
|
@@ -2951,13 +2951,13 @@ function Ue(t, e) {
|
|
|
2951
2951
|
const v = p.points;
|
|
2952
2952
|
if (!v || v.length < 2)
|
|
2953
2953
|
continue;
|
|
2954
|
-
const M = y.width ?? 0,
|
|
2955
|
-
if (M <= 0 ||
|
|
2954
|
+
const M = y.width ?? 0, T = y.height ?? 0;
|
|
2955
|
+
if (M <= 0 || T <= 0)
|
|
2956
2956
|
continue;
|
|
2957
|
-
const
|
|
2957
|
+
const E = [];
|
|
2958
2958
|
for (let Q = 0; Q < v.length - 1; Q++) {
|
|
2959
2959
|
const W = v[Q], et = v[Q + 1], at = Math.abs(W.x - et.x), gt = Math.abs(W.y - et.y);
|
|
2960
|
-
at < Kt && gt < Kt || at >= Kt && gt >= Kt ||
|
|
2960
|
+
at < Kt && gt < Kt || at >= Kt && gt >= Kt || E.push({
|
|
2961
2961
|
idx: Q,
|
|
2962
2962
|
length: at + gt,
|
|
2963
2963
|
orientation: at >= Kt ? "horizontal" : "vertical",
|
|
@@ -2965,37 +2965,37 @@ function Ue(t, e) {
|
|
|
2965
2965
|
midY: (W.y + et.y) / 2
|
|
2966
2966
|
});
|
|
2967
2967
|
}
|
|
2968
|
-
if (
|
|
2968
|
+
if (E.length === 0)
|
|
2969
2969
|
continue;
|
|
2970
|
-
const m =
|
|
2970
|
+
const m = E.length >= 3 ? E.filter((Q) => Q.idx > 0 && Q.idx < E.length - 1) : E, S = m.length > 0 ? m : E, A = M >= T ? "horizontal" : "vertical", R = /* @__PURE__ */ d((Q) => [...Q].sort((W, et) => {
|
|
2971
2971
|
const at = W.orientation === A, gt = et.orientation === A;
|
|
2972
2972
|
if (at !== gt)
|
|
2973
2973
|
return at ? -1 : 1;
|
|
2974
|
-
const xt = W.length >= (W.orientation === "horizontal" ? M :
|
|
2974
|
+
const xt = W.length >= (W.orientation === "horizontal" ? M : T) + 2, vt = et.length >= (et.orientation === "horizontal" ? M : T) + 2;
|
|
2975
2975
|
return xt !== vt ? xt ? -1 : 1 : et.length - W.length;
|
|
2976
|
-
}), "rankSegments"), k =
|
|
2976
|
+
}), "rankSegments"), k = E[0], O = E[E.length - 1], F = [0.5, 0.25, 0.75, 0.05, 0.95, 0.15, 0.85, 0.1, 0.9], H = /* @__PURE__ */ d((Q, W) => {
|
|
2977
2977
|
const et = v[Q.idx], at = v[Q.idx + 1];
|
|
2978
2978
|
return {
|
|
2979
2979
|
midX: et.x + (at.x - et.x) * W,
|
|
2980
2980
|
midY: et.y + (at.y - et.y) * W
|
|
2981
2981
|
};
|
|
2982
2982
|
}, "anchorAtT"), P = /* @__PURE__ */ d((Q, W, et) => Math.min(et, Math.max(W, Q)), "clamp"), G = /* @__PURE__ */ d((Q, W) => Q.midX >= W.left - Kt && Q.midX <= W.right + Kt && Q.midY >= W.top - Kt && Q.midY <= W.bottom + Kt, "pointInsideRectInclusive"), j = /* @__PURE__ */ d((Q) => {
|
|
2983
|
-
const W = Ae(Q.midX, Q.midY, M,
|
|
2983
|
+
const W = Ae(Q.midX, Q.midY, M, T), et = I(W);
|
|
2984
2984
|
if (et)
|
|
2985
2985
|
return { laneId: et, anchor: Q, rect: W };
|
|
2986
2986
|
const at = s.find(({ rect: te }) => G(Q, te));
|
|
2987
2987
|
if (!at)
|
|
2988
2988
|
return;
|
|
2989
|
-
const gt = at.rect.left + M / 2 + i, xt = at.rect.right - M / 2 - i, vt = at.rect.top +
|
|
2989
|
+
const gt = at.rect.left + M / 2 + i, xt = at.rect.right - M / 2 - i, vt = at.rect.top + T / 2 + i, Vt = at.rect.bottom - T / 2 - i;
|
|
2990
2990
|
if (gt > xt || vt > Vt)
|
|
2991
2991
|
return;
|
|
2992
2992
|
const jt = {
|
|
2993
2993
|
midX: P(Q.midX, gt, xt),
|
|
2994
2994
|
midY: P(Q.midY, vt, Vt)
|
|
2995
|
-
}, Ut = Ae(jt.midX, jt.midY, M,
|
|
2995
|
+
}, Ut = Ae(jt.midX, jt.midY, M, T);
|
|
2996
2996
|
return G(Q, Ut) ? { laneId: at.id, anchor: jt, rect: Ut } : void 0;
|
|
2997
2997
|
}, "placementForAnchor"), J = /* @__PURE__ */ d((Q, W, et) => Q.orientation === "horizontal" ? Math.abs(W.midX - et.x) : Math.abs(W.midY - et.y), "distanceAlongSegment"), dt = /* @__PURE__ */ d((Q, W) => {
|
|
2998
|
-
const at = (Q.orientation === "horizontal" ? M / 2 :
|
|
2998
|
+
const at = (Q.orientation === "horizontal" ? M / 2 : T / 2) + c;
|
|
2999
2999
|
if (Q === k) {
|
|
3000
3000
|
const gt = v[Q.idx];
|
|
3001
3001
|
if (J(Q, W, gt) + Kt < at)
|
|
@@ -3028,10 +3028,10 @@ function Ue(t, e) {
|
|
|
3028
3028
|
if (vt && !zn(vt.rect, v) && !u(f, vt.rect) && !a(f, vt.rect) && (et || !l(p.id, vt.rect)))
|
|
3029
3029
|
return { laneId: vt.laneId, anchor: vt.anchor };
|
|
3030
3030
|
}
|
|
3031
|
-
}, "findLaneContainingFallback"), Pt = mt(S) ?? (S.length <
|
|
3031
|
+
}, "findLaneContainingFallback"), Pt = mt(S) ?? (S.length < E.length ? mt(E) : void 0) ?? kt(E, !0) ?? kt(E, !1) ?? kt(E, !1, !0);
|
|
3032
3032
|
if (Pt) {
|
|
3033
3033
|
y.x = Pt.anchor.midX, y.y = Pt.anchor.midY, y.parentId = Pt.laneId;
|
|
3034
|
-
const Q = Ae(Pt.anchor.midX, Pt.anchor.midY, M,
|
|
3034
|
+
const Q = Ae(Pt.anchor.midX, Pt.anchor.midY, M, T), W = x.findIndex((et) => et.labelId === f);
|
|
3035
3035
|
W >= 0 ? x[W] = { labelId: f, rect: Q } : x.push({ labelId: f, rect: Q });
|
|
3036
3036
|
}
|
|
3037
3037
|
}
|
|
@@ -3042,7 +3042,7 @@ function Vn(t, e) {
|
|
|
3042
3042
|
return t < e ? `${t}::${e}` : `${e}::${t}`;
|
|
3043
3043
|
}
|
|
3044
3044
|
d(Vn, "pairKey");
|
|
3045
|
-
function
|
|
3045
|
+
function Es(t, e) {
|
|
3046
3046
|
const { nodeInfoById: n, realNodeRects: o } = an(e), s = /* @__PURE__ */ new Map();
|
|
3047
3047
|
for (const i of e) {
|
|
3048
3048
|
const c = i.id;
|
|
@@ -3097,8 +3097,8 @@ function Ts(t, e) {
|
|
|
3097
3097
|
}
|
|
3098
3098
|
if (At(f, y, o, [l, g], 1))
|
|
3099
3099
|
continue;
|
|
3100
|
-
const M = r(i, l, g, u ? "x" : "y"),
|
|
3101
|
-
for (const m of
|
|
3100
|
+
const M = r(i, l, g, u ? "x" : "y"), T = M > Bo ? M : Bo, E = [0, T, -T];
|
|
3101
|
+
for (const m of E) {
|
|
3102
3102
|
const S = { ...f }, A = { ...y };
|
|
3103
3103
|
if (u) {
|
|
3104
3104
|
if (S.x += m, A.x += m, S.x <= x.rect.left || S.x >= x.rect.right || A.x <= I.rect.left || A.x >= I.rect.right)
|
|
@@ -3112,7 +3112,7 @@ function Ts(t, e) {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
}
|
|
3114
3114
|
}
|
|
3115
|
-
d(
|
|
3115
|
+
d(Es, "straightenCollinearSiblingDetours");
|
|
3116
3116
|
function jn(t, e) {
|
|
3117
3117
|
const { realNodeRects: a, labelNodeRects: l } = me(
|
|
3118
3118
|
e.values()
|
|
@@ -3212,7 +3212,7 @@ function jn(t, e) {
|
|
|
3212
3212
|
],
|
|
3213
3213
|
1e-3
|
|
3214
3214
|
);
|
|
3215
|
-
}, "horizontalSourceDetour"),
|
|
3215
|
+
}, "horizontalSourceDetour"), T = /* @__PURE__ */ d((m, S) => {
|
|
3216
3216
|
const A = y(m);
|
|
3217
3217
|
if (A) {
|
|
3218
3218
|
if (m.vertical)
|
|
@@ -3234,7 +3234,7 @@ function jn(t, e) {
|
|
|
3234
3234
|
A.tail
|
|
3235
3235
|
);
|
|
3236
3236
|
}
|
|
3237
|
-
}, "sourceDetourCandidate"),
|
|
3237
|
+
}, "sourceDetourCandidate"), E = [
|
|
3238
3238
|
-7,
|
|
3239
3239
|
7,
|
|
3240
3240
|
-14,
|
|
@@ -3252,13 +3252,13 @@ function jn(t, e) {
|
|
|
3252
3252
|
continue;
|
|
3253
3253
|
const H = [O, F].filter((P) => P.interior);
|
|
3254
3254
|
for (const P of H) {
|
|
3255
|
-
for (const G of
|
|
3255
|
+
for (const G of E) {
|
|
3256
3256
|
const j = p(P, G);
|
|
3257
3257
|
if (j && u(P.edge, j)) {
|
|
3258
3258
|
P.edge.points = j, A = !0;
|
|
3259
3259
|
break;
|
|
3260
3260
|
}
|
|
3261
|
-
const J =
|
|
3261
|
+
const J = T(P, G);
|
|
3262
3262
|
if (J && u(P.edge, J)) {
|
|
3263
3263
|
P.edge.points = J, A = !0;
|
|
3264
3264
|
break;
|
|
@@ -3352,7 +3352,7 @@ function Rs(t, e) {
|
|
|
3352
3352
|
Qe(a)
|
|
3353
3353
|
));
|
|
3354
3354
|
}
|
|
3355
|
-
Ls(o, n),
|
|
3355
|
+
Ls(o, n), Es(o, n), ys(o, n);
|
|
3356
3356
|
const r = /* @__PURE__ */ new Map();
|
|
3357
3357
|
for (const c of n)
|
|
3358
3358
|
r.set(String(c.id), c);
|
|
@@ -3598,18 +3598,18 @@ function Bs(t, e) {
|
|
|
3598
3598
|
const A = y.get(S);
|
|
3599
3599
|
A ? A.push(m.id) : y.set(S, [m.id]);
|
|
3600
3600
|
}
|
|
3601
|
-
const v = [], M = [],
|
|
3602
|
-
if (!
|
|
3603
|
-
|
|
3601
|
+
const v = [], M = [], T = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ d((m) => {
|
|
3602
|
+
if (!T.has(m)) {
|
|
3603
|
+
T.add(m), v.push(m);
|
|
3604
3604
|
for (const S of l.get(m) ?? [])
|
|
3605
|
-
|
|
3605
|
+
E(S);
|
|
3606
3606
|
M.push(m);
|
|
3607
3607
|
}
|
|
3608
3608
|
}, "walk");
|
|
3609
3609
|
for (const m of x)
|
|
3610
|
-
|
|
3610
|
+
E(m);
|
|
3611
3611
|
for (const m of i)
|
|
3612
|
-
|
|
3612
|
+
E(m);
|
|
3613
3613
|
return {
|
|
3614
3614
|
parent: a,
|
|
3615
3615
|
children: l,
|
|
@@ -3692,60 +3692,60 @@ function Hs(t, e, n, o) {
|
|
|
3692
3692
|
d(Hs, "popBlock");
|
|
3693
3693
|
function Xs(t, e, n) {
|
|
3694
3694
|
const o = [...t.nodes], s = /* @__PURE__ */ new Map();
|
|
3695
|
-
for (const [M,
|
|
3696
|
-
s.set(
|
|
3695
|
+
for (const [M, T] of o.entries())
|
|
3696
|
+
s.set(T, M);
|
|
3697
3697
|
const r = o.length, i = new Array(r).fill(-1), c = new Array(r).fill(0), a = [], l = /* @__PURE__ */ new Set();
|
|
3698
3698
|
for (const M of o) {
|
|
3699
|
-
const
|
|
3700
|
-
|
|
3699
|
+
const T = n.parent.get(M) ?? null, E = s.get(M);
|
|
3700
|
+
E != null && T == null && (i[E] = -1, c[E] = 0, l.has(M) || (l.add(M), a.push(M)));
|
|
3701
3701
|
}
|
|
3702
3702
|
for (; a.length > 0; ) {
|
|
3703
|
-
const M = a.shift(),
|
|
3704
|
-
if (
|
|
3703
|
+
const M = a.shift(), T = s.get(M);
|
|
3704
|
+
if (T == null)
|
|
3705
3705
|
continue;
|
|
3706
|
-
const
|
|
3707
|
-
for (const m of
|
|
3706
|
+
const E = n.children.get(M) ?? [];
|
|
3707
|
+
for (const m of E) {
|
|
3708
3708
|
if (l.has(m))
|
|
3709
3709
|
continue;
|
|
3710
3710
|
const S = s.get(m);
|
|
3711
|
-
S != null && (i[S] =
|
|
3711
|
+
S != null && (i[S] = T, c[S] = c[T] + 1, l.add(m), a.push(m));
|
|
3712
3712
|
}
|
|
3713
3713
|
}
|
|
3714
3714
|
for (const M of o) {
|
|
3715
3715
|
if (l.has(M))
|
|
3716
3716
|
continue;
|
|
3717
|
-
const
|
|
3718
|
-
|
|
3717
|
+
const T = s.get(M);
|
|
3718
|
+
T != null && (i[T] = -1, c[T] = 0, l.add(M));
|
|
3719
3719
|
}
|
|
3720
3720
|
const g = Math.max(1, Math.ceil(Math.log2(Math.max(1, r))) + 1), x = Array.from({ length: g }, () => new Array(r).fill(-1));
|
|
3721
3721
|
for (let M = 0; M < r; M++)
|
|
3722
3722
|
x[0][M] = i[M];
|
|
3723
3723
|
for (let M = 1; M < g; M++)
|
|
3724
|
-
for (let
|
|
3725
|
-
const
|
|
3726
|
-
x[M][
|
|
3724
|
+
for (let T = 0; T < r; T++) {
|
|
3725
|
+
const E = x[M - 1][T];
|
|
3726
|
+
x[M][T] = E === -1 ? -1 : x[M - 1][E];
|
|
3727
3727
|
}
|
|
3728
|
-
const I = /* @__PURE__ */ d((M,
|
|
3729
|
-
if (M === -1 ||
|
|
3728
|
+
const I = /* @__PURE__ */ d((M, T) => {
|
|
3729
|
+
if (M === -1 || T === -1)
|
|
3730
3730
|
return -1;
|
|
3731
|
-
c[M] < c[
|
|
3732
|
-
const
|
|
3731
|
+
c[M] < c[T] && ([M, T] = [T, M]);
|
|
3732
|
+
const E = c[M] - c[T];
|
|
3733
3733
|
for (let m = 0; m < g; m++)
|
|
3734
|
-
if (
|
|
3734
|
+
if (E >> m & 1 && (M = x[m][M], M === -1))
|
|
3735
3735
|
return -1;
|
|
3736
|
-
if (M ===
|
|
3736
|
+
if (M === T)
|
|
3737
3737
|
return M;
|
|
3738
3738
|
for (let m = g - 1; m >= 0; m--) {
|
|
3739
|
-
const S = x[m][M], A = x[m][
|
|
3740
|
-
S === -1 || A === -1 || S !== A && (M = S,
|
|
3739
|
+
const S = x[m][M], A = x[m][T];
|
|
3740
|
+
S === -1 || A === -1 || S !== A && (M = S, T = A);
|
|
3741
3741
|
}
|
|
3742
3742
|
return x[0][M];
|
|
3743
3743
|
}, "lcaIndex"), u = Array.from({ length: r }, () => /* @__PURE__ */ new Map());
|
|
3744
3744
|
for (const M of t.edges) {
|
|
3745
|
-
let
|
|
3746
|
-
if (m == null || S == null || (m > S && ([
|
|
3745
|
+
let T = M.src, E = M.dst, m = e[T], S = e[E];
|
|
3746
|
+
if (m == null || S == null || (m > S && ([T, E] = [E, T], [m, S] = [S, m]), m == null || S == null || m === S))
|
|
3747
3747
|
continue;
|
|
3748
|
-
const A = s.get(
|
|
3748
|
+
const A = s.get(T), R = s.get(E);
|
|
3749
3749
|
if (A == null || R == null)
|
|
3750
3750
|
continue;
|
|
3751
3751
|
const k = I(A, R);
|
|
@@ -3755,14 +3755,14 @@ function Xs(t, e, n) {
|
|
|
3755
3755
|
for (let F = m; F < S; F++)
|
|
3756
3756
|
O.set(F, (O.get(F) ?? 0) + 1);
|
|
3757
3757
|
}
|
|
3758
|
-
const p = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ d((M,
|
|
3759
|
-
if (
|
|
3760
|
-
for (const [
|
|
3761
|
-
M.set(
|
|
3758
|
+
const p = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ d((M, T) => {
|
|
3759
|
+
if (T.size !== 0)
|
|
3760
|
+
for (const [E, m] of T)
|
|
3761
|
+
M.set(E, (M.get(E) ?? 0) + m);
|
|
3762
3762
|
}, "mergeInto"), y = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ d((M) => {
|
|
3763
|
-
const
|
|
3763
|
+
const T = s.get(M);
|
|
3764
3764
|
y.add(M);
|
|
3765
|
-
const
|
|
3765
|
+
const E = T == null ? void 0 : u[T], m = E ? new Map(E) : /* @__PURE__ */ new Map(), S = n.children.get(M) ?? [];
|
|
3766
3766
|
for (const A of S) {
|
|
3767
3767
|
const R = v(A), k = e[M];
|
|
3768
3768
|
if (k != null) {
|
|
@@ -3999,18 +3999,18 @@ function Ks(t, e) {
|
|
|
3999
3999
|
return !0;
|
|
4000
4000
|
}), a = Be(n) ?? [...n.nodes], l = [...a].reverse(), g = /* @__PURE__ */ d((p, f) => {
|
|
4001
4001
|
let y = 0;
|
|
4002
|
-
for (const
|
|
4003
|
-
y = Math.max(y, (s[
|
|
4002
|
+
for (const T of i.get(p) ?? [])
|
|
4003
|
+
y = Math.max(y, (s[T] ?? 0) + 1);
|
|
4004
4004
|
let v = Number.POSITIVE_INFINITY;
|
|
4005
4005
|
const M = c.get(p) ?? [];
|
|
4006
|
-
return M.length > 0 && (v = Math.min(...M.map((
|
|
4006
|
+
return M.length > 0 && (v = Math.min(...M.map((T) => (s[T] ?? 0) - 1))), Number.isFinite(v) || (v = Math.max(y, f)), Math.min(Math.max(f, y), v);
|
|
4007
4007
|
}, "clampFeasible"), x = sn.GRAVITY_ITERATIONS, I = /* @__PURE__ */ d((p) => {
|
|
4008
4008
|
let f = !1;
|
|
4009
4009
|
for (const y of p) {
|
|
4010
4010
|
const v = i.get(y) ?? [], M = c.get(y) ?? [];
|
|
4011
4011
|
if (v.length === 0 && M.length === 0)
|
|
4012
4012
|
continue;
|
|
4013
|
-
const
|
|
4013
|
+
const T = v.length > 0 ? v.reduce((A, R) => A + (s[R] ?? 0) + 1, 0) / v.length : s[y] ?? 0, E = M.length > 0 ? M.reduce((A, R) => A + (s[R] ?? 0) - 1, 0) / M.length : s[y] ?? 0, m = Math.round((T + E) / 2), S = g(y, m);
|
|
4014
4014
|
S !== s[y] && (s[y] = S, f = !0);
|
|
4015
4015
|
}
|
|
4016
4016
|
return f;
|
|
@@ -4061,8 +4061,8 @@ function Js(t, e) {
|
|
|
4061
4061
|
let u = 0;
|
|
4062
4062
|
if (I.length > 0)
|
|
4063
4063
|
for (const v of I) {
|
|
4064
|
-
const M = v.src,
|
|
4065
|
-
u = Math.max(u,
|
|
4064
|
+
const M = v.src, T = i[M] ?? 0;
|
|
4065
|
+
u = Math.max(u, T + a(M, g));
|
|
4066
4066
|
}
|
|
4067
4067
|
const p = r(g), f = c.get(p) ?? 0, y = Math.max(u, f);
|
|
4068
4068
|
i[g] = y, c.set(p, y + 1);
|
|
@@ -4088,9 +4088,9 @@ function Zs(t, e) {
|
|
|
4088
4088
|
continue;
|
|
4089
4089
|
}
|
|
4090
4090
|
let y = u.src;
|
|
4091
|
-
for (let M = p + 1,
|
|
4092
|
-
const
|
|
4093
|
-
g.push({ id: `${u.id}#${
|
|
4091
|
+
for (let M = p + 1, T = 0; M < f; M++, T++) {
|
|
4092
|
+
const E = a(M);
|
|
4093
|
+
g.push({ id: `${u.id}#${T}`, src: y, dst: E, weight: u.weight, ref: u.ref }), y = E;
|
|
4094
4094
|
}
|
|
4095
4095
|
const v = f - p - 2;
|
|
4096
4096
|
g.push({
|
|
@@ -4197,8 +4197,8 @@ function Zn(t, e, n, o, s) {
|
|
|
4197
4197
|
u = !1;
|
|
4198
4198
|
for (let f = 0; f + 1 < r.length; f++) {
|
|
4199
4199
|
if (I) {
|
|
4200
|
-
const M = I.get(r[f]),
|
|
4201
|
-
if (M !==
|
|
4200
|
+
const M = I.get(r[f]), T = I.get(r[f + 1]);
|
|
4201
|
+
if (M !== T)
|
|
4202
4202
|
continue;
|
|
4203
4203
|
}
|
|
4204
4204
|
const y = p;
|
|
@@ -4234,10 +4234,10 @@ function nr(t, e, n) {
|
|
|
4234
4234
|
for (const O of a)
|
|
4235
4235
|
for (const F of O)
|
|
4236
4236
|
M.add(p(F));
|
|
4237
|
-
const
|
|
4238
|
-
for (const O of
|
|
4237
|
+
const T = M.has(null), E = f.filter((O) => M.has(O)), m = [...T ? [null] : [], ...E], S = /* @__PURE__ */ Object.create(null);
|
|
4238
|
+
for (const O of E)
|
|
4239
4239
|
S[O] = 0;
|
|
4240
|
-
|
|
4240
|
+
T && (S.null = 0);
|
|
4241
4241
|
for (const O of a) {
|
|
4242
4242
|
const F = /* @__PURE__ */ Object.create(null), H = [];
|
|
4243
4243
|
for (const P of O) {
|
|
@@ -4248,7 +4248,7 @@ function nr(t, e, n) {
|
|
|
4248
4248
|
const j = G.reduce((J, dt) => J + I(dt), 0) + s * Math.max(0, G.length - 1);
|
|
4249
4249
|
S[P] = Math.max(S[P] ?? 0, j);
|
|
4250
4250
|
}
|
|
4251
|
-
if (
|
|
4251
|
+
if (T && H.length) {
|
|
4252
4252
|
const P = H.reduce((G, j) => G + I(j), 0) + s * Math.max(0, H.length - 1);
|
|
4253
4253
|
S.null = Math.max(S.null ?? 0, P);
|
|
4254
4254
|
}
|
|
@@ -4451,7 +4451,7 @@ function ur(t, e) {
|
|
|
4451
4451
|
};
|
|
4452
4452
|
}
|
|
4453
4453
|
d(ur, "sugiyamaLayout");
|
|
4454
|
-
var ct = qr.EPSILON, Jr = 8, be = 15,
|
|
4454
|
+
var ct = qr.EPSILON, Jr = 8, be = 15, Ee = 15, je = 25, ne = 20, Cn = 10;
|
|
4455
4455
|
function eo(t, e, n) {
|
|
4456
4456
|
const o = t.x ?? 0, s = t.y ?? 0, r = e.x - o, i = e.y - s, c = Math.abs(r), a = Math.abs(i);
|
|
4457
4457
|
return c < ct && a < ct ? n : a > ct && a * 3 >= c ? i > 0 ? "bottom" : "top" : c > ct ? r > 0 ? "right" : "left" : n;
|
|
@@ -4536,7 +4536,7 @@ function hr(t, e) {
|
|
|
4536
4536
|
Y.edgeIndex === h || Y.orientation !== "horizontal" || Y.pipe.coord < q || Y.pipe.coord > z || Y.from - ct <= U && Y.to + ct >= U && (B += v);
|
|
4537
4537
|
}
|
|
4538
4538
|
return B;
|
|
4539
|
-
}, "crossingPenalty"),
|
|
4539
|
+
}, "crossingPenalty"), T = s.map((h, b) => {
|
|
4540
4540
|
if (!h.start || !h.end)
|
|
4541
4541
|
return { idx: b, crossLane: 0, dx: 0, dy: 0 };
|
|
4542
4542
|
const C = r.get(h.start), L = r.get(h.end), w = i.get(h.start), B = i.get(h.end), U = w && B && w.id !== B.id ? 1 : 0, q = C && L ? Math.abs((L.x ?? 0) - (C.x ?? 0)) : 0, z = C && L ? Math.abs((L.y ?? 0) - (C.y ?? 0)) : 0;
|
|
@@ -4546,7 +4546,7 @@ function hr(t, e) {
|
|
|
4546
4546
|
return b.crossLane - h.crossLane;
|
|
4547
4547
|
const C = h.dx + h.dy, L = b.dx + b.dy;
|
|
4548
4548
|
return Math.abs(C - L) > 1 ? C - L : h.idx - b.idx;
|
|
4549
|
-
}).map((h) => h.idx),
|
|
4549
|
+
}).map((h) => h.idx), E = /* @__PURE__ */ d((h, b, C, L) => {
|
|
4550
4550
|
const w = Math.min(h.x, b.x), B = Math.max(h.x, b.x), U = Math.min(h.y, b.y), q = Math.max(h.y, b.y);
|
|
4551
4551
|
return !!g.find((Y) => C && Y.nodeId === C || L && Y.nodeId === L ? !1 : Math.abs(h.x - b.x) > ct ? Y.minY < h.y && Y.maxY > h.y && Y.maxX > w && Y.minX < B : Y.minX < h.x && Y.maxX > h.x && Y.maxY > U && Y.minY < q);
|
|
4552
4552
|
}, "isSegmentBlocked"), m = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
|
|
@@ -4648,7 +4648,7 @@ function hr(t, e) {
|
|
|
4648
4648
|
const ot = J.get(`${h}:src`), rt = J.get(`${h}:dst`);
|
|
4649
4649
|
return ot !== void 0 && (z = Pt(z, U, ot)), rt !== void 0 && (Y = Pt(Y, q, rt)), { pSrcPort: z, pDstPort: Y, srcSide: U, dstSide: q };
|
|
4650
4650
|
}, "portsForEdge");
|
|
4651
|
-
for (const h of
|
|
4651
|
+
for (const h of T) {
|
|
4652
4652
|
const b = s[h];
|
|
4653
4653
|
if (f[h] = [], !b.start || !b.end || b.points && b.points.length > 0 || b.start === b.end)
|
|
4654
4654
|
continue;
|
|
@@ -4685,14 +4685,14 @@ function hr(t, e) {
|
|
|
4685
4685
|
const Nt = X.y > ($.y ?? 0);
|
|
4686
4686
|
return {
|
|
4687
4687
|
x: (K.x ?? 0) >= X.x ? lt.maxX + be : lt.minX - be,
|
|
4688
|
-
y: Nt ? lt.maxY +
|
|
4688
|
+
y: Nt ? lt.maxY + Ee : lt.minY - Ee,
|
|
4689
4689
|
leavesPositiveSide: Nt
|
|
4690
4690
|
};
|
|
4691
4691
|
}
|
|
4692
|
-
const bt = X.x > ($.x ?? 0),
|
|
4692
|
+
const bt = X.x > ($.x ?? 0), Tt = (K.y ?? 0) >= X.y;
|
|
4693
4693
|
return {
|
|
4694
4694
|
x: bt ? lt.maxX + be : lt.minX - be,
|
|
4695
|
-
y:
|
|
4695
|
+
y: Tt ? lt.maxY + Ee : lt.minY - Ee,
|
|
4696
4696
|
leavesPositiveSide: bt
|
|
4697
4697
|
};
|
|
4698
4698
|
}, "obstacleDetour");
|
|
@@ -4748,8 +4748,8 @@ function hr(t, e) {
|
|
|
4748
4748
|
}
|
|
4749
4749
|
}
|
|
4750
4750
|
if (yt.length === 0 && Dt.length === 0) {
|
|
4751
|
-
const X = be, $ = Math.abs(z.x - Y.x) < X, K = Math.abs(z.y - Y.y) < X, lt = J.get(`${h}:src`) !== void 0 || J.get(`${h}:dst`) !== void 0, Ct = (m.get(`${b.start ?? ""}:${U}:src`)?.length ?? 0) + (m.get(`${b.start ?? ""}:${U}:dst`)?.length ?? 0), bt = (m.get(`${b.end ?? ""}:${q}:src`)?.length ?? 0) + (m.get(`${b.end ?? ""}:${q}:dst`)?.length ?? 0),
|
|
4752
|
-
if (($ || K) && !lt && (!
|
|
4751
|
+
const X = be, $ = Math.abs(z.x - Y.x) < X, K = Math.abs(z.y - Y.y) < X, lt = J.get(`${h}:src`) !== void 0 || J.get(`${h}:dst`) !== void 0, Ct = (m.get(`${b.start ?? ""}:${U}:src`)?.length ?? 0) + (m.get(`${b.start ?? ""}:${U}:dst`)?.length ?? 0), bt = (m.get(`${b.end ?? ""}:${q}:src`)?.length ?? 0) + (m.get(`${b.end ?? ""}:${q}:dst`)?.length ?? 0), Tt = Ct > 1 || bt > 1, Nt = S.get(b.start ?? "") ?? 0, ut = S.get(b.end ?? "") ?? 0, Yt = Ct > 1 && kt(b.start, U) || bt > 1 && kt(b.end, q), ee = Ct <= 1 || Nt <= 2, Bt = bt <= 1 || ut <= 2;
|
|
4752
|
+
if (($ || K) && !lt && (!Tt || Tt && !Yt && ee && Bt) && !E(w, B, b.start, b.end)) {
|
|
4753
4753
|
b.points = [{ ...w }, { ...z }, { ...Y }, { ...B }], y.add(h);
|
|
4754
4754
|
const Mt = K ? "horizontal" : "vertical", $t = K ? w.y : w.x, It = K ? Math.min(w.x, B.x) : Math.min(w.y, B.y), St = K ? Math.max(w.x, B.x) : Math.max(w.y, B.y), Wt = {
|
|
4755
4755
|
id: `fast-path-${Mt}-${$t.toFixed(0)}-${h}`,
|
|
@@ -4785,7 +4785,7 @@ function hr(t, e) {
|
|
|
4785
4785
|
continue;
|
|
4786
4786
|
const $ = be;
|
|
4787
4787
|
x("horizontal", X.minY - $, ue, he), x("horizontal", X.maxY + $, ue, he);
|
|
4788
|
-
const K =
|
|
4788
|
+
const K = Ee;
|
|
4789
4789
|
x("vertical", X.minX - K, ve, Le), x("vertical", X.maxX + K, ve, Le);
|
|
4790
4790
|
}
|
|
4791
4791
|
x("horizontal", z.y, ue, he), x("horizontal", Y.y, ue, he);
|
|
@@ -4800,7 +4800,7 @@ function hr(t, e) {
|
|
|
4800
4800
|
pt: z
|
|
4801
4801
|
}), De.add(Fe);
|
|
4802
4802
|
let Ht = [];
|
|
4803
|
-
const ge = /* @__PURE__ */ d((X, $) =>
|
|
4803
|
+
const ge = /* @__PURE__ */ d((X, $) => E(X, $, b.start, b.end), "checkSegmentBlocked"), yn = { x: Y.x, y: z.y }, br = ge(z, yn), Mr = ge(yn, Y), Ir = br || Mr, xn = { x: z.x, y: Y.y }, Sr = ge(z, xn), Cr = ge(xn, Y);
|
|
4804
4804
|
if (Ir ? Sr || Cr || (Math.abs(z.x - Y.x) < ct ? Ht = [z, Y] : Ht = [z, xn, Y]) : Math.abs(z.y - Y.y) < ct || Math.abs(z.x - Y.x) < ct ? Ht = [z, Y] : Ht = [z, yn, Y], Ht.length === 0)
|
|
4805
4805
|
for (; xe.length > 0; ) {
|
|
4806
4806
|
xe.sort((ut, Yt) => ut.f - Yt.f);
|
|
@@ -4813,22 +4813,22 @@ function hr(t, e) {
|
|
|
4813
4813
|
}
|
|
4814
4814
|
break;
|
|
4815
4815
|
}
|
|
4816
|
-
const $ = X.pt.x, K = X.pt.y, lt = xr.sort((ut, Yt) => ut.coord - Yt.coord), Ct = lt.findIndex((ut) => Math.abs(ut.coord - $) < 1), bt = yr.sort((ut, Yt) => ut.coord - Yt.coord),
|
|
4817
|
-
Ct > 0 && Nt.push({ x: lt[Ct - 1].coord, y: K }), Ct >= 0 && Ct < lt.length - 1 && Nt.push({ x: lt[Ct + 1].coord, y: K }),
|
|
4816
|
+
const $ = X.pt.x, K = X.pt.y, lt = xr.sort((ut, Yt) => ut.coord - Yt.coord), Ct = lt.findIndex((ut) => Math.abs(ut.coord - $) < 1), bt = yr.sort((ut, Yt) => ut.coord - Yt.coord), Tt = bt.findIndex((ut) => Math.abs(ut.coord - K) < 1), Nt = [];
|
|
4817
|
+
Ct > 0 && Nt.push({ x: lt[Ct - 1].coord, y: K }), Ct >= 0 && Ct < lt.length - 1 && Nt.push({ x: lt[Ct + 1].coord, y: K }), Tt > 0 && Nt.push({ x: $, y: bt[Tt - 1].coord }), Tt >= 0 && Tt < bt.length - 1 && Nt.push({ x: $, y: bt[Tt + 1].coord });
|
|
4818
4818
|
for (const ut of Nt) {
|
|
4819
4819
|
const Yt = Math.min($, ut.x), ee = Math.max($, ut.x), Bt = Math.min(K, ut.y), Gt = Math.max(K, ut.y);
|
|
4820
4820
|
if (g.some((Zt) => Zt.nodeId === b.start || Zt.nodeId === b.end ? !1 : Yt !== ee ? Zt.minY < K && Zt.maxY > K && Zt.maxX > Yt && Zt.minX < ee : Zt.minX < $ && Zt.maxX > $ && Zt.maxY > Bt && Zt.minY < Gt))
|
|
4821
4821
|
continue;
|
|
4822
4822
|
const Mt = ke(ut.x, ut.y), $t = Math.abs(ut.x - $) + Math.abs(ut.y - K), It = M(h, X.pt, ut);
|
|
4823
4823
|
let St = 0;
|
|
4824
|
-
const Wt = Y.x - z.x,
|
|
4825
|
-
(
|
|
4824
|
+
const Wt = Y.x - z.x, Te = Y.y - z.y, He = ut.x - $, bn = ut.y - K;
|
|
4825
|
+
(Te > 10 && bn < -5 || Te < -10 && bn > 5) && (St = Math.abs(bn) * 100), (Wt > 10 && He < -5 || Wt < -10 && He > 5) && (St += Math.abs(He) * 50);
|
|
4826
4826
|
let Lo = 0;
|
|
4827
|
-
const
|
|
4828
|
-
|
|
4827
|
+
const To = mn.get(X.key) ?? "n", Eo = Math.abs(He) > ct ? "h" : "v";
|
|
4828
|
+
To !== "n" && To !== Eo && (Lo = 50);
|
|
4829
4829
|
const vr = $t + It + St + Lo, Xe = (_e.get(X.key) ?? 1 / 0) + vr, wo = Math.abs(Y.x - ut.x) + Math.abs(Y.y - ut.y);
|
|
4830
4830
|
if (Xe < (_e.get(Mt) ?? 1 / 0))
|
|
4831
|
-
if (pn.set(Mt, X.pt), _e.set(Mt, Xe), mn.set(Mt,
|
|
4831
|
+
if (pn.set(Mt, X.pt), _e.set(Mt, Xe), mn.set(Mt, Eo), !De.has(Mt))
|
|
4832
4832
|
xe.push({ key: Mt, f: Xe + wo, pt: ut }), De.add(Mt);
|
|
4833
4833
|
else {
|
|
4834
4834
|
const Zt = xe.findIndex((Lr) => Lr.key === Mt);
|
|
@@ -4841,10 +4841,10 @@ function hr(t, e) {
|
|
|
4841
4841
|
let K = Math.min(X.x, $.x), lt = Math.max(X.x, $.x), Ct = Math.min(X.y, $.y), bt = Math.max(X.y, $.y);
|
|
4842
4842
|
for (const Bt of Ht)
|
|
4843
4843
|
K = Math.min(K, Bt.x), lt = Math.max(lt, Bt.x), Ct = Math.min(Ct, Bt.y), bt = Math.max(bt, Bt.y);
|
|
4844
|
-
const
|
|
4844
|
+
const Tt = lt > Math.max(X.x, $.x), Nt = K < Math.min(X.x, $.x);
|
|
4845
4845
|
if (a) {
|
|
4846
|
-
const Bt =
|
|
4847
|
-
if (
|
|
4846
|
+
const Bt = Ee;
|
|
4847
|
+
if (Tt) {
|
|
4848
4848
|
const Gt = Math.max(X.x, $.x), Ot = Math.min(X.y, $.y), Mt = Math.max(X.y, $.y), $t = g.filter(
|
|
4849
4849
|
(It) => It.minX < Gt && It.maxX > Gt && // obstacle's x-range contains the path x
|
|
4850
4850
|
It.minY < Mt && It.maxY > Ot
|
|
@@ -4856,8 +4856,8 @@ function hr(t, e) {
|
|
|
4856
4856
|
const Wt = (St.minX + St.maxX) / 2;
|
|
4857
4857
|
if (St.visualXHalfExtent === void 0 || isNaN(St.visualXHalfExtent))
|
|
4858
4858
|
continue;
|
|
4859
|
-
const
|
|
4860
|
-
It = Math.max(It,
|
|
4859
|
+
const Te = Wt + St.visualXHalfExtent + Bt;
|
|
4860
|
+
It = Math.max(It, Te);
|
|
4861
4861
|
}
|
|
4862
4862
|
isNaN(It) || (lt = It);
|
|
4863
4863
|
}
|
|
@@ -4904,9 +4904,9 @@ function hr(t, e) {
|
|
|
4904
4904
|
}
|
|
4905
4905
|
return $.y;
|
|
4906
4906
|
}, "findBestReturnY"), Yt = /* @__PURE__ */ d((Bt) => {
|
|
4907
|
-
const Gt = ut(Bt), Ot = { x: Bt, y: X.y }, Mt = { x: Bt, y: Gt }, $t = { x: $.x, y: Gt }, It = ge(X, Ot), St = ge(Ot, Mt), Wt = ge(Mt, $t),
|
|
4908
|
-
return !It && !St && !Wt && !
|
|
4909
|
-
}, "trySimplifyWithDetourX"), ee =
|
|
4907
|
+
const Gt = ut(Bt), Ot = { x: Bt, y: X.y }, Mt = { x: Bt, y: Gt }, $t = { x: $.x, y: Gt }, It = ge(X, Ot), St = ge(Ot, Mt), Wt = ge(Mt, $t), Te = Gt !== $.y ? ge($t, $) : !1;
|
|
4908
|
+
return !It && !St && !Wt && !Te ? Math.abs(Gt - $.y) < ct ? [X, Ot, Mt, $] : [X, Ot, Mt, $t, $] : null;
|
|
4909
|
+
}, "trySimplifyWithDetourX"), ee = Tt && !Nt ? Yt(lt) : Nt && !Tt ? Yt(K) : null;
|
|
4910
4910
|
ee && (Ht = ee);
|
|
4911
4911
|
}
|
|
4912
4912
|
const Xt = [
|
|
@@ -4920,11 +4920,11 @@ function hr(t, e) {
|
|
|
4920
4920
|
if (Xt.length >= 3) {
|
|
4921
4921
|
const X = Xt[Xt.length - 1], $ = Xt[Xt.length - 2], K = Xt[Xt.length - 3], lt = Math.abs(K.y - $.y) < ct && Math.abs($.y - X.y) < ct, Ct = Math.abs(K.x - $.x) < ct && Math.abs($.x - X.x) < ct;
|
|
4922
4922
|
if (lt) {
|
|
4923
|
-
const bt = Math.sign($.x - K.x),
|
|
4924
|
-
bt !== 0 && bt ===
|
|
4923
|
+
const bt = Math.sign($.x - K.x), Tt = Math.sign(X.x - K.x);
|
|
4924
|
+
bt !== 0 && bt === Tt && Math.abs($.x - K.x) > Math.abs(X.x - K.x) && Xt.splice(-2, 1);
|
|
4925
4925
|
} else if (Ct) {
|
|
4926
|
-
const bt = Math.sign($.y - K.y),
|
|
4927
|
-
bt !== 0 && bt ===
|
|
4926
|
+
const bt = Math.sign($.y - K.y), Tt = Math.sign(X.y - K.y);
|
|
4927
|
+
bt !== 0 && bt === Tt && Math.abs($.y - K.y) > Math.abs(X.y - K.y) && Xt.splice(-2, 1);
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
4930
4930
|
const ie = [Xt[0]];
|
|
@@ -4954,7 +4954,7 @@ function hr(t, e) {
|
|
|
4954
4954
|
}
|
|
4955
4955
|
ie.push(Xt[Xt.length - 1]);
|
|
4956
4956
|
for (let X = 0; X < ie.length - 1; X++) {
|
|
4957
|
-
const $ = ie[X], K = ie[X + 1], lt = Math.abs($.x - K.x) < ct ? "vertical" : "horizontal", Ct = lt === "vertical" ? $.x : $.y, bt = lt === "vertical" ? Math.min($.y, K.y) : Math.min($.x, K.x),
|
|
4957
|
+
const $ = ie[X], K = ie[X + 1], lt = Math.abs($.x - K.x) < ct ? "vertical" : "horizontal", Ct = lt === "vertical" ? $.x : $.y, bt = lt === "vertical" ? Math.min($.y, K.y) : Math.min($.x, K.x), Tt = lt === "vertical" ? Math.max($.y, K.y) : Math.max($.x, K.x), Nt = x(lt, Ct, bt, Tt), ut = {
|
|
4958
4958
|
edgeIndex: h,
|
|
4959
4959
|
segmentIndex: X,
|
|
4960
4960
|
orientation: lt,
|
|
@@ -4962,13 +4962,13 @@ function hr(t, e) {
|
|
|
4962
4962
|
trackIndex: 0,
|
|
4963
4963
|
// Initial track
|
|
4964
4964
|
from: bt,
|
|
4965
|
-
to:
|
|
4965
|
+
to: Tt
|
|
4966
4966
|
};
|
|
4967
4967
|
p.push(ut), f[h].push(p.length - 1), Nt.tracks[0] || (Nt.tracks[0] = { index: 0, coord: Nt.coord, segments: [] }), Nt.tracks[0].segments.push({
|
|
4968
4968
|
edgeIndex: h,
|
|
4969
4969
|
segmentIndex: X,
|
|
4970
4970
|
from: bt,
|
|
4971
|
-
to:
|
|
4971
|
+
to: Tt
|
|
4972
4972
|
});
|
|
4973
4973
|
}
|
|
4974
4974
|
}
|
|
@@ -5320,7 +5320,7 @@ function pr(t) {
|
|
|
5320
5320
|
d(pr, "runSwimlaneLayoutCore");
|
|
5321
5321
|
async function Zr(t, e) {
|
|
5322
5322
|
const n = e.select("g");
|
|
5323
|
-
|
|
5323
|
+
Er(n, t.markers, t.type, t.diagramId), wr(), Ar(), Rr(), Tr(), qo(t);
|
|
5324
5324
|
const o = Qo(t);
|
|
5325
5325
|
t.nodes = o.nodes, t.edges = o.edges;
|
|
5326
5326
|
const { groups: s } = await Fo(n, t);
|