@juki-team/base-ui 1.4.108 → 1.4.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/ArrowForwardIcon-CfqRXB-e.js +1 -0
- package/dist/esm/BarChart-BflV6xj2.js +1 -0
- package/dist/esm/{CartesianChart-Baw7HRSt.js → CartesianChart-Be_Msy-L.js} +5 -5
- package/dist/esm/ChangePasswordModal-DX01z_Xk.js +1 -0
- package/dist/esm/CodeEditor-BOGzDG3d.js +1 -0
- package/dist/esm/CodeViewer-DViv-qRC.js +1 -0
- package/dist/esm/Collapse-B-9MQjHh.js +1 -0
- package/dist/esm/{DataGrid-DfeSy9_J.js → DataGrid-DAZ5DKz9.js} +2 -2
- package/dist/esm/DataViewer-D8eXfNsQ.js +1 -0
- package/dist/esm/DrawerView-BVaIELlv.js +1 -0
- package/dist/esm/ExcalidrawButton-pTn865SY.js +1 -0
- package/dist/esm/GraphvizViewer-vH3t2wUS.js +1 -0
- package/dist/esm/ImageLoaderCropper-C5KjohnD.js +1 -0
- package/dist/esm/InputCellPhoneNumber-D9uGI1bD.js +1 -0
- package/dist/esm/InputColor-DrI8PNC-.js +14 -0
- package/dist/esm/LineChart-DLj6A5m5.js +1 -0
- package/dist/esm/MdMath-B4XKMYj5.js +1 -0
- package/dist/esm/{MdMathEditor-CpZtmRPS.js → MdMathEditor-ChZMTVwl.js} +2 -2
- package/dist/esm/{Popover-D_58lHiS.js → Popover-Crnc5Mbi.js} +1 -1
- package/dist/esm/ProblemStatus-FyUP73Qa.js +1 -0
- package/dist/esm/ReplyIcon-MNlM5Yom.js +1 -0
- package/dist/esm/SettingsIcon-DYcyghgs.js +1 -0
- package/dist/esm/SlideDeck-CzwvVTCV.js +1 -0
- package/dist/esm/TableOfContents-CBjKYpSh.js +1 -0
- package/dist/esm/TextHeadCell-Br9BtjJh.js +1 -0
- package/dist/esm/{Tooltip-yTYBsAPO.js → Tooltip-BLaMAeAf.js} +1 -1
- package/dist/esm/{UserCodeEditor-DDOoLvCn.js → UserCodeEditor-BawBx01d.js} +3 -3
- package/dist/esm/VirtualizedRowsFixed-CGitJjiS.js +1 -0
- package/dist/esm/WorksheetAsSlides-CLjpQVm5.js +1 -0
- package/dist/esm/WorksheetBodies-CZeRGme9.js +1 -0
- package/dist/esm/WorksheetContents-CnJBOanQ.js +1 -0
- package/dist/esm/WorksheetEditor-fMHttnD5.js +1 -0
- package/dist/esm/WorksheetNode-Kpoi8x-M.js +1 -0
- package/dist/esm/WorksheetViewer-CcPGkFZY.js +1 -0
- package/dist/esm/{arc-BqJSq9Se.js → arc-CpSlG_nw.js} +1 -1
- package/dist/esm/architecture-YZFGNWBL-B8OIAguO.js +1 -0
- package/dist/esm/architectureDiagram-Q4EWVU46-BqXqiLku.js +1 -0
- package/dist/esm/blockDiagram-DXYQGD6D-yjrbpeL0.js +1 -0
- package/dist/esm/c4Diagram-AHTNJAMY-4NdVv0Ao.js +1 -0
- package/dist/esm/channel-BzbUIu8B.js +1 -0
- package/dist/esm/{chunk-4BX2VUAB-CnWIexnZ.js → chunk-4BX2VUAB-CdXAk4UL.js} +1 -1
- package/dist/esm/{chunk-4TB4RGXK-DZFf4xWt.js → chunk-4TB4RGXK-DeaLGiy0.js} +1 -1
- package/dist/esm/{chunk-55IACEB6--eYNbhf5.js → chunk-55IACEB6-ZkJD77DM.js} +1 -1
- package/dist/esm/{chunk-EDXVE4YY-Bz1Eb3eQ.js → chunk-EDXVE4YY-CqeZhnl8.js} +1 -1
- package/dist/esm/{chunk-FMBD7UC4-_aFPbUyk.js → chunk-FMBD7UC4-B4Z_oaMt.js} +1 -1
- package/dist/esm/{chunk-OYMX7WX6-6xwPlg6L.js → chunk-OYMX7WX6-CiBqSRlH.js} +1 -1
- package/dist/esm/{chunk-QZHKN3VN-Cbrr74yt.js → chunk-QZHKN3VN-C_DglKRL.js} +1 -1
- package/dist/esm/{chunk-YZCP3GAM-bcgQ75kF.js → chunk-YZCP3GAM-C92EM7hh.js} +1 -1
- package/dist/esm/classDiagram-6PBFFD2Q-IphAkZk8.js +1 -0
- package/dist/esm/classDiagram-v2-HSJHXN6E-IphAkZk8.js +1 -0
- package/dist/esm/clone-c8fZ8s2e.js +1 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/cose-bilkent-S5V4N54A-DXHTtvh4.js +1 -0
- package/dist/esm/{cytoscape.esm-CCdmu2Bz.js → cytoscape.esm-B8MMPWBb.js} +1 -1
- package/dist/esm/dagre-KV5264BT-C1Bi5Hlh.js +1 -0
- package/dist/esm/date-Be2Mk-oF.js +1 -0
- package/dist/esm/date-DabTuCYQ.js +1 -0
- package/dist/esm/diagram-5BDNPKRD-CRH_FA4_.js +1 -0
- package/dist/esm/diagram-G4DWMVQ6-GP4ahuTv.js +1 -0
- package/dist/esm/diagram-MMDJMWI5-DFTlftEV.js +1 -0
- package/dist/esm/diagram-TYMM5635-Cn4xZrOw.js +1 -0
- package/dist/esm/erDiagram-SMLLAGMA-Ck4PcI--.js +1 -0
- package/dist/esm/flowDiagram-DWJPFMVM-BBbHw1zk.js +1 -0
- package/dist/esm/ganttDiagram-T4ZO3ILL-GoBARLMA.js +1 -0
- package/dist/esm/gitGraph-7Q5UKJZL-D0FpBDlQ.js +1 -0
- package/dist/esm/gitGraphDiagram-UUTBAWPF-B-znwuk7.js +1 -0
- package/dist/esm/{graph-i0Iev2-Z.js → graph-D6v73SUk.js} +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/index-B0Ju49H0.js +1 -0
- package/dist/esm/{index-9OsMb8z-.js → index-B8o5x2RR.js} +1 -1
- package/dist/esm/index-BD_n8l03.js +1 -0
- package/dist/esm/index-BWbfbDmw.js +1 -0
- package/dist/esm/{index-B5nEC544.js → index-BXwIVJ1i.js} +1 -1
- package/dist/esm/{index-C8adNPQr.js → index-B_SR88hF.js} +1 -1
- package/dist/esm/{index-BD2F8534.js → index-BdEuQrE0.js} +1 -1
- package/dist/esm/{index-nQf0NFR-.js → index-Buo8u5Rd.js} +1 -1
- package/dist/esm/{index-rdA_qZgh.js → index-BypZQ30J.js} +1 -1
- package/dist/esm/{index-BR_DZYGh.js → index-CG-nC_T_.js} +1 -1
- package/dist/esm/{index-lcxmGwoj.js → index-CG5i3mPd.js} +1 -1
- package/dist/esm/{index-C1WDoixa.js → index-CHC6KNKh.js} +1 -1
- package/dist/esm/{index-M6y9Wbel.js → index-CLMLLwc9.js} +1 -1
- package/dist/esm/{index-CxP7N0Hx.js → index-CUjyY2a3.js} +1 -1
- package/dist/esm/{index-BEVf94U5.js → index-C__8JPAk.js} +1 -1
- package/dist/esm/index-CjH2xgIx.js +2 -0
- package/dist/esm/{index-CgfL5OzV.js → index-CoedJ1ql.js} +1 -1
- package/dist/esm/{index-BLW3It0q.js → index-CueeU9Hx.js} +1 -1
- package/dist/esm/{index-DzHNpFcT.js → index-D1ky-z91.js} +1 -1
- package/dist/esm/{index-BjZU1VKq.js → index-DDs-O4vd.js} +1 -1
- package/dist/esm/{index-1CDORI5w.js → index-DEH449Hc.js} +1 -1
- package/dist/esm/{index-BUSYadhg.js → index-DFMzt8xL.js} +1 -1
- package/dist/esm/{index-CWn0Vi5N.js → index-DI-7QOUe.js} +1 -1
- package/dist/esm/{index-BmpEdvsk.js → index-DUtxMiYq.js} +1 -1
- package/dist/esm/index-DaLn6fdm.js +1 -0
- package/dist/esm/{index-CNCj4you.js → index-DquUMjcv.js} +1 -1
- package/dist/esm/{index-CQlgVNck.js → index-MkWt_kX0.js} +1 -1
- package/dist/esm/{index-CM96a8L6.js → index-_eiBoCQ6.js} +1 -1
- package/dist/esm/{index-DJK6aeDm.js → index-a79hibwg.js} +1 -1
- package/dist/esm/{index-Cpax-OZ_.js → index-iowlALIm.js} +1 -1
- package/dist/esm/{index-DptBXgBN.js → index-tGGDvGCv.js} +1 -1
- package/dist/esm/info-OMHHGYJF-DloUnReg.js +1 -0
- package/dist/esm/infoDiagram-42DDH7IO-BZXN5IXJ.js +1 -0
- package/dist/esm/ishikawaDiagram-UXIWVN3A-DyGvD6G7.js +1 -0
- package/dist/esm/journeyDiagram-VCZTEJTY-DxXXhahs.js +1 -0
- package/dist/esm/kanban-definition-6JOO6SKY-D4Fz7zVa.js +1 -0
- package/dist/esm/{layout-Dl8swpJM.js → layout-FPgIfzKv.js} +1 -1
- package/dist/esm/{lib-DdKR2uQv.js → lib-mG56Y3Rb.js} +1 -1
- package/dist/esm/{linear-Bjc68iA-.js → linear-BRlKh6eb.js} +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/{mermaid-parser.core-CKOUdqet.js → mermaid-parser.core-BCKOf1D4.js} +1 -1
- package/dist/esm/{mermaid.core-DcN2Nakz.js → mermaid.core-Dx_hE5Vb.js} +1 -1
- package/dist/esm/mindmap-definition-QFDTVHPH-BudCGGFH.js +1 -0
- package/dist/esm/packet-4T2RLAQJ-DrY-zHX-.js +1 -0
- package/dist/esm/pie-ZZUOXDRM-Ong88F43.js +1 -0
- package/dist/esm/pieDiagram-DEJITSTG-BhJWS0Q4.js +1 -0
- package/dist/esm/quadrantDiagram-34T5L4WZ-WoNzEH2-.js +1 -0
- package/dist/esm/radar-PYXPWWZC-D57lFxmR.js +1 -0
- package/dist/esm/requirementDiagram-MS252O5E-C0M6L425.js +1 -0
- package/dist/esm/sankeyDiagram-XADWPNL6-DwH4gDO6.js +1 -0
- package/dist/esm/sequenceDiagram-FGHM5R23-DgDclAkj.js +1 -0
- package/dist/esm/server.js +1 -1
- package/dist/esm/settings.js +1 -1
- package/dist/esm/stateDiagram-FHFEXIEX-CuWet3bI.js +1 -0
- package/dist/esm/stateDiagram-v2-QKLJ7IA2-CGfwkJ3x.js +1 -0
- package/dist/esm/{time-D_shzpG-.js → time-CyaZFqIA.js} +1 -1
- package/dist/esm/timeline-definition-GMOUNBTQ-BMFr1mBJ.js +1 -0
- package/dist/esm/treeView-SZITEDCU-CYq4WblB.js +1 -0
- package/dist/esm/treemap-W4RFUUIX-70AFdrYl.js +1 -0
- package/dist/esm/{types-5lPOp5sX.js → types-DMKo-tVy.js} +1 -1
- package/dist/esm/vennDiagram-DHZGUBPP-D0NR4Ns6.js +1 -0
- package/dist/esm/wardley-RL74JXVD-Kam1OQea.js +1 -0
- package/dist/esm/wardleyDiagram-NUSXRM2D-CTlkGBtH.js +1 -0
- package/dist/esm/websocket-CoMeGplN.js +1 -0
- package/dist/esm/{worksheet-C49PpYy4.js → worksheet-BxUIsAEo.js} +1 -1
- package/dist/esm/worksheet-ClM0CaBH.js +1 -0
- package/dist/esm/{worksheet-b5Ja38dB.js → worksheet-D1AAXRU9.js} +1 -1
- package/dist/esm/xychartDiagram-5P7HB3ND-CWDBw8NU.js +1 -0
- package/dist/module-types/src/components/atoms/T/T.server.d.ts +2 -0
- package/dist/module-types/src/components/atoms/T/cache.d.ts +4 -0
- package/dist/module-types/src/components/atoms/T/client.d.ts +7 -0
- package/dist/module-types/src/components/atoms/T/server.d.ts +12 -0
- package/dist/module-types/src/components/atoms/T/shared.d.ts +2 -0
- package/dist/module-types/src/components/atoms/T/types.d.ts +11 -0
- package/dist/module-types/src/components/atoms/index.d.ts +1 -1
- package/dist/module-types/src/components/atoms/{DateLiteral → server/DateLiteral}/types.d.ts +1 -1
- package/dist/module-types/src/components/atoms/server/T/index.d.ts +3 -0
- package/dist/module-types/src/components/atoms/server/index.d.ts +2 -0
- package/dist/module-types/src/components/atoms/types.d.ts +0 -1
- package/dist/module-types/src/components/helpers/date.d.ts +2 -3
- package/dist/module-types/src/components/helpers/problem.d.ts +1 -2
- package/dist/module-types/src/components/molecules/index.d.ts +0 -2
- package/dist/module-types/src/components/molecules/server/NewlineInfo/NewlineInfo.d.ts +2 -0
- package/dist/module-types/src/components/molecules/server/NewlineInfo/types.d.ts +3 -0
- package/dist/module-types/src/components/molecules/server/index.d.ts +2 -0
- package/dist/module-types/src/components/molecules/server/types.d.ts +1 -0
- package/dist/module-types/src/components/organisms/_layz_/DataViewer/commons/utils.d.ts +1 -2
- package/dist/module-types/src/components/organisms/index.d.ts +0 -1
- package/dist/module-types/src/components/organisms/{TextHeadCell → server/TextHeadCell}/TextHeadCell.d.ts +1 -1
- package/dist/module-types/src/components/organisms/server/index.d.ts +3 -0
- package/dist/module-types/src/components/organisms/server/types.d.ts +1 -0
- package/dist/module-types/src/components/providers/JukiI18nBridge/JukiI18nBridge.d.ts +23 -0
- package/dist/module-types/src/components/providers/JukiI18nBridge/index.d.ts +1 -0
- package/dist/module-types/src/components/providers/JukiUIProvider/types.d.ts +2 -20
- package/dist/module-types/src/components/providers/index.d.ts +1 -1
- package/dist/module-types/src/components/providers/server/Image/types.d.ts +20 -0
- package/dist/module-types/src/components/providers/server/index.d.ts +1 -0
- package/dist/module-types/src/components/providers/server/types.d.ts +1 -0
- package/dist/module-types/src/components/server/index.d.ts +3 -0
- package/dist/module-types/src/components/server/types.d.ts +3 -0
- package/dist/module-types/src/components/templates/index.d.ts +0 -1
- package/dist/module-types/src/components/templates/problem/types.d.ts +0 -6
- package/dist/module-types/src/components/templates/server/ProblemStatus/types.d.ts +6 -0
- package/dist/module-types/src/components/templates/server/index.d.ts +1 -0
- package/dist/module-types/src/components/templates/server/types.d.ts +1 -0
- package/dist/module-types/src/hooks/index.d.ts +0 -1
- package/package.json +3 -3
- package/dist/esm/ArrowForwardIcon-CAW87Y9x.js +0 -1
- package/dist/esm/BarChart-DIQRNd6X.js +0 -1
- package/dist/esm/ChangePasswordModal-Ct1SQk_8.js +0 -1
- package/dist/esm/CodeEditor-B2a58qPl.js +0 -1
- package/dist/esm/CodeViewer-DQU8BMXl.js +0 -1
- package/dist/esm/Collapse-BptfTJkN.js +0 -1
- package/dist/esm/DataViewer-DtHc31H0.js +0 -1
- package/dist/esm/DrawerView-Dj3KsxZ5.js +0 -1
- package/dist/esm/ExcalidrawButton-BxKNP8Ju.js +0 -1
- package/dist/esm/GraphvizViewer-CoUNA6V3.js +0 -1
- package/dist/esm/ImageLoaderCropper-BfEUj6Lt.js +0 -1
- package/dist/esm/InputCellPhoneNumber-C3wckkgH.js +0 -1
- package/dist/esm/InputColor-BP4osp1m.js +0 -14
- package/dist/esm/LineChart-BEBY05Jk.js +0 -1
- package/dist/esm/LineLoader-DJ-mqlCg.js +0 -1
- package/dist/esm/MdMath-BPRFr0z2.js +0 -1
- package/dist/esm/ReplyIcon-CFQENJJ2.js +0 -1
- package/dist/esm/SettingsIcon-B-R6M6zm.js +0 -1
- package/dist/esm/SlideDeck-VjBsZWE5.js +0 -1
- package/dist/esm/TableEyeIcon-ArU4vD_b.js +0 -1
- package/dist/esm/TableOfContents-CJTjJpW1.js +0 -1
- package/dist/esm/VirtualizedRowsFixed-CSfuBo-L.js +0 -1
- package/dist/esm/WorksheetAsSlides-BsxgD7Ou.js +0 -1
- package/dist/esm/WorksheetBodies-CoUCsRQL.js +0 -1
- package/dist/esm/WorksheetContents-CXwCj_9n.js +0 -1
- package/dist/esm/WorksheetEditor-B6sFcv5f.js +0 -1
- package/dist/esm/WorksheetNode-D9TYabCW.js +0 -1
- package/dist/esm/WorksheetViewer-DzWM2z--.js +0 -1
- package/dist/esm/architecture-YZFGNWBL-B4l12l1n.js +0 -1
- package/dist/esm/architectureDiagram-Q4EWVU46-35IDohve.js +0 -1
- package/dist/esm/blockDiagram-DXYQGD6D-DMV0Turg.js +0 -1
- package/dist/esm/c4Diagram-AHTNJAMY-B1Q5D-a4.js +0 -1
- package/dist/esm/channel-BmfGiUet.js +0 -1
- package/dist/esm/classDiagram-6PBFFD2Q-DfQo6n2Y.js +0 -1
- package/dist/esm/classDiagram-v2-HSJHXN6E-DfQo6n2Y.js +0 -1
- package/dist/esm/clone-ytho4G-U.js +0 -1
- package/dist/esm/commons-Ql7V2J1Q.js +0 -1
- package/dist/esm/cose-bilkent-S5V4N54A-BSGvXKpJ.js +0 -1
- package/dist/esm/dagre-KV5264BT-vfGof8_w.js +0 -1
- package/dist/esm/diagram-5BDNPKRD-BNLEkZrt.js +0 -1
- package/dist/esm/diagram-G4DWMVQ6-BNy00oOM.js +0 -1
- package/dist/esm/diagram-MMDJMWI5-m5lju_Ql.js +0 -1
- package/dist/esm/diagram-TYMM5635-DcdkioVb.js +0 -1
- package/dist/esm/erDiagram-SMLLAGMA-CceV2aLj.js +0 -1
- package/dist/esm/flowDiagram-DWJPFMVM-7JDV2iFZ.js +0 -1
- package/dist/esm/ganttDiagram-T4ZO3ILL-BJitnff4.js +0 -1
- package/dist/esm/gitGraph-7Q5UKJZL-Lm8K3gu8.js +0 -1
- package/dist/esm/gitGraphDiagram-UUTBAWPF-BFIe5oyZ.js +0 -1
- package/dist/esm/index-3eSLBs4N.js +0 -1
- package/dist/esm/index-CpZesTpI.js +0 -1
- package/dist/esm/index-DEsPeQN2.js +0 -1
- package/dist/esm/index-DS396i5X.js +0 -2
- package/dist/esm/index-sCShfFDb.js +0 -1
- package/dist/esm/info-OMHHGYJF-DgFByN2Q.js +0 -1
- package/dist/esm/infoDiagram-42DDH7IO-_pYHRGdQ.js +0 -1
- package/dist/esm/ishikawaDiagram-UXIWVN3A-DDWTFBtt.js +0 -1
- package/dist/esm/journeyDiagram-VCZTEJTY-DyNlikrx.js +0 -1
- package/dist/esm/kanban-definition-6JOO6SKY-Cvqzz0T0.js +0 -1
- package/dist/esm/mindmap-definition-QFDTVHPH-D6o47E4D.js +0 -1
- package/dist/esm/packet-4T2RLAQJ-nSjqpN2G.js +0 -1
- package/dist/esm/pie-ZZUOXDRM-DE0yKaq5.js +0 -1
- package/dist/esm/pieDiagram-DEJITSTG-DNKo_uDP.js +0 -1
- package/dist/esm/quadrantDiagram-34T5L4WZ-CfNwmuso.js +0 -1
- package/dist/esm/radar-PYXPWWZC-B221trO2.js +0 -1
- package/dist/esm/requirementDiagram-MS252O5E-DMqflNcm.js +0 -1
- package/dist/esm/sankeyDiagram-XADWPNL6-Bxl0NJ7t.js +0 -1
- package/dist/esm/sequenceDiagram-FGHM5R23-BcciAiMg.js +0 -1
- package/dist/esm/stateDiagram-FHFEXIEX-Cn-RB4wx.js +0 -1
- package/dist/esm/stateDiagram-v2-QKLJ7IA2-C6pgM7SG.js +0 -1
- package/dist/esm/timeline-definition-GMOUNBTQ-BLR2EM9w.js +0 -1
- package/dist/esm/treeView-SZITEDCU-ChLgNmS5.js +0 -1
- package/dist/esm/treemap-W4RFUUIX-DRWvqad0.js +0 -1
- package/dist/esm/vennDiagram-DHZGUBPP-jpRGjpOo.js +0 -1
- package/dist/esm/wardley-RL74JXVD-zNwlgftV.js +0 -1
- package/dist/esm/wardleyDiagram-NUSXRM2D-B8WsPQJA.js +0 -1
- package/dist/esm/websocket-Dly3sf0m.js +0 -1
- package/dist/esm/worksheet-CglFWSed.js +0 -1
- package/dist/esm/xychartDiagram-5P7HB3ND-5kY0N0P9.js +0 -1
- package/dist/module-types/src/components/molecules/InformationPopover/NewlineInfo.d.ts +0 -3
- package/dist/module-types/src/components/providers/JukiI18nInitializer/JukiI18nInitializer.d.ts +0 -1
- package/dist/module-types/src/components/providers/JukiI18nInitializer/index.d.ts +0 -1
- package/dist/module-types/src/stores/i18n/i18n.d.ts +0 -2
- package/dist/module-types/src/stores/i18n/i18nConfig.d.ts +0 -7
- package/dist/module-types/src/stores/i18n/useI18nStore.d.ts +0 -8
- /package/dist/module-types/src/components/atoms/{DateLiteral → server/DateLiteral}/DateLiteral.d.ts +0 -0
- /package/dist/module-types/src/components/molecules/{ThemeColorPalette → server/ThemeColorPalette}/ThemeColorPalette.d.ts +0 -0
- /package/dist/module-types/src/components/organisms/{SubmitView/commons → server/SubmissionMemory}/SubmissionMemory.d.ts +0 -0
- /package/dist/module-types/src/components/organisms/{SubmitView/commons → server/SubmissionTime}/SubmissionTime.d.ts +0 -0
- /package/dist/module-types/src/components/providers/{JukiUIProvider → server/Image}/Image.d.ts +0 -0
- /package/dist/module-types/src/components/templates/{problem → server/ProblemStatus}/ProblemStatus.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,l as e,d as i}from"./mermaid.core-Dx_hE5Vb.js";import{c as r}from"./cytoscape.esm-B8MMPWBb.js";import{J as n}from"./index-CjH2xgIx.js";import"./purify.es-BkjUCQC6.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"react/jsx-runtime";import"react";import"./settings-DgLs6IK_.js";import"./ProblemStatus-FyUP73Qa.js";import"./index-BWbfbDmw.js";import"./enums.js";import"./date-Be2Mk-oF.js";import"./date-DabTuCYQ.js";import"./websocket-CoMeGplN.js";import"./worksheet-ClM0CaBH.js";import"motion/react";import"react-dom";import"./index-BD_n8l03.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";var o,s={exports:{}},a={exports:{}},h={exports:{}};function l(){return o?h.exports:(o=1,t=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=26)}([function(t,e,i){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,e,i){var r=i(2),n=i(8),o=i(9);function s(t,e,i){r.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(var a in s.prototype=Object.create(r.prototype),r)s[a]=r[a];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(t,e){for(var i=this.getOtherEnd(t),r=e.getGraphManager().getRoot();;){if(i.getOwner()==e)return i;if(i.getOwner()==r)break;i=i.getOwner().getParent()}return null},s.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,i){t.exports=function(t){this.vGraphObject=t}},function(t,e,i){var r=i(2),n=i(10),o=i(13),s=i(0),a=i(16),h=i(4);function l(t,e,i,s){null==i&&null==s&&(s=e),r.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=i&&null!=e?new o(e.x,e.y,i.width,i.height):new o}for(var g in l.prototype=Object.create(r.prototype),r)l[g]=r[g];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(t){this.rect.width=t},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(t){this.rect.height=t},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},l.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},l.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},l.prototype.getEdgeListToNode=function(t){var e=[],i=this;return i.edges.forEach(function(r){if(r.target==t){if(r.source!=i)throw"Incorrect edge source!";e.push(r)}}),e},l.prototype.getEdgesBetween=function(t){var e=[],i=this;return i.edges.forEach(function(r){if(r.source!=i&&r.target!=i)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||e.push(r)}),e},l.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach(function(i){if(i.source==e)t.add(i.target);else{if(i.target!=e)throw"Incorrect incidency!";t.add(i.source)}}),t},l.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),i=0;i<e.length;i++)e[i].withChildren().forEach(function(e){t.add(e)});return t},l.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),i=0;i<e.length;i++)t+=e[i].getNoOfChildren();return 0==t&&(t=1),t},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},l.prototype.scatter=function(){var t,e,i=-s.INITIAL_WORLD_BOUNDARY,r=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+a.nextDouble()*(r-i)+i;var n=-s.INITIAL_WORLD_BOUNDARY,o=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+a.nextDouble()*(o-n)+n,this.rect.x=t,this.rect.y=e},l.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),i=t.getBottom()-t.getTop();this.labelWidth>e&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>i&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-i)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-i),this.setHeight(this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},l.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var i=this.rect.y;i>s.WORLD_BOUNDARY?i=s.WORLD_BOUNDARY:i<-s.WORLD_BOUNDARY&&(i=-s.WORLD_BOUNDARY);var r=new h(e,i),n=t.inverseTransformPoint(r);this.setLocation(n.x,n.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=l},function(t,e,i){function r(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,e,i){var r=i(2),n=i(10),o=i(0),s=i(6),a=i(3),h=i(1),l=i(13),g=i(12),u=i(11);function c(t,e,i){r.call(this,i),this.estimatedSize=n.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var d in c.prototype=Object.create(r.prototype),r)c[d]=r[d];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(t,e,i){if(null==e&&null==i){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var n=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(i)>-1))throw"Source or target not in graph!";if(e.owner!=i.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=i.owner?null:(n.source=e,n.target=i,n.isInterGraph=!1,this.getEdges().push(n),e.edges.push(n),i!=e&&i.edges.push(n),n)},c.prototype.remove=function(t){var e=t;if(t instanceof a){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var i=e.edges.slice(),r=i.length,n=0;n<r;n++)(o=i[n]).isInterGraph?this.graphManager.remove(o):o.source.owner.remove(o);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof h){var o;if(null==(o=t))throw"Edge is null!";if(null==o.source||null==o.target)throw"Source and/or target is null!";if(null==o.source.owner||null==o.target.owner||o.source.owner!=this||o.target.owner!=this)throw"Source and/or target owner is invalid!";var s,l=o.source.edges.indexOf(o),g=o.target.edges.indexOf(o);if(!(l>-1&&g>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(l,1),o.target!=o.source&&o.target.edges.splice(g,1),-1==(s=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(s,1)}},c.prototype.updateLeftTop=function(){for(var t,e,i,r=n.MAX_VALUE,o=n.MAX_VALUE,s=this.getNodes(),a=s.length,h=0;h<a;h++){var l=s[h];r>(t=l.getTop())&&(r=t),o>(e=l.getLeft())&&(o=e)}return r==n.MAX_VALUE?null:(i=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=o-i,this.top=r-i,new g(this.left,this.top))},c.prototype.updateBounds=function(t){for(var e,i,r,o,s,a=n.MAX_VALUE,h=-n.MAX_VALUE,g=n.MAX_VALUE,u=-n.MAX_VALUE,c=this.nodes,d=c.length,p=0;p<d;p++){var f=c[p];t&&null!=f.child&&f.updateBounds(),a>(e=f.getLeft())&&(a=e),h<(i=f.getRight())&&(h=i),g>(r=f.getTop())&&(g=r),u<(o=f.getBottom())&&(u=o)}var y=new l(a,g,h-a,u-g);a==n.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=c[0].getParent().paddingLeft?c[0].getParent().paddingLeft:this.margin,this.left=y.x-s,this.right=y.x+y.width+s,this.top=y.y-s,this.bottom=y.y+y.height+s},c.calculateBounds=function(t){for(var e,i,r,o,s=n.MAX_VALUE,a=-n.MAX_VALUE,h=n.MAX_VALUE,g=-n.MAX_VALUE,u=t.length,c=0;c<u;c++){var d=t[c];s>(e=d.getLeft())&&(s=e),a<(i=d.getRight())&&(a=i),h>(r=d.getTop())&&(h=r),g<(o=d.getBottom())&&(g=o)}return new l(s,h,a-s,g-h)},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,i=e.length,r=0;r<i;r++)t+=e[r].calcEstimatedSize();return this.estimatedSize=0==t?o.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,i,r=new u,n=new Set,o=this.nodes[0];for(o.withChildren().forEach(function(t){r.push(t),n.add(t)});0!==r.length;)for(var s=(e=(o=r.shift()).getEdges()).length,a=0;a<s;a++)null==(i=e[a].getOtherEndInGraph(o,this))||n.has(i)||i.withChildren().forEach(function(t){r.push(t),n.add(t)});if(this.isConnected=!1,n.size>=this.nodes.length){var h=0;n.forEach(function(e){e.owner==t&&h++}),h==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=c},function(t,e,i){var r,n=i(1);function o(t){r=i(5),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),i=this.add(t,e);return this.setRootGraph(i),this.rootGraph},o.prototype.add=function(t,e,i,r,n){if(null==i&&null==r&&null==n){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}n=i,i=t;var o=(r=e).getOwner(),s=n.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==s)return i.isInterGraph=!1,o.add(i,r,n);if(i.isInterGraph=!0,i.source=r,i.target=n,this.edges.indexOf(i)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(i),null==i.source||null==i.target)throw"Edge source and/or target is null!";if(-1!=i.source.edges.indexOf(i)||-1!=i.target.edges.indexOf(i))throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},o.prototype.remove=function(t){if(t instanceof r){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var i,o=[],s=(o=o.concat(e.getEdges())).length,a=0;a<s;a++)i=o[a],e.remove(i);var h,l=[];for(s=(l=l.concat(e.getNodes())).length,a=0;a<s;a++)h=l[a],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(e);this.graphs.splice(g,1),e.parent=null}else if(t instanceof n){if(null==(i=t))throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(-1==i.source.edges.indexOf(i)||-1==i.target.edges.indexOf(i))throw"Source and/or target doesn't know this edge!";if(g=i.source.edges.indexOf(i),i.source.edges.splice(g,1),g=i.target.edges.indexOf(i),i.target.edges.splice(g,1),null==i.source.owner||null==i.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==i.source.owner.getGraphManager().edges.indexOf(i))throw"Not in owner graph manager's edge list!";g=i.source.owner.getGraphManager().edges.indexOf(i),i.source.owner.getGraphManager().edges.splice(g,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),i=e.length,r=0;r<i;r++)t=t.concat(e[r].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var i=0;i<e.length;i++)t=t.concat(e[i].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var i,r=t.getOwner();null!=(i=r.getParent());){if(i==e)return!0;if(null==(r=i.getOwner()))break}for(r=e.getOwner();null!=(i=r.getParent());){if(i==t)return!0;if(null==(r=i.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,i,r,n,o=this.getAllEdges(),s=o.length,a=0;a<s;a++)if(e=(t=o[a]).source,i=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=i,e!=i){for(r=e.getOwner();null==t.lca;){for(t.targetInLca=i,n=i.getOwner();null==t.lca;){if(n==r){t.lca=n;break}if(n==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=n.getParent(),n=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var i=t.getOwner();null!=i;){for(var r=e.getOwner();null!=r;){if(r==i)return r;r=r.getParent().getOwner()}i=i.getParent().getOwner()}return i},o.prototype.calcInclusionTreeDepths=function(t,e){var i;null==t&&null==e&&(t=this.rootGraph,e=1);for(var r=t.getNodes(),n=r.length,o=0;o<n;o++)(i=r[o]).inclusionTreeDepth=e,null!=i.child&&this.calcInclusionTreeDepths(i.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=this.edges.length,i=0;i<e;i++)if(t=this.edges[i],this.isOneAncestorOfOther(t.source,t.target))return!0;return!1},t.exports=o},function(t,e,i){var r=i(0);function n(){}for(var o in r)n[o]=r[o];n.MAX_ITERATIONS=2500,n.DEFAULT_EDGE_LENGTH=50,n.DEFAULT_SPRING_STRENGTH=.45,n.DEFAULT_REPULSION_STRENGTH=4500,n.DEFAULT_GRAVITY_STRENGTH=.4,n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,n.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,n.COOLING_ADAPTATION_FACTOR=.33,n.ADAPTATION_LOWER_NODE_LIMIT=1e3,n.ADAPTATION_UPPER_NODE_LIMIT=5e3,n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,n.MAX_NODE_DISPLACEMENT=3*n.MAX_NODE_DISPLACEMENT_INCREMENTAL,n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10,n.CONVERGENCE_CHECK_PERIOD=100,n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,n.MIN_EDGE_LENGTH=1,n.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=n},function(t,e,i){var r=i(12);function n(){}n.calcSeparationAmount=function(t,e,i,r){if(!t.intersects(e))throw"assert failed";var n=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,n),i[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),i[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(i[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(i[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var s=o*i[0],a=i[1]/o;i[0]<a?a=i[0]:s=i[1],i[0]=-1*n[0]*(a/2+r),i[1]=-1*n[1]*(s/2+r)},n.decideDirectionsForOverlappingNodes=function(t,e,i){t.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,t.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},n.getIntersection2=function(t,e,i){var r=t.getCenterX(),n=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return i[0]=r,i[1]=n,i[2]=o,i[3]=s,!0;var a=t.getX(),h=t.getY(),l=t.getRight(),g=t.getX(),u=t.getBottom(),c=t.getRight(),d=t.getWidthHalf(),p=t.getHeightHalf(),f=e.getX(),y=e.getY(),E=e.getRight(),v=e.getX(),A=e.getBottom(),N=e.getRight(),T=e.getWidthHalf(),m=e.getHeightHalf(),L=!1,_=!1;if(r===o){if(n>s)return i[0]=r,i[1]=h,i[2]=o,i[3]=A,!1;if(n<s)return i[0]=r,i[1]=u,i[2]=o,i[3]=y,!1}else if(n===s){if(r>o)return i[0]=a,i[1]=n,i[2]=E,i[3]=s,!1;if(r<o)return i[0]=l,i[1]=n,i[2]=f,i[3]=s,!1}else{var O=t.height/t.width,I=e.height/e.width,D=(s-n)/(o-r),w=void 0,R=void 0,C=void 0,M=void 0,x=void 0,G=void 0;if(-O===D?r>o?(i[0]=g,i[1]=u,L=!0):(i[0]=l,i[1]=h,L=!0):O===D&&(r>o?(i[0]=a,i[1]=h,L=!0):(i[0]=c,i[1]=u,L=!0)),-I===D?o>r?(i[2]=v,i[3]=A,_=!0):(i[2]=E,i[3]=y,_=!0):I===D&&(o>r?(i[2]=f,i[3]=y,_=!0):(i[2]=N,i[3]=A,_=!0)),L&&_)return!1;if(r>o?n>s?(w=this.getCardinalDirection(O,D,4),R=this.getCardinalDirection(I,D,2)):(w=this.getCardinalDirection(-O,D,3),R=this.getCardinalDirection(-I,D,1)):n>s?(w=this.getCardinalDirection(-O,D,1),R=this.getCardinalDirection(-I,D,3)):(w=this.getCardinalDirection(O,D,2),R=this.getCardinalDirection(I,D,4)),!L)switch(w){case 1:M=h,C=r+-p/D,i[0]=C,i[1]=M;break;case 2:C=c,M=n+d*D,i[0]=C,i[1]=M;break;case 3:M=u,C=r+p/D,i[0]=C,i[1]=M;break;case 4:C=g,M=n+-d*D,i[0]=C,i[1]=M}if(!_)switch(R){case 1:G=y,x=o+-m/D,i[2]=x,i[3]=G;break;case 2:x=N,G=s+T*D,i[2]=x,i[3]=G;break;case 3:G=A,x=o+m/D,i[2]=x,i[3]=G;break;case 4:x=v,G=s+-T*D,i[2]=x,i[3]=G}}return!1},n.getCardinalDirection=function(t,e,i){return t>e?i:1+i%4},n.getIntersection=function(t,e,i,n){if(null==n)return this.getIntersection2(t,e,i);var o,s,a,h,l,g,u,c=t.x,d=t.y,p=e.x,f=e.y,y=i.x,E=i.y,v=n.x,A=n.y;return 0===(u=(o=f-d)*(h=y-v)-(s=A-E)*(a=c-p))?null:new r((a*(g=v*E-y*A)-h*(l=p*d-c*f))/u,(s*l-o*g)/u)},n.angleOfVector=function(t,e,i,r){var n=void 0;return t!==i?(n=Math.atan((r-e)/(i-t)),i<t?n+=Math.PI:r<e&&(n+=this.TWO_PI)):n=r<e?this.ONE_AND_HALF_PI:this.HALF_PI,n},n.doIntersect=function(t,e,i,r){var n=t.x,o=t.y,s=e.x,a=e.y,h=i.x,l=i.y,g=r.x,u=r.y,c=(s-n)*(u-l)-(g-h)*(a-o);if(0===c)return!1;var d=((u-l)*(g-n)+(h-g)*(u-o))/c,p=((o-a)*(g-n)+(s-n)*(u-o))/c;return 0<d&&d<1&&0<p&&p<1},n.HALF_PI=.5*Math.PI,n.ONE_AND_HALF_PI=1.5*Math.PI,n.TWO_PI=2*Math.PI,n.THREE_PI=3*Math.PI,t.exports=n},function(t,e,i){function r(){}r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,e,i){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,e,i){var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n=function(t){return{value:t,next:null,prev:null}},o=function(t,e,i,r){return null!==t?t.next=e:r.head=e,null!==i?i.prev=e:r.tail=e,e.prev=t,e.next=i,r.length++,e},s=function(t,e){var i=t.prev,r=t.next;return null!==i?i.next=r:e.head=r,null!==r?r.prev=i:e.tail=i,t.prev=t.next=null,e.length--,t},a=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach(function(t){return i.push(t)})}return r(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,n(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,n(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,n(t),null,this)}},{key:"unshift",value:function(t){return o(null,n(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,i=this.head;e<t;)i=i.next,e++;return i.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var i=1,r=this.head;i<t;)r=r.next,i++;r.value=e}}}]),t}();t.exports=a},function(t,e,i){function r(t,e,i){this.x=null,this.y=null,null==t&&null==e&&null==i?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==i?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==i&&(i=t,this.x=i.x,this.y=i.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(t,e,i){"Point"==t.constructor.name&&null==e&&null==i?(i=t,this.setLocation(i.x,i.y)):"number"==typeof t&&"number"==typeof e&&null==i&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},r.prototype.move=function(t,e){this.x=t,this.y=e},r.prototype.translate=function(t,e){this.x+=t,this.y+=e},r.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,e,i){function r(t,e,i,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=i&&null!=r&&(this.x=t,this.y=e,this.width=i,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(t){this.x=t},r.prototype.getY=function(){return this.y},r.prototype.setY=function(t){this.y=t},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},t.exports=r},function(t,e,i){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function n(){}n.lastID=0,n.createID=function(t){return n.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=n.getString(),n.lastID++),t.uniqueID)},n.getString=function(t){return null==t&&(t=n.lastID),"Object#"+t},n.isPrimitive=function(t){var e=void 0===t?"undefined":r(t);return null==t||"object"!=e&&"function"!=e},t.exports=n},function(t,e,i){function r(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var n=i(0),o=i(6),s=i(3),a=i(1),h=i(5),l=i(4),g=i(17),u=i(27);function c(t){u.call(this),this.layoutQuality=n.QUALITY,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=n.DEFAULT_INCREMENTAL,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}c.RANDOM_SEED=1,c.prototype=Object.create(u.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},c.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},c.prototype.newNode=function(t){return new s(this.graphManager,t)},c.prototype.newEdge=function(t){return new a(null,null,t)},c.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==n.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var i=this.graphManager.getRoot().getNodes();for(e=0;e<i.length;e++)i[e];this.update(this.graphManager.getRoot())}},c.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var i=e.getChild().getNodes(),r=0;r<i.length;r++)update(i[r]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else if(t instanceof a){var n=t;null!=n.vGraphObject&&n.vGraphObject.update(n)}else if(t instanceof h){var o=t;null!=o.vGraphObject&&o.vGraphObject.update(o)}},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=n.QUALITY,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=n.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(t){if(null==t)this.transform(new l(0,0));else{var e=new g,i=this.graphManager.getRoot().updateLeftTop();if(null!=i){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(i.x),e.setDeviceOrgY(i.y);for(var r=this.getAllNodes(),n=0;n<r.length;n++)r[n].transform(e)}}},c.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,i,r=t.getNodes(),n=0;n<r.length;n++)null==(i=(e=r[n]).getChild())||0==i.getNodes().length?e.scatter():(this.positionNodesRandomly(i),e.updateBounds())},c.prototype.getFlatForest=function(){for(var t=[],e=!0,i=this.graphManager.getRoot().getNodes(),n=!0,o=0;o<i.length;o++)null!=i[o].getChild()&&(n=!1);if(!n)return t;var s=new Set,a=[],h=new Map,l=[];for(l=l.concat(i);l.length>0&&e;){for(a.push(l[0]);a.length>0&&e;){var g=a[0];a.splice(0,1),s.add(g);var u=g.getEdges();for(o=0;o<u.length;o++){var c=u[o].getOtherEnd(g);if(h.get(g)!=c){if(s.has(c)){e=!1;break}a.push(c),h.set(c,g)}}}if(e){var d=[].concat(r(s));for(t.push(d),o=0;o<d.length;o++){var p=d[o],f=l.indexOf(p);f>-1&&l.splice(f,1)}s=new Set,h=new Map}else t=[]}return t},c.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],i=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),n=0;n<t.bendpoints.length;n++){var o=this.newNode(null);o.setRect(new Point(0,0),new Dimension(1,1)),r.add(o);var s=this.newEdge(null);this.graphManager.add(s,i,o),e.add(o),i=o}return s=this.newEdge(null),this.graphManager.add(s,i,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),e},c.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var i=t[e];if(i.bendpoints.length>0){for(var n=this.edgeToDummyNodes.get(i),o=0;o<n.length;o++){var s=n[o],a=new l(s.getCenterX(),s.getCenterY()),h=i.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(i,i.source,i.target)}}},c.transform=function(t,e,i,r){if(null!=i&&null!=r){var n=e;return t<=50?n-=(e-e/i)/50*(50-t):n+=(e*r-e)/50*(t-50),n}var o,s;return t<=50?(o=9*e/500,s=e/10):(o=9*e/50,s=-8*e),o*t+s},c.findCenterOfTree=function(t){var e=[];e=e.concat(t);var i=[],r=new Map,n=!1,o=null;1!=e.length&&2!=e.length||(n=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=(g=e[s]).getNeighborsList().size;r.set(g,g.getNeighborsList().size),1==a&&i.push(g)}var h=[];for(h=h.concat(i);!n;){var l=[];for(l=l.concat(h),h=[],s=0;s<e.length;s++){var g=e[s],u=e.indexOf(g);u>=0&&e.splice(u,1),g.getNeighborsList().forEach(function(t){if(i.indexOf(t)<0){var e=r.get(t)-1;1==e&&h.push(t),r.set(t,e)}})}i=i.concat(h),1!=e.length&&2!=e.length||(n=!0,o=e[0])}return o},c.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=c},function(t,e,i){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,e,i){var r=i(4);function n(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(t){this.lworldExtX=t},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(t){this.lworldExtY=t},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},n.prototype.transformX=function(t){var e=0,i=this.lworldExtX;return 0!=i&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/i),e},n.prototype.transformY=function(t){var e=0,i=this.lworldExtY;return 0!=i&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/i),e},n.prototype.inverseTransformX=function(t){var e=0,i=this.ldeviceExtX;return 0!=i&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/i),e},n.prototype.inverseTransformY=function(t){var e=0,i=this.ldeviceExtY;return 0!=i&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/i),e},n.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=n},function(t,e,i){var r=i(15),n=i(7),o=i(0),s=i(8),a=i(9);function h(){r.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=n.DEFAULT_EDGE_LENGTH,this.springConstant=n.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=n.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}for(var l in h.prototype=Object.create(r.prototype),r)h[l]=r[l];h.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,i,r,s,a,h=this.getGraphManager().getAllEdges(),l=0;l<h.length;l++)(t=h[l]).idealLength=this.idealEdgeLength,t.isInterGraph&&(i=t.getSource(),r=t.getTarget(),s=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=s+a-2*o.SIMPLE_NODE_SIZE),e=t.getLca().getInclusionTreeDepth(),t.idealLength+=n.DEFAULT_EDGE_LENGTH*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(i.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*e))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),i=0;i<e.length;i++)t=e[i],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,i,r,o,s=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),o=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,o,s,a),o.add(i);else for(t=0;t<h.length;t++)for(i=h[t],e=t+1;e<h.length;e++)r=h[e],i.getOwner()==r.getOwner()&&this.calcRepulsionForce(i,r)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),i=0;i<e.length;i++)t=e[i],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var i,r,n,o,s=t.getSource(),a=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==a.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(i=t.getLength())&&(n=(r=this.springConstant*(i-e))*(t.lengthX/i),o=r*(t.lengthY/i),s.springForceX+=n,s.springForceY+=o,a.springForceX-=n,a.springForceY-=o)},h.prototype.calcRepulsionForce=function(t,e){var i,r,o,h,l,g,u,c=t.getRect(),d=e.getRect(),p=new Array(2),f=new Array(4);if(c.intersects(d)){s.calcSeparationAmount(c,d,p,n.DEFAULT_EDGE_LENGTH/2),g=2*p[0],u=2*p[1];var y=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=y*g,t.repulsionForceY-=y*u,e.repulsionForceX+=y*g,e.repulsionForceY+=y*u}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(i=d.getCenterX()-c.getCenterX(),r=d.getCenterY()-c.getCenterY()):(s.getIntersection(c,d,f),i=f[2]-f[0],r=f[3]-f[1]),Math.abs(i)<n.MIN_REPULSION_DIST&&(i=a.sign(i)*n.MIN_REPULSION_DIST),Math.abs(r)<n.MIN_REPULSION_DIST&&(r=a.sign(r)*n.MIN_REPULSION_DIST),o=i*i+r*r,h=Math.sqrt(o),g=(l=this.repulsionConstant*t.noOfChildren*e.noOfChildren/o)*i/h,u=l*r/h,t.repulsionForceX-=g,t.repulsionForceY-=u,e.repulsionForceX+=g,e.repulsionForceY+=u},h.prototype.calcGravitationalForce=function(t){var e,i,r,n,o,s,a,h;i=((e=t.getOwner()).getRight()+e.getLeft())/2,r=(e.getTop()+e.getBottom())/2,n=t.getCenterX()-i,o=t.getCenterY()-r,s=Math.abs(n)+t.getWidth()/2,a=Math.abs(o)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(h=e.getEstimatedSize()*this.gravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*n,t.gravitationForceY=-this.gravityConstant*o):(s>(h=e.getEstimatedSize()*this.compoundGravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)(t=e[i]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,i;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),i=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(e),n=0;n<e;n++)r[n]=new Array(i);for(n=0;n<e;n++)for(var o=0;o<i;o++)r[n][o]=new Array;return r},h.prototype.addNodeToGrid=function(t,e,i){var r,n,o,s;r=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),n=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange));for(var a=r;a<=n;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(r,n,o,s)},h.prototype.updateGrid=function(){var t,e,i=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<i.length;t++)e=i[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,i,r){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&i||r){var o,s=new Set;t.surrounding=new Array;for(var a=this.grid,h=t.startX-1;h<t.finishX+2;h++)for(var l=t.startY-1;l<t.finishY+2;l++)if(!(h<0||l<0||h>=a.length||l>=a[0].length))for(var g=0;g<a[h][l].length;g++)if(o=a[h][l][g],t.getOwner()==o.getOwner()&&t!=o&&!e.has(o)&&!s.has(o)){var u=Math.abs(t.getCenterX()-o.getCenterX())-(t.getWidth()/2+o.getWidth()/2),c=Math.abs(t.getCenterY()-o.getCenterY())-(t.getHeight()/2+o.getHeight()/2);u<=this.repulsionRange&&c<=this.repulsionRange&&s.add(o)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}(s))}for(h=0;h<t.surrounding.length;h++)this.calcRepulsionForce(t,t.surrounding[h])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,i){var r=i(1),n=i(7);function o(t,e,i){r.call(this,t,e,i),this.idealLength=n.DEFAULT_EDGE_LENGTH}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];t.exports=o},function(t,e,i){var r=i(3);function n(t,e,i,n){r.call(this,t,e,i,n),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];n.prototype.setGridCoordinates=function(t,e,i,r){this.startX=t,this.finishX=e,this.startY=i,this.finishY=r},t.exports=n},function(t,e,i){function r(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},t.exports=r},function(t,e,i){var r=i(14);function n(){this.map={},this.keys=[]}n.prototype.put=function(t,e){var i=r.createID(t);this.contains(i)||(this.map[i]=e,this.keys.push(t))},n.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},n.prototype.get=function(t){var e=r.createID(t);return this.map[e]},n.prototype.keySet=function(){return this.keys},t.exports=n},function(t,e,i){var r=i(14);function n(){this.set={}}n.prototype.add=function(t){var e=r.createID(t);this.contains(e)||(this.set[e]=t)},n.prototype.remove=function(t){delete this.set[r.createID(t)]},n.prototype.clear=function(){this.set={}},n.prototype.contains=function(t){return this.set[r.createID(t)]==t},n.prototype.isEmpty=function(){return 0===this.size()},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),i=e.length,r=0;r<i;r++)t.push(this.set[e[r]])},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAll=function(t){for(var e=t.length,i=0;i<e;i++){var r=t[i];this.add(r)}},t.exports=n},function(t,e,i){var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n=i(11),o=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null===i&&void 0===i||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=e instanceof n?e.size():e.length,this._quicksort(e,0,r-1)}return r(t,[{key:"_quicksort",value:function(t,e,i){if(e<i){var r=this._partition(t,e,i);this._quicksort(t,e,r),this._quicksort(t,r+1,i)}}},{key:"_partition",value:function(t,e,i){for(var r=this._get(t,e),n=e,o=i;;){for(;this.compareFunction(r,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,n),r);)n++;if(!(n<o))return o;this._swap(t,n,o),n++,o--}}},{key:"_get",value:function(t,e){return t instanceof n?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,i){t instanceof n?t.set_object_at(e,i):t[e]=i}},{key:"_swap",value:function(t,e,i){var r=this._get(t,e);this._set(t,e,this._get(t,i)),this._set(t,i,r)}},{key:"_defaultCompareFunction",value:function(t,e){return e>t}}]),t}();t.exports=o},function(t,e,i){var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n=function(){function t(e,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=e,this.sequence2=i,this.match_score=r,this.mismatch_penalty=n,this.gap_penalty=o,this.iMax=e.length+1,this.jMax=i.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[h][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var r=1;r<this.jMax;r++){var n=[this.sequence1[i-1]===this.sequence2[r-1]?this.grid[i-1][r-1]+this.match_score:this.grid[i-1][r-1]+this.mismatch_penalty,this.grid[i-1][r]+this.gap_penalty,this.grid[i][r-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(n);this.grid[i][r]=n[o[0]],this.tracebackGrid[i][r]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],i=this.tracebackGrid[e.pos[0]][e.pos[1]];i[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),i[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),i[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var i=[],r=-1;-1!==(r=t.indexOf(e,r+1));)i.push(r);return i}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=n},function(t,e,i){var r=function(){};r.FDLayout=i(18),r.FDLayoutConstants=i(7),r.FDLayoutEdge=i(19),r.FDLayoutNode=i(20),r.DimensionD=i(21),r.HashMap=i(22),r.HashSet=i(23),r.IGeometry=i(8),r.IMath=i(9),r.Integer=i(10),r.Point=i(12),r.PointD=i(4),r.RandomSeed=i(16),r.RectangleD=i(13),r.Transform=i(17),r.UniqueIDGeneretor=i(14),r.Quicksort=i(24),r.LinkedList=i(11),r.LGraphObject=i(2),r.LGraph=i(5),r.LEdge=i(1),r.LGraphManager=i(6),r.LNode=i(3),r.Layout=i(15),r.LayoutConstants=i(0),r.NeedlemanWunsch=i(25),t.exports=r},function(t,e,i){function r(){this.listeners=[]}var n=r.prototype;n.addListener=function(t,e){this.listeners.push({event:t,callback:e})},n.removeListener=function(t,e){for(var i=this.listeners.length;i>=0;i--){var r=this.listeners[i];r.event===t&&r.callback===e&&this.listeners.splice(i,1)}},n.emit=function(t,e){for(var i=0;i<this.listeners.length;i++){var r=this.listeners[i];t===r.event&&r.callback(e)}},t.exports=r}])},h.exports=t());var t}var g;var u;var c,d,p=(u||(u=1,s.exports=(c=g?a.exports:(g=1,d=function(t){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([function(e,i){e.exports=t},function(t,e,i){var r=i(0).FDLayoutConstants;function n(){}for(var o in r)n[o]=r[o];n.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,n.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,n.DEFAULT_COMPONENT_SEPERATION=60,n.TILE=!0,n.TILING_PADDING_VERTICAL=10,n.TILING_PADDING_HORIZONTAL=10,n.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=n},function(t,e,i){var r=i(0).FDLayoutEdge;function n(t,e,i){r.call(this,t,e,i)}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];t.exports=n},function(t,e,i){var r=i(0).LGraph;function n(t,e,i){r.call(this,t,e,i)}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];t.exports=n},function(t,e,i){var r=i(0).LGraphManager;function n(t){r.call(this,t)}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];t.exports=n},function(t,e,i){var r=i(0).FDLayoutNode,n=i(0).IMath;function o(t,e,i,n){r.call(this,t,e,i,n)}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.move=function(){var t=this.graphManager.getLayout();this.displacementX=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},o.prototype.propogateDisplacementToChildren=function(t,e){for(var i,r=this.getChild().getNodes(),n=0;n<r.length;n++)null==(i=r[n]).getChild()?(i.moveBy(t,e),i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},o.prototype.setPred1=function(t){this.pred1=t},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(t){this.next=t},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(t){this.processed=t},o.prototype.isProcessed=function(){return processed},t.exports=o},function(t,e,i){var r=i(0).FDLayout,n=i(4),o=i(3),s=i(5),a=i(2),h=i(1),l=i(0).FDLayoutConstants,g=i(0).LayoutConstants,u=i(0).Point,c=i(0).PointD,d=i(0).Layout,p=i(0).Integer,f=i(0).IGeometry,y=i(0).LGraph,E=i(0).Transform;function v(){r.call(this),this.toBeTiled={}}for(var A in v.prototype=Object.create(r.prototype),r)v[A]=r[A];v.prototype.newGraphManager=function(){var t=new n(this);return this.graphManager=t,t},v.prototype.newGraph=function(t){return new o(null,this.graphManager,t)},v.prototype.newNode=function(t){return new s(this.graphManager,t)},v.prototype.newEdge=function(t){return new a(null,null,t)},v.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=l.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=l.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=l.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(t){return e.has(t)}),this.graphManager.setAllNodesToApplyGravitation(i));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var i=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(i,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var r=t[i].rect,n=t[i].id;e[n]={id:n,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return e},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===l.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,i=[],r=this.graphManager.getGraphs(),n=r.length;for(e=0;e<n;e++)(t=r[e]).updateConnected(),t.isConnected||(i=i.concat(t.getNodes()));return i},v.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,i=new Set;for(e=0;e<t.length;e++){var r=t[e];if(!i.has(r)){var n=r.getSource(),o=r.getTarget();if(n==o)r.getBendpoints().push(new c),r.getBendpoints().push(new c),this.createDummyNodesForBendpoints(r),i.add(r);else{var s=[];if(s=(s=s.concat(n.getEdgeListToNode(o))).concat(o.getEdgeListToNode(n)),!i.has(s[0])){var a;if(s.length>1)for(a=0;a<s.length;a++){var h=s[a];h.getBendpoints().push(new c),this.createDummyNodesForBendpoints(h)}s.forEach(function(t){i.add(t)})}}}if(i.size==t.length)break}},v.prototype.positionNodesRadially=function(t){for(var e=new u(0,0),i=Math.ceil(Math.sqrt(t.length)),r=0,n=0,o=0,s=new c(0,0),a=0;a<t.length;a++){a%i==0&&(o=0,n=r,0!=a&&(n+=h.DEFAULT_COMPONENT_SEPERATION),r=0);var l=t[a],p=d.findCenterOfTree(l);e.x=o,e.y=n,(s=v.radialLayout(l,p,e)).y>r&&(r=Math.floor(s.y)),o=Math.floor(s.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new c(g.WORLD_CENTER_X-s.x/2,g.WORLD_CENTER_Y-s.y/2))},v.radialLayout=function(t,e,i){var r=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(e,null,0,359,0,r);var n=y.calculateBounds(t),o=new E;o.setDeviceOrgX(n.getMinX()),o.setDeviceOrgY(n.getMinY()),o.setWorldOrgX(i.x),o.setWorldOrgY(i.y);for(var s=0;s<t.length;s++)t[s].transform(o);var a=new c(n.getMaxX(),n.getMaxY());return o.inverseTransformPoint(a)},v.branchRadialLayout=function(t,e,i,r,n,o){var s=(r-i+1)/2;s<0&&(s+=180);var a=(s+i)%360*f.TWO_PI/360,h=n*Math.cos(a),l=n*Math.sin(a);t.setCenter(h,l);var g=[],u=(g=g.concat(t.getEdges())).length;null!=e&&u--;for(var c,d=0,p=g.length,y=t.getEdgesBetween(e);y.length>1;){var E=y[0];y.splice(0,1);var A=g.indexOf(E);A>=0&&g.splice(A,1),p--,u--}c=null!=e?(g.indexOf(y[0])+1)%p:0;for(var N=Math.abs(r-i)/u,T=c;d!=u;T=++T%p){var m=g[T].getOtherEnd(t);if(m!=e){var L=(i+d*N)%360,_=(L+N)%360;v.branchRadialLayout(m,t,L,_,n+o,o),d++}}},v.maxDiagonalInTree=function(t){for(var e=p.MIN_VALUE,i=0;i<t.length;i++){var r=t[i].getDiagonal();r>e&&(e=r)}return e},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var i=[],r=this.graphManager.getAllNodes(),n=0;n<r.length;n++){var o=(a=r[n]).getParent();0!==this.getNodeDegreeWithChildren(a)||null!=o.id&&this.getToBeTiled(o)||i.push(a)}for(n=0;n<i.length;n++){var a,h=(a=i[n]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(a)}Object.keys(e).forEach(function(i){if(e[i].length>1){var r="DummyCompound_"+i;t.memberGroups[r]=e[i];var n=e[i][0].getParent(),o=new s(t.graphManager);o.id=r,o.paddingLeft=n.paddingLeft||0,o.paddingRight=n.paddingRight||0,o.paddingBottom=n.paddingBottom||0,o.paddingTop=n.paddingTop||0,t.idToDummyNode[r]=o;var a=t.getGraphManager().add(t.newGraph(),o),h=n.getChild();h.add(o);for(var l=0;l<e[i].length;l++){var g=e[i][l];h.remove(g),a.add(g)}}})},v.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},v.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(i){var r=t.idToDummyNode[i];e[i]=t.tileNodes(t.memberGroups[i],r.paddingLeft+r.paddingRight),r.rect.width=e[i].width,r.rect.height=e[i].height})},v.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],i=e.id,r=e.paddingLeft,n=e.paddingTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,r,n)}},v.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach(function(i){var r=t.idToDummyNode[i],n=r.paddingLeft,o=r.paddingTop;t.adjustLocations(e[i],r.rect.x,r.rect.y,n,o)})},v.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var i=t.getChild();if(null==i)return this.toBeTiled[e]=!1,!1;for(var r=i.getNodes(),n=0;n<r.length;n++){var o=r[n];if(this.getNodeDegree(o)>0)return this.toBeTiled[e]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[e]=!0,!0},v.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,r=0;r<e.length;r++){var n=e[r];n.getSource().id!==n.getTarget().id&&(i+=1)}return i},v.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var i=t.getChild().getNodes(),r=0;r<i.length;r++){var n=i[r];e+=this.getNodeDegreeWithChildren(n)}return e},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},v.prototype.adjustLocations=function(t,e,i,r,n){i+=n;for(var o=e+=r,s=0;s<t.rows.length;s++){var a=t.rows[s];e=o;for(var h=0,l=0;l<a.length;l++){var g=a[l];g.rect.x=e,g.rect.y=i,e+=g.rect.width+t.horizontalPadding,g.rect.height>h&&(h=g.rect.height)}i+=h+t.verticalPadding}},v.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(r){var n=e[r];i.tiledMemberPack[r]=i.tileNodes(t[r],n.paddingLeft+n.paddingRight),n.rect.width=i.tiledMemberPack[r].width,n.rect.height=i.tiledMemberPack[r].height})},v.prototype.tileNodes=function(t,e){var i={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:h.TILING_PADDING_VERTICAL,horizontalPadding:h.TILING_PADDING_HORIZONTAL};t.sort(function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:t.rect.width*t.rect.height<e.rect.width*e.rect.height?1:0});for(var r=0;r<t.length;r++){var n=t[r];0==i.rows.length?this.insertNodeToRow(i,n,0,e):this.canAddHorizontal(i,n.rect.width,n.rect.height)?this.insertNodeToRow(i,n,this.getShortestRowIndex(i),e):this.insertNodeToRow(i,n,i.rows.length,e),this.shiftToLastRow(i)}return i},v.prototype.insertNodeToRow=function(t,e,i,r){var n=r;i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(n),t.rowHeight.push(0));var o=t.rowWidth[i]+e.rect.width;t.rows[i].length>0&&(o+=t.horizontalPadding),t.rowWidth[i]=o,t.width<o&&(t.width=o);var s=e.rect.height;i>0&&(s+=t.verticalPadding);var a=0;s>t.rowHeight[i]&&(a=t.rowHeight[i],t.rowHeight[i]=s,a=t.rowHeight[i]-a),t.height+=a,t.rows[i].push(e)},v.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<i&&(e=r,i=t.rowWidth[r]);return e},v.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>i&&(e=r,i=t.rowWidth[r]);return e},v.prototype.canAddHorizontal=function(t,e,i){var r=this.getShortestRowIndex(t);if(r<0)return!0;var n=t.rowWidth[r];if(n+t.horizontalPadding+e<=t.width)return!0;var o,s,a=0;return t.rowHeight[r]<i&&r>0&&(a=i+t.verticalPadding-t.rowHeight[r]),o=t.width-n>=e+t.horizontalPadding?(t.height+a)/(n+e+t.horizontalPadding):(t.height+a)/t.width,a=i+t.verticalPadding,(s=t.width<e?(t.height+a)/e:(t.height+a)/t.width)<1&&(s=1/s),o<1&&(o=1/o),o<s},v.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,r=t.rows[e],n=r[r.length-1],o=n.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>o&&e!=i){r.splice(-1,1),t.rows[i].push(n),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[i]=t.rowWidth[i]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,a=0;a<r.length;a++)r[a].height>s&&(s=r[a].height);e>0&&(s+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[i];t.rowHeight[e]=s,t.rowHeight[i]<n.height+t.verticalPadding&&(t.rowHeight[i]=n.height+t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[i];t.height+=l-h,this.shiftToLastRow(t)}},v.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var t,e=[],i=!0;i;){var r=this.graphManager.getAllNodes(),n=[];i=!1;for(var o=0;o<r.length;o++)1!=(t=r[o]).getEdges().length||t.getEdges()[0].isInterGraph||null!=t.getChild()||(n.push([t,t.getEdges()[0],t.getOwner()]),i=!0);if(1==i){for(var s=[],a=0;a<n.length;a++)1==n[a][0].getEdges().length&&(s.push(n[a]),n[a][0].getOwner().remove(n[a][0]));e.push(s),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},v.prototype.growTree=function(t){for(var e,i=t[t.length-1],r=0;r<i.length;r++)e=i[r],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(t){var e,i,r=t[0],n=(i=r==t[1].source?t[1].target:t[1].source).startX,o=i.finishX,s=i.startY,a=i.finishY,h=[0,0,0,0];if(s>0)for(var g=n;g<=o;g++)h[0]+=this.grid[g][s-1].length+this.grid[g][s].length-1;if(o<this.grid.length-1)for(g=s;g<=a;g++)h[1]+=this.grid[o+1][g].length+this.grid[o][g].length-1;if(a<this.grid[0].length-1)for(g=n;g<=o;g++)h[2]+=this.grid[g][a+1].length+this.grid[g][a].length-1;if(n>0)for(g=s;g<=a;g++)h[3]+=this.grid[n-1][g].length+this.grid[n][g].length-1;for(var u,c,d=p.MAX_VALUE,f=0;f<h.length;f++)h[f]<d?(d=h[f],u=1,c=f):h[f]==d&&u++;if(3==u&&0==d)0==h[0]&&0==h[1]&&0==h[2]?e=1:0==h[0]&&0==h[1]&&0==h[3]?e=0:0==h[0]&&0==h[2]&&0==h[3]?e=3:0==h[1]&&0==h[2]&&0==h[3]&&(e=2);else if(2==u&&0==d){var y=Math.floor(2*Math.random());e=0==h[0]&&0==h[1]?0==y?0:1:0==h[0]&&0==h[2]?0==y?0:2:0==h[0]&&0==h[3]?0==y?0:3:0==h[1]&&0==h[2]?0==y?1:2:0==h[1]&&0==h[3]?0==y?1:3:0==y?2:3}else e=4==u&&0==d?y=Math.floor(4*Math.random()):c;0==e?r.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-l.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==e?r.setCenter(i.getCenterX()+i.getWidth()/2+l.DEFAULT_EDGE_LENGTH+r.getWidth()/2,i.getCenterY()):2==e?r.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+l.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(i.getCenterX()-i.getWidth()/2-l.DEFAULT_EDGE_LENGTH-r.getWidth()/2,i.getCenterY())},t.exports=v},function(t,e,i){var r={};r.layoutBase=i(0),r.CoSEConstants=i(1),r.CoSEEdge=i(2),r.CoSEGraph=i(3),r.CoSEGraphManager=i(4),r.CoSELayout=i(6),r.CoSENode=i(5),t.exports=r}])},a.exports=d(l())),function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e){t.exports=c},function(t,e,i){var r=i(0).layoutBase.LayoutConstants,n=i(0).layoutBase.FDLayoutConstants,o=i(0).CoSEConstants,s=i(0).CoSELayout,a=i(0).CoSENode,h=i(0).layoutBase.PointD,l=i(0).layoutBase.DimensionD,g={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function u(t){this.options=function(t,e){var i={};for(var r in t)i[r]=t[r];for(var r in e)i[r]=e[r];return i}(g,t),c(this.options)}var c=function(t){null!=t.nodeRepulsion&&(o.DEFAULT_REPULSION_STRENGTH=n.DEFAULT_REPULSION_STRENGTH=t.nodeRepulsion),null!=t.idealEdgeLength&&(o.DEFAULT_EDGE_LENGTH=n.DEFAULT_EDGE_LENGTH=t.idealEdgeLength),null!=t.edgeElasticity&&(o.DEFAULT_SPRING_STRENGTH=n.DEFAULT_SPRING_STRENGTH=t.edgeElasticity),null!=t.nestingFactor&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(o.DEFAULT_GRAVITY_STRENGTH=n.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(o.MAX_ITERATIONS=n.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=n.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=n.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),"draft"==t.quality?r.QUALITY=0:"proof"==t.quality?r.QUALITY=2:r.QUALITY=1,o.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!t.randomize,o.ANIMATE=n.ANIMATE=r.ANIMATE=t.animate,o.TILE=t.tile,o.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal};u.prototype.run=function(){var t,e,i=this.options;this.idToLNode={};var r=this.layout=new s,n=this;n.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var o=r.newGraphManager();this.gm=o;var a=this.options.eles.nodes(),h=this.options.eles.edges();this.root=o.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(a),r);for(var l=0;l<h.length;l++){var g=h[l],u=this.idToLNode[g.data("source")],c=this.idToLNode[g.data("target")];u!==c&&0==u.getEdgesBetween(c).length&&(o.add(r.newEdge(),u,c).id=g.id())}var d=function(t,e){"number"==typeof t&&(t=e);var i=t.data("id"),r=n.idToLNode[i];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},p=function o(){for(var s,a=function(){i.fit&&i.cy.fit(i.eles,i.padding),t||(t=!0,n.cy.one("layoutready",i.ready),n.cy.trigger({type:"layoutready",layout:n}))},h=n.options.refresh,l=0;l<h&&!s;l++)s=n.stopped||n.layout.tick();if(s)return r.checkLayoutSuccess()&&!r.isSubLayout&&r.doPostLayout(),r.tilingPostLayout&&r.tilingPostLayout(),r.isLayoutFinished=!0,n.options.eles.nodes().positions(d),a(),n.cy.one("layoutstop",n.options.stop),n.cy.trigger({type:"layoutstop",layout:n}),e&&cancelAnimationFrame(e),void(t=!1);var g=n.layout.getPositionsData();i.eles.nodes().positions(function(t,e){if("number"==typeof t&&(t=e),!t.isParent()){for(var i=t.id(),r=g[i],n=t;null==r&&(r=g[n.data("parent")]||g["DummyCompound_"+n.data("parent")],g[i]=r,null!=(n=n.parent()[0])););return null!=r?{x:r.x,y:r.y}:{x:t.position("x"),y:t.position("y")}}}),a(),e=requestAnimationFrame(o)};return r.addListener("layoutstarted",function(){"during"===n.options.animate&&(e=requestAnimationFrame(p))}),r.runLayout(),"during"!==this.options.animate&&(n.options.eles.nodes().not(":parent").layoutPositions(n,n.options,d),t=!1),this},u.prototype.getTopMostNodes=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].id()]=!0;var r=t.filter(function(t,i){"number"==typeof t&&(t=i);for(var r=t.parent()[0];null!=r;){if(e[r.id()])return!1;r=r.parent()[0]}return!0});return r},u.prototype.processChildrenList=function(t,e,i){for(var r=e.length,n=0;n<r;n++){var o,s,g=e[n],u=g.children(),c=g.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((o=null!=g.outerWidth()&&null!=g.outerHeight()?t.add(new a(i.graphManager,new h(g.position("x")-c.w/2,g.position("y")-c.h/2),new l(parseFloat(c.w),parseFloat(c.h)))):t.add(new a(this.graphManager))).id=g.data("id"),o.paddingLeft=parseInt(g.css("padding")),o.paddingTop=parseInt(g.css("padding")),o.paddingRight=parseInt(g.css("padding")),o.paddingBottom=parseInt(g.css("padding")),this.options.nodeDimensionsIncludeLabels&&g.isParent()){var d=g.boundingBox({includeLabels:!0,includeNodes:!1}).w,p=g.boundingBox({includeLabels:!0,includeNodes:!1}).h,f=g.css("text-halign");o.labelWidth=d,o.labelHeight=p,o.labelPos=f}this.idToLNode[g.data("id")]=o,isNaN(o.rect.x)&&(o.rect.x=0),isNaN(o.rect.y)&&(o.rect.y=0),null!=u&&u.length>0&&(s=i.getGraphManager().add(i.newGraph(),o),this.processChildrenList(s,u,i))}},u.prototype.stop=function(){return this.stopped=!0,this};var d=function(t){t("layout","cose-bilkent",u)};"undefined"!=typeof cytoscape&&d(cytoscape),t.exports=d}]))),s.exports),f=n(p);function y(t,e){t.forEach(t=>{const i={id:t.id,labelText:t.label,height:t.height,width:t.width,padding:t.padding??0};Object.keys(t).forEach(e=>{["id","label","height","width","padding","x","y"].includes(e)||(i[e]=t[e])}),e.add({group:"nodes",data:i,position:{x:t.x??0,y:t.y??0}})})}function E(t,e){t.forEach(t=>{const i={id:t.id,source:t.start,target:t.end};Object.keys(t).forEach(e=>{["id","start","end"].includes(e)||(i[e]=t[e])}),e.add({group:"edges",data:i})})}function v(t){return new Promise(n=>{const o=i("body").append("div").attr("id","cy").attr("style","display:none"),s=r({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});o.remove(),y(t.nodes,s),E(t.edges,s),s.nodes().forEach(function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}});s.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),s.ready(t=>{e.info("Cytoscape ready",t),n(s)})})}function A(t){return t.nodes().map(t=>{const e=t.data(),i=t.position(),r={id:e.id,x:i.x,y:i.y};return Object.keys(e).forEach(t=>{"id"!==t&&(r[t]=e[t])}),r})}function N(t){return t.edges().map(t=>{const e=t.data(),i=t._private.rscratch,r={id:e.id,source:e.source,target:e.target,startX:i.startX,startY:i.startY,midX:i.midX,midY:i.midY,endX:i.endX,endY:i.endY};return Object.keys(e).forEach(t=>{["id","source","target"].includes(t)||(r[t]=e[t])}),r})}async function T(t,i){e.debug("Starting cose-bilkent layout algorithm");try{m(t);const i=await v(t),r=A(i),n=N(i);return e.debug(`Layout completed: ${r.length} nodes, ${n.length} edges`),{nodes:r,edges:n}}catch(t){throw e.error("Error in cose-bilkent layout algorithm:",t),t}}function m(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}r.use(f),t(y,"addNodes"),t(E,"addEdges"),t(v,"createCytoscapeInstance"),t(A,"extractPositionedNodes"),t(N,"extractPositionedEdges"),t(T,"executeCoseBilkentLayout"),t(m,"validateLayoutData");var L=t(async(t,e,{insertCluster:i,insertEdge:r,insertEdgeLabel:n,insertMarkers:o,insertNode:s,log:a,positionEdgeLabel:h},{algorithm:l})=>{const g={},u={},c=e.select("g");o(c,t.markers,t.type,t.diagramId);const d=c.insert("g").attr("class","subgraphs"),p=c.insert("g").attr("class","edgePaths"),f=c.insert("g").attr("class","edgeLabels"),y=c.insert("g").attr("class","nodes");a.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async e=>{if(e.isGroup){const t={...e};u[e.id]=t,g[e.id]=t,await i(d,e)}else{const i={...e};g[e.id]=i;const r=await s(y,e,{config:t.config,dir:t.direction||"TB"}),n=r.node().getBBox();i.width=n.width,i.height=n.height,i.domId=r,a.debug(`Node ${e.id} dimensions: ${n.width}x${n.height}`)}})),a.debug("Running cose-bilkent layout algorithm");const E={...t,nodes:t.nodes.map(t=>{const e=g[t.id];return{...t,width:e.width,height:e.height}})},v=await T(E,t.config);a.debug("Positioning nodes based on layout results"),v.nodes.forEach(t=>{const e=g[t.id];e?.domId&&(e.domId.attr("transform",`translate(${t.x}, ${t.y})`),e.x=t.x,e.y=t.y,a.debug(`Positioned node ${e.id} at center (${t.x}, ${t.y})`))}),v.edges.forEach(e=>{const i=t.edges.find(t=>t.id===e.id);i&&(i.points=[{x:e.startX,y:e.startY},{x:e.midX,y:e.midY},{x:e.endX,y:e.endY}])}),a.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async e=>{await n(f,e);const i=g[e.start??""],o=g[e.end??""];if(i&&o){const n=v.edges.find(t=>t.id===e.id);if(n){a.debug("APA01 positionedEdge",n);const s={...e},l=r(p,s,u,t.type,i,o,t.diagramId);h(s,l)}else{const n={...e,points:[{x:i.x||0,y:i.y||0},{x:o.x||0,y:o.y||0}]},s=r(p,n,u,t.type,i,o,t.diagramId);h(n,s)}}})),a.debug("Cose-bilkent rendering completed")},"render");export{L as render};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var c="undefined"==typeof window?null:window,d=c?c.navigator:null;c&&c.document;var h,f,p,v,g,y,m,b,x,w,E,k,T,C,P,S,B,D,_,A,M,R,I,N,L,z,O,V,F=l(""),X=l({}),j=l(function(){}),Y="undefined"==typeof HTMLElement?"undefined":l(HTMLElement),q=function(e){return e&&e.instanceString&&U(e.instanceString)?e.instanceString():null},W=function(e){return null!=e&&l(e)==F},U=function(e){return null!=e&&l(e)===j},H=function(e){return!$(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},K=function(e){return null!=e&&l(e)===X&&!H(e)&&e.constructor===Object},G=function(e){return null!=e&&l(e)===l(1)&&!isNaN(e)},Z=function(e){return"undefined"===Y?void 0:null!=e&&e instanceof HTMLElement},$=function(e){return Q(e)||J(e)},Q=function(e){return"collection"===q(e)&&e._private.single},J=function(e){return"collection"===q(e)&&!e._private.single},ee=function(e){return"core"===q(e)},te=function(e){return"stylesheet"===q(e)},ne=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},re=function(e){return function(e){return null!=e&&l(e)===X}(e)&&U(e.then)},ae=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function(){var r,a=arguments,i=t.apply(this,a),o=n.cache;return(r=o[i])||(r=o[i]=e.apply(this,a)),r};return n.cache={},n},ie=ae(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),oe=ae(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),se=ae(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),le=function(e){return ne(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ue=function(e,t){return e.slice(-1*t.length)===t},ce="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",de="rgb[a]?\\(("+ce+"[%]?)\\s*,\\s*("+ce+"[%]?)\\s*,\\s*("+ce+"[%]?)(?:\\s*,\\s*("+ce+"))?\\)",he="rgb[a]?\\((?:"+ce+"[%]?)\\s*,\\s*(?:"+ce+"[%]?)\\s*,\\s*(?:"+ce+"[%]?)(?:\\s*,\\s*(?:"+ce+"))?\\)",fe="hsl[a]?\\(("+ce+")\\s*,\\s*("+ce+"[%])\\s*,\\s*("+ce+"[%])(?:\\s*,\\s*("+ce+"))?\\)",pe="hsl[a]?\\((?:"+ce+")\\s*,\\s*(?:"+ce+"[%])\\s*,\\s*(?:"+ce+"[%])(?:\\s*,\\s*(?:"+ce+"))?\\)",ve=function(e,t){return e<t?-1:e>t?1:0},ge=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var a=Object.keys(r),i=0;i<a.length;i++){var o=a[i];e[o]=r[o]}}return e},ye=function(e){return(H(e)?e:null)||function(e){return me[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,a=16;return 4===e.length?(t=parseInt(e[1]+e[1],a),n=parseInt(e[2]+e[2],a),r=parseInt(e[3]+e[3],a)):(t=parseInt(e[1]+e[2],a),n=parseInt(e[3]+e[4],a),r=parseInt(e[5]+e[6],a)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^"+de+"$").exec(e);if(n){t=[];for(var r=[],a=1;a<=3;a++){var i=n[a];if("%"===i[i.length-1]&&(r[a]=!0),i=parseFloat(i),r[a]&&(i=i/100*255),i<0||i>255)return;t.push(Math.floor(i))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,a,i,o,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+fe+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(a=parseFloat(c[3]))<0||a>100)return;if(a/=100,void 0!==(i=c[4])&&((i=parseFloat(i))<0||i>1))return;if(0===r)o=s=l=Math.round(255*a);else{var d=a<.5?a*(1+r):a+r-a*r,h=2*a-d;o=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[o,s,l,i]}return t}(e)},me={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},be=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var i=n[a];if(K(i))throw Error("Tried to set map with object key");a<n.length-1?(null==t[i]&&(t[i]={}),t=t[i]):t[i]=e.value}},xe=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var i=n[a];if(K(i))throw Error("Tried to get map with object key");if(null==(t=t[i]))return t}return t},we="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ke(){if(f)return h;return f=1,h=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function Te(){if(y)return g;y=1;var e=function(){if(v)return p;v=1;var e="object"==typeof we&&we&&we.Object===Object&&we;return p=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return g=n}function Ce(){if(k)return E;k=1;var e=function(){if(w)return x;w=1;var e=/\s/;return x=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},x}(),t=/^\s+/;return E=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},E}function Pe(){if(C)return T;C=1;var e=Te().Symbol;return T=e}function Se(){if(A)return _;A=1;var e=Pe(),t=function(){if(S)return P;S=1;var e=Pe(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;return P=function(e){var t=n.call(e,a),i=e[a];try{e[a]=void 0;var o=!0}catch(e){}var s=r.call(e);return o&&(t?e[a]=i:delete e[a]),s}}(),n=function(){if(D)return B;D=1;var e=Object.prototype.toString;return B=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return _=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Be(){if(N)return I;N=1;var e=Se(),t=R?M:(R=1,M=function(e){return null!=e&&"object"==typeof e});return I=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var De=Ee(function(){if(V)return O;V=1;var e=ke(),t=function(){if(b)return m;b=1;var e=Te();return m=function(){return e.Date.now()}}(),n=function(){if(z)return L;z=1;var e=Ce(),t=ke(),n=Be(),r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt;return L=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var u=a.test(s);return u||i.test(s)?o(s.slice(2),u?2:8):r.test(s)?NaN:+s}}(),r=Math.max,a=Math.min;return O=function(i,o,s){var l,u,c,d,h,f,p=0,v=!1,g=!1,y=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function m(e){var t=l,n=u;return l=u=void 0,p=e,d=i.apply(n,t)}function b(e){var t=e-f;return void 0===f||t>=o||t<0||g&&e-p>=c}function x(){var e=t();if(b(e))return w(e);h=setTimeout(x,function(e){var t=o-(e-f);return g?a(t,c-(e-p)):t}(e))}function w(e){return h=void 0,y&&l?m(e):(l=u=void 0,d)}function E(){var e=t(),n=b(e);if(l=arguments,u=this,f=e,n){if(void 0===h)return function(e){return p=e,h=setTimeout(x,o),v?m(e):d}(f);if(g)return clearTimeout(h),h=setTimeout(x,o),m(f)}return void 0===h&&(h=setTimeout(x,o)),d}return o=n(o)||0,e(s)&&(v=!!s.leading,c=(g="maxWait"in s)?r(n(s.maxWait)||0,o):c,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},E.flush=function(){return void 0===h?d:w(t())},E}}()),_e=c?c.performance:null,Ae=_e&&_e.now?function(){return _e.now()}:function(){return Date.now()},Me=function(){if(c){if(c.requestAnimationFrame)return function(e){c.requestAnimationFrame(e)};if(c.mozRequestAnimationFrame)return function(e){c.mozRequestAnimationFrame(e)};if(c.webkitRequestAnimationFrame)return function(e){c.webkitRequestAnimationFrame(e)};if(c.msRequestAnimationFrame)return function(e){c.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(Ae())},1e3/60)}}(),Re=function(e){return Me(e)},Ie=Ae,Ne=9261,Le=5381,ze=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Oe=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne)+e|0},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Le;return(t<<5)+t+e|0},Fe=function(e){return 2097152*e[0]+e[1]},Xe=function(e,t){return[Oe(e[0],t[0]),Ve(e[1],t[1])]},je=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return ze({next:function(){return r<a?n.value=e[r++]:n.done=!0,n}},t)},Ye=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return ze({next:function(){return r<a?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},qe=function(){return We(arguments)},We=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?Ye(r):Ye(r,t)}return t};function Ue(e,t,n){if(0===n)return e;var r=(t.x1+t.x2)/2,a=(t.y1+t.y2)/2,i=t.w/t.h,o=1/i,s=function(e,t,n,r,a){var i=a*Math.PI/180;return{x:Math.cos(i)*(e-n)-Math.sin(i)*(t-r)+n,y:Math.sin(i)*(e-n)+Math.cos(i)*(t-r)+r}}(e.x,e.y,r,a,n),l=function(e,t,n,r,a,i){return{x:(e-n)*a+n,y:(t-r)*i+r}}(s.x,s.y,r,a,i,o);return{x:l.x,y:l.y}}var He=!0,Ke=null!=console.warn,Ge=null!=console.trace,Ze=Number.MAX_SAFE_INTEGER||9007199254740991,$e=function(){return!0},Qe=function(){return!1},Je=function(){return 0},et=function(){},tt=function(e){throw new Error(e)},nt=function(e){if(void 0===e)return He;He=!!e},rt=function(e){nt()&&(Ke?console.warn(e):(console.log(e),Ge&&console.trace()))},at=function(e){return null==e?e:H(e)?e.slice():K(e)?function(e){return ge({},e)}(e):e},it=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},ot={},st=function(){return ot},lt=function(e){var t=Object.keys(e);return function(n){for(var r={},a=0;a<t.length;a++){var i=t[a],o=null==n?void 0:n[i];r[i]=void 0===o?e[i]:o}return r}},ut=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},ct=function(e){e.splice(0,e.length)},dt=function(e,t,n){return n&&(t=se(n,t)),e[t]},ht=function(e,t,n,r){n&&(t=se(n,t)),e[t]=r},ft="undefined"!=typeof Map?Map:function(){return n(function e(){t(this,e),this._obj={}},[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}])}(),pt=function(){return n(function e(n){if(t(this,e),this._obj=Object.create(null),this.size=0,null!=n){var r;r=null!=n.instanceString&&n.instanceString()===this.instanceString()?n.toArray():n;for(var a=0;a<r.length;a++)this.add(r[a])}},[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter(function(t){return e.has(t)})}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}])}(),vt="undefined"!==("undefined"==typeof Set?"undefined":l(Set))?Set:pt,gt=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&ee(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new vt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==a.position.x&&(a.position.x=0),null==a.position.y&&(a.position.y=0),t.renderedPosition){var i=t.renderedPosition,o=e.pan(),s=e.zoom();a.position={x:(i.x-o.x)/s,y:(i.y-o.y)/s}}var l=[];H(t.classes)?l=t.classes:W(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var d=l[u];d&&""!==d&&a.classes.add(d)}this.createEmitter(),(void 0===n||n)&&this.restore();var h=t.style||t.css;h&&(rt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))}else tt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else tt("An element must have a core reference and parameters set")},yt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var a;K(t)&&!$(t)&&(t=(a=t).roots||a.root,n=a.visit,r=a.directed),r=2!==arguments.length||U(n)?r:n,n=U(n)?n:function(){};for(var i,o=this._private.cy,s=t=W(t)?this.filter(t):t,l=[],u=[],c={},d={},h={},f=0,p=this.byGroup(),v=p.nodes,g=p.edges,y=0;y<s.length;y++){var m=s[y],b=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(h[b]=!0,u.push(m)),d[b]=0)}for(var x,w=function(){var t=e.bfs?l.shift():l.pop(),a=t.id();if(e.dfs){if(h[a])return 0;h[a]=!0,u.push(t)}var o,s=d[a],p=c[a],y=null!=p?p.source():null,m=null!=p?p.target():null,b=null==p?void 0:t.same(y)?m[0]:y[0];if(!0===(o=n(t,p,b,f++,s)))return i=t,1;if(!1===o)return 1;for(var x=t.connectedEdges().filter(function(e){return(!r||e.source().same(t))&&g.has(e)}),w=0;w<x.length;w++){var E=x[w],k=E.connectedNodes().filter(function(e){return!e.same(t)&&v.has(e)}),T=k.id();0===k.length||h[T]||(k=k[0],l.push(k),e.bfs&&(h[T]=!0,u.push(k)),c[T]=E,d[T]=d[a]+1)}};0!==l.length&&(0===(x=w())||1!==x););for(var E=o.collection(),k=0;k<u.length;k++){var T=u[k],C=c[T.id()];null!=C&&E.push(C),E.push(T)}return{path:o.collection(E),found:o.collection(i)}}},mt={breadthFirstSearch:yt({bfs:!0}),depthFirstSearch:yt({dfs:!0})};mt.bfs=mt.breadthFirstSearch,mt.dfs=mt.depthFirstSearch;var bt,xt,wt,Et={exports:{}},kt=Et.exports;function Tt(){return bt||(bt=1,e=Et,function(){var t,n,r,a,i,o,s,l,u,c,d,h,f,p,v;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,a,i,o){var s;if(null==a&&(a=0),null==o&&(o=n),a<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);a<i;)o(t,e[s=r((a+i)/2)])<0?i=s:a=s+1;return[].splice.apply(e,[a,a-a].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),p(e,0,e.length-1,r)},i=function(e,t){var r,a;return null==t&&(t=n),r=e.pop(),e.length?(a=e[0],e[0]=r,v(e,0,t)):a=r,a},l=function(e,t,r){var a;return null==r&&(r=n),a=e[0],e[0]=t,v(e,0,r),a},s=function(e,t,r){var a;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(t=(a=[e[0],t])[0],e[0]=a[1],v(e,0,r)),t},a=function(e,t){var a,i,o,s,l,u;for(null==t&&(t=n),l=[],i=0,o=(s=function(){u=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;i<o;i++)a=s[i],l.push(v(e,a,t));return l},f=function(e,t,r){var a;if(null==r&&(r=n),-1!==(a=e.indexOf(t)))return p(e,0,a,r),v(e,a,r)},d=function(e,t,r){var i,o,l,u,c;if(null==r&&(r=n),!(o=e.slice(0,t)).length)return o;for(a(o,r),l=0,u=(c=e.slice(t)).length;l<u;l++)i=c[l],s(o,i,r);return o.sort(r).reverse()},h=function(e,t,r){var o,s,l,d,h,f,p,v,g;if(null==r&&(r=n),10*t<=e.length){if(!(l=e.slice(0,t).sort(r)).length)return l;for(s=l[l.length-1],d=0,f=(p=e.slice(t)).length;d<f;d++)r(o=p[d],s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(a(e,r),g=[],h=0,v=c(t,e.length);0<=v?h<v:h>v;0<=v?++h:--h)g.push(i(e,r));return g},p=function(e,t,r,a){var i,o,s;for(null==a&&(a=n),i=e[r];r>t&&a(i,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=i},v=function(e,t,r){var a,i,o,s,l;for(null==r&&(r=n),i=e.length,l=t,o=e[t],a=2*t+1;a<i;)(s=a+1)<i&&!(r(e[a],e[s])<0)&&(a=s),e[t]=e[a],a=2*(t=a)+1;return e[t]=o,p(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=i,e.replace=l,e.pushpop=s,e.heapify=a,e.updateItem=f,e.nlargest=d,e.nsmallest=h,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return i(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return a(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return f(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),e.exports=t}.call(kt)),Et.exports;var e}var Ct,Pt=Ee(wt?xt:(wt=1,xt=Tt())),St=lt({root:null,weight:function(e){return 1},directed:!1}),Bt={dijkstra:function(e){if(!K(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=St(e),r=n.root,a=n.weight,i=n.directed,o=this,s=a,l=W(r)?this.filter(r)[0]:r[0],u={},c={},d={},h=this.byGroup(),f=h.nodes,p=h.edges;p.unmergeBy(function(e){return e.isLoop()});for(var v=function(e){return u[e.id()]},g=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new Pt(function(e,t){return v(e)-v(t)}),m=0;m<f.length;m++){var b=f[m];u[b.id()]=b.same(l)?0:1/0,y.push(b)}for(var x=function(e,t){for(var n,r=(i?e.edgesTo(t):e.edgesWith(t)).intersect(p),a=1/0,o=0;o<r.length;o++){var l=r[o],u=s(l);(u<a||!n)&&(a=u,n=l)}return{edge:n,dist:a}};y.size()>0;){var w=y.pop(),E=v(w),k=w.id();if(d[k]=E,E!==1/0)for(var T=w.neighborhood().intersect(f),C=0;C<T.length;C++){var P=T[C],S=P.id(),B=x(w,P),D=E+B.dist;D<v(P)&&(g(P,D),c[S]={node:w,edge:B.edge})}}return{distanceTo:function(e){var t=W(e)?f.filter(e)[0]:e[0];return d[t.id()]},pathTo:function(e){var t=W(e)?f.filter(e)[0]:e[0],n=[],r=t,a=r.id();if(t.length>0)for(n.unshift(t);c[a];){var i=c[a];n.unshift(i.edge),n.unshift(i.node),a=(r=i.node).id()}return o.spawn(n)}}}},Dt={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,a=n.length,i=new Array(a),o=n,s=function(e){for(var t=0;t<i.length;t++){if(i[t].has(e))return t}},l=0;l<a;l++)i[l]=this.spawn(n[l]);for(var u=r.sort(function(t,n){return e(t)-e(n)}),c=0;c<u.length;c++){var d=u[c],h=d.source()[0],f=d.target()[0],p=s(h),v=s(f),g=i[p],y=i[v];p!==v&&(o.merge(d),g.merge(y),i.splice(v,1))}return o}},_t=lt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),At={aStar:function(e){var t=this.cy(),n=_t(e),r=n.root,a=n.goal,i=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],a=t.collection(a)[0];var l,u,c=r.id(),d=a.id(),h={},f={},p={},v=new Pt(function(e,t){return f[e.id()]-f[t.id()]}),g=new vt,y={},m={},b=function(e,t){v.push(e),g.add(t)},x=function(){l=v.pop(),u=l.id(),g.delete(u)},w=function(e){return g.has(e)};b(r,c),h[c]=0,f[c]=i(r);for(var E=0;v.size()>0;){if(x(),E++,u===d){for(var k=[],T=a,C=d,P=m[C];k.unshift(T),null!=P&&k.unshift(P),null!=(T=y[C]);)P=m[C=T.id()];return{found:!0,distance:h[u],path:this.spawn(k),steps:E}}p[u]=!0;for(var S=l._private.edges,B=0;B<S.length;B++){var D=S[B];if(this.hasElementWithId(D.id())&&(!o||D.data("source")===u)){var _=D.source(),A=D.target(),M=_.id()!==u?_:A,R=M.id();if(this.hasElementWithId(R)&&!p[R]){var I=h[u]+s(D);w(R)?I<h[R]&&(h[R]=I,f[R]=I+i(M),y[R]=l,m[R]=D):(h[R]=I,f[R]=I+i(M),b(M,R),y[R]=l,m[R]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Mt=lt({weight:function(e){return 1},directed:!1}),Rt={floydWarshall:function(e){for(var t=this.cy(),n=Mt(e),r=n.weight,a=n.directed,i=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,c=u*u,d=function(e){return s.indexOf(e)},h=function(e){return s[e]},f=new Array(c),p=0;p<c;p++){var v=p%u,g=(p-v)/u;f[p]=g===v?0:1/0}for(var y=new Array(c),m=new Array(c),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],E=x.target()[0];if(w!==E){var k=d(w),T=d(E),C=k*u+T,P=i(x);if(f[C]>P&&(f[C]=P,y[C]=T,m[C]=x),!a){var S=T*u+k;!a&&f[S]>P&&(f[S]=P,y[S]=k,m[S]=x)}}}for(var B=0;B<u;B++)for(var D=0;D<u;D++)for(var _=D*u+B,A=0;A<u;A++){var M=D*u+A,R=B*u+A;f[_]+f[R]<f[M]&&(f[M]=f[_]+f[R],y[M]=y[_])}var I=function(e){return d(function(e){return(W(e)?t.filter(e):e)[0]}(e))},N={distance:function(e,t){var n=I(e),r=I(t);return f[n*u+r]},path:function(e,n){var r=I(e),a=I(n),i=h(r);if(r===a)return i.collection();if(null==y[r*u+a])return t.collection();var o,s=t.collection(),l=r;for(s.merge(i);r!==a;)l=r,r=y[r*u+a],o=m[l*u+r],s.merge(o),s.merge(h(r));return s}};return N}},It=lt({weight:function(e){return 1},directed:!1,root:null}),Nt={bellmanFord:function(e){var t=this,n=It(e),r=n.weight,a=n.directed,i=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,d=u.nodes,h=d.length,f=new ft,p=!1,v=[];i=l.collection(i)[0],c.unmergeBy(function(e){return e.isLoop()});for(var g=c.length,y=function(e){var t=f.get(e.id());return t||(t={},f.set(e.id(),t)),t},m=function(e){return(W(e)?l.$(e):e)[0]},b=0;b<h;b++){var x=d[b],w=y(x);x.same(i)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,k=function(e,t,n,r,a,i){var o=r.dist+i;o<a.dist&&!n.same(r.edge)&&(a.dist=o,a.pred=e,a.edge=n,E=!0)},T=1;T<h;T++){E=!1;for(var C=0;C<g;C++){var P=c[C],S=P.source(),B=P.target(),D=o(P),_=y(S),A=y(B);k(S,0,P,_,A,D),a||k(B,0,P,A,_,D)}if(!E)break}if(E)for(var M=[],R=0;R<g;R++){var I=c[R],N=I.source(),L=I.target(),z=o(I),O=y(N).dist,V=y(L).dist;if(O+z<V||!a&&V+z<O){if(p||(rt("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var F=[];O+z<V&&F.push(N),!a&&V+z<O&&F.push(L);for(var X=F.length,j=0;j<X;j++){var Y=F[j],q=[Y];q.push(y(Y).edge);for(var U=y(Y).pred;-1===q.indexOf(U);)q.push(U),q.push(y(U).edge),U=y(U).pred;for(var H=(q=q.slice(q.indexOf(U)))[0].id(),K=0,G=2;G<q.length;G+=2)q[G].id()<H&&(H=q[G].id(),K=G);(q=q.slice(K).concat(q.slice(0,K))).push(q[0]);var Z=q.map(function(e){return e.id()}).join(",");-1===M.indexOf(Z)&&(v.push(s.spawn(q)),M.push(Z))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=[],a=m(e);;){if(null==a)return t.spawn();var o=y(a),l=o.edge,u=o.pred;if(r.unshift(a[0]),a.same(n)&&r.length>0)break;null!=l&&r.unshift(l),a=u}return s.spawn(r)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},Lt=Math.sqrt(2),zt=function(e,t,n){0===n.length&&tt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],a=r[1],i=r[2],o=t[a],s=t[i],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===o&&t[h]===s||t[d]===s&&t[h]===o)&&l.splice(u,1)}for(var f=0;f<l.length;f++){var p=l[f];p[1]===s?(l[f]=p.slice(),l[f][1]=o):p[2]===s&&(l[f]=p.slice(),l[f][2]=o)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=o);return l},Ot=function(e,t,n,r){for(;n>r;){var a=Math.floor(Math.random()*t.length);t=zt(a,e,t),n--}return t},Vt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var a=n.length,i=r.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),s=Math.floor(a/Lt);if(!(a<2)){for(var l=[],u=0;u<i;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,h=[],f=new Array(a),p=new Array(a),v=new Array(a),g=function(e,t){for(var n=0;n<a;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<a;m++)p[m]=m;var b=Ot(p,l.slice(),a,s),x=b.slice();g(p,v);var w=Ot(p,b,s,2),E=Ot(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,g(p,f)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,g(v,f))}for(var k=this.spawn(h.map(function(e){return r[e[0]]})),T=this.spawn(),C=this.spawn(),P=f[0],S=0;S<f.length;S++){var B=f[S],D=n[S];B===P?T.merge(D):C.merge(D)}var _=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!k.contains(t)&&n.merge(t)})}),n},A=[_(T),_(C)];return{cut:k,components:A,partition1:T,partition2:C}}tt("At least 2 nodes are required for Karger-Stein algorithm")}},Ft=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Xt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},jt=function(e){return{x:e[0],y:e[1]}},Yt=function(e,t){return Math.atan2(t,e)-Math.PI/2},qt=Math.log2||function(e){return Math.log(e)/Math.log(2)},Wt=function(e){return e>0?1:e<0?-1:0},Ut=function(e,t){return Math.sqrt(Ht(e,t))},Ht=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Kt=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var a=0;a<t;a++)e[a]=e[a]/n;return e},Gt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Zt=function(e,t,n,r){return{x:Gt(e.x,t.x,n.x,r),y:Gt(e.y,t.y,n.y,r)}},$t=function(e,t,n){return Math.max(e,Math.min(n,t))},Qt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Jt=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},en=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},nn=function(e){var t,n,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=a=o[0];else if(2===o.length)t=r=o[0],a=n=o[1];else if(4===o.length){var s=i(o,4);t=s[0],n=s[1],r=s[2],a=s[3]}return e.x1-=a,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rn=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},an=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},on=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},sn=function(e,t){return on(e,t.x,t.y)},ln=function(e,t){return on(e,t.x1,t.y1)&&on(e,t.x2,t.y2)},un=null!==(Ct=Math.hypot)&&void 0!==Ct?Ct:function(e,t){return Math.sqrt(e*e+t*t)};function cn(e,t,n,r,a,i){var o=function(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},a=function(e,t){return{x:e.x*t,y:e.y*t}},i=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=un(e.x,e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e,t,o,s){var l=r(t,e),u=r(s,o),c=i(l,u);if(Math.abs(c)<1e-9)return n(e,a(l,.5));var d=i(r(o,e),u)/c;return n(e,a(l,d))},l=e.map(function(e){return{x:e.x,y:e.y}});(function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],a=e[(n+1)%e.length];t+=r.x*a.y-a.x*r.y}return t/2})(l)<0&&l.reverse();for(var u=l.length,c=[],d=0;d<u;d++){var h=l[d],f=l[(d+1)%u],p=r(f,h),v=o({x:p.y,y:-p.x});c.push(v)}for(var g=c.map(function(e,r){return{p1:n(l[r],a(e,t)),p2:n(l[(r+1)%u],a(e,t))}}),y=[],m=0;m<u;m++){var b=g[(m-1+u)%u],x=g[m],w=s(b.p1,b.p2,x.p1,x.p2);y.push(w)}return y}(Tn(e,t,n,r,a),i),s=Qt();return o.forEach(function(e){return en(s,e.x,e.y)}),s}var dn=function(e,t,n,r,a,i,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?_n(a,i):u,d=a/2,h=i/2,f=(c=Math.min(c,d,h))!==d,p=c!==h;if(f){var v=r-h-o;if((s=kn(e,t,n,r,n-d+c-o,v,n+d-c+o,v,!1)).length>0)return s}if(p){var g=n+d+o;if((s=kn(e,t,n,r,g,r-h+c-o,g,r+h-c+o,!1)).length>0)return s}if(f){var y=r+h+o;if((s=kn(e,t,n,r,n-d+c-o,y,n+d-c+o,y,!1)).length>0)return s}if(p){var m=n-d-o;if((s=kn(e,t,n,r,m,r-h+c-o,m,r+h-c+o,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=wn(e,t,n,r,b,x,c+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=wn(e,t,n,r,w,E,c+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var k=n+d-c,T=r+h-c;if((l=wn(e,t,n,r,k,T,c+o)).length>0&&l[0]>=k&&l[1]>=T)return[l[0],l[1]];var C=n-d+c,P=r+h-c;return(l=wn(e,t,n,r,C,P,c+o)).length>0&&l[0]<=C&&l[1]>=P?[l[0],l[1]]:[]},hn=function(e,t,n,r,a,i,o){var s=o,l=Math.min(n,a),u=Math.max(n,a),c=Math.min(r,i),d=Math.max(r,i);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},fn=function(e,t,n,r,a,i,o,s,l){var u=Math.min(n,o,a)-l,c=Math.max(n,o,a)+l,d=Math.min(r,s,i)-l,h=Math.max(r,s,i)+l;return!(e<u||e>c||t<d||t>h)},pn=function(e,t,n,r,a,i,o,s){var l=[];!function(e,t,n,r,a){var i,o,s,l,u,c,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),i=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,a[1]=0,d=t/3,i>0?(u=(u=s+Math.sqrt(i))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(i))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),a[0]=-d+u+c,d+=(u+c)/2,a[4]=a[2]=-d,d=Math.sqrt(3)*(-c+u)/2,a[3]=d,a[5]=-d):(a[5]=a[3]=0,0===i?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),a[0]=2*h-d,a[4]=a[2]=-(h+d)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),a[0]=-d+h*Math.cos(l/3),a[2]=-d+h*Math.cos((l+2*Math.PI)/3),a[4]=-d+h*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+r*r-4*r*i+2*r*s+4*i*i-4*i*s+s*s,9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*r*i-3*r*r-3*r*s-6*i*i+3*i*s,3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*r*r-6*r*i+r*s-r*t+2*i*i+2*i*t-s*t,1*n*a-n*n+n*e-a*e+r*i-r*r+r*t-i*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var d,h,f,p=-1,v=0;v<u.length;v++)d=Math.pow(1-u[v],2)*n+2*(1-u[v])*u[v]*a+u[v]*u[v]*o,h=Math.pow(1-u[v],2)*r+2*(1-u[v])*u[v]*i+u[v]*u[v]*s,f=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?f<p&&(p=f):p=f;return p},vn=function(e,t,n,r,a,i){var o=[e-n,t-r],s=[a-n,i-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-a)*(e-a)+(t-i)*(t-i):u-d},gn=function(e,t,n){for(var r,a,i,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],a=n[2*l+1],l+1<n.length/2?(i=n[2*(l+1)],o=n[2*(l+1)+1]):(i=n[2*(l+1-n.length/2)],o=n[2*(l+1-n.length/2)+1]),r==e&&i==e);else{if(!(r>=e&&e>=i||r<=e&&e<=i))continue;(e-r)/(i-r)*(o-a)+a>t&&s++}return s%2!=0},yn=function(e,t,n,r,a,i,o,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),f=Math.sin(-u),p=0;p<c.length/2;p++)c[2*p]=i/2*(n[2*p]*h-n[2*p+1]*f),c[2*p+1]=o/2*(n[2*p+1]*h+n[2*p]*f),c[2*p]+=r,c[2*p+1]+=a;if(l>0){var v=bn(c,-l);d=mn(v)}else d=c;return gn(e,t,d)},mn=function(e){for(var t,n,r,a,i,o,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],a=e[4*c+3],c<e.length/4-1?(i=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(i=e[0],o=e[1],s=e[2],l=e[3]);var d=kn(t,n,r,a,i,o,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},bn=function(e,t){for(var n,r,a,i,o=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(a=e[2*(s+1)],i=e[2*(s+1)+1]):(a=e[0],i=e[1]);var l=i-r,u=-(a-n),c=Math.sqrt(l*l+u*u),d=l/c,h=u/c;o[4*s]=n+d*t,o[4*s+1]=r+h*t,o[4*s+2]=a+d*t,o[4*s+3]=i+h*t}return o},xn=function(e,t,n,r,a,i,o){return e-=a,t-=i,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},wn=function(e,t,n,r,a,i,o){var s=[n-e,r-t],l=[e-a,t-i],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(d<0)return[];var h=(-c+Math.sqrt(d))/(2*u),f=(-c-Math.sqrt(d))/(2*u),p=Math.min(h,f),v=Math.max(h,f),g=[];if(p>=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var y=g[0]*s[0]+e,m=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[y,m]:[y,m,g[1]*s[0]+e,g[1]*s[1]+t]:[y,m]},En=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},kn=function(e,t,n,r,a,i,o,s,l){var u=e-a,c=n-e,d=o-a,h=t-i,f=r-t,p=s-i,v=d*h-p*u,g=c*h-f*u,y=p*c-d*f;if(0!==y){var m=v/y,b=g/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*f]:[]}return 0===v||0===g?En(e,n,o)===o?[o,s]:En(e,n,a)===a?[a,i]:En(a,o,n)===n?[n,r]:[]:[]},Tn=function(e,t,n,r,a){var i=[],o=r/2,s=a/2,l=t,u=n;i.push({x:l+o*e[0],y:u+s*e[1]});for(var c=1;c<e.length/2;c++)i.push({x:l+o*e[2*c],y:u+s*e[2*c+1]});return i},Cn=function(e,t,n,r,a,i,o,s){var l,u,c,d,h,f,p=[],v=new Array(n.length),g=!0;if(null==i&&(g=!1),g){for(var y=0;y<v.length/2;y++)v[2*y]=n[2*y]*i+r,v[2*y+1]=n[2*y+1]*o+a;if(s>0){var m=bn(v,-s);u=mn(m)}else u=v}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],d=u[2*b+1],b<u.length/2-1?(h=u[2*(b+1)],f=u[2*(b+1)+1]):(h=u[0],f=u[1]),0!==(l=kn(e,t,r,a,c,d,h,f)).length&&p.push(l[0],l[1]);return p},Pn=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),i=(a-n)/a;return i<0&&(i=1e-5),[t[0]+i*r[0],t[1]+i*r[1]]},Sn=function(e,t){var n=Dn(e,t);return n=Bn(n)},Bn=function(e){for(var t,n,r=e.length/2,a=1/0,i=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],a=Math.min(a,t),o=Math.max(o,t),i=Math.min(i,n),s=Math.max(s,n);for(var u=2/(o-a),c=2/(s-i),d=0;d<r;d++)t=e[2*d]=e[2*d]*u,n=e[2*d+1]=e[2*d+1]*c,a=Math.min(a,t),o=Math.max(o,t),i=Math.min(i,n),s=Math.max(s,n);if(i<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-i);return e},Dn=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var a,i=new Array(2*e),o=0;o<e;o++)a=o*n+r,i[2*o]=Math.cos(a),i[2*o+1]=Math.sin(-a);return i},_n=function(e,t){return Math.min(e/4,t/4,8)},An=function(e,t){return Math.min(e/10,t/10,8)},Mn=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Rn(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],a=e[(n+1)%e.length],i={x:a.x-r.x,y:a.y-r.y},o={x:-i.y,y:i.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function a(e,t){var n,a=1/0,i=-1/0,o=r(e);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=s.x*t.x+s.y*t.y;a=Math.min(a,l),i=Math.max(i,l)}}catch(e){o.e(e)}finally{o.f()}return{min:a,max:i}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var s,l=r([].concat(o(n(e)),o(n(t))));try{for(l.s();!(s=l.n()).done;){var u=s.value;if(!i(a(e,u),a(t,u)))return!1}}catch(e){l.e(e)}finally{l.f()}return!0}var In=lt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Nn={pageRank:function(e){for(var t=In(e),n=t.dampingFactor,r=t.precision,a=t.iterations,i=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=u.length,f=new Array(d),p=new Array(c),v=(1-n)/c,g=0;g<c;g++){for(var y=0;y<c;y++){f[g*c+y]=0}p[g]=0}for(var m=0;m<h;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),k=l.indexOfId(w),T=i(b);f[k*c+E]+=T,p[E]+=T}}for(var C=1/c+v,P=0;P<c;P++)if(0===p[P])for(var S=0;S<c;S++){f[S*c+P]=C}else for(var B=0;B<c;B++){var D=B*c+P;f[D]=f[D]/p[P]+v}for(var _,A=new Array(c),M=new Array(c),R=0;R<c;R++)A[R]=1;for(var I=0;I<a;I++){for(var N=0;N<c;N++)M[N]=0;for(var L=0;L<c;L++)for(var z=0;z<c;z++){var O=L*c+z;M[L]+=f[O]*A[z]}Kt(M),_=A,A=M,M=_;for(var V=0,F=0;F<c;F++){var X=_[F]-A[F];V+=X*X}if(V<r)break}return{rank:function(e){return e=o.collection(e)[0],A[l.indexOf(e)]}}}},Ln=lt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),zn={degreeCentralityNormalized:function(e){e=Ln(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var a={},i={},o=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var d=this.degreeCentrality(e);o<d.indegree&&(o=d.indegree),s<d.outdegree&&(s=d.outdegree),a[c]=d.indegree,i[c]=d.outdegree}return{indegree:function(e){return 0==o?0:(W(e)&&(e=t.filter(e)),a[e.id()]/o)},outdegree:function(e){return 0===s?0:(W(e)&&(e=t.filter(e)),i[e.id()]/s)}}}for(var h={},f=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);f<g.degree&&(f=g.degree),h[v.id()]=g.degree}return{degree:function(e){return 0===f?0:(W(e)&&(e=t.filter(e)),h[e.id()]/f)}}},degreeCentrality:function(e){e=Ln(e);var t=this.cy(),n=this,r=e,a=r.root,i=r.weight,o=r.directed,s=r.alpha;if(a=t.collection(a)[0],o){for(var l=a.connectedEdges(),u=l.filter(function(e){return e.target().same(a)&&n.has(e)}),c=l.filter(function(e){return e.source().same(a)&&n.has(e)}),d=u.length,h=c.length,f=0,p=0,v=0;v<u.length;v++)f+=i(u[v]);for(var g=0;g<c.length;g++)p+=i(c[g]);return{indegree:Math.pow(d,1-s)*Math.pow(f,s),outdegree:Math.pow(h,1-s)*Math.pow(p,s)}}for(var y=a.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=i(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};zn.dc=zn.degreeCentrality,zn.dcn=zn.degreeCentralityNormalised=zn.degreeCentralityNormalized;var On=lt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Vn={closenessCentralityNormalized:function(e){for(var t=On(e),n=t.harmonic,r=t.weight,a=t.directed,i=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:a}),c=0;c<l.length;c++){for(var d=0,h=l[c],f=0;f<l.length;f++)if(c!==f){var p=u.distance(h,l[f]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),o[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=W(e)?i.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=On(e),n=t.root,r=t.weight,a=t.directed,i=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:a}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var d=o.distanceTo(c);s+=i?1/d:d}}return i?s:1/s}};Vn.cc=Vn.closenessCentrality,Vn.ccn=Vn.closenessCentralityNormalised=Vn.closenessCentralityNormalized;var Fn=lt({weight:null,directed:!1}),Xn={betweennessCentrality:function(e){for(var t=Fn(e),n=t.directed,r=t.weight,a=null!=r,i=this.cy(),o=this.nodes(),s={},l={},u=0,c=function(e,t){l[e]=t,t>u&&(u=t)},d=function(e){return l[e]},h=0;h<o.length;h++){var f=o[h],p=f.id();s[p]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),c(p,0)}for(var v=function(){for(var e=o[g].id(),t=[],n={},l={},u={},h=new Pt(function(e,t){return u[e]-u[t]}),f=0;f<o.length;f++){var p=o[f].id();n[p]=[],l[p]=0,u[p]=1/0}for(l[e]=1,u[e]=0,h.push(e);!h.empty();){var v=h.pop();if(t.push(v),a)for(var y=0;y<s[v].length;y++){var m=s[v][y],b=i.getElementById(v),x=void 0;x=b.edgesTo(m).length>0?b.edgesTo(m)[0]:m.edgesTo(b)[0];var w=r(x);m=m.id(),u[m]>u[v]+w&&(u[m]=u[v]+w,h.nodes.indexOf(m)<0?h.push(m):h.updateItem(m),l[m]=0,n[m]=[]),u[m]==u[v]+w&&(l[m]=l[m]+l[v],n[m].push(v))}else for(var E=0;E<s[v].length;E++){var k=s[v][E].id();u[k]==1/0&&(h.push(k),u[k]=u[v]+1),u[k]==u[v]+1&&(l[k]=l[k]+l[v],n[k].push(v))}}for(var T={},C=0;C<o.length;C++)T[o[C].id()]=0;for(;t.length>0;){for(var P=t.pop(),S=0;S<n[P].length;S++){var B=n[P][S];T[B]=T[B]+l[B]/l[P]*(1+T[P])}P!=o[g].id()&&c(P,d(P)+T[P])}},g=0;g<o.length;g++)v();var y={betweenness:function(e){var t=i.collection(e).id();return d(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=i.collection(e).id();return d(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};Xn.bc=Xn.betweennessCentrality;var jn=lt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Yn=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},qn=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var a=0;a<t;a++)n+=e[a*t+r];for(var i=0;i<t;i++)e[i*t+r]=e[i*t+r]/n}},Wn=function(e,t,n){for(var r=new Array(n*n),a=0;a<n;a++){for(var i=0;i<n;i++)r[a*n+i]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[a*n+s]+=e[a*n+o]*t[o*n+s]}return r},Un=function(e,t,n){for(var r=e.slice(0),a=1;a<n;a++)e=Wn(e,r,t);return e},Hn=function(e,t,n){for(var r=new Array(t*t),a=0;a<t*t;a++)r[a]=Math.pow(e[a],n);return qn(r,t),r},Kn=function(e,t,n,r){for(var a=0;a<n;a++){if(Math.round(e[a]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[a]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},Gn=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Zn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),a=function(e){return jn(e)}(e),i={},o=0;o<t.length;o++)i[t[o].id()]=o;for(var s,l=t.length,u=l*l,c=new Array(u),d=0;d<u;d++)c[d]=0;for(var h=0;h<n.length;h++){var f=n[h],p=i[f.source().id()],v=i[f.target().id()],g=Yn(f,a.attributes);c[p*l+v]+=g,c[v*l+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,a.multFactor),qn(c,l);for(var y=!0,m=0;y&&m<a.maxIterations;)y=!1,s=Un(c,l,a.expandFactor),c=Hn(s,l,a.inflateFactor),Kn(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var a=[],i=0;i<t;i++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[i*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&a.push(r.collection(o))}return a}(c,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Gn(e[t],e[n])&&e.splice(n,1);return e}(b),b},$n={markovClustering:Zn,mcl:Zn},Qn=function(e){return e},Jn=function(e,t){return Math.abs(t-e)},er=function(e,t,n){return e+Jn(t,n)},tr=function(e,t,n){return e+Math.pow(n-t,2)},nr=function(e){return Math.sqrt(e)},rr=function(e,t,n){return Math.max(e,Jn(t,n))},ar=function(e,t,n,r,a){for(var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Qn,o=r,s=0;s<e;s++)o=a(o,t(s),n(s));return i(o)},ir={euclidean:function(e,t,n){return e>=2?ar(e,t,n,0,tr,nr):ar(e,t,n,0,er)},squaredEuclidean:function(e,t,n){return ar(e,t,n,0,tr)},manhattan:function(e,t,n){return ar(e,t,n,0,er)},max:function(e,t,n){return ar(e,t,n,-1/0,rr)}};function or(e,t,n,r,a,i){var o;return o=U(e)?e:ir[e]||ir.euclidean,0===t&&U(e)?o(a,i):o(t,n,r,a,i)}ir["squared-euclidean"]=ir.squaredEuclidean,ir.squaredeuclidean=ir.squaredEuclidean;var sr=lt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),lr=function(e){return sr(e)},ur=function(e,t,n,r,a){var i="kMedoids"!==a?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return or(e,r.length,i,function(e){return r[e](t)},o,s)},cr=function(e,t,n){for(var r=n.length,a=new Array(r),i=new Array(r),o=new Array(t),s=null,l=0;l<r;l++)a[l]=e.min(n[l]).value,i[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(i[c]-a[c])+a[c];o[u]=s}return o},dr=function(e,t,n,r,a){for(var i=1/0,o=0,s=0;s<t.length;s++){var l=ur(n,e,t[s],r,a);l<i&&(i=l,o=s)}return o},hr=function(e,t,n){for(var r=[],a=null,i=0;i<t.length;i++)n[(a=t[i]).id()]===e&&r.push(a);return r},fr=function(e,t,n){return Math.abs(t-e)<=n},pr=function(e,t,n){for(var r=0;r<e.length;r++)for(var a=0;a<e[r].length;a++){if(Math.abs(e[r][a]-t[r][a])>n)return!1}return!0},vr=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},gr=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var a=e[Math.floor(Math.random()*e.length)];vr(a,n,r);)a=e[Math.floor(Math.random()*e.length)];n[r]=a}else for(var i=0;i<t;i++)n[i]=e[Math.floor(Math.random()*e.length)];return n},yr=function(e,t,n){for(var r=0,a=0;a<t.length;a++)r+=ur("manhattan",t[a],e,n,"kMedoids");return r},mr=function(e,t,n,r,a){for(var i,o,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],a.m);for(var u=0;u<e.length;u++)for(var c=0;c<a.attributes.length;c++){i=0,o=0;for(var d=0;d<t.length;d++)i+=r[d][u]*a.attributes[c](t[d]),o+=r[d][u];e[u][c]=i/o}},br=function(e,t,n,r,a){for(var i=0;i<e.length;i++)t[i]=e[i].slice();for(var o,s,l,u=2/(a.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){o=0;for(var h=0;h<n.length;h++)s=ur(a.distance,r[d],n[c],a.attributes,"cmeans"),l=ur(a.distance,r[d],n[h],a.attributes,"cmeans"),o+=Math.pow(s/l,u);e[d][c]=1/o}},xr=function(e){var t,n,r,a,i,o=this.cy(),s=this.nodes(),l=lr(e);a=new Array(s.length);for(var u=0;u<s.length;u++)a[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var d=0;d<s.length;d++){for(var h=0,f=0;f<l.k;f++)r[d][f]=Math.random(),h+=r[d][f];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/h}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);i=new Array(s.length);for(var g=0;g<s.length;g++)i[g]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,mr(n,s,r,i,l),br(r,a,n,s,l),pr(r,a,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var a,i,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){a=-1/0,i=-1;for(var u=0;u<t[0].length;u++)t[l][u]>a&&(a=t[l][u],i=u);o[i].push(e[l])}for(var c=0;c<o.length;c++)o[c]=r.collection(o[c]);return o}(s,r,l,o),{clusters:t,degreeOfMembership:r}},wr={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),a=null,i=lr(e),o=new Array(i.k),s={};i.testMode?"number"==typeof i.testCentroids?(i.testCentroids,t=cr(r,i.k,i.attributes)):t="object"===l(i.testCentroids)?i.testCentroids:cr(r,i.k,i.attributes):t=cr(r,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<r.length;d++)s[(a=r[d]).id()]=dr(a,t,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var f=hr(h,r,s);if(0!==f.length){for(var p=i.attributes.length,v=t[h],g=new Array(p),y=new Array(p),m=0;m<p;m++){y[m]=0;for(var b=0;b<f.length;b++)a=f[b],y[m]+=i.attributes[m](a);g[m]=y[m]/f.length,fr(g[m],v[m],i.sensitivityThreshold)||(u=!0)}t[h]=g,o[h]=n.collection(f)}}c++}return o},kMedoids:function(e){var t,n,r=this.cy(),a=this.nodes(),i=null,o=lr(e),s=new Array(o.k),u={},c=new Array(o.k);o.testMode?"number"==typeof o.testCentroids||(t="object"===l(o.testCentroids)?o.testCentroids:gr(a,o.k)):t=gr(a,o.k);for(var d=!0,h=0;d&&h<o.maxIterations;){for(var f=0;f<a.length;f++)u[(i=a[f]).id()]=dr(i,t,o.distance,o.attributes,"kMedoids");d=!1;for(var p=0;p<t.length;p++){var v=hr(p,a,u);if(0!==v.length){c[p]=yr(t[p],v,o.attributes);for(var g=0;g<v.length;g++)(n=yr(v[g],v,o.attributes))<c[p]&&(c[p]=n,t[p]=v[g],d=!0);s[p]=r.collection(v)}}h++}return s},fuzzyCMeans:xr,fcm:xr},Er=lt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),kr={single:"min",complete:"max"},Tr=function(e,t,n,r,a){for(var i,o=0,s=1/0,l=a.attributes,u=function(e,t){return or(a.distance,l.length,function(t){return l[t](e)},function(e){return l[e](t)},e,t)},c=0;c<e.length;c++){var d=e[c].key,h=n[d][r[d]];h<s&&(o=d,s=h)}if("threshold"===a.mode&&s>=a.threshold||"dendrogram"===a.mode&&1===e.length)return!1;var f,p=t[o],v=t[r[o]];f="dendrogram"===a.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=f,e.splice(v.index,1),t[p.key]=f;for(var g=0;g<e.length;g++){var y=e[g];p.key===y.key?i=1/0:"min"===a.linkage?(i=n[p.key][y.key],n[p.key][y.key]>n[v.key][y.key]&&(i=n[v.key][y.key])):"max"===a.linkage?(i=n[p.key][y.key],n[p.key][y.key]<n[v.key][y.key]&&(i=n[v.key][y.key])):i="mean"===a.linkage?(n[p.key][y.key]*p.size+n[v.key][y.key]*v.size)/(p.size+v.size):"dendrogram"===a.mode?u(y.value,p.value):u(y.value[0],p.value[0]),n[p.key][y.key]=n[y.key][p.key]=i}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return p.key=v.key=p.index=v.index=null,!0},Cr=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Cr(e.left,t),e.right&&Cr(e.right,t)))},Pr=function(e,t){if(!e)return"";if(e.left&&e.right){var n=Pr(e.left,t),r=Pr(e.right,t),a=t.add({group:"nodes",data:{id:n+","+r}});return t.add({group:"edges",data:{source:n,target:a.id()}}),t.add({group:"edges",data:{source:r,target:a.id()}}),a.id()}return e.value?e.value.id():void 0},Sr=function(e,t,n){if(!e)return[];var r=[],a=[],i=[];return 0===t?(e.left&&Cr(e.left,r),e.right&&Cr(e.right,a),i=r.concat(a),[n.collection(i)]):1===t?e.value?[n.collection(e.value)]:(e.left&&Cr(e.left,r),e.right&&Cr(e.right,a),[n.collection(r),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(r=Sr(e.left,t-1,n)),e.right&&(a=Sr(e.right,t-1,n)),r.concat(a))},Br=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=Er(e),n=kr[t.linkage];return null!=n&&(t.linkage=n),t}(e),a=r.attributes,i=function(e,t){return or(r.distance,a.length,function(t){return a[t](e)},function(e){return a[e](t)},e,t)},o=[],s=[],l=[],u=[],c=0;c<n.length;c++){var d={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};o[c]=d,u[c]=d,s[c]=[],l[c]=0}for(var h=0;h<o.length;h++)for(var f=0;f<=h;f++){var p=void 0;p="dendrogram"===r.mode?h===f?1/0:i(o[h].value,o[f].value):h===f?1/0:i(o[h].value[0],o[f].value[0]),s[h][f]=p,s[f][h]=p,p<s[h][l[h]]&&(l[h]=f)}for(var v,g=Tr(o,u,s,l,r);g;)g=Tr(o,u,s,l,r);return"dendrogram"===r.mode?(v=Sr(o[0],r.dendrogramDepth,t),r.addDendrogram&&Pr(o[0],t)):(v=new Array(o.length),o.forEach(function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)})),v},Dr={hierarchicalClustering:Br,hca:Br},_r=lt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Ar=function(e,t,n,r){var a=function(e,t){return r[t](e)};return-or(e,r.length,function(e){return a(t,e)},function(e){return a(n,e)},t,n)},Mr=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var i=0,o=e.length-1;o>=0;o--){var s=e[o];a?isFinite(s)||(e[o]=-1/0,i++):e.splice(o,1)}r&&e.sort(function(e,t){return e-t});var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+i]:(e[u-1+i]+e[u+i])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,a=0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r+=o,a++)}return r/a}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,a=t;a<n;a++){var i=e[a];isFinite(i)&&(r=Math.min(i,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,a=t;a<n;a++){var i=e[a];isFinite(i)&&(r=Math.max(i,r))}return r}(e):t,n},Rr=function(e,t,n){for(var r=[],a=0;a<e;a++){for(var i=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[a*e+l]>o&&(i=l,o=t[a*e+l])}i>0&&r.push(i)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},Ir=function(e){for(var t,n,r,a,i,o,s=this.cy(),l=this.nodes(),u=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||tt("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some(function(e){return e===n})||G(n)||tt("Preference must be one of [".concat(r.map(function(e){return"'".concat(e,"'")}).join(", "),"] or a number. Got: ").concat(n)),_r(e)}(e),c={},d=0;d<l.length;d++)c[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var f=0;f<t;f++)for(var p=0;p<t;p++)f!==p&&(r[f*t+p]=Ar(u.distance,l[f],l[p],u.attributes));a=Mr(r,u.preference);for(var v=0;v<t;v++)r[v*t+v]=a;i=new Array(n);for(var g=0;g<n;g++)i[g]=0;o=new Array(n);for(var y=0;y<n;y++)o[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,k=new Array(t*u.minIterations),T=0;T<k.length;T++)k[T]=0;for(E=0;E<u.maxIterations;E++){for(var C=0;C<t;C++){for(var P=-1/0,S=-1/0,B=-1,D=0,_=0;_<t;_++)m[_]=i[C*t+_],(D=o[C*t+_]+r[C*t+_])>=P?(S=P,P=D,B=_):D>S&&(S=D);for(var A=0;A<t;A++)i[C*t+A]=(1-u.damping)*(r[C*t+A]-P)+u.damping*m[A];i[C*t+B]=(1-u.damping)*(r[C*t+B]-S)+u.damping*m[B]}for(var M=0;M<t;M++){for(var R=0,I=0;I<t;I++)m[I]=o[I*t+M],b[I]=Math.max(0,i[I*t+M]),R+=b[I];R-=b[M],b[M]=i[M*t+M],R+=b[M];for(var N=0;N<t;N++)o[N*t+M]=(1-u.damping)*Math.min(0,R-b[N])+u.damping*m[N];o[M*t+M]=(1-u.damping)*(R-b[M])+u.damping*m[M]}for(var L=0,z=0;z<t;z++){var O=o[z*t+z]+i[z*t+z]>0?1:0;k[E%u.minIterations*t+z]=O,L+=O}if(L>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var V=0,F=0;F<t;F++){x[F]=0;for(var X=0;X<u.minIterations;X++)x[F]+=k[X*t+F];0!==x[F]&&x[F]!==u.minIterations||V++}if(V===t)break}}for(var j=function(e,t,n){for(var r=[],a=0;a<e;a++)t[a*e+a]+n[a*e+a]>0&&r.push(a);return r}(t,i,o),Y=function(e,t,n){for(var r=Rr(e,t,n),a=0;a<n.length;a++){for(var i=[],o=0;o<r.length;o++)r[o]===n[a]&&i.push(o);for(var s=-1,l=-1/0,u=0;u<i.length;u++){for(var c=0,d=0;d<i.length;d++)c+=t[i[d]*e+i[u]];c>l&&(s=u,l=c)}n[a]=i[s]}return Rr(e,t,n)}(t,r,j),q={},W=0;W<j.length;W++)q[j[W]]=[];for(var U=0;U<l.length;U++){var H=Y[c[l[U].id()]];null!=H&&q[H].push(l[U])}for(var K=new Array(j.length),Z=0;Z<j.length;Z++)K[Z]=s.collection(q[j[Z]]);return K},Nr={affinityPropagation:Ir,ap:Ir},Lr=lt({root:void 0,directed:!1}),zr=function(){var e=this,t={},n=0,r=0,a=[],i=[],o={},s=function(l,u,c){l===c&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var d,h,f,p,v=e.getElementById(u).connectedEdges().intersection(e);0===v.size()?a.push(e.spawn(e.getElementById(u))):v.forEach(function(n){d=n.source().id(),h=n.target().id(),(f=d===u?h:d)!==c&&(p=n.id(),o[p]||(o[p]=!0,i.push({x:u,y:f,edge:n})),f in t?t[u].low=Math.min(t[u].low,t[f].id):(s(l,f,u),t[u].low=Math.min(t[u].low,t[f].low),t[u].id<=t[f].low&&(t[u].cutVertex=!0,function(n,r){for(var o=i.length-1,s=[],l=e.spawn();i[o].x!=n||i[o].y!=r;)s.push(i.pop().edge),o--;s.push(i.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),a=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(a.filter(function(e){return e.isLoop()})):l.merge(a)})}),a.push(l)}(u,f))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:a}},Or=function(){var e=this,t={},n=0,r=[],a=[],i=e.spawn(e),o=function(s){if(a.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=a.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),i=i.difference(d)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:i,components:r}},Vr={};[mt,Bt,Dt,At,Rt,Nt,Vt,Nn,zn,Vn,Xn,$n,wr,Dr,Nr,{hierholzer:function(e){if(!K(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,a,i=Lr(e),o=i.root,s=i.directed,l=this,u=!1;o&&(a=W(o)?this.filter(o)[0].id():o[0].id());var c={},d={};s?l.forEach(function(e){var t=e.id();if(e.isNode()){var a=e.indegree(!0),i=e.outdegree(!0),o=a-i,s=i-a;1==o?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||o>1)&&(u=!0),c[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&c[t].push(e.id())})}else d[t]=[void 0,e.target().id()]}):l.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach(function(e){return c[t].push(e.id())})):d[t]=[e.source().id(),e.target().id()]});var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(a&&r!=a)return h;a=r}else{if(a&&r!=a&&n!=a)return h;a||(a=r)}else a||(a=l[0].id());var f=function(e){for(var t,n,r,a=e,i=[e];c[a].length;)t=c[a].shift(),n=d[t][0],a!=(r=d[t][1])?(c[r]=c[r].filter(function(e){return e!=t}),a=r):s||a==n||(c[n]=c[n].filter(function(e){return e!=t}),a=n),i.unshift(t),i.unshift(a);return i},p=[],v=[];for(v=f(a);1!=v.length;)0==c[v[0]].length?(p.unshift(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=f(v.shift()).concat(v);for(var g in p.unshift(l.getElementById(v.shift())),c)if(c[g].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},{hopcroftTarjanBiconnected:zr,htbc:zr,htb:zr,hopcroftTarjanBiconnectedComponents:zr},{tarjanStronglyConnected:Or,tsc:Or,tscc:Or,tarjanStronglyConnectedComponents:Or}].forEach(function(e){ge(Vr,e)});
|
|
1
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function l(e){"@babel/helpers - typeof";return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var c="undefined"==typeof window?null:window,d=c?c.navigator:null;c&&c.document;var h,f,p,v,g,y,m,b,x,w,E,k,T,C,P,S,B,D,_,A,M,R,I,N,L,z,O,V,F=l(""),X=l({}),j=l(function(){}),Y="undefined"==typeof HTMLElement?"undefined":l(HTMLElement),q=function(e){return e&&e.instanceString&&U(e.instanceString)?e.instanceString():null},W=function(e){return null!=e&&l(e)==F},U=function(e){return null!=e&&l(e)===j},H=function(e){return!$(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},K=function(e){return null!=e&&l(e)===X&&!H(e)&&e.constructor===Object},G=function(e){return null!=e&&l(e)===l(1)&&!isNaN(e)},Z=function(e){return"undefined"===Y?void 0:null!=e&&e instanceof HTMLElement},$=function(e){return Q(e)||J(e)},Q=function(e){return"collection"===q(e)&&e._private.single},J=function(e){return"collection"===q(e)&&!e._private.single},ee=function(e){return"core"===q(e)},te=function(e){return"stylesheet"===q(e)},ne=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},re=function(e){return function(e){return null!=e&&l(e)===X}(e)&&U(e.then)},ae=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function(){var r,a=arguments,i=t.apply(this,a),o=n.cache;return(r=o[i])||(r=o[i]=e.apply(this,a)),r};return n.cache={},n},ie=ae(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),oe=ae(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),se=ae(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),le=function(e){return ne(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ue=function(e,t){return e.slice(-1*t.length)===t},ce="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",de="rgb[a]?\\(("+ce+"[%]?)\\s*,\\s*("+ce+"[%]?)\\s*,\\s*("+ce+"[%]?)(?:\\s*,\\s*("+ce+"))?\\)",he="rgb[a]?\\((?:"+ce+"[%]?)\\s*,\\s*(?:"+ce+"[%]?)\\s*,\\s*(?:"+ce+"[%]?)(?:\\s*,\\s*(?:"+ce+"))?\\)",fe="hsl[a]?\\(("+ce+")\\s*,\\s*("+ce+"[%])\\s*,\\s*("+ce+"[%])(?:\\s*,\\s*("+ce+"))?\\)",pe="hsl[a]?\\((?:"+ce+")\\s*,\\s*(?:"+ce+"[%])\\s*,\\s*(?:"+ce+"[%])(?:\\s*,\\s*(?:"+ce+"))?\\)",ve=function(e,t){return e<t?-1:e>t?1:0},ge=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var a=Object.keys(r),i=0;i<a.length;i++){var o=a[i];e[o]=r[o]}}return e},ye=function(e){return(H(e)?e:null)||function(e){return me[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,a=16;return 4===e.length?(t=parseInt(e[1]+e[1],a),n=parseInt(e[2]+e[2],a),r=parseInt(e[3]+e[3],a)):(t=parseInt(e[1]+e[2],a),n=parseInt(e[3]+e[4],a),r=parseInt(e[5]+e[6],a)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^"+de+"$").exec(e);if(n){t=[];for(var r=[],a=1;a<=3;a++){var i=n[a];if("%"===i[i.length-1]&&(r[a]=!0),i=parseFloat(i),r[a]&&(i=i/100*255),i<0||i>255)return;t.push(Math.floor(i))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,a,i,o,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+fe+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(a=parseFloat(c[3]))<0||a>100)return;if(a/=100,void 0!==(i=c[4])&&((i=parseFloat(i))<0||i>1))return;if(0===r)o=s=l=Math.round(255*a);else{var d=a<.5?a*(1+r):a+r-a*r,h=2*a-d;o=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[o,s,l,i]}return t}(e)},me={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},be=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var i=n[a];if(K(i))throw Error("Tried to set map with object key");a<n.length-1?(null==t[i]&&(t[i]={}),t=t[i]):t[i]=e.value}},xe=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var i=n[a];if(K(i))throw Error("Tried to get map with object key");if(null==(t=t[i]))return t}return t},we="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ke(){if(f)return h;return f=1,h=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function Te(){if(y)return g;y=1;var e=function(){if(v)return p;v=1;var e="object"==typeof we&&we&&we.Object===Object&&we;return p=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return g=n}function Ce(){if(k)return E;k=1;var e=function(){if(w)return x;w=1;var e=/\s/;return x=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},x}(),t=/^\s+/;return E=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},E}function Pe(){if(C)return T;C=1;var e=Te().Symbol;return T=e}function Se(){if(A)return _;A=1;var e=Pe(),t=function(){if(S)return P;S=1;var e=Pe(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;return P=function(e){var t=n.call(e,a),i=e[a];try{e[a]=void 0;var o=!0}catch(e){}var s=r.call(e);return o&&(t?e[a]=i:delete e[a]),s}}(),n=function(){if(D)return B;D=1;var e=Object.prototype.toString;return B=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return _=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Be(){if(N)return I;N=1;var e=Se(),t=R?M:(R=1,M=function(e){return null!=e&&"object"==typeof e});return I=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var De=Ee(function(){if(V)return O;V=1;var e=ke(),t=function(){if(b)return m;b=1;var e=Te();return m=function(){return e.Date.now()}}(),n=function(){if(z)return L;z=1;var e=Ce(),t=ke(),n=Be(),r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt;return L=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var u=a.test(s);return u||i.test(s)?o(s.slice(2),u?2:8):r.test(s)?NaN:+s}}(),r=Math.max,a=Math.min;return O=function(i,o,s){var l,u,c,d,h,f,p=0,v=!1,g=!1,y=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function m(e){var t=l,n=u;return l=u=void 0,p=e,d=i.apply(n,t)}function b(e){var t=e-f;return void 0===f||t>=o||t<0||g&&e-p>=c}function x(){var e=t();if(b(e))return w(e);h=setTimeout(x,function(e){var t=o-(e-f);return g?a(t,c-(e-p)):t}(e))}function w(e){return h=void 0,y&&l?m(e):(l=u=void 0,d)}function E(){var e=t(),n=b(e);if(l=arguments,u=this,f=e,n){if(void 0===h)return function(e){return p=e,h=setTimeout(x,o),v?m(e):d}(f);if(g)return clearTimeout(h),h=setTimeout(x,o),m(f)}return void 0===h&&(h=setTimeout(x,o)),d}return o=n(o)||0,e(s)&&(v=!!s.leading,c=(g="maxWait"in s)?r(n(s.maxWait)||0,o):c,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},E.flush=function(){return void 0===h?d:w(t())},E}}()),_e=c?c.performance:null,Ae=_e&&_e.now?function(){return _e.now()}:function(){return Date.now()},Me=function(){if(c){if(c.requestAnimationFrame)return function(e){c.requestAnimationFrame(e)};if(c.mozRequestAnimationFrame)return function(e){c.mozRequestAnimationFrame(e)};if(c.webkitRequestAnimationFrame)return function(e){c.webkitRequestAnimationFrame(e)};if(c.msRequestAnimationFrame)return function(e){c.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(Ae())},1e3/60)}}(),Re=function(e){return Me(e)},Ie=Ae,Ne=9261,Le=5381,ze=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Oe=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne)+e|0},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Le;return(t<<5)+t+e|0},Fe=function(e){return 2097152*e[0]+e[1]},Xe=function(e,t){return[Oe(e[0],t[0]),Ve(e[1],t[1])]},je=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return ze({next:function(){return r<a?n.value=e[r++]:n.done=!0,n}},t)},Ye=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return ze({next:function(){return r<a?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},qe=function(){return We(arguments)},We=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?Ye(r):Ye(r,t)}return t};function Ue(e,t,n){if(0===n)return e;var r=(t.x1+t.x2)/2,a=(t.y1+t.y2)/2,i=t.w/t.h,o=1/i,s=function(e,t,n,r,a){var i=a*Math.PI/180;return{x:Math.cos(i)*(e-n)-Math.sin(i)*(t-r)+n,y:Math.sin(i)*(e-n)+Math.cos(i)*(t-r)+r}}(e.x,e.y,r,a,n),l=function(e,t,n,r,a,i){return{x:(e-n)*a+n,y:(t-r)*i+r}}(s.x,s.y,r,a,i,o);return{x:l.x,y:l.y}}var He=!0,Ke=null!=console.warn,Ge=null!=console.trace,Ze=Number.MAX_SAFE_INTEGER||9007199254740991,$e=function(){return!0},Qe=function(){return!1},Je=function(){return 0},et=function(){},tt=function(e){throw new Error(e)},nt=function(e){if(void 0===e)return He;He=!!e},rt=function(e){nt()&&(Ke?console.warn(e):(console.log(e),Ge&&console.trace()))},at=function(e){return null==e?e:H(e)?e.slice():K(e)?function(e){return ge({},e)}(e):e},it=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},ot={},st=function(){return ot},lt=function(e){var t=Object.keys(e);return function(n){for(var r={},a=0;a<t.length;a++){var i=t[a],o=null==n?void 0:n[i];r[i]=void 0===o?e[i]:o}return r}},ut=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},ct=function(e){e.splice(0,e.length)},dt=function(e,t,n){return n&&(t=se(n,t)),e[t]},ht=function(e,t,n,r){n&&(t=se(n,t)),e[t]=r},ft="undefined"!=typeof Map?Map:function(){return n(function e(){t(this,e),this._obj={}},[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}])}(),pt=function(){return n(function e(n){if(t(this,e),this._obj=Object.create(null),this.size=0,null!=n){var r;r=null!=n.instanceString&&n.instanceString()===this.instanceString()?n.toArray():n;for(var a=0;a<r.length;a++)this.add(r[a])}},[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter(function(t){return e.has(t)})}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}])}(),vt="undefined"!==("undefined"==typeof Set?"undefined":l(Set))?Set:pt,gt=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&ee(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new vt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==a.position.x&&(a.position.x=0),null==a.position.y&&(a.position.y=0),t.renderedPosition){var i=t.renderedPosition,o=e.pan(),s=e.zoom();a.position={x:(i.x-o.x)/s,y:(i.y-o.y)/s}}var l=[];H(t.classes)?l=t.classes:W(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var d=l[u];d&&""!==d&&a.classes.add(d)}this.createEmitter(),(void 0===n||n)&&this.restore();var h=t.style||t.css;h&&(rt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))}else tt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else tt("An element must have a core reference and parameters set")},yt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var a;K(t)&&!$(t)&&(t=(a=t).roots||a.root,n=a.visit,r=a.directed),r=2!==arguments.length||U(n)?r:n,n=U(n)?n:function(){};for(var i,o=this._private.cy,s=t=W(t)?this.filter(t):t,l=[],u=[],c={},d={},h={},f=0,p=this.byGroup(),v=p.nodes,g=p.edges,y=0;y<s.length;y++){var m=s[y],b=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(h[b]=!0,u.push(m)),d[b]=0)}for(var x,w=function(){var t=e.bfs?l.shift():l.pop(),a=t.id();if(e.dfs){if(h[a])return 0;h[a]=!0,u.push(t)}var o,s=d[a],p=c[a],y=null!=p?p.source():null,m=null!=p?p.target():null,b=null==p?void 0:t.same(y)?m[0]:y[0];if(!0===(o=n(t,p,b,f++,s)))return i=t,1;if(!1===o)return 1;for(var x=t.connectedEdges().filter(function(e){return(!r||e.source().same(t))&&g.has(e)}),w=0;w<x.length;w++){var E=x[w],k=E.connectedNodes().filter(function(e){return!e.same(t)&&v.has(e)}),T=k.id();0===k.length||h[T]||(k=k[0],l.push(k),e.bfs&&(h[T]=!0,u.push(k)),c[T]=E,d[T]=d[a]+1)}};0!==l.length&&(0===(x=w())||1!==x););for(var E=o.collection(),k=0;k<u.length;k++){var T=u[k],C=c[T.id()];null!=C&&E.push(C),E.push(T)}return{path:o.collection(E),found:o.collection(i)}}},mt={breadthFirstSearch:yt({bfs:!0}),depthFirstSearch:yt({dfs:!0})};mt.bfs=mt.breadthFirstSearch,mt.dfs=mt.depthFirstSearch;var bt,xt,wt,Et={exports:{}},kt=Et.exports;function Tt(){return bt||(bt=1,e=Et,function(){var t,n,r,a,i,o,s,l,u,c,d,h,f,p,v;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,a,i,o){var s;if(null==a&&(a=0),null==o&&(o=n),a<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);a<i;)o(t,e[s=r((a+i)/2)])<0?i=s:a=s+1;return[].splice.apply(e,[a,a-a].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),p(e,0,e.length-1,r)},i=function(e,t){var r,a;return null==t&&(t=n),r=e.pop(),e.length?(a=e[0],e[0]=r,v(e,0,t)):a=r,a},l=function(e,t,r){var a;return null==r&&(r=n),a=e[0],e[0]=t,v(e,0,r),a},s=function(e,t,r){var a;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(t=(a=[e[0],t])[0],e[0]=a[1],v(e,0,r)),t},a=function(e,t){var a,i,o,s,l,u;for(null==t&&(t=n),l=[],i=0,o=(s=function(){u=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;i<o;i++)a=s[i],l.push(v(e,a,t));return l},f=function(e,t,r){var a;if(null==r&&(r=n),-1!==(a=e.indexOf(t)))return p(e,0,a,r),v(e,a,r)},d=function(e,t,r){var i,o,l,u,c;if(null==r&&(r=n),!(o=e.slice(0,t)).length)return o;for(a(o,r),l=0,u=(c=e.slice(t)).length;l<u;l++)i=c[l],s(o,i,r);return o.sort(r).reverse()},h=function(e,t,r){var o,s,l,d,h,f,p,v,g;if(null==r&&(r=n),10*t<=e.length){if(!(l=e.slice(0,t).sort(r)).length)return l;for(s=l[l.length-1],d=0,f=(p=e.slice(t)).length;d<f;d++)r(o=p[d],s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(a(e,r),g=[],h=0,v=c(t,e.length);0<=v?h<v:h>v;0<=v?++h:--h)g.push(i(e,r));return g},p=function(e,t,r,a){var i,o,s;for(null==a&&(a=n),i=e[r];r>t&&a(i,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=i},v=function(e,t,r){var a,i,o,s,l;for(null==r&&(r=n),i=e.length,l=t,o=e[t],a=2*t+1;a<i;)(s=a+1)<i&&!(r(e[a],e[s])<0)&&(a=s),e[t]=e[a],a=2*(t=a)+1;return e[t]=o,p(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=i,e.replace=l,e.pushpop=s,e.heapify=a,e.updateItem=f,e.nlargest=d,e.nsmallest=h,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return i(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return a(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return f(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),e.exports=t}.call(kt)),Et.exports;var e}var Ct,Pt=Ee(wt?xt:(wt=1,xt=Tt())),St=lt({root:null,weight:function(e){return 1},directed:!1}),Bt={dijkstra:function(e){if(!K(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=St(e),r=n.root,a=n.weight,i=n.directed,o=this,s=a,l=W(r)?this.filter(r)[0]:r[0],u={},c={},d={},h=this.byGroup(),f=h.nodes,p=h.edges;p.unmergeBy(function(e){return e.isLoop()});for(var v=function(e){return u[e.id()]},g=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new Pt(function(e,t){return v(e)-v(t)}),m=0;m<f.length;m++){var b=f[m];u[b.id()]=b.same(l)?0:1/0,y.push(b)}for(var x=function(e,t){for(var n,r=(i?e.edgesTo(t):e.edgesWith(t)).intersect(p),a=1/0,o=0;o<r.length;o++){var l=r[o],u=s(l);(u<a||!n)&&(a=u,n=l)}return{edge:n,dist:a}};y.size()>0;){var w=y.pop(),E=v(w),k=w.id();if(d[k]=E,E!==1/0)for(var T=w.neighborhood().intersect(f),C=0;C<T.length;C++){var P=T[C],S=P.id(),B=x(w,P),D=E+B.dist;D<v(P)&&(g(P,D),c[S]={node:w,edge:B.edge})}}return{distanceTo:function(e){var t=W(e)?f.filter(e)[0]:e[0];return d[t.id()]},pathTo:function(e){var t=W(e)?f.filter(e)[0]:e[0],n=[],r=t,a=r.id();if(t.length>0)for(n.unshift(t);c[a];){var i=c[a];n.unshift(i.edge),n.unshift(i.node),a=(r=i.node).id()}return o.spawn(n)}}}},Dt={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,a=n.length,i=new Array(a),o=n,s=function(e){for(var t=0;t<i.length;t++){if(i[t].has(e))return t}},l=0;l<a;l++)i[l]=this.spawn(n[l]);for(var u=r.sort(function(t,n){return e(t)-e(n)}),c=0;c<u.length;c++){var d=u[c],h=d.source()[0],f=d.target()[0],p=s(h),v=s(f),g=i[p],y=i[v];p!==v&&(o.merge(d),g.merge(y),i.splice(v,1))}return o}},_t=lt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),At={aStar:function(e){var t=this.cy(),n=_t(e),r=n.root,a=n.goal,i=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],a=t.collection(a)[0];var l,u,c=r.id(),d=a.id(),h={},f={},p={},v=new Pt(function(e,t){return f[e.id()]-f[t.id()]}),g=new vt,y={},m={},b=function(e,t){v.push(e),g.add(t)},x=function(){l=v.pop(),u=l.id(),g.delete(u)},w=function(e){return g.has(e)};b(r,c),h[c]=0,f[c]=i(r);for(var E=0;v.size()>0;){if(x(),E++,u===d){for(var k=[],T=a,C=d,P=m[C];k.unshift(T),null!=P&&k.unshift(P),null!=(T=y[C]);)P=m[C=T.id()];return{found:!0,distance:h[u],path:this.spawn(k),steps:E}}p[u]=!0;for(var S=l._private.edges,B=0;B<S.length;B++){var D=S[B];if(this.hasElementWithId(D.id())&&(!o||D.data("source")===u)){var _=D.source(),A=D.target(),M=_.id()!==u?_:A,R=M.id();if(this.hasElementWithId(R)&&!p[R]){var I=h[u]+s(D);w(R)?I<h[R]&&(h[R]=I,f[R]=I+i(M),y[R]=l,m[R]=D):(h[R]=I,f[R]=I+i(M),b(M,R),y[R]=l,m[R]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Mt=lt({weight:function(e){return 1},directed:!1}),Rt={floydWarshall:function(e){for(var t=this.cy(),n=Mt(e),r=n.weight,a=n.directed,i=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,c=u*u,d=function(e){return s.indexOf(e)},h=function(e){return s[e]},f=new Array(c),p=0;p<c;p++){var v=p%u,g=(p-v)/u;f[p]=g===v?0:1/0}for(var y=new Array(c),m=new Array(c),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],E=x.target()[0];if(w!==E){var k=d(w),T=d(E),C=k*u+T,P=i(x);if(f[C]>P&&(f[C]=P,y[C]=T,m[C]=x),!a){var S=T*u+k;!a&&f[S]>P&&(f[S]=P,y[S]=k,m[S]=x)}}}for(var B=0;B<u;B++)for(var D=0;D<u;D++)for(var _=D*u+B,A=0;A<u;A++){var M=D*u+A,R=B*u+A;f[_]+f[R]<f[M]&&(f[M]=f[_]+f[R],y[M]=y[_])}var I=function(e){return d(function(e){return(W(e)?t.filter(e):e)[0]}(e))},N={distance:function(e,t){var n=I(e),r=I(t);return f[n*u+r]},path:function(e,n){var r=I(e),a=I(n),i=h(r);if(r===a)return i.collection();if(null==y[r*u+a])return t.collection();var o,s=t.collection(),l=r;for(s.merge(i);r!==a;)l=r,r=y[r*u+a],o=m[l*u+r],s.merge(o),s.merge(h(r));return s}};return N}},It=lt({weight:function(e){return 1},directed:!1,root:null}),Nt={bellmanFord:function(e){var t=this,n=It(e),r=n.weight,a=n.directed,i=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,d=u.nodes,h=d.length,f=new ft,p=!1,v=[];i=l.collection(i)[0],c.unmergeBy(function(e){return e.isLoop()});for(var g=c.length,y=function(e){var t=f.get(e.id());return t||(t={},f.set(e.id(),t)),t},m=function(e){return(W(e)?l.$(e):e)[0]},b=0;b<h;b++){var x=d[b],w=y(x);x.same(i)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,k=function(e,t,n,r,a,i){var o=r.dist+i;o<a.dist&&!n.same(r.edge)&&(a.dist=o,a.pred=e,a.edge=n,E=!0)},T=1;T<h;T++){E=!1;for(var C=0;C<g;C++){var P=c[C],S=P.source(),B=P.target(),D=o(P),_=y(S),A=y(B);k(S,0,P,_,A,D),a||k(B,0,P,A,_,D)}if(!E)break}if(E)for(var M=[],R=0;R<g;R++){var I=c[R],N=I.source(),L=I.target(),z=o(I),O=y(N).dist,V=y(L).dist;if(O+z<V||!a&&V+z<O){if(p||(rt("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var F=[];O+z<V&&F.push(N),!a&&V+z<O&&F.push(L);for(var X=F.length,j=0;j<X;j++){var Y=F[j],q=[Y];q.push(y(Y).edge);for(var U=y(Y).pred;-1===q.indexOf(U);)q.push(U),q.push(y(U).edge),U=y(U).pred;for(var H=(q=q.slice(q.indexOf(U)))[0].id(),K=0,G=2;G<q.length;G+=2)q[G].id()<H&&(H=q[G].id(),K=G);(q=q.slice(K).concat(q.slice(0,K))).push(q[0]);var Z=q.map(function(e){return e.id()}).join(",");-1===M.indexOf(Z)&&(v.push(s.spawn(q)),M.push(Z))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=[],a=m(e);;){if(null==a)return t.spawn();var o=y(a),l=o.edge,u=o.pred;if(r.unshift(a[0]),a.same(n)&&r.length>0)break;null!=l&&r.unshift(l),a=u}return s.spawn(r)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},Lt=Math.sqrt(2),zt=function(e,t,n){0===n.length&&tt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],a=r[1],i=r[2],o=t[a],s=t[i],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===o&&t[h]===s||t[d]===s&&t[h]===o)&&l.splice(u,1)}for(var f=0;f<l.length;f++){var p=l[f];p[1]===s?(l[f]=p.slice(),l[f][1]=o):p[2]===s&&(l[f]=p.slice(),l[f][2]=o)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=o);return l},Ot=function(e,t,n,r){for(;n>r;){var a=Math.floor(Math.random()*t.length);t=zt(a,e,t),n--}return t},Vt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var a=n.length,i=r.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),s=Math.floor(a/Lt);if(!(a<2)){for(var l=[],u=0;u<i;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,h=[],f=new Array(a),p=new Array(a),v=new Array(a),g=function(e,t){for(var n=0;n<a;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<a;m++)p[m]=m;var b=Ot(p,l.slice(),a,s),x=b.slice();g(p,v);var w=Ot(p,b,s,2),E=Ot(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,g(p,f)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,g(v,f))}for(var k=this.spawn(h.map(function(e){return r[e[0]]})),T=this.spawn(),C=this.spawn(),P=f[0],S=0;S<f.length;S++){var B=f[S],D=n[S];B===P?T.merge(D):C.merge(D)}var _=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!k.contains(t)&&n.merge(t)})}),n},A=[_(T),_(C)];return{cut:k,components:A,partition1:T,partition2:C}}tt("At least 2 nodes are required for Karger-Stein algorithm")}},Ft=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Xt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},jt=function(e){return{x:e[0],y:e[1]}},Yt=function(e,t){return Math.atan2(t,e)-Math.PI/2},qt=Math.log2||function(e){return Math.log(e)/Math.log(2)},Wt=function(e){return e>0?1:e<0?-1:0},Ut=function(e,t){return Math.sqrt(Ht(e,t))},Ht=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Kt=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var a=0;a<t;a++)e[a]=e[a]/n;return e},Gt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Zt=function(e,t,n,r){return{x:Gt(e.x,t.x,n.x,r),y:Gt(e.y,t.y,n.y,r)}},$t=function(e,t,n){return Math.max(e,Math.min(n,t))},Qt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Jt=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},en=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},nn=function(e){var t,n,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=a=o[0];else if(2===o.length)t=r=o[0],a=n=o[1];else if(4===o.length){var s=i(o,4);t=s[0],n=s[1],r=s[2],a=s[3]}return e.x1-=a,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rn=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},an=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},on=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},sn=function(e,t){return on(e,t.x,t.y)},ln=function(e,t){return on(e,t.x1,t.y1)&&on(e,t.x2,t.y2)},un=null!==(Ct=Math.hypot)&&void 0!==Ct?Ct:function(e,t){return Math.sqrt(e*e+t*t)};function cn(e,t,n,r,a,i){var o=function(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},a=function(e,t){return{x:e.x*t,y:e.y*t}},i=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=un(e.x,e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e,t,o,s){var l=r(t,e),u=r(s,o),c=i(l,u);if(Math.abs(c)<1e-9)return n(e,a(l,.5));var d=i(r(o,e),u)/c;return n(e,a(l,d))},l=e.map(function(e){return{x:e.x,y:e.y}});(function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],a=e[(n+1)%e.length];t+=r.x*a.y-a.x*r.y}return t/2})(l)<0&&l.reverse();for(var u=l.length,c=[],d=0;d<u;d++){var h=l[d],f=l[(d+1)%u],p=r(f,h),v=o({x:p.y,y:-p.x});c.push(v)}for(var g=c.map(function(e,r){return{p1:n(l[r],a(e,t)),p2:n(l[(r+1)%u],a(e,t))}}),y=[],m=0;m<u;m++){var b=g[(m-1+u)%u],x=g[m],w=s(b.p1,b.p2,x.p1,x.p2);y.push(w)}return y}(Tn(e,t,n,r,a),i),s=Qt();return o.forEach(function(e){return en(s,e.x,e.y)}),s}var dn=function(e,t,n,r,a,i,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?_n(a,i):u,d=a/2,h=i/2,f=(c=Math.min(c,d,h))!==d,p=c!==h;if(f){var v=r-h-o;if((s=kn(e,t,n,r,n-d+c-o,v,n+d-c+o,v,!1)).length>0)return s}if(p){var g=n+d+o;if((s=kn(e,t,n,r,g,r-h+c-o,g,r+h-c+o,!1)).length>0)return s}if(f){var y=r+h+o;if((s=kn(e,t,n,r,n-d+c-o,y,n+d-c+o,y,!1)).length>0)return s}if(p){var m=n-d-o;if((s=kn(e,t,n,r,m,r-h+c-o,m,r+h-c+o,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=wn(e,t,n,r,b,x,c+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=wn(e,t,n,r,w,E,c+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var k=n+d-c,T=r+h-c;if((l=wn(e,t,n,r,k,T,c+o)).length>0&&l[0]>=k&&l[1]>=T)return[l[0],l[1]];var C=n-d+c,P=r+h-c;return(l=wn(e,t,n,r,C,P,c+o)).length>0&&l[0]<=C&&l[1]>=P?[l[0],l[1]]:[]},hn=function(e,t,n,r,a,i,o){var s=o,l=Math.min(n,a),u=Math.max(n,a),c=Math.min(r,i),d=Math.max(r,i);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},fn=function(e,t,n,r,a,i,o,s,l){var u=Math.min(n,o,a)-l,c=Math.max(n,o,a)+l,d=Math.min(r,s,i)-l,h=Math.max(r,s,i)+l;return!(e<u||e>c||t<d||t>h)},pn=function(e,t,n,r,a,i,o,s){var l=[];!function(e,t,n,r,a){var i,o,s,l,u,c,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),i=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,a[1]=0,d=t/3,i>0?(u=(u=s+Math.sqrt(i))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(i))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),a[0]=-d+u+c,d+=(u+c)/2,a[4]=a[2]=-d,d=Math.sqrt(3)*(-c+u)/2,a[3]=d,a[5]=-d):(a[5]=a[3]=0,0===i?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),a[0]=2*h-d,a[4]=a[2]=-(h+d)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),a[0]=-d+h*Math.cos(l/3),a[2]=-d+h*Math.cos((l+2*Math.PI)/3),a[4]=-d+h*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+r*r-4*r*i+2*r*s+4*i*i-4*i*s+s*s,9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*r*i-3*r*r-3*r*s-6*i*i+3*i*s,3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*r*r-6*r*i+r*s-r*t+2*i*i+2*i*t-s*t,1*n*a-n*n+n*e-a*e+r*i-r*r+r*t-i*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var d,h,f,p=-1,v=0;v<u.length;v++)d=Math.pow(1-u[v],2)*n+2*(1-u[v])*u[v]*a+u[v]*u[v]*o,h=Math.pow(1-u[v],2)*r+2*(1-u[v])*u[v]*i+u[v]*u[v]*s,f=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?f<p&&(p=f):p=f;return p},vn=function(e,t,n,r,a,i){var o=[e-n,t-r],s=[a-n,i-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-a)*(e-a)+(t-i)*(t-i):u-d},gn=function(e,t,n){for(var r,a,i,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],a=n[2*l+1],l+1<n.length/2?(i=n[2*(l+1)],o=n[2*(l+1)+1]):(i=n[2*(l+1-n.length/2)],o=n[2*(l+1-n.length/2)+1]),r==e&&i==e);else{if(!(r>=e&&e>=i||r<=e&&e<=i))continue;(e-r)/(i-r)*(o-a)+a>t&&s++}return s%2!=0},yn=function(e,t,n,r,a,i,o,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),f=Math.sin(-u),p=0;p<c.length/2;p++)c[2*p]=i/2*(n[2*p]*h-n[2*p+1]*f),c[2*p+1]=o/2*(n[2*p+1]*h+n[2*p]*f),c[2*p]+=r,c[2*p+1]+=a;if(l>0){var v=bn(c,-l);d=mn(v)}else d=c;return gn(e,t,d)},mn=function(e){for(var t,n,r,a,i,o,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],a=e[4*c+3],c<e.length/4-1?(i=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(i=e[0],o=e[1],s=e[2],l=e[3]);var d=kn(t,n,r,a,i,o,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},bn=function(e,t){for(var n,r,a,i,o=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(a=e[2*(s+1)],i=e[2*(s+1)+1]):(a=e[0],i=e[1]);var l=i-r,u=-(a-n),c=Math.sqrt(l*l+u*u),d=l/c,h=u/c;o[4*s]=n+d*t,o[4*s+1]=r+h*t,o[4*s+2]=a+d*t,o[4*s+3]=i+h*t}return o},xn=function(e,t,n,r,a,i,o){return e-=a,t-=i,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},wn=function(e,t,n,r,a,i,o){var s=[n-e,r-t],l=[e-a,t-i],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(d<0)return[];var h=(-c+Math.sqrt(d))/(2*u),f=(-c-Math.sqrt(d))/(2*u),p=Math.min(h,f),v=Math.max(h,f),g=[];if(p>=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var y=g[0]*s[0]+e,m=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[y,m]:[y,m,g[1]*s[0]+e,g[1]*s[1]+t]:[y,m]},En=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},kn=function(e,t,n,r,a,i,o,s,l){var u=e-a,c=n-e,d=o-a,h=t-i,f=r-t,p=s-i,v=d*h-p*u,g=c*h-f*u,y=p*c-d*f;if(0!==y){var m=v/y,b=g/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*f]:[]}return 0===v||0===g?En(e,n,o)===o?[o,s]:En(e,n,a)===a?[a,i]:En(a,o,n)===n?[n,r]:[]:[]},Tn=function(e,t,n,r,a){var i=[],o=r/2,s=a/2,l=t,u=n;i.push({x:l+o*e[0],y:u+s*e[1]});for(var c=1;c<e.length/2;c++)i.push({x:l+o*e[2*c],y:u+s*e[2*c+1]});return i},Cn=function(e,t,n,r,a,i,o,s){var l,u,c,d,h,f,p=[],v=new Array(n.length),g=!0;if(null==i&&(g=!1),g){for(var y=0;y<v.length/2;y++)v[2*y]=n[2*y]*i+r,v[2*y+1]=n[2*y+1]*o+a;if(s>0){var m=bn(v,-s);u=mn(m)}else u=v}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],d=u[2*b+1],b<u.length/2-1?(h=u[2*(b+1)],f=u[2*(b+1)+1]):(h=u[0],f=u[1]),0!==(l=kn(e,t,r,a,c,d,h,f)).length&&p.push(l[0],l[1]);return p},Pn=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),i=(a-n)/a;return i<0&&(i=1e-5),[t[0]+i*r[0],t[1]+i*r[1]]},Sn=function(e,t){var n=Dn(e,t);return n=Bn(n)},Bn=function(e){for(var t,n,r=e.length/2,a=1/0,i=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],a=Math.min(a,t),o=Math.max(o,t),i=Math.min(i,n),s=Math.max(s,n);for(var u=2/(o-a),c=2/(s-i),d=0;d<r;d++)t=e[2*d]=e[2*d]*u,n=e[2*d+1]=e[2*d+1]*c,a=Math.min(a,t),o=Math.max(o,t),i=Math.min(i,n),s=Math.max(s,n);if(i<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-i);return e},Dn=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var a,i=new Array(2*e),o=0;o<e;o++)a=o*n+r,i[2*o]=Math.cos(a),i[2*o+1]=Math.sin(-a);return i},_n=function(e,t){return Math.min(e/4,t/4,8)},An=function(e,t){return Math.min(e/10,t/10,8)},Mn=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Rn(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],a=e[(n+1)%e.length],i={x:a.x-r.x,y:a.y-r.y},o={x:-i.y,y:i.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function a(e,t){var n,a=1/0,i=-1/0,o=r(e);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=s.x*t.x+s.y*t.y;a=Math.min(a,l),i=Math.max(i,l)}}catch(e){o.e(e)}finally{o.f()}return{min:a,max:i}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var s,l=r([].concat(o(n(e)),o(n(t))));try{for(l.s();!(s=l.n()).done;){var u=s.value;if(!i(a(e,u),a(t,u)))return!1}}catch(e){l.e(e)}finally{l.f()}return!0}var In=lt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Nn={pageRank:function(e){for(var t=In(e),n=t.dampingFactor,r=t.precision,a=t.iterations,i=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=u.length,f=new Array(d),p=new Array(c),v=(1-n)/c,g=0;g<c;g++){for(var y=0;y<c;y++){f[g*c+y]=0}p[g]=0}for(var m=0;m<h;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),k=l.indexOfId(w),T=i(b);f[k*c+E]+=T,p[E]+=T}}for(var C=1/c+v,P=0;P<c;P++)if(0===p[P])for(var S=0;S<c;S++){f[S*c+P]=C}else for(var B=0;B<c;B++){var D=B*c+P;f[D]=f[D]/p[P]+v}for(var _,A=new Array(c),M=new Array(c),R=0;R<c;R++)A[R]=1;for(var I=0;I<a;I++){for(var N=0;N<c;N++)M[N]=0;for(var L=0;L<c;L++)for(var z=0;z<c;z++){var O=L*c+z;M[L]+=f[O]*A[z]}Kt(M),_=A,A=M,M=_;for(var V=0,F=0;F<c;F++){var X=_[F]-A[F];V+=X*X}if(V<r)break}return{rank:function(e){return e=o.collection(e)[0],A[l.indexOf(e)]}}}},Ln=lt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),zn={degreeCentralityNormalized:function(e){e=Ln(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var a={},i={},o=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var d=this.degreeCentrality(e);o<d.indegree&&(o=d.indegree),s<d.outdegree&&(s=d.outdegree),a[c]=d.indegree,i[c]=d.outdegree}return{indegree:function(e){return 0==o?0:(W(e)&&(e=t.filter(e)),a[e.id()]/o)},outdegree:function(e){return 0===s?0:(W(e)&&(e=t.filter(e)),i[e.id()]/s)}}}for(var h={},f=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);f<g.degree&&(f=g.degree),h[v.id()]=g.degree}return{degree:function(e){return 0===f?0:(W(e)&&(e=t.filter(e)),h[e.id()]/f)}}},degreeCentrality:function(e){e=Ln(e);var t=this.cy(),n=this,r=e,a=r.root,i=r.weight,o=r.directed,s=r.alpha;if(a=t.collection(a)[0],o){for(var l=a.connectedEdges(),u=l.filter(function(e){return e.target().same(a)&&n.has(e)}),c=l.filter(function(e){return e.source().same(a)&&n.has(e)}),d=u.length,h=c.length,f=0,p=0,v=0;v<u.length;v++)f+=i(u[v]);for(var g=0;g<c.length;g++)p+=i(c[g]);return{indegree:Math.pow(d,1-s)*Math.pow(f,s),outdegree:Math.pow(h,1-s)*Math.pow(p,s)}}for(var y=a.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=i(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};zn.dc=zn.degreeCentrality,zn.dcn=zn.degreeCentralityNormalised=zn.degreeCentralityNormalized;var On=lt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Vn={closenessCentralityNormalized:function(e){for(var t=On(e),n=t.harmonic,r=t.weight,a=t.directed,i=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:a}),c=0;c<l.length;c++){for(var d=0,h=l[c],f=0;f<l.length;f++)if(c!==f){var p=u.distance(h,l[f]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),o[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=W(e)?i.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=On(e),n=t.root,r=t.weight,a=t.directed,i=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:a}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var d=o.distanceTo(c);s+=i?1/d:d}}return i?s:1/s}};Vn.cc=Vn.closenessCentrality,Vn.ccn=Vn.closenessCentralityNormalised=Vn.closenessCentralityNormalized;var Fn=lt({weight:null,directed:!1}),Xn={betweennessCentrality:function(e){for(var t=Fn(e),n=t.directed,r=t.weight,a=null!=r,i=this.cy(),o=this.nodes(),s={},l={},u=0,c=function(e,t){l[e]=t,t>u&&(u=t)},d=function(e){return l[e]},h=0;h<o.length;h++){var f=o[h],p=f.id();s[p]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),c(p,0)}for(var v=function(){for(var e=o[g].id(),t=[],n={},l={},u={},h=new Pt(function(e,t){return u[e]-u[t]}),f=0;f<o.length;f++){var p=o[f].id();n[p]=[],l[p]=0,u[p]=1/0}for(l[e]=1,u[e]=0,h.push(e);!h.empty();){var v=h.pop();if(t.push(v),a)for(var y=0;y<s[v].length;y++){var m=s[v][y],b=i.getElementById(v),x=void 0;x=b.edgesTo(m).length>0?b.edgesTo(m)[0]:m.edgesTo(b)[0];var w=r(x);m=m.id(),u[m]>u[v]+w&&(u[m]=u[v]+w,h.nodes.indexOf(m)<0?h.push(m):h.updateItem(m),l[m]=0,n[m]=[]),u[m]==u[v]+w&&(l[m]=l[m]+l[v],n[m].push(v))}else for(var E=0;E<s[v].length;E++){var k=s[v][E].id();u[k]==1/0&&(h.push(k),u[k]=u[v]+1),u[k]==u[v]+1&&(l[k]=l[k]+l[v],n[k].push(v))}}for(var T={},C=0;C<o.length;C++)T[o[C].id()]=0;for(;t.length>0;){for(var P=t.pop(),S=0;S<n[P].length;S++){var B=n[P][S];T[B]=T[B]+l[B]/l[P]*(1+T[P])}P!=o[g].id()&&c(P,d(P)+T[P])}},g=0;g<o.length;g++)v();var y={betweenness:function(e){var t=i.collection(e).id();return d(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=i.collection(e).id();return d(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};Xn.bc=Xn.betweennessCentrality;var jn=lt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Yn=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},qn=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var a=0;a<t;a++)n+=e[a*t+r];for(var i=0;i<t;i++)e[i*t+r]=e[i*t+r]/n}},Wn=function(e,t,n){for(var r=new Array(n*n),a=0;a<n;a++){for(var i=0;i<n;i++)r[a*n+i]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[a*n+s]+=e[a*n+o]*t[o*n+s]}return r},Un=function(e,t,n){for(var r=e.slice(0),a=1;a<n;a++)e=Wn(e,r,t);return e},Hn=function(e,t,n){for(var r=new Array(t*t),a=0;a<t*t;a++)r[a]=Math.pow(e[a],n);return qn(r,t),r},Kn=function(e,t,n,r){for(var a=0;a<n;a++){if(Math.round(e[a]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[a]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},Gn=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Zn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),a=function(e){return jn(e)}(e),i={},o=0;o<t.length;o++)i[t[o].id()]=o;for(var s,l=t.length,u=l*l,c=new Array(u),d=0;d<u;d++)c[d]=0;for(var h=0;h<n.length;h++){var f=n[h],p=i[f.source().id()],v=i[f.target().id()],g=Yn(f,a.attributes);c[p*l+v]+=g,c[v*l+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,a.multFactor),qn(c,l);for(var y=!0,m=0;y&&m<a.maxIterations;)y=!1,s=Un(c,l,a.expandFactor),c=Hn(s,l,a.inflateFactor),Kn(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var a=[],i=0;i<t;i++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[i*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&a.push(r.collection(o))}return a}(c,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Gn(e[t],e[n])&&e.splice(n,1);return e}(b),b},$n={markovClustering:Zn,mcl:Zn},Qn=function(e){return e},Jn=function(e,t){return Math.abs(t-e)},er=function(e,t,n){return e+Jn(t,n)},tr=function(e,t,n){return e+Math.pow(n-t,2)},nr=function(e){return Math.sqrt(e)},rr=function(e,t,n){return Math.max(e,Jn(t,n))},ar=function(e,t,n,r,a){for(var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Qn,o=r,s=0;s<e;s++)o=a(o,t(s),n(s));return i(o)},ir={euclidean:function(e,t,n){return e>=2?ar(e,t,n,0,tr,nr):ar(e,t,n,0,er)},squaredEuclidean:function(e,t,n){return ar(e,t,n,0,tr)},manhattan:function(e,t,n){return ar(e,t,n,0,er)},max:function(e,t,n){return ar(e,t,n,-1/0,rr)}};function or(e,t,n,r,a,i){var o;return o=U(e)?e:ir[e]||ir.euclidean,0===t&&U(e)?o(a,i):o(t,n,r,a,i)}ir["squared-euclidean"]=ir.squaredEuclidean,ir.squaredeuclidean=ir.squaredEuclidean;var sr=lt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),lr=function(e){return sr(e)},ur=function(e,t,n,r,a){var i="kMedoids"!==a?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return or(e,r.length,i,function(e){return r[e](t)},o,s)},cr=function(e,t,n){for(var r=n.length,a=new Array(r),i=new Array(r),o=new Array(t),s=null,l=0;l<r;l++)a[l]=e.min(n[l]).value,i[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(i[c]-a[c])+a[c];o[u]=s}return o},dr=function(e,t,n,r,a){for(var i=1/0,o=0,s=0;s<t.length;s++){var l=ur(n,e,t[s],r,a);l<i&&(i=l,o=s)}return o},hr=function(e,t,n){for(var r=[],a=null,i=0;i<t.length;i++)n[(a=t[i]).id()]===e&&r.push(a);return r},fr=function(e,t,n){return Math.abs(t-e)<=n},pr=function(e,t,n){for(var r=0;r<e.length;r++)for(var a=0;a<e[r].length;a++){if(Math.abs(e[r][a]-t[r][a])>n)return!1}return!0},vr=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},gr=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var a=e[Math.floor(Math.random()*e.length)];vr(a,n,r);)a=e[Math.floor(Math.random()*e.length)];n[r]=a}else for(var i=0;i<t;i++)n[i]=e[Math.floor(Math.random()*e.length)];return n},yr=function(e,t,n){for(var r=0,a=0;a<t.length;a++)r+=ur("manhattan",t[a],e,n,"kMedoids");return r},mr=function(e,t,n,r,a){for(var i,o,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],a.m);for(var u=0;u<e.length;u++)for(var c=0;c<a.attributes.length;c++){i=0,o=0;for(var d=0;d<t.length;d++)i+=r[d][u]*a.attributes[c](t[d]),o+=r[d][u];e[u][c]=i/o}},br=function(e,t,n,r,a){for(var i=0;i<e.length;i++)t[i]=e[i].slice();for(var o,s,l,u=2/(a.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){o=0;for(var h=0;h<n.length;h++)s=ur(a.distance,r[d],n[c],a.attributes,"cmeans"),l=ur(a.distance,r[d],n[h],a.attributes,"cmeans"),o+=Math.pow(s/l,u);e[d][c]=1/o}},xr=function(e){var t,n,r,a,i,o=this.cy(),s=this.nodes(),l=lr(e);a=new Array(s.length);for(var u=0;u<s.length;u++)a[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var d=0;d<s.length;d++){for(var h=0,f=0;f<l.k;f++)r[d][f]=Math.random(),h+=r[d][f];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/h}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);i=new Array(s.length);for(var g=0;g<s.length;g++)i[g]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,mr(n,s,r,i,l),br(r,a,n,s,l),pr(r,a,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var a,i,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){a=-1/0,i=-1;for(var u=0;u<t[0].length;u++)t[l][u]>a&&(a=t[l][u],i=u);o[i].push(e[l])}for(var c=0;c<o.length;c++)o[c]=r.collection(o[c]);return o}(s,r,l,o),{clusters:t,degreeOfMembership:r}},wr={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),a=null,i=lr(e),o=new Array(i.k),s={};i.testMode?"number"==typeof i.testCentroids?(i.testCentroids,t=cr(r,i.k,i.attributes)):t="object"===l(i.testCentroids)?i.testCentroids:cr(r,i.k,i.attributes):t=cr(r,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<r.length;d++)s[(a=r[d]).id()]=dr(a,t,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var f=hr(h,r,s);if(0!==f.length){for(var p=i.attributes.length,v=t[h],g=new Array(p),y=new Array(p),m=0;m<p;m++){y[m]=0;for(var b=0;b<f.length;b++)a=f[b],y[m]+=i.attributes[m](a);g[m]=y[m]/f.length,fr(g[m],v[m],i.sensitivityThreshold)||(u=!0)}t[h]=g,o[h]=n.collection(f)}}c++}return o},kMedoids:function(e){var t,n,r=this.cy(),a=this.nodes(),i=null,o=lr(e),s=new Array(o.k),u={},c=new Array(o.k);o.testMode?"number"==typeof o.testCentroids||(t="object"===l(o.testCentroids)?o.testCentroids:gr(a,o.k)):t=gr(a,o.k);for(var d=!0,h=0;d&&h<o.maxIterations;){for(var f=0;f<a.length;f++)u[(i=a[f]).id()]=dr(i,t,o.distance,o.attributes,"kMedoids");d=!1;for(var p=0;p<t.length;p++){var v=hr(p,a,u);if(0!==v.length){c[p]=yr(t[p],v,o.attributes);for(var g=0;g<v.length;g++)(n=yr(v[g],v,o.attributes))<c[p]&&(c[p]=n,t[p]=v[g],d=!0);s[p]=r.collection(v)}}h++}return s},fuzzyCMeans:xr,fcm:xr},Er=lt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),kr={single:"min",complete:"max"},Tr=function(e,t,n,r,a){for(var i,o=0,s=1/0,l=a.attributes,u=function(e,t){return or(a.distance,l.length,function(t){return l[t](e)},function(e){return l[e](t)},e,t)},c=0;c<e.length;c++){var d=e[c].key,h=n[d][r[d]];h<s&&(o=d,s=h)}if("threshold"===a.mode&&s>=a.threshold||"dendrogram"===a.mode&&1===e.length)return!1;var f,p=t[o],v=t[r[o]];f="dendrogram"===a.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=f,e.splice(v.index,1),t[p.key]=f;for(var g=0;g<e.length;g++){var y=e[g];p.key===y.key?i=1/0:"min"===a.linkage?(i=n[p.key][y.key],n[p.key][y.key]>n[v.key][y.key]&&(i=n[v.key][y.key])):"max"===a.linkage?(i=n[p.key][y.key],n[p.key][y.key]<n[v.key][y.key]&&(i=n[v.key][y.key])):i="mean"===a.linkage?(n[p.key][y.key]*p.size+n[v.key][y.key]*v.size)/(p.size+v.size):"dendrogram"===a.mode?u(y.value,p.value):u(y.value[0],p.value[0]),n[p.key][y.key]=n[y.key][p.key]=i}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return p.key=v.key=p.index=v.index=null,!0},Cr=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Cr(e.left,t),e.right&&Cr(e.right,t)))},Pr=function(e,t){if(!e)return"";if(e.left&&e.right){var n=Pr(e.left,t),r=Pr(e.right,t),a=t.add({group:"nodes",data:{id:n+","+r}});return t.add({group:"edges",data:{source:n,target:a.id()}}),t.add({group:"edges",data:{source:r,target:a.id()}}),a.id()}return e.value?e.value.id():void 0},Sr=function(e,t,n){if(!e)return[];var r=[],a=[],i=[];return 0===t?(e.left&&Cr(e.left,r),e.right&&Cr(e.right,a),i=r.concat(a),[n.collection(i)]):1===t?e.value?[n.collection(e.value)]:(e.left&&Cr(e.left,r),e.right&&Cr(e.right,a),[n.collection(r),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(r=Sr(e.left,t-1,n)),e.right&&(a=Sr(e.right,t-1,n)),r.concat(a))},Br=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=Er(e),n=kr[t.linkage];return null!=n&&(t.linkage=n),t}(e),a=r.attributes,i=function(e,t){return or(r.distance,a.length,function(t){return a[t](e)},function(e){return a[e](t)},e,t)},o=[],s=[],l=[],u=[],c=0;c<n.length;c++){var d={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};o[c]=d,u[c]=d,s[c]=[],l[c]=0}for(var h=0;h<o.length;h++)for(var f=0;f<=h;f++){var p=void 0;p="dendrogram"===r.mode?h===f?1/0:i(o[h].value,o[f].value):h===f?1/0:i(o[h].value[0],o[f].value[0]),s[h][f]=p,s[f][h]=p,p<s[h][l[h]]&&(l[h]=f)}for(var v,g=Tr(o,u,s,l,r);g;)g=Tr(o,u,s,l,r);return"dendrogram"===r.mode?(v=Sr(o[0],r.dendrogramDepth,t),r.addDendrogram&&Pr(o[0],t)):(v=new Array(o.length),o.forEach(function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)})),v},Dr={hierarchicalClustering:Br,hca:Br},_r=lt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Ar=function(e,t,n,r){var a=function(e,t){return r[t](e)};return-or(e,r.length,function(e){return a(t,e)},function(e){return a(n,e)},t,n)},Mr=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var i=0,o=e.length-1;o>=0;o--){var s=e[o];a?isFinite(s)||(e[o]=-1/0,i++):e.splice(o,1)}r&&e.sort(function(e,t){return e-t});var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+i]:(e[u-1+i]+e[u+i])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,a=0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r+=o,a++)}return r/a}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,a=t;a<n;a++){var i=e[a];isFinite(i)&&(r=Math.min(i,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,a=t;a<n;a++){var i=e[a];isFinite(i)&&(r=Math.max(i,r))}return r}(e):t,n},Rr=function(e,t,n){for(var r=[],a=0;a<e;a++){for(var i=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[a*e+l]>o&&(i=l,o=t[a*e+l])}i>0&&r.push(i)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},Ir=function(e){for(var t,n,r,a,i,o,s=this.cy(),l=this.nodes(),u=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||tt("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some(function(e){return e===n})||G(n)||tt("Preference must be one of [".concat(r.map(function(e){return"'".concat(e,"'")}).join(", "),"] or a number. Got: ").concat(n)),_r(e)}(e),c={},d=0;d<l.length;d++)c[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var f=0;f<t;f++)for(var p=0;p<t;p++)f!==p&&(r[f*t+p]=Ar(u.distance,l[f],l[p],u.attributes));a=Mr(r,u.preference);for(var v=0;v<t;v++)r[v*t+v]=a;i=new Array(n);for(var g=0;g<n;g++)i[g]=0;o=new Array(n);for(var y=0;y<n;y++)o[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,k=new Array(t*u.minIterations),T=0;T<k.length;T++)k[T]=0;for(E=0;E<u.maxIterations;E++){for(var C=0;C<t;C++){for(var P=-1/0,S=-1/0,B=-1,D=0,_=0;_<t;_++)m[_]=i[C*t+_],(D=o[C*t+_]+r[C*t+_])>=P?(S=P,P=D,B=_):D>S&&(S=D);for(var A=0;A<t;A++)i[C*t+A]=(1-u.damping)*(r[C*t+A]-P)+u.damping*m[A];i[C*t+B]=(1-u.damping)*(r[C*t+B]-S)+u.damping*m[B]}for(var M=0;M<t;M++){for(var R=0,I=0;I<t;I++)m[I]=o[I*t+M],b[I]=Math.max(0,i[I*t+M]),R+=b[I];R-=b[M],b[M]=i[M*t+M],R+=b[M];for(var N=0;N<t;N++)o[N*t+M]=(1-u.damping)*Math.min(0,R-b[N])+u.damping*m[N];o[M*t+M]=(1-u.damping)*(R-b[M])+u.damping*m[M]}for(var L=0,z=0;z<t;z++){var O=o[z*t+z]+i[z*t+z]>0?1:0;k[E%u.minIterations*t+z]=O,L+=O}if(L>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var V=0,F=0;F<t;F++){x[F]=0;for(var X=0;X<u.minIterations;X++)x[F]+=k[X*t+F];0!==x[F]&&x[F]!==u.minIterations||V++}if(V===t)break}}for(var j=function(e,t,n){for(var r=[],a=0;a<e;a++)t[a*e+a]+n[a*e+a]>0&&r.push(a);return r}(t,i,o),Y=function(e,t,n){for(var r=Rr(e,t,n),a=0;a<n.length;a++){for(var i=[],o=0;o<r.length;o++)r[o]===n[a]&&i.push(o);for(var s=-1,l=-1/0,u=0;u<i.length;u++){for(var c=0,d=0;d<i.length;d++)c+=t[i[d]*e+i[u]];c>l&&(s=u,l=c)}n[a]=i[s]}return Rr(e,t,n)}(t,r,j),q={},W=0;W<j.length;W++)q[j[W]]=[];for(var U=0;U<l.length;U++){var H=Y[c[l[U].id()]];null!=H&&q[H].push(l[U])}for(var K=new Array(j.length),Z=0;Z<j.length;Z++)K[Z]=s.collection(q[j[Z]]);return K},Nr={affinityPropagation:Ir,ap:Ir},Lr=lt({root:void 0,directed:!1}),zr=function(){var e=this,t={},n=0,r=0,a=[],i=[],o={},s=function(l,u,c){l===c&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var d,h,f,p,v=e.getElementById(u).connectedEdges().intersection(e);0===v.size()?a.push(e.spawn(e.getElementById(u))):v.forEach(function(n){d=n.source().id(),h=n.target().id(),(f=d===u?h:d)!==c&&(p=n.id(),o[p]||(o[p]=!0,i.push({x:u,y:f,edge:n})),f in t?t[u].low=Math.min(t[u].low,t[f].id):(s(l,f,u),t[u].low=Math.min(t[u].low,t[f].low),t[u].id<=t[f].low&&(t[u].cutVertex=!0,function(n,r){for(var o=i.length-1,s=[],l=e.spawn();i[o].x!=n||i[o].y!=r;)s.push(i.pop().edge),o--;s.push(i.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),a=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(a.filter(function(e){return e.isLoop()})):l.merge(a)})}),a.push(l)}(u,f))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:a}},Or=function(){var e=this,t={},n=0,r=[],a=[],i=e.spawn(e),o=function(s){if(a.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=a.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),i=i.difference(d)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:i,components:r}},Vr={};[mt,Bt,Dt,At,Rt,Nt,Vt,Nn,zn,Vn,Xn,$n,wr,Dr,Nr,{hierholzer:function(e){if(!K(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,a,i=Lr(e),o=i.root,s=i.directed,l=this,u=!1;o&&(a=W(o)?this.filter(o)[0].id():o[0].id());var c={},d={};s?l.forEach(function(e){var t=e.id();if(e.isNode()){var a=e.indegree(!0),i=e.outdegree(!0),o=a-i,s=i-a;1==o?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||o>1)&&(u=!0),c[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&c[t].push(e.id())})}else d[t]=[void 0,e.target().id()]}):l.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach(function(e){return c[t].push(e.id())})):d[t]=[e.source().id(),e.target().id()]});var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(a&&r!=a)return h;a=r}else{if(a&&r!=a&&n!=a)return h;a||(a=r)}else a||(a=l[0].id());var f=function(e){for(var t,n,r,a=e,i=[e];c[a].length;)t=c[a].shift(),n=d[t][0],a!=(r=d[t][1])?(c[r]=c[r].filter(function(e){return e!=t}),a=r):s||a==n||(c[n]=c[n].filter(function(e){return e!=t}),a=n),i.unshift(t),i.unshift(a);return i},p=[],v=[];for(v=f(a);1!=v.length;)0==c[v[0]].length?(p.unshift(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=f(v.shift()).concat(v);for(var g in p.unshift(l.getElementById(v.shift())),c)if(c[g].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},{hopcroftTarjanBiconnected:zr,htbc:zr,htb:zr,hopcroftTarjanBiconnectedComponents:zr},{tarjanStronglyConnected:Or,tsc:Or,tscc:Or,tarjanStronglyConnectedComponents:Or}].forEach(function(e){ge(Vr,e)});
|
|
2
2
|
/*!
|
|
3
3
|
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
4
4
|
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,ac as t,ad as n,ae as r,af as a,l as i,c as o,ag as s,ah as d,a1 as c,a7 as g,a2 as l,a0 as p,ai as f,aj as h,ak as u}from"./mermaid.core-Dx_hE5Vb.js";import{G as m}from"./graph-D6v73SUk.js";import{l as w}from"./layout-FPgIfzKv.js";import{i as y}from"./isUndefined-DgmxjSXK.js";import{c as v}from"./clone-c8fZ8s2e.js";import{m as X}from"./map-BvlAjF4J.js";import"./index-CjH2xgIx.js";import"react/jsx-runtime";import"react";import"./settings-DgLs6IK_.js";import"./ProblemStatus-FyUP73Qa.js";import"./index-BWbfbDmw.js";import"./enums.js";import"./date-Be2Mk-oF.js";import"./date-DabTuCYQ.js";import"./websocket-CoMeGplN.js";import"./worksheet-ClM0CaBH.js";import"motion/react";import"react-dom";import"./index-BD_n8l03.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-BkjUCQC6.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"./_baseIteratee-DJNkOVK7.js";import"./isSymbol-CATEdeai.js";import"./_baseUniq-BJKKUJ6e.js";import"./min-Dc9VrJ6M.js";import"./toNumber-Bh_HTlSx.js";function b(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:E(e),edges:N(e)};return y(e.graph())||(t.value=v(e.graph())),t}function E(e){return X(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),a={v:t};return y(n)||(a.value=n),y(r)||(a.parent=r),a})}function N(e){return X(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return y(t.name)||(r.name=t.name),y(n)||(r.value=n),r})}var x=new Map,j=new Map,C=new Map,S=e(()=>{j.clear(),C.clear(),x.clear()},"clear"),I=e((e,t)=>{const n=j.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),D=e((e,t)=>{const n=j.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v!==t&&e.w!==t&&(n?n.includes(e.v)||I(e.v,t)||I(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),k=e((e,t,n,r)=>{i.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const a=t.children(e)||[];e!==r&&a.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(a=>{if(t.children(a).length>0)k(a,t,n,r);else{const o=t.node(a);i.info("cp ",a," to ",r," with parent ",e),n.setNode(a,o),r!==t.parent(a)&&(i.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(i.debug("Setting parent",a,e),n.setParent(a,e)):(i.info("In copy ",e,"root",r,"data",t.node(e),r),i.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const s=t.edges(a);i.debug("Copying Edges",s),s.forEach(a=>{i.info("Edge",a);const o=t.edge(a.v,a.w,a.name);i.info("Edge data",o,r);try{D(a,r)?(i.info("Copying as ",a.v,a.w,o,a.name),n.setEdge(a.v,a.w,o,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",a.v,"--\x3e",a.w," rootId: ",r," clusterId:",e)}catch(e){i.error(e)}})}i.debug("Removing node",a),t.removeNode(a)})},"copy"),O=e((e,t)=>{const n=t.children(e);let r=[...n];for(const a of n)C.set(a,e),r=[...r,...O(a,t)];return r},"extractDescendants"),G=e((e,t,n)=>{const r=e.edges().filter(e=>e.v===t||e.w===t),a=e.edges().filter(e=>e.v===n||e.w===n),i=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=a.map(e=>({v:e.v,w:e.w}));return i.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},"findCommonEdges"),P=e((e,t,n)=>{const r=t.children(e);if(i.trace("Searching children of id ",e,r),r.length<1)return e;let a;for(const e of r){const r=P(e,t,n),i=G(t,n,r);if(r){if(!(i.length>0))return r;a=r}}return a},"findNonClusterChild"),B=e(e=>x.has(e)&&x.get(e).externalConnections&&x.has(e)?x.get(e).id:e,"getAnchorId"),J=e((e,t)=>{if(!e||t>10)i.debug("Opting out, no graph ");else{i.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(i.warn("Cluster identified",t," Replacement id in edges: ",P(t,e,t)),j.set(t,O(t,e)),x.set(t,{id:P(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const n=e.children(t),r=e.edges();n.length>0?(i.debug("Cluster identified",t,j),r.forEach(e=>{I(e.v,t)^I(e.w,t)&&(i.warn("Edge: ",e," leaves cluster ",t),i.warn("Descendants of XXX ",t,": ",j.get(t)),x.get(t).externalConnections=!0)})):i.debug("Not a cluster ",t,j)});for(let t of x.keys()){const n=x.get(t).id,r=e.parent(n);r!==t&&x.has(r)&&!x.get(r).externalConnections&&(x.get(t).id=r)}e.edges().forEach(function(t){const n=e.edge(t);i.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),i.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,a=t.w;if(i.warn("Fix XXX",x,"ids:",t.v,t.w,"Translating: ",x.get(t.v)," --- ",x.get(t.w)),x.get(t.v)||x.get(t.w)){if(i.warn("Fixing and trying - removing XXX",t.v,t.w,t.name),r=B(t.v),a=B(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){const a=e.parent(r);x.get(a).externalConnections=!0,n.fromCluster=t.v}if(a!==t.w){const r=e.parent(a);x.get(r).externalConnections=!0,n.toCluster=t.w}i.warn("Fix Replacing with XXX",r,a,t.name),e.setEdge(r,a,n,t.name)}}),i.warn("Adjusted Graph",b(e)),A(e,0),i.trace(x)}},"adjustClustersAndEdges"),A=e((e,t)=>{if(i.warn("extractor - ",t,b(e),e.children("D")),t>10)return void i.error("Bailing out");let n=e.nodes(),r=!1;for(const t of n){const n=e.children(t);r=r||n.length>0}if(r){i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,x,x.has(r)&&!x.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),x.has(r))if(!x.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";x.get(r)?.clusterData?.dir&&(n=x.get(r).clusterData.dir,i.warn("Fixing dir",x.get(r).clusterData.dir,n));const a=new m({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",b(e)),k(r,e,a,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:x.get(r).clusterData,label:x.get(r).label,graph:a}),i.warn("New graph after copy node: (",r,")",b(a)),i.debug("Old graph after copy",b(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!x.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(x);else i.debug("Not a cluster",r,t);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const n=e.node(r);i.warn(" Now next level",r,n),n?.clusterNode&&A(n.graph,t+1)}}else i.debug("Done, no node has children",e.nodes())},"extractor"),R=e((e,t)=>{if(0===t.length)return[];let n=Object.assign([],t);return t.forEach(t=>{const r=e.children(t),a=R(e,r);n=[...n,...a]}),n},"sorter"),T=e(e=>R(e,e.children()),"sortNodesByHierarchy"),F=e(async(t,n,r,a,o,m)=>{i.warn("Graph in recursive render:XAX",b(n),o);const y=n.graph().rankdir;i.trace("Dir in recursive render - dir:",y);const v=t.insert("g").attr("class","root");n.nodes()?i.info("Recursive render XXX",n.nodes()):i.info("No nodes found for",n),n.edges().length>0&&i.info("Recursive edges",n.edge(n.edges()[0]));const X=v.insert("g").attr("class","clusters"),E=v.insert("g").attr("class","edgePaths"),N=v.insert("g").attr("class","edgeLabels"),j=v.insert("g").attr("class","nodes");await Promise.all(n.nodes().map(async function(e){const t=n.node(e);if(void 0!==o){const t=JSON.parse(JSON.stringify(o.clusterData));i.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",t.height,"\nParent cluster",o.height),n.setNode(o.id,t),n.parent(e)||(i.trace("Setting parent",e,o.id),n.setParent(e,o.id,t))}if(i.info("(Insert) Node XXX"+e+": "+JSON.stringify(n.node(e))),t?.clusterNode){i.info("Cluster identified XBX",e,t.width,n.node(e));const{ranksep:o,nodesep:c}=n.graph();t.graph.setGraph({...t.graph.graph(),ranksep:o+25,nodesep:c});const g=await F(j,t.graph,r,a,n.node(e),m),l=g.elem;s(t,l),t.diff=g.diff||0,i.info("New compound node after recursive render XAX",e,"width",t.width,"height",t.height),d(l,t)}else n.children(e).length>0?(i.trace("Cluster - the non recursive path XBX",e,t.id,t,t.width,"Graph:",n),i.trace(P(t.id,n)),x.set(t.id,{id:P(t.id,n),node:t})):(i.trace("Node - the non recursive path XAX",e,j,n.node(e),y),await c(j,n.node(e),{config:m,dir:y}))}));const C=e(async()=>{const e=n.edges().map(async function(e){const t=n.edge(e.v,e.w,e.name);i.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),i.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(n.edge(e))),i.info("Fix",x,"ids:",e.v,e.w,"Translating: ",x.get(e.v),x.get(e.w)),await u(N,t)});await Promise.all(e)},"processEdges");await C(),i.info("Graph before layout:",JSON.stringify(b(n))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),w(n),i.info("Graph after layout:",JSON.stringify(b(n)));let S=0,{subGraphTitleTotalMargin:I}=g(m);return await Promise.all(T(n).map(async function(e){const t=n.node(e);if(i.info("Position XBX => "+e+": ("+t.x,","+t.y,") width: ",t.width," height: ",t.height),t?.clusterNode)t.y+=I,i.info("A tainted cluster node XBX1",e,t.id,t.width,t.height,t.x,t.y,n.parent(e)),x.get(t.id).node=t,l(t);else if(n.children(e).length>0){i.info("A pure cluster node XBX1",e,t.id,t.x,t.y,t.width,t.height,n.parent(e)),t.height+=I,n.node(t.parentId);const r=t?.padding/2||0,a=t?.labelBBox?.height||0,o=a-r||0;i.debug("OffsetY",o,"labelHeight",a,"halfPadding",r),await p(X,t),x.get(t.id).node=t}else{const e=n.node(t.parentId);t.y+=I/2,i.info("A regular node XBX1 - using the padding",t.id,"parent",t.parentId,t.width,t.height,t.x,t.y,"offsetY",t.offsetY,"parent",e,e?.offsetY,t),l(t)}})),n.edges().forEach(function(e){const t=n.edge(e);i.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t),t),t.points.forEach(e=>e.y+=I/2);const o=n.node(e.v);var s=n.node(e.w);const d=f(E,t,x,r,o,s,a);h(t,d)}),n.nodes().forEach(function(e){const t=n.node(e);i.info(e,t.type,t.diff),t.isGroup&&(S=t.diff)}),i.warn("Returning from recursive render XAX",v,S),{elem:v,diff:S}},"recursiveRender"),L=e(async(e,s)=>{const d=new m({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),c=s.select("g");t(c,e.markers,e.type,e.diagramId),n(),r(),a(),S(),e.nodes.forEach(e=>{d.setNode(e.id,{...e}),e.parentId&&d.setParent(e.id,e.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){const t=e.start,n=t+"---"+t+"---1",r=t+"---"+t+"---2",a=d.node(t);d.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),d.setParent(n,a.parentId),d.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),d.setParent(r,a.parentId);const i=structuredClone(e),o=structuredClone(e),s=structuredClone(e);i.label="",i.arrowTypeEnd="none",i.id=t+"-cyclic-special-1",o.arrowTypeStart="none",o.arrowTypeEnd="none",o.id=t+"-cyclic-special-mid",s.label="",a.isGroup&&(i.fromCluster=t,s.toCluster=t),s.id=t+"-cyclic-special-2",s.arrowTypeStart="none",d.setEdge(t,n,i,t+"-cyclic-special-0"),d.setEdge(n,r,o,t+"-cyclic-special-1"),d.setEdge(r,t,s,t+"-cyc<lic-special-2")}else d.setEdge(e.start,e.end,{...e},e.id)}),i.warn("Graph at first:",JSON.stringify(b(d))),J(d),i.warn("Graph after XAX:",JSON.stringify(b(d)));const g=o();await F(c,d,e.type,e.diagramId,void 0,g)},"render");export{L as render};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as s}from"./date-DabTuCYQ.js";const e=(s,e,o="0")=>`${s}`.padStart(e,o),o=s=>{const e=s.includes("milliseconds"),o=s.includes("seconds"),n=s.includes("minutes"),i=s.includes("hours"),d=s.includes("day"),c=s.includes("month");return{showYears:s.includes("year"),showMonths:c,showDays:d,showHours:i,showMinutes:n,showSeconds:o,showMilliseconds:e}},n=s=>({showWeeks:s.includes("weeks"),showDays:s.includes("days"),showHours:s.includes("hours"),showMinutes:s.includes("minutes"),showSeconds:s.includes("seconds"),showMilliseconds:s.includes("milliseconds")}),i=(n,i,d)=>{const{showYears:c,showMonths:t,showDays:u,showHours:l,showMinutes:h,showSeconds:w,showMilliseconds:a}=o(i);return(u?n.getDate():"")+(t?` ${d(s[n.getMonth()]||"")}`:"")+(c?` ${n.getFullYear()}`:"")+(l?", "+e(n.getHours(),2)+(h?`:${e(n.getMinutes(),2)}`:"")+(w?`:${e(n.getSeconds(),2)}`:"")+(a?`.${e(n.getMilliseconds(),3)}`:""):"")};export{n as a,i as g,e as p,o as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={ES:"ES",EN:"EN"},r={NONE:"NONE",PENDING:"PENDING",HIDDEN:"HIDDEN",CE:"CE",RE:"RE",TLE:"TLE",MLE:"MLE",WA:"WA",PE:"PE",PA:"PA",AC:"AC"},a=e=>{let r=0;for(;-1!==e.indexOf(r);)r++;return r},E=(e,r)=>{const a=[];for(let E=e;E<r;E++)a.push(E);return a},t=(e,r)=>{if(e===r)return!1;if(e.length!==r.length)return!0;for(let a=0;a<r.length;a+=1)if(r[a]!==e[a])return!0;return!1},s=E(1970,2100),n=["January","February","March","April","May","June","July","August","September","October","November","December"],u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],N=E(0,24),y=E(0,60),d=E(0,60),o=E(0,1e3);export{u as D,N as H,e as L,n as M,r as P,d as S,s as Y,y as a,o as b,t as c,a as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as e,b as t,s as r,t as i,g as s,a as o,_ as a,G as n,l as d,K as c,e as l,E as p,H as m,z as g}from"./mermaid.core-Dx_hE5Vb.js";import{p as h}from"./chunk-4BX2VUAB-CdXAk4UL.js";import{I as b}from"./chunk-QZHKN3VN-C_DglKRL.js";import{p as j}from"./mermaid-parser.core-BCKOf1D4.js";import"./index-CjH2xgIx.js";import"react/jsx-runtime";import"react";import"./settings-DgLs6IK_.js";import"./ProblemStatus-FyUP73Qa.js";import"./index-BWbfbDmw.js";import"./enums.js";import"./date-Be2Mk-oF.js";import"./date-DabTuCYQ.js";import"./websocket-CoMeGplN.js";import"./worksheet-ClM0CaBH.js";import"motion/react";import"react-dom";import"./index-BD_n8l03.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-BkjUCQC6.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"./map-BvlAjF4J.js";import"./_baseIteratee-DJNkOVK7.js";import"./isSymbol-CATEdeai.js";import"./_baseUniq-BJKKUJ6e.js";import"./min-Dc9VrJ6M.js";var w=new b(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),k=a(()=>{w.reset(),g()},"clear"),x=a(()=>w.records.stack[0],"getRoot"),y=a(()=>w.records.cnt,"getCount"),u=m.treeView,f=a(()=>n(u,p().treeView),"getConfig"),B={clear:k,addNode:a((e,t)=>{for(;e<=w.records.stack[w.records.stack.length-1].level;)w.records.stack.pop();const r={id:w.records.cnt++,level:e,name:t,children:[]};w.records.stack[w.records.stack.length-1].children.push(r),w.records.stack.push(r)},"addNode"),getRoot:x,getCount:y,getConfig:f,getAccTitle:o,getAccDescription:s,getDiagramTitle:i,setAccDescription:r,setAccTitle:t,setDiagramTitle:e},V=a(e=>{h(e,B),e.nodes.map(e=>B.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),C={parse:a(async e=>{const t=await j("treeView",e);d.debug(t),V(t)},"parse")},T=a((e,t,r,i,s)=>{const o=i.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:a,width:n}=o.node().getBBox(),d=a+2*s.paddingY,c=n+2*s.paddingX;o.attr("x",e+s.paddingX),o.attr("y",t+d/2),r.BBox={x:e,y:t,width:c,height:d}},"positionLabel"),v=a((e,t,r,i,s,o)=>e.append("line").attr("x1",t).attr("y1",r).attr("x2",i).attr("y2",s).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),N=a((e,t,r)=>{let i=0,s=0;const o=a((e,t,r,o)=>{const a=o*(r.rowIndent+r.paddingX);T(a,i,t,e,r);const{height:n,width:d}=t.BBox;v(e,a-r.rowIndent,i+n/2,a,i+n/2,r.lineThickness),s=Math.max(s,a+d),i+=n},"drawNode"),n=a((t,i=0)=>{o(e,t,r,i),t.children.forEach(e=>{n(e,i+1)});const{x:s,y:a,height:d}=t.BBox;if(t.children.length){const{y:i,height:o}=t.children[t.children.length-1].BBox;v(e,s+r.paddingX,a+d,s+r.paddingX,i+o/2+r.lineThickness/2,r.lineThickness)}},"processNode");return n(t),{totalHeight:i,totalWidth:s}},"drawTree"),I={labelFontSize:"16px",labelColor:"black",lineColor:"black"},X={db:B,renderer:{draw:a((e,t,r,i)=>{d.debug("Rendering treeView diagram\n"+e);const s=i.db,o=s.getRoot(),a=s.getConfig(),n=c(t),p=n.append("g");p.attr("class","tree-view");const{totalHeight:m,totalWidth:g}=N(p,o,a);n.attr("viewBox",`-${a.lineThickness/2} 0 ${g} ${m}`),l(n,m,g,a.useMaxWidth)},"draw")},parser:C,styles:a(({treeView:e})=>{const{labelFontSize:t,labelColor:r,lineColor:i}=n(I,e);return`\n .treeView-node-label {\n font-size: ${t};\n fill: ${r};\n }\n .treeView-node-line {\n stroke: ${i};\n }\n `},"styles")};export{X as diagram};
|