ranui 0.2.1-alpha.1 → 0.2.1-alpha.4
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/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +39 -34
- package/dist/{builtin-D9djWkCE.js → builtin-1lUEp_ro.js} +83 -76
- package/dist/button-Cj-XSCsd.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-CqJa4Q_v.js → card-BHN9Xp4S.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-CThC9-vy.js → checkbox-O_J_n1_W.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-XNxDRcQ-.js → colorpicker-mebH0XLm.js} +8 -8
- package/dist/colorpicker.js +1 -1
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/content-YOKzMoc7.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-CCvsambb.js → dropdown-CzGAVWYC.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-ZNhcQ4tf.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-Ceq3uJzz.js → form-B8afuJlF.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-BniIptBE.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-C_ENrJ3F.js → icon-GZrfSeon.js} +77 -25
- package/dist/icon.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/iife/theme-switch.iife.js +1 -1
- package/dist/{image-B7MBI5n_.js → image-CqoQfJoV.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +38 -37
- package/dist/index.d.ts +8 -0
- package/dist/index.iife.js +3623 -88
- package/dist/index.js +88 -84
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-RNqdEHPf.js → input-BlwAXu7I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-B9MFI03l.js → loading-M6gWxLbm.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-CudIwEXZ.js → math-8E-45Y8e.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-C1oQyPE3.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-DW7qWpEm.js → message-CNdmbeLf.js} +6 -6
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-CrvGKL2B.js → modal-gRagDkTb.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-BKQaaT7o.js → player-CAQ5Og2P.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-CvYIVgUS.js → popover-BZKSLe3D.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-C6jctsFH.js → progress-vk40tuhm.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-BUb4EzmG.js → radar-Bg0cexzU.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/{route-Djrf9UR_.js → route-CGwS0cd_.js} +10 -10
- package/dist/route.js +1 -1
- package/dist/{router-BU2KhtxV.js → router-BK6DEkcN.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-CO4I2dIa.js → scratch-ClF1awGi.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-CsUkp8bv.js → section-BL0V7Kjf.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-Dn26ajJZ.js → select-BIFVbQIj.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-BuMLhvzQ.js → skeleton-D7JIbROq.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-40fDkuox.js → tab-DFVtDJb2.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-F4Pd7JtC.js → tabpane-C3qZGN-D.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/test/ssr/stream.test.d.ts +1 -0
- package/dist/{theme-switch-B09egc6h.js → theme-switch-BXNH5uPD.js} +45 -45
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +135 -3
- package/dist/utils/builder/index.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +170 -2
- package/package.json +7 -1
- package/dist/button-BfYw0fes.js +0 -117
- package/dist/factory-DCrO37si.js +0 -334
|
@@ -0,0 +1,1955 @@
|
|
|
1
|
+
import { n as w } from "./chunk-Y2CYZVJY-0JxdZxki.js";
|
|
2
|
+
import { p as ot } from "./src-DtRLxcYO.js";
|
|
3
|
+
import { H as Wt, K as Ht, U as Yt, a as Xt, b as _t, c as Zt, et as Jt, f as Qt, nt as $t, rt as te, tt as ee, v as ne, w as se, y as ie } from "./chunk-WYO6CB5R-DDHkKowO.js";
|
|
4
|
+
import { i as re } from "./chunk-ICXQ74PX-DR8rL-xF.js";
|
|
5
|
+
import { t as oe } from "./chunk-VAUOI2AC-izt0o4id.js";
|
|
6
|
+
import { t as ae } from "./rough.esm-BWe9E0Nz.js";
|
|
7
|
+
var Mt = (t, n) => $t(t, "a", -n), Tt = 1e-10;
|
|
8
|
+
function st(t, n) {
|
|
9
|
+
const s = ce(t), e = s.filter((c) => le(c, t));
|
|
10
|
+
let i = 0, r = 0;
|
|
11
|
+
const a = [];
|
|
12
|
+
if (e.length > 1) {
|
|
13
|
+
const c = zt(e);
|
|
14
|
+
for (let l = 0; l < e.length; ++l) {
|
|
15
|
+
const u = e[l];
|
|
16
|
+
u.angle = Math.atan2(u.x - c.x, u.y - c.y);
|
|
17
|
+
}
|
|
18
|
+
e.sort((l, u) => u.angle - l.angle);
|
|
19
|
+
let f = e[e.length - 1];
|
|
20
|
+
for (let l = 0; l < e.length; ++l) {
|
|
21
|
+
const u = e[l];
|
|
22
|
+
r += (f.x + u.x) * (u.y - f.y);
|
|
23
|
+
const d = {
|
|
24
|
+
x: (u.x + f.x) / 2,
|
|
25
|
+
y: (u.y + f.y) / 2
|
|
26
|
+
};
|
|
27
|
+
let h = null;
|
|
28
|
+
for (let b = 0; b < u.parentIndex.length; ++b) if (f.parentIndex.includes(u.parentIndex[b])) {
|
|
29
|
+
const y = t[u.parentIndex[b]], S = Math.atan2(u.x - y.x, u.y - y.y), T = Math.atan2(f.x - y.x, f.y - y.y);
|
|
30
|
+
let m = T - S;
|
|
31
|
+
m < 0 && (m += 2 * Math.PI);
|
|
32
|
+
const g = T - m / 2;
|
|
33
|
+
let v = U(d, {
|
|
34
|
+
x: y.x + y.radius * Math.sin(g),
|
|
35
|
+
y: y.y + y.radius * Math.cos(g)
|
|
36
|
+
});
|
|
37
|
+
v > y.radius * 2 && (v = y.radius * 2), (h == null || h.width > v) && (h = {
|
|
38
|
+
circle: y,
|
|
39
|
+
width: v,
|
|
40
|
+
p1: u,
|
|
41
|
+
p2: f,
|
|
42
|
+
large: v > y.radius,
|
|
43
|
+
sweep: !0
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
h != null && (a.push(h), i += ct(h.circle.radius, h.width), f = u);
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
let c = t[0];
|
|
50
|
+
for (let l = 1; l < t.length; ++l) t[l].radius < c.radius && (c = t[l]);
|
|
51
|
+
let f = !1;
|
|
52
|
+
for (let l = 0; l < t.length; ++l) if (U(t[l], c) > Math.abs(c.radius - t[l].radius)) {
|
|
53
|
+
f = !0;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
f ? i = r = 0 : (i = c.radius * c.radius * Math.PI, a.push({
|
|
57
|
+
circle: c,
|
|
58
|
+
p1: {
|
|
59
|
+
x: c.x,
|
|
60
|
+
y: c.y + c.radius
|
|
61
|
+
},
|
|
62
|
+
p2: {
|
|
63
|
+
x: c.x - Tt,
|
|
64
|
+
y: c.y + c.radius
|
|
65
|
+
},
|
|
66
|
+
width: c.radius * 2,
|
|
67
|
+
large: !0,
|
|
68
|
+
sweep: !0
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
return r /= 2, n && (n.area = i + r, n.arcArea = i, n.polygonArea = r, n.arcs = a, n.innerPoints = e, n.intersectionPoints = s), i + r;
|
|
72
|
+
}
|
|
73
|
+
function le(t, n) {
|
|
74
|
+
return n.every((s) => U(t, s) < s.radius + Tt);
|
|
75
|
+
}
|
|
76
|
+
function ce(t) {
|
|
77
|
+
const n = [];
|
|
78
|
+
for (let s = 0; s < t.length; ++s) for (let e = s + 1; e < t.length; ++e) {
|
|
79
|
+
const i = Et(t[s], t[e]);
|
|
80
|
+
for (const r of i)
|
|
81
|
+
r.parentIndex = [s, e], n.push(r);
|
|
82
|
+
}
|
|
83
|
+
return n;
|
|
84
|
+
}
|
|
85
|
+
function ct(t, n) {
|
|
86
|
+
return t * t * Math.acos(1 - n / t) - (t - n) * Math.sqrt(n * (2 * t - n));
|
|
87
|
+
}
|
|
88
|
+
function U(t, n) {
|
|
89
|
+
return Math.sqrt((t.x - n.x) * (t.x - n.x) + (t.y - n.y) * (t.y - n.y));
|
|
90
|
+
}
|
|
91
|
+
function xt(t, n, s) {
|
|
92
|
+
if (s >= t + n) return 0;
|
|
93
|
+
if (s <= Math.abs(t - n)) return Math.PI * Math.min(t, n) * Math.min(t, n);
|
|
94
|
+
const e = t - (s * s - n * n + t * t) / (2 * s), i = n - (s * s - t * t + n * n) / (2 * s);
|
|
95
|
+
return ct(t, e) + ct(n, i);
|
|
96
|
+
}
|
|
97
|
+
function Et(t, n) {
|
|
98
|
+
const s = U(t, n), e = t.radius, i = n.radius;
|
|
99
|
+
if (s >= e + i || s <= Math.abs(e - i)) return [];
|
|
100
|
+
const r = (e * e - i * i + s * s) / (2 * s), a = Math.sqrt(e * e - r * r), c = t.x + r * (n.x - t.x) / s, f = t.y + r * (n.y - t.y) / s, l = -(n.y - t.y) * (a / s), u = -(n.x - t.x) * (a / s);
|
|
101
|
+
return [{
|
|
102
|
+
x: c + l,
|
|
103
|
+
y: f - u
|
|
104
|
+
}, {
|
|
105
|
+
x: c - l,
|
|
106
|
+
y: f + u
|
|
107
|
+
}];
|
|
108
|
+
}
|
|
109
|
+
function zt(t) {
|
|
110
|
+
const n = {
|
|
111
|
+
x: 0,
|
|
112
|
+
y: 0
|
|
113
|
+
};
|
|
114
|
+
for (const s of t)
|
|
115
|
+
n.x += s.x, n.y += s.y;
|
|
116
|
+
return n.x /= t.length, n.y /= t.length, n;
|
|
117
|
+
}
|
|
118
|
+
function ue(t, n, s, e) {
|
|
119
|
+
e = e || {};
|
|
120
|
+
const i = e.maxIterations || 100, r = e.tolerance || 1e-10, a = t(n), c = t(s);
|
|
121
|
+
let f = s - n;
|
|
122
|
+
if (a * c > 0) throw "Initial bisect points must have opposite signs";
|
|
123
|
+
if (a === 0) return n;
|
|
124
|
+
if (c === 0) return s;
|
|
125
|
+
for (let l = 0; l < i; ++l) {
|
|
126
|
+
f /= 2;
|
|
127
|
+
const u = n + f, d = t(u);
|
|
128
|
+
if (d * a >= 0 && (n = u), Math.abs(f) < r || d === 0) return u;
|
|
129
|
+
}
|
|
130
|
+
return n + f;
|
|
131
|
+
}
|
|
132
|
+
function ut(t) {
|
|
133
|
+
const n = new Array(t);
|
|
134
|
+
for (let s = 0; s < t; ++s) n[s] = 0;
|
|
135
|
+
return n;
|
|
136
|
+
}
|
|
137
|
+
function St(t, n) {
|
|
138
|
+
return ut(t).map(() => ut(n));
|
|
139
|
+
}
|
|
140
|
+
function $(t, n) {
|
|
141
|
+
let s = 0;
|
|
142
|
+
for (let e = 0; e < t.length; ++e) s += t[e] * n[e];
|
|
143
|
+
return s;
|
|
144
|
+
}
|
|
145
|
+
function ft(t) {
|
|
146
|
+
return Math.sqrt($(t, t));
|
|
147
|
+
}
|
|
148
|
+
function ht(t, n, s) {
|
|
149
|
+
for (let e = 0; e < n.length; ++e) t[e] = n[e] * s;
|
|
150
|
+
}
|
|
151
|
+
function X(t, n, s, e, i) {
|
|
152
|
+
for (let r = 0; r < t.length; ++r) t[r] = n * s[r] + e * i[r];
|
|
153
|
+
}
|
|
154
|
+
function At(t, n, s) {
|
|
155
|
+
s = s || {};
|
|
156
|
+
const e = s.maxIterations || n.length * 200, i = s.nonZeroDelta || 1.05, r = s.zeroDelta || 1e-3, a = s.minErrorDelta || 1e-6, c = s.minErrorDelta || 1e-5, f = s.rho !== void 0 ? s.rho : 1, l = s.chi !== void 0 ? s.chi : 2, u = s.psi !== void 0 ? s.psi : -0.5, d = s.sigma !== void 0 ? s.sigma : 0.5;
|
|
157
|
+
let h;
|
|
158
|
+
const b = n.length, y = new Array(b + 1);
|
|
159
|
+
y[0] = n, y[0].fx = t(n), y[0].id = 0;
|
|
160
|
+
for (let p = 0; p < b; ++p) {
|
|
161
|
+
const x = n.slice();
|
|
162
|
+
x[p] = x[p] ? x[p] * i : r, y[p + 1] = x, y[p + 1].fx = t(x), y[p + 1].id = p + 1;
|
|
163
|
+
}
|
|
164
|
+
function S(p) {
|
|
165
|
+
for (let x = 0; x < p.length; x++) y[b][x] = p[x];
|
|
166
|
+
y[b].fx = p.fx;
|
|
167
|
+
}
|
|
168
|
+
const T = (p, x) => p.fx - x.fx, m = n.slice(), g = n.slice(), v = n.slice(), k = n.slice();
|
|
169
|
+
for (let p = 0; p < e; ++p) {
|
|
170
|
+
if (y.sort(T), s.history) {
|
|
171
|
+
const o = y.map((_) => {
|
|
172
|
+
const I = _.slice();
|
|
173
|
+
return I.fx = _.fx, I.id = _.id, I;
|
|
174
|
+
});
|
|
175
|
+
o.sort((_, I) => _.id - I.id), s.history.push({
|
|
176
|
+
x: y[0].slice(),
|
|
177
|
+
fx: y[0].fx,
|
|
178
|
+
simplex: o
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
h = 0;
|
|
182
|
+
for (let o = 0; o < b; ++o) h = Math.max(h, Math.abs(y[0][o] - y[1][o]));
|
|
183
|
+
if (Math.abs(y[0].fx - y[b].fx) < a && h < c) break;
|
|
184
|
+
for (let o = 0; o < b; ++o) {
|
|
185
|
+
m[o] = 0;
|
|
186
|
+
for (let _ = 0; _ < b; ++_) m[o] += y[_][o];
|
|
187
|
+
m[o] /= b;
|
|
188
|
+
}
|
|
189
|
+
const x = y[b];
|
|
190
|
+
if (X(g, 1 + f, m, -f, x), g.fx = t(g), g.fx < y[0].fx)
|
|
191
|
+
X(k, 1 + l, m, -l, x), k.fx = t(k), k.fx < g.fx ? S(k) : S(g);
|
|
192
|
+
else if (g.fx >= y[b - 1].fx) {
|
|
193
|
+
let o = !1;
|
|
194
|
+
if (g.fx > x.fx ? (X(v, 1 + u, m, -u, x), v.fx = t(v), v.fx < x.fx ? S(v) : o = !0) : (X(v, 1 - u * f, m, u * f, x), v.fx = t(v), v.fx < g.fx ? S(v) : o = !0), o) {
|
|
195
|
+
if (d >= 1) break;
|
|
196
|
+
for (let _ = 1; _ < y.length; ++_)
|
|
197
|
+
X(y[_], 1 - d, y[0], d, y[_]), y[_].fx = t(y[_]);
|
|
198
|
+
}
|
|
199
|
+
} else S(g);
|
|
200
|
+
}
|
|
201
|
+
return y.sort(T), {
|
|
202
|
+
fx: y[0].fx,
|
|
203
|
+
x: y[0]
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function fe(t, n, s, e, i, r, a) {
|
|
207
|
+
const c = s.fx, f = $(s.fxprime, n);
|
|
208
|
+
let l = c, u = c, d = f, h = 0;
|
|
209
|
+
i = i || 1, r = r || 1e-6, a = a || 0.1;
|
|
210
|
+
function b(y, S, T) {
|
|
211
|
+
for (let m = 0; m < 16; ++m)
|
|
212
|
+
if (i = (y + S) / 2, X(e.x, 1, s.x, i, n), l = e.fx = t(e.x, e.fxprime), d = $(e.fxprime, n), l > c + r * i * f || l >= T) S = i;
|
|
213
|
+
else {
|
|
214
|
+
if (Math.abs(d) <= -a * f) return i;
|
|
215
|
+
d * (S - y) >= 0 && (S = y), y = i, T = l;
|
|
216
|
+
}
|
|
217
|
+
return 0;
|
|
218
|
+
}
|
|
219
|
+
for (let y = 0; y < 10; ++y) {
|
|
220
|
+
if (X(e.x, 1, s.x, i, n), l = e.fx = t(e.x, e.fxprime), d = $(e.fxprime, n), l > c + r * i * f || y && l >= u) return b(h, i, u);
|
|
221
|
+
if (Math.abs(d) <= -a * f) return i;
|
|
222
|
+
if (d >= 0) return b(i, h, l);
|
|
223
|
+
u = l, h = i, i *= 2;
|
|
224
|
+
}
|
|
225
|
+
return i;
|
|
226
|
+
}
|
|
227
|
+
function he(t, n, s) {
|
|
228
|
+
let e = {
|
|
229
|
+
x: n.slice(),
|
|
230
|
+
fx: 0,
|
|
231
|
+
fxprime: n.slice()
|
|
232
|
+
}, i = {
|
|
233
|
+
x: n.slice(),
|
|
234
|
+
fx: 0,
|
|
235
|
+
fxprime: n.slice()
|
|
236
|
+
};
|
|
237
|
+
const r = n.slice();
|
|
238
|
+
let a, c, f = 1, l;
|
|
239
|
+
s = s || {}, l = s.maxIterations || n.length * 20, e.fx = t(e.x, e.fxprime), a = e.fxprime.slice(), ht(a, e.fxprime, -1);
|
|
240
|
+
for (let u = 0; u < l; ++u) {
|
|
241
|
+
if (f = fe(t, a, e, i, f), s.history && s.history.push({
|
|
242
|
+
x: e.x.slice(),
|
|
243
|
+
fx: e.fx,
|
|
244
|
+
fxprime: e.fxprime.slice(),
|
|
245
|
+
alpha: f
|
|
246
|
+
}), !f) ht(a, e.fxprime, -1);
|
|
247
|
+
else {
|
|
248
|
+
X(r, 1, i.fxprime, -1, e.fxprime);
|
|
249
|
+
const d = $(e.fxprime, e.fxprime), h = Math.max(0, $(r, i.fxprime) / d);
|
|
250
|
+
X(a, h, a, -1, i.fxprime), c = e, e = i, i = c;
|
|
251
|
+
}
|
|
252
|
+
if (ft(e.fxprime) <= 1e-5) break;
|
|
253
|
+
}
|
|
254
|
+
return s.history && s.history.push({
|
|
255
|
+
x: e.x.slice(),
|
|
256
|
+
fx: e.fx,
|
|
257
|
+
fxprime: e.fxprime.slice(),
|
|
258
|
+
alpha: f
|
|
259
|
+
}), e;
|
|
260
|
+
}
|
|
261
|
+
function Dt(t, n = {}) {
|
|
262
|
+
n.maxIterations = n.maxIterations || 500;
|
|
263
|
+
const s = n.initialLayout || xe, e = n.lossFunction || tt, i = de(t, n), r = s(i, n), a = Object.keys(r), c = [];
|
|
264
|
+
for (const l of a)
|
|
265
|
+
c.push(r[l].x), c.push(r[l].y);
|
|
266
|
+
const f = At((l) => {
|
|
267
|
+
const u = {};
|
|
268
|
+
for (let d = 0; d < a.length; ++d) {
|
|
269
|
+
const h = a[d];
|
|
270
|
+
u[h] = {
|
|
271
|
+
x: l[2 * d],
|
|
272
|
+
y: l[2 * d + 1],
|
|
273
|
+
radius: r[h].radius
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return e(u, i);
|
|
277
|
+
}, c, n).x;
|
|
278
|
+
for (let l = 0; l < a.length; ++l) {
|
|
279
|
+
const u = a[l];
|
|
280
|
+
r[u].x = f[2 * l], r[u].y = f[2 * l + 1];
|
|
281
|
+
}
|
|
282
|
+
return r;
|
|
283
|
+
}
|
|
284
|
+
var Ct = 1e-10;
|
|
285
|
+
function dt(t, n, s) {
|
|
286
|
+
return Math.min(t, n) * Math.min(t, n) * Math.PI <= s + Ct ? Math.abs(t - n) : ue((e) => xt(t, n, e) - s, 0, t + n);
|
|
287
|
+
}
|
|
288
|
+
function de(t, n = {}) {
|
|
289
|
+
const s = n.distinct, e = t.map((c) => Object.assign({}, c));
|
|
290
|
+
function i(c) {
|
|
291
|
+
return c.join(";");
|
|
292
|
+
}
|
|
293
|
+
if (s) {
|
|
294
|
+
const c = /* @__PURE__ */ new Map();
|
|
295
|
+
for (const f of e) for (let l = 0; l < f.sets.length; l++) {
|
|
296
|
+
const u = String(f.sets[l]);
|
|
297
|
+
c.set(u, f.size + (c.get(u) || 0));
|
|
298
|
+
for (let d = l + 1; d < f.sets.length; d++) {
|
|
299
|
+
const h = String(f.sets[d]), b = `${u};${h}`, y = `${h};${u}`;
|
|
300
|
+
c.set(b, f.size + (c.get(b) || 0)), c.set(y, f.size + (c.get(y) || 0));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
for (const f of e) f.sets.length < 3 && (f.size = c.get(i(f.sets)));
|
|
304
|
+
}
|
|
305
|
+
const r = [], a = /* @__PURE__ */ new Set();
|
|
306
|
+
for (const c of e) if (c.sets.length === 1) r.push(c.sets[0]);
|
|
307
|
+
else if (c.sets.length === 2) {
|
|
308
|
+
const f = c.sets[0], l = c.sets[1];
|
|
309
|
+
a.add(i(c.sets)), a.add(i([l, f]));
|
|
310
|
+
}
|
|
311
|
+
r.sort((c, f) => c === f ? 0 : c < f ? -1 : 1);
|
|
312
|
+
for (let c = 0; c < r.length; ++c) {
|
|
313
|
+
const f = r[c];
|
|
314
|
+
for (let l = c + 1; l < r.length; ++l) {
|
|
315
|
+
const u = r[l];
|
|
316
|
+
a.has(i([f, u])) || e.push({
|
|
317
|
+
sets: [f, u],
|
|
318
|
+
size: 0
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return e;
|
|
323
|
+
}
|
|
324
|
+
function ge(t, n, s) {
|
|
325
|
+
const e = St(n.length, n.length), i = St(n.length, n.length);
|
|
326
|
+
return t.filter((r) => r.sets.length === 2).forEach((r) => {
|
|
327
|
+
const a = s[r.sets[0]], c = s[r.sets[1]], f = dt(Math.sqrt(n[a].size / Math.PI), Math.sqrt(n[c].size / Math.PI), r.size);
|
|
328
|
+
e[a][c] = e[c][a] = f;
|
|
329
|
+
let l = 0;
|
|
330
|
+
r.size + 1e-10 >= Math.min(n[a].size, n[c].size) ? l = 1 : r.size <= 1e-10 && (l = -1), i[a][c] = i[c][a] = l;
|
|
331
|
+
}), {
|
|
332
|
+
distances: e,
|
|
333
|
+
constraints: i
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function ye(t, n, s, e) {
|
|
337
|
+
for (let r = 0; r < n.length; ++r) n[r] = 0;
|
|
338
|
+
let i = 0;
|
|
339
|
+
for (let r = 0; r < s.length; ++r) {
|
|
340
|
+
const a = t[2 * r], c = t[2 * r + 1];
|
|
341
|
+
for (let f = r + 1; f < s.length; ++f) {
|
|
342
|
+
const l = t[2 * f], u = t[2 * f + 1], d = s[r][f], h = e[r][f], b = (l - a) * (l - a) + (u - c) * (u - c), y = Math.sqrt(b), S = b - d * d;
|
|
343
|
+
h > 0 && y <= d || h < 0 && y >= d || (i += 2 * S * S, n[2 * r] += 4 * S * (a - l), n[2 * r + 1] += 4 * S * (c - u), n[2 * f] += 4 * S * (l - a), n[2 * f + 1] += 4 * S * (u - c));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return i;
|
|
347
|
+
}
|
|
348
|
+
function xe(t, n = {}) {
|
|
349
|
+
let s = me(t, n);
|
|
350
|
+
const e = n.lossFunction || tt;
|
|
351
|
+
if (t.length >= 8) {
|
|
352
|
+
const i = pe(t, n), r = e(i, t), a = e(s, t);
|
|
353
|
+
r + 1e-8 < a && (s = i);
|
|
354
|
+
}
|
|
355
|
+
return s;
|
|
356
|
+
}
|
|
357
|
+
function pe(t, n = {}) {
|
|
358
|
+
const s = n.restarts || 10, e = [], i = {};
|
|
359
|
+
for (const h of t) h.sets.length === 1 && (i[h.sets[0]] = e.length, e.push(h));
|
|
360
|
+
let { distances: r, constraints: a } = ge(t, e, i);
|
|
361
|
+
const c = ft(r.map(ft)) / r.length;
|
|
362
|
+
r = r.map((h) => h.map((b) => b / c));
|
|
363
|
+
const f = (h, b) => ye(h, b, r, a);
|
|
364
|
+
let l = null;
|
|
365
|
+
for (let h = 0; h < s; ++h) {
|
|
366
|
+
const b = he(f, ut(r.length * 2).map(Math.random), n);
|
|
367
|
+
(!l || b.fx < l.fx) && (l = b);
|
|
368
|
+
}
|
|
369
|
+
const u = l.x, d = {};
|
|
370
|
+
for (let h = 0; h < e.length; ++h) {
|
|
371
|
+
const b = e[h];
|
|
372
|
+
d[b.sets[0]] = {
|
|
373
|
+
x: u[2 * h] * c,
|
|
374
|
+
y: u[2 * h + 1] * c,
|
|
375
|
+
radius: Math.sqrt(b.size / Math.PI)
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
if (n.history) for (const h of n.history) ht(h.x, c);
|
|
379
|
+
return d;
|
|
380
|
+
}
|
|
381
|
+
function me(t, n) {
|
|
382
|
+
const s = n && n.lossFunction ? n.lossFunction : tt, e = {}, i = {};
|
|
383
|
+
for (const d of t) if (d.sets.length === 1) {
|
|
384
|
+
const h = d.sets[0];
|
|
385
|
+
e[h] = {
|
|
386
|
+
x: 1e10,
|
|
387
|
+
y: 1e10,
|
|
388
|
+
rowid: e.length,
|
|
389
|
+
size: d.size,
|
|
390
|
+
radius: Math.sqrt(d.size / Math.PI)
|
|
391
|
+
}, i[h] = [];
|
|
392
|
+
}
|
|
393
|
+
t = t.filter((d) => d.sets.length === 2);
|
|
394
|
+
for (const d of t) {
|
|
395
|
+
let h = d.weight != null ? d.weight : 1;
|
|
396
|
+
const b = d.sets[0], y = d.sets[1];
|
|
397
|
+
d.size + Ct >= Math.min(e[b].size, e[y].size) && (h = 0), i[b].push({
|
|
398
|
+
set: y,
|
|
399
|
+
size: d.size,
|
|
400
|
+
weight: h
|
|
401
|
+
}), i[y].push({
|
|
402
|
+
set: b,
|
|
403
|
+
size: d.size,
|
|
404
|
+
weight: h
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
const r = [];
|
|
408
|
+
Object.keys(i).forEach((d) => {
|
|
409
|
+
let h = 0;
|
|
410
|
+
for (let b = 0; b < i[d].length; ++b) h += i[d][b].size * i[d][b].weight;
|
|
411
|
+
r.push({
|
|
412
|
+
set: d,
|
|
413
|
+
size: h
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
function a(d, h) {
|
|
417
|
+
return h.size - d.size;
|
|
418
|
+
}
|
|
419
|
+
r.sort(a);
|
|
420
|
+
const c = {};
|
|
421
|
+
function f(d) {
|
|
422
|
+
return d.set in c;
|
|
423
|
+
}
|
|
424
|
+
function l(d, h) {
|
|
425
|
+
e[h].x = d.x, e[h].y = d.y, c[h] = !0;
|
|
426
|
+
}
|
|
427
|
+
l({
|
|
428
|
+
x: 0,
|
|
429
|
+
y: 0
|
|
430
|
+
}, r[0].set);
|
|
431
|
+
for (let d = 1; d < r.length; ++d) {
|
|
432
|
+
const h = r[d].set, b = i[h].filter(f), y = e[h];
|
|
433
|
+
if (b.sort(a), b.length === 0) throw "ERROR: missing pairwise overlap information";
|
|
434
|
+
const S = [];
|
|
435
|
+
for (var u = 0; u < b.length; ++u) {
|
|
436
|
+
const g = e[b[u].set], v = dt(y.radius, g.radius, b[u].size);
|
|
437
|
+
S.push({
|
|
438
|
+
x: g.x + v,
|
|
439
|
+
y: g.y
|
|
440
|
+
}), S.push({
|
|
441
|
+
x: g.x - v,
|
|
442
|
+
y: g.y
|
|
443
|
+
}), S.push({
|
|
444
|
+
y: g.y + v,
|
|
445
|
+
x: g.x
|
|
446
|
+
}), S.push({
|
|
447
|
+
y: g.y - v,
|
|
448
|
+
x: g.x
|
|
449
|
+
});
|
|
450
|
+
for (let k = u + 1; k < b.length; ++k) {
|
|
451
|
+
const p = e[b[k].set], x = dt(y.radius, p.radius, b[k].size), o = Et({
|
|
452
|
+
x: g.x,
|
|
453
|
+
y: g.y,
|
|
454
|
+
radius: v
|
|
455
|
+
}, {
|
|
456
|
+
x: p.x,
|
|
457
|
+
y: p.y,
|
|
458
|
+
radius: x
|
|
459
|
+
});
|
|
460
|
+
S.push(...o);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
let T = 1e50, m = S[0];
|
|
464
|
+
for (const g of S) {
|
|
465
|
+
e[h].x = g.x, e[h].y = g.y;
|
|
466
|
+
const v = s(e, t);
|
|
467
|
+
v < T && (T = v, m = g);
|
|
468
|
+
}
|
|
469
|
+
l(m, h);
|
|
470
|
+
}
|
|
471
|
+
return e;
|
|
472
|
+
}
|
|
473
|
+
function tt(t, n) {
|
|
474
|
+
let s = 0;
|
|
475
|
+
for (const e of n) {
|
|
476
|
+
if (e.sets.length === 1) continue;
|
|
477
|
+
let i;
|
|
478
|
+
if (e.sets.length === 2) {
|
|
479
|
+
const a = t[e.sets[0]], c = t[e.sets[1]];
|
|
480
|
+
i = xt(a.radius, c.radius, U(a, c));
|
|
481
|
+
} else i = st(e.sets.map((a) => t[a]));
|
|
482
|
+
const r = e.weight != null ? e.weight : 1;
|
|
483
|
+
s += r * (i - e.size) * (i - e.size);
|
|
484
|
+
}
|
|
485
|
+
return s;
|
|
486
|
+
}
|
|
487
|
+
function Rt(t, n) {
|
|
488
|
+
let s = 0;
|
|
489
|
+
for (const e of n) {
|
|
490
|
+
if (e.sets.length === 1) continue;
|
|
491
|
+
let i;
|
|
492
|
+
if (e.sets.length === 2) {
|
|
493
|
+
const c = t[e.sets[0]], f = t[e.sets[1]];
|
|
494
|
+
i = xt(c.radius, f.radius, U(c, f));
|
|
495
|
+
} else i = st(e.sets.map((c) => t[c]));
|
|
496
|
+
const r = e.weight != null ? e.weight : 1, a = Math.log((i + 1) / (e.size + 1));
|
|
497
|
+
s += r * a * a;
|
|
498
|
+
}
|
|
499
|
+
return s;
|
|
500
|
+
}
|
|
501
|
+
function be(t, n, s) {
|
|
502
|
+
if (s == null ? t.sort((i, r) => r.radius - i.radius) : t.sort(s), t.length > 0) {
|
|
503
|
+
const i = t[0].x, r = t[0].y;
|
|
504
|
+
for (const a of t)
|
|
505
|
+
a.x -= i, a.y -= r;
|
|
506
|
+
}
|
|
507
|
+
if (t.length === 2 && U(t[0], t[1]) < Math.abs(t[1].radius - t[0].radius) && (t[1].x = t[0].x + t[0].radius - t[1].radius - 1e-10, t[1].y = t[0].y), t.length > 1) {
|
|
508
|
+
const i = Math.atan2(t[1].x, t[1].y) - n, r = Math.cos(i), a = Math.sin(i);
|
|
509
|
+
for (const c of t) {
|
|
510
|
+
const f = c.x, l = c.y;
|
|
511
|
+
c.x = r * f - a * l, c.y = a * f + r * l;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
if (t.length > 2) {
|
|
515
|
+
let i = Math.atan2(t[2].x, t[2].y) - n;
|
|
516
|
+
for (; i < 0; ) i += 2 * Math.PI;
|
|
517
|
+
for (; i > 2 * Math.PI; ) i -= 2 * Math.PI;
|
|
518
|
+
if (i > Math.PI) {
|
|
519
|
+
const r = t[1].y / (1e-10 + t[1].x);
|
|
520
|
+
for (const a of t) {
|
|
521
|
+
var e = (a.x + r * a.y) / (1 + r * r);
|
|
522
|
+
a.x = 2 * e - a.x, a.y = 2 * e * r - a.y;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
function ve(t) {
|
|
528
|
+
t.forEach((i) => {
|
|
529
|
+
i.parent = i;
|
|
530
|
+
});
|
|
531
|
+
function n(i) {
|
|
532
|
+
return i.parent !== i && (i.parent = n(i.parent)), i.parent;
|
|
533
|
+
}
|
|
534
|
+
function s(i, r) {
|
|
535
|
+
const a = n(i);
|
|
536
|
+
a.parent = n(r);
|
|
537
|
+
}
|
|
538
|
+
for (let i = 0; i < t.length; ++i) for (let r = i + 1; r < t.length; ++r) {
|
|
539
|
+
const a = t[i].radius + t[r].radius;
|
|
540
|
+
U(t[i], t[r]) + 1e-10 < a && s(t[r], t[i]);
|
|
541
|
+
}
|
|
542
|
+
const e = /* @__PURE__ */ new Map();
|
|
543
|
+
for (let i = 0; i < t.length; ++i) {
|
|
544
|
+
const r = n(t[i]).parent.setid;
|
|
545
|
+
e.has(r) || e.set(r, []), e.get(r).push(t[i]);
|
|
546
|
+
}
|
|
547
|
+
return t.forEach((i) => {
|
|
548
|
+
delete i.parent;
|
|
549
|
+
}), Array.from(e.values());
|
|
550
|
+
}
|
|
551
|
+
function gt(t) {
|
|
552
|
+
const n = (s) => ({
|
|
553
|
+
max: t.reduce((e, i) => Math.max(e, i[s] + i.radius), Number.NEGATIVE_INFINITY),
|
|
554
|
+
min: t.reduce((e, i) => Math.min(e, i[s] - i.radius), Number.POSITIVE_INFINITY)
|
|
555
|
+
});
|
|
556
|
+
return {
|
|
557
|
+
xRange: n("x"),
|
|
558
|
+
yRange: n("y")
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
function Ot(t, n, s) {
|
|
562
|
+
n == null && (n = Math.PI / 2);
|
|
563
|
+
let e = Ft(t).map((l) => Object.assign({}, l));
|
|
564
|
+
const i = ve(e);
|
|
565
|
+
for (const l of i) {
|
|
566
|
+
be(l, n, s);
|
|
567
|
+
const u = gt(l);
|
|
568
|
+
l.size = (u.xRange.max - u.xRange.min) * (u.yRange.max - u.yRange.min), l.bounds = u;
|
|
569
|
+
}
|
|
570
|
+
i.sort((l, u) => u.size - l.size), e = i[0];
|
|
571
|
+
let r = e.bounds;
|
|
572
|
+
const a = (r.xRange.max - r.xRange.min) / 50;
|
|
573
|
+
function c(l, u, d) {
|
|
574
|
+
if (!l) return;
|
|
575
|
+
const h = l.bounds;
|
|
576
|
+
let b, y;
|
|
577
|
+
if (u) b = r.xRange.max - h.xRange.min + a;
|
|
578
|
+
else {
|
|
579
|
+
b = r.xRange.max - h.xRange.max;
|
|
580
|
+
const S = (h.xRange.max - h.xRange.min) / 2 - (r.xRange.max - r.xRange.min) / 2;
|
|
581
|
+
S < 0 && (b += S);
|
|
582
|
+
}
|
|
583
|
+
if (d) y = r.yRange.max - h.yRange.min + a;
|
|
584
|
+
else {
|
|
585
|
+
y = r.yRange.max - h.yRange.max;
|
|
586
|
+
const S = (h.yRange.max - h.yRange.min) / 2 - (r.yRange.max - r.yRange.min) / 2;
|
|
587
|
+
S < 0 && (y += S);
|
|
588
|
+
}
|
|
589
|
+
for (const S of l)
|
|
590
|
+
S.x += b, S.y += y, e.push(S);
|
|
591
|
+
}
|
|
592
|
+
let f = 1;
|
|
593
|
+
for (; f < i.length; )
|
|
594
|
+
c(i[f], !0, !1), c(i[f + 1], !1, !0), c(i[f + 2], !0, !0), f += 3, r = gt(e);
|
|
595
|
+
return jt(e);
|
|
596
|
+
}
|
|
597
|
+
function Nt(t, n, s, e, i) {
|
|
598
|
+
const r = Ft(t);
|
|
599
|
+
n -= 2 * e, s -= 2 * e;
|
|
600
|
+
const { xRange: a, yRange: c } = gt(r);
|
|
601
|
+
if (a.max === a.min || c.max === c.min) return t;
|
|
602
|
+
let f, l;
|
|
603
|
+
if (i) {
|
|
604
|
+
const b = Math.sqrt(i / Math.PI) * 2;
|
|
605
|
+
f = n / b, l = s / b;
|
|
606
|
+
} else
|
|
607
|
+
f = n / (a.max - a.min), l = s / (c.max - c.min);
|
|
608
|
+
const u = Math.min(l, f), d = (n - (a.max - a.min) * u) / 2, h = (s - (c.max - c.min) * u) / 2;
|
|
609
|
+
return jt(r.map((b) => ({
|
|
610
|
+
radius: u * b.radius,
|
|
611
|
+
x: e + d + (b.x - a.min) * u,
|
|
612
|
+
y: e + h + (b.y - c.min) * u,
|
|
613
|
+
setid: b.setid
|
|
614
|
+
})));
|
|
615
|
+
}
|
|
616
|
+
function jt(t) {
|
|
617
|
+
const n = {};
|
|
618
|
+
for (const s of t) n[s.setid] = s;
|
|
619
|
+
return n;
|
|
620
|
+
}
|
|
621
|
+
function Ft(t) {
|
|
622
|
+
return Object.keys(t).map((n) => Object.assign(t[n], { setid: n }));
|
|
623
|
+
}
|
|
624
|
+
function ke(t = {}) {
|
|
625
|
+
let n = !1, s = 600, e = 350, i = 15, r = 1e3, a = Math.PI / 2, c = !0, f = null, l = !0, u = !0, d = null, h = null, b = !1, y = null, S = t && t.symmetricalTextCentre ? t.symmetricalTextCentre : !1, T = {}, m = t && t.colourScheme ? t.colourScheme : t && t.colorScheme ? t.colorScheme : [
|
|
626
|
+
"#1f77b4",
|
|
627
|
+
"#ff7f0e",
|
|
628
|
+
"#2ca02c",
|
|
629
|
+
"#d62728",
|
|
630
|
+
"#9467bd",
|
|
631
|
+
"#8c564b",
|
|
632
|
+
"#e377c2",
|
|
633
|
+
"#7f7f7f",
|
|
634
|
+
"#bcbd22",
|
|
635
|
+
"#17becf"
|
|
636
|
+
], g = 0, v = function(o) {
|
|
637
|
+
if (o in T) return T[o];
|
|
638
|
+
var _ = T[o] = m[g];
|
|
639
|
+
return g += 1, g >= m.length && (g = 0), _;
|
|
640
|
+
}, k = Dt, p = tt;
|
|
641
|
+
function x(o) {
|
|
642
|
+
let _ = o.datum();
|
|
643
|
+
const I = /* @__PURE__ */ new Set();
|
|
644
|
+
_.forEach((M) => {
|
|
645
|
+
M.size == 0 && M.sets.length == 1 && I.add(M.sets[0]);
|
|
646
|
+
}), _ = _.filter((M) => !M.sets.some((O) => I.has(O)));
|
|
647
|
+
let z = {}, N = {};
|
|
648
|
+
if (_.length > 0) {
|
|
649
|
+
let M = k(_, {
|
|
650
|
+
lossFunction: p,
|
|
651
|
+
distinct: b
|
|
652
|
+
});
|
|
653
|
+
c && (M = Ot(M, a, h)), z = Nt(M, s, e, i, f), N = Lt(z, _, S);
|
|
654
|
+
}
|
|
655
|
+
const K = {};
|
|
656
|
+
_.forEach((M) => {
|
|
657
|
+
M.label && (K[M.sets] = M.label);
|
|
658
|
+
});
|
|
659
|
+
function B(M) {
|
|
660
|
+
if (M.sets in K) return K[M.sets];
|
|
661
|
+
if (M.sets.length == 1) return "" + M.sets[0];
|
|
662
|
+
}
|
|
663
|
+
o.selectAll("svg").data([z]).enter().append("svg");
|
|
664
|
+
const A = o.select("svg");
|
|
665
|
+
n ? A.attr("viewBox", `0 0 ${s} ${e}`) : A.attr("width", s).attr("height", e);
|
|
666
|
+
const C = {};
|
|
667
|
+
let E = !1;
|
|
668
|
+
A.selectAll(".venn-area path").each(function(M) {
|
|
669
|
+
const O = this.getAttribute("d");
|
|
670
|
+
M.sets.length == 1 && O && !b && (E = !0, C[M.sets[0]] = Se(O));
|
|
671
|
+
});
|
|
672
|
+
function j(M) {
|
|
673
|
+
return (O) => wt(M.sets.map((Q) => {
|
|
674
|
+
let V = C[Q], Z = z[Q];
|
|
675
|
+
return V || (V = {
|
|
676
|
+
x: s / 2,
|
|
677
|
+
y: e / 2,
|
|
678
|
+
radius: 1
|
|
679
|
+
}), Z || (Z = {
|
|
680
|
+
x: s / 2,
|
|
681
|
+
y: e / 2,
|
|
682
|
+
radius: 1
|
|
683
|
+
}), {
|
|
684
|
+
x: V.x * (1 - O) + Z.x * O,
|
|
685
|
+
y: V.y * (1 - O) + Z.y * O,
|
|
686
|
+
radius: V.radius * (1 - O) + Z.radius * O
|
|
687
|
+
};
|
|
688
|
+
}), y);
|
|
689
|
+
}
|
|
690
|
+
const R = A.selectAll(".venn-area").data(_, (M) => M.sets), F = R.enter().append("g").attr("class", (M) => `venn-area venn-${M.sets.length == 1 ? "circle" : "intersection"}${M.colour || M.color ? " venn-coloured" : ""}`).attr("data-venn-sets", (M) => M.sets.join("_")), W = F.append("path"), H = F.append("text").attr("class", "label").text((M) => B(M)).attr("text-anchor", "middle").attr("dy", ".35em").attr("x", s / 2).attr("y", e / 2);
|
|
691
|
+
u && (W.style("fill-opacity", "0").filter((M) => M.sets.length == 1).style("fill", (M) => M.colour ? M.colour : M.color ? M.color : v(M.sets)).style("fill-opacity", ".25"), H.style("fill", (M) => M.colour || M.color ? "#FFF" : t.textFill ? t.textFill : M.sets.length == 1 ? v(M.sets) : "#444"));
|
|
692
|
+
function Y(M) {
|
|
693
|
+
return typeof M.transition == "function" ? M.transition("venn").duration(r) : M;
|
|
694
|
+
}
|
|
695
|
+
let D = o;
|
|
696
|
+
E && typeof D.transition == "function" ? (D = Y(o), D.selectAll("path").attrTween("d", j)) : D.selectAll("path").attr("d", (M) => wt(M.sets.map((O) => z[O])), y);
|
|
697
|
+
const q = D.selectAll("text").filter((M) => M.sets in N).text((M) => B(M)).attr("x", (M) => Math.floor(N[M.sets].x)).attr("y", (M) => Math.floor(N[M.sets].y));
|
|
698
|
+
l && (E ? "on" in q ? q.on("end", at(z, B)) : q.each("end", at(z, B)) : q.each(at(z, B)));
|
|
699
|
+
const L = Y(R.exit()).remove();
|
|
700
|
+
typeof R.transition == "function" && L.selectAll("path").attrTween("d", j);
|
|
701
|
+
const P = L.selectAll("text").attr("x", s / 2).attr("y", e / 2);
|
|
702
|
+
return d !== null && (H.style("font-size", "0px"), q.style("font-size", d), P.style("font-size", "0px")), {
|
|
703
|
+
circles: z,
|
|
704
|
+
textCentres: N,
|
|
705
|
+
nodes: R,
|
|
706
|
+
enter: F,
|
|
707
|
+
update: D,
|
|
708
|
+
exit: L
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
return x.wrap = function(o) {
|
|
712
|
+
return arguments.length ? (l = o, x) : l;
|
|
713
|
+
}, x.useViewBox = function() {
|
|
714
|
+
return n = !0, x;
|
|
715
|
+
}, x.width = function(o) {
|
|
716
|
+
return arguments.length ? (s = o, x) : s;
|
|
717
|
+
}, x.height = function(o) {
|
|
718
|
+
return arguments.length ? (e = o, x) : e;
|
|
719
|
+
}, x.padding = function(o) {
|
|
720
|
+
return arguments.length ? (i = o, x) : i;
|
|
721
|
+
}, x.distinct = function(o) {
|
|
722
|
+
return arguments.length ? (b = o, x) : b;
|
|
723
|
+
}, x.colours = function(o) {
|
|
724
|
+
return arguments.length ? (v = o, x) : v;
|
|
725
|
+
}, x.colors = function(o) {
|
|
726
|
+
return arguments.length ? (v = o, x) : v;
|
|
727
|
+
}, x.fontSize = function(o) {
|
|
728
|
+
return arguments.length ? (d = o, x) : d;
|
|
729
|
+
}, x.round = function(o) {
|
|
730
|
+
return arguments.length ? (y = o, x) : y;
|
|
731
|
+
}, x.duration = function(o) {
|
|
732
|
+
return arguments.length ? (r = o, x) : r;
|
|
733
|
+
}, x.layoutFunction = function(o) {
|
|
734
|
+
return arguments.length ? (k = o, x) : k;
|
|
735
|
+
}, x.normalize = function(o) {
|
|
736
|
+
return arguments.length ? (c = o, x) : c;
|
|
737
|
+
}, x.scaleToFit = function(o) {
|
|
738
|
+
return arguments.length ? (f = o, x) : f;
|
|
739
|
+
}, x.styled = function(o) {
|
|
740
|
+
return arguments.length ? (u = o, x) : u;
|
|
741
|
+
}, x.orientation = function(o) {
|
|
742
|
+
return arguments.length ? (a = o, x) : a;
|
|
743
|
+
}, x.orientationOrder = function(o) {
|
|
744
|
+
return arguments.length ? (h = o, x) : h;
|
|
745
|
+
}, x.lossFunction = function(o) {
|
|
746
|
+
return arguments.length ? (p = o === "default" ? tt : o === "logRatio" ? Rt : o, x) : p;
|
|
747
|
+
}, x;
|
|
748
|
+
}
|
|
749
|
+
function at(t, n) {
|
|
750
|
+
return function(s) {
|
|
751
|
+
const e = this, i = t[s.sets[0]].radius || 50, r = n(s) || "", a = r.split(/\s+/).reverse(), c = (r.length + a.length) / 3;
|
|
752
|
+
let f = a.pop(), l = [f], u = 0;
|
|
753
|
+
const d = 1.1;
|
|
754
|
+
e.textContent = null;
|
|
755
|
+
const h = [];
|
|
756
|
+
function b(g) {
|
|
757
|
+
const v = e.ownerDocument.createElementNS(e.namespaceURI, "tspan");
|
|
758
|
+
return v.textContent = g, h.push(v), e.append(v), v;
|
|
759
|
+
}
|
|
760
|
+
let y = b(f);
|
|
761
|
+
for (; f = a.pop(), !!f; ) {
|
|
762
|
+
l.push(f);
|
|
763
|
+
const g = l.join(" ");
|
|
764
|
+
y.textContent = g, g.length > c && y.getComputedTextLength() > i && (l.pop(), y.textContent = l.join(" "), l = [f], y = b(f), u++);
|
|
765
|
+
}
|
|
766
|
+
const S = 0.35 - u * d / 2, T = e.getAttribute("x"), m = e.getAttribute("y");
|
|
767
|
+
h.forEach((g, v) => {
|
|
768
|
+
g.setAttribute("x", T), g.setAttribute("y", m), g.setAttribute("dy", `${S + v * d}em`);
|
|
769
|
+
});
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
function lt(t, n, s) {
|
|
773
|
+
let e = n[0].radius - U(n[0], t);
|
|
774
|
+
for (let i = 1; i < n.length; ++i) {
|
|
775
|
+
const r = n[i].radius - U(n[i], t);
|
|
776
|
+
r <= e && (e = r);
|
|
777
|
+
}
|
|
778
|
+
for (let i = 0; i < s.length; ++i) {
|
|
779
|
+
const r = U(s[i], t) - s[i].radius;
|
|
780
|
+
r <= e && (e = r);
|
|
781
|
+
}
|
|
782
|
+
return e;
|
|
783
|
+
}
|
|
784
|
+
function Pt(t, n, s) {
|
|
785
|
+
const e = [];
|
|
786
|
+
for (const u of t)
|
|
787
|
+
e.push({
|
|
788
|
+
x: u.x,
|
|
789
|
+
y: u.y
|
|
790
|
+
}), e.push({
|
|
791
|
+
x: u.x + u.radius / 2,
|
|
792
|
+
y: u.y
|
|
793
|
+
}), e.push({
|
|
794
|
+
x: u.x - u.radius / 2,
|
|
795
|
+
y: u.y
|
|
796
|
+
}), e.push({
|
|
797
|
+
x: u.x,
|
|
798
|
+
y: u.y + u.radius / 2
|
|
799
|
+
}), e.push({
|
|
800
|
+
x: u.x,
|
|
801
|
+
y: u.y - u.radius / 2
|
|
802
|
+
});
|
|
803
|
+
let i = e[0], r = lt(e[0], t, n);
|
|
804
|
+
for (let u = 1; u < e.length; ++u) {
|
|
805
|
+
const d = lt(e[u], t, n);
|
|
806
|
+
d >= r && (i = e[u], r = d);
|
|
807
|
+
}
|
|
808
|
+
const a = At((u) => -1 * lt({
|
|
809
|
+
x: u[0],
|
|
810
|
+
y: u[1]
|
|
811
|
+
}, t, n), [i.x, i.y], {
|
|
812
|
+
maxIterations: 500,
|
|
813
|
+
minErrorDelta: 1e-10
|
|
814
|
+
}).x, c = {
|
|
815
|
+
x: s ? 0 : a[0],
|
|
816
|
+
y: a[1]
|
|
817
|
+
};
|
|
818
|
+
let f = !0;
|
|
819
|
+
for (const u of t) if (U(c, u) > u.radius) {
|
|
820
|
+
f = !1;
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
for (const u of n) if (U(c, u) < u.radius) {
|
|
824
|
+
f = !1;
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
if (f) return c;
|
|
828
|
+
if (t.length == 1) return {
|
|
829
|
+
x: t[0].x,
|
|
830
|
+
y: t[0].y
|
|
831
|
+
};
|
|
832
|
+
const l = {};
|
|
833
|
+
return st(t, l), l.arcs.length === 0 ? {
|
|
834
|
+
x: 0,
|
|
835
|
+
y: -1e3,
|
|
836
|
+
disjoint: !0
|
|
837
|
+
} : l.arcs.length == 1 ? {
|
|
838
|
+
x: l.arcs[0].circle.x,
|
|
839
|
+
y: l.arcs[0].circle.y
|
|
840
|
+
} : n.length ? Pt(t, []) : zt(l.arcs.map((u) => u.p1));
|
|
841
|
+
}
|
|
842
|
+
function Ie(t) {
|
|
843
|
+
const n = {}, s = Object.keys(t);
|
|
844
|
+
for (const e of s) n[e] = [];
|
|
845
|
+
for (let e = 0; e < s.length; e++) {
|
|
846
|
+
const i = s[e], r = t[i];
|
|
847
|
+
for (let a = e + 1; a < s.length; ++a) {
|
|
848
|
+
const c = s[a], f = t[c], l = U(r, f);
|
|
849
|
+
l + f.radius <= r.radius + 1e-10 ? n[c].push(i) : l + r.radius <= f.radius + 1e-10 && n[i].push(c);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return n;
|
|
853
|
+
}
|
|
854
|
+
function Lt(t, n, s) {
|
|
855
|
+
const e = {}, i = Ie(t);
|
|
856
|
+
for (let r = 0; r < n.length; ++r) {
|
|
857
|
+
const a = n[r].sets, c = {}, f = {};
|
|
858
|
+
for (let h = 0; h < a.length; ++h) {
|
|
859
|
+
c[a[h]] = !0;
|
|
860
|
+
const b = i[a[h]];
|
|
861
|
+
for (let y = 0; y < b.length; ++y) f[b[y]] = !0;
|
|
862
|
+
}
|
|
863
|
+
const l = [], u = [];
|
|
864
|
+
for (let h in t) h in c ? l.push(t[h]) : h in f || u.push(t[h]);
|
|
865
|
+
const d = Pt(l, u, s);
|
|
866
|
+
e[a] = d, d.disjoint && n[r].size > 0 && "" + a;
|
|
867
|
+
}
|
|
868
|
+
return e;
|
|
869
|
+
}
|
|
870
|
+
function Me(t, n, s) {
|
|
871
|
+
const e = [];
|
|
872
|
+
return e.push(`
|
|
873
|
+
M`, t, n), e.push(`
|
|
874
|
+
m`, -s, 0), e.push(`
|
|
875
|
+
a`, s, s, 0, 1, 0, s * 2, 0), e.push(`
|
|
876
|
+
a`, s, s, 0, 1, 0, -s * 2, 0), e.join(" ");
|
|
877
|
+
}
|
|
878
|
+
function Se(t) {
|
|
879
|
+
const n = t.split(" ");
|
|
880
|
+
return {
|
|
881
|
+
x: Number.parseFloat(n[1]),
|
|
882
|
+
y: Number.parseFloat(n[2]),
|
|
883
|
+
radius: -Number.parseFloat(n[4])
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
function Vt(t) {
|
|
887
|
+
if (t.length === 0) return [];
|
|
888
|
+
const n = {};
|
|
889
|
+
return st(t, n), n.arcs;
|
|
890
|
+
}
|
|
891
|
+
function Bt(t, n) {
|
|
892
|
+
if (t.length === 0) return "M 0 0";
|
|
893
|
+
const s = Math.pow(10, n || 0), e = n != null ? (r) => Math.round(r * s) / s : (r) => r;
|
|
894
|
+
if (t.length == 1) {
|
|
895
|
+
const r = t[0].circle;
|
|
896
|
+
return Me(e(r.x), e(r.y), e(r.radius));
|
|
897
|
+
}
|
|
898
|
+
const i = [
|
|
899
|
+
`
|
|
900
|
+
M`,
|
|
901
|
+
e(t[0].p2.x),
|
|
902
|
+
e(t[0].p2.y)
|
|
903
|
+
];
|
|
904
|
+
for (const r of t) {
|
|
905
|
+
const a = e(r.circle.radius);
|
|
906
|
+
i.push(`
|
|
907
|
+
A`, a, a, 0, r.large ? 1 : 0, r.sweep ? 1 : 0, e(r.p1.x), e(r.p1.y));
|
|
908
|
+
}
|
|
909
|
+
return i.join(" ");
|
|
910
|
+
}
|
|
911
|
+
function wt(t, n) {
|
|
912
|
+
return Bt(Vt(t), n);
|
|
913
|
+
}
|
|
914
|
+
function we(t, n = {}) {
|
|
915
|
+
const { lossFunction: s, layoutFunction: e = Dt, normalize: i = !0, orientation: r = Math.PI / 2, orientationOrder: a, width: c = 600, height: f = 350, padding: l = 15, scaleToFit: u = !1, symmetricalTextCentre: d = !1, distinct: h, round: b = 2 } = n;
|
|
916
|
+
let y = e(t, {
|
|
917
|
+
lossFunction: s === "default" || !s ? tt : s === "logRatio" ? Rt : s,
|
|
918
|
+
distinct: h
|
|
919
|
+
});
|
|
920
|
+
i && (y = Ot(y, r, a));
|
|
921
|
+
const S = Nt(y, c, f, l, u), T = Lt(S, t, d), m = new Map(Object.keys(S).map((k) => [k, {
|
|
922
|
+
set: k,
|
|
923
|
+
x: S[k].x,
|
|
924
|
+
y: S[k].y,
|
|
925
|
+
radius: S[k].radius
|
|
926
|
+
}])), g = t.map((k) => {
|
|
927
|
+
const p = k.sets.map((o) => m.get(o)), x = Vt(p);
|
|
928
|
+
return {
|
|
929
|
+
circles: p,
|
|
930
|
+
arcs: x,
|
|
931
|
+
path: Bt(x, b),
|
|
932
|
+
area: k,
|
|
933
|
+
has: new Set(k.sets)
|
|
934
|
+
};
|
|
935
|
+
});
|
|
936
|
+
function v(k) {
|
|
937
|
+
let p = "";
|
|
938
|
+
for (const x of g) x.has.size > k.length && k.every((o) => x.has.has(o)) && (p += " " + x.path);
|
|
939
|
+
return p;
|
|
940
|
+
}
|
|
941
|
+
return g.map(({ circles: k, arcs: p, path: x, area: o }) => ({
|
|
942
|
+
data: o,
|
|
943
|
+
text: T[o.sets],
|
|
944
|
+
circles: k,
|
|
945
|
+
arcs: p,
|
|
946
|
+
path: x,
|
|
947
|
+
distinctPath: x + v(o.sets)
|
|
948
|
+
}));
|
|
949
|
+
}
|
|
950
|
+
var yt = (function() {
|
|
951
|
+
var t = /* @__PURE__ */ w(function(m, g, v, k) {
|
|
952
|
+
for (v = v || {}, k = m.length; k--; v[m[k]] = g) ;
|
|
953
|
+
return v;
|
|
954
|
+
}, "o"), n = [5, 8], s = [
|
|
955
|
+
7,
|
|
956
|
+
8,
|
|
957
|
+
11,
|
|
958
|
+
12,
|
|
959
|
+
17,
|
|
960
|
+
19,
|
|
961
|
+
22,
|
|
962
|
+
24
|
|
963
|
+
], e = [1, 17], i = [1, 18], r = [
|
|
964
|
+
7,
|
|
965
|
+
8,
|
|
966
|
+
11,
|
|
967
|
+
12,
|
|
968
|
+
14,
|
|
969
|
+
15,
|
|
970
|
+
16,
|
|
971
|
+
17,
|
|
972
|
+
19,
|
|
973
|
+
20,
|
|
974
|
+
21,
|
|
975
|
+
22,
|
|
976
|
+
24,
|
|
977
|
+
27
|
|
978
|
+
], a = [1, 31], c = [1, 39], f = [
|
|
979
|
+
7,
|
|
980
|
+
8,
|
|
981
|
+
11,
|
|
982
|
+
12,
|
|
983
|
+
17,
|
|
984
|
+
19,
|
|
985
|
+
22,
|
|
986
|
+
24,
|
|
987
|
+
27
|
|
988
|
+
], l = [1, 57], u = [1, 56], d = [1, 58], h = [1, 59], b = [1, 60], y = [
|
|
989
|
+
7,
|
|
990
|
+
8,
|
|
991
|
+
11,
|
|
992
|
+
12,
|
|
993
|
+
16,
|
|
994
|
+
17,
|
|
995
|
+
19,
|
|
996
|
+
20,
|
|
997
|
+
22,
|
|
998
|
+
24,
|
|
999
|
+
27,
|
|
1000
|
+
31,
|
|
1001
|
+
32,
|
|
1002
|
+
33
|
|
1003
|
+
], S = {
|
|
1004
|
+
trace: /* @__PURE__ */ w(function() {
|
|
1005
|
+
}, "trace"),
|
|
1006
|
+
yy: {},
|
|
1007
|
+
symbols_: {
|
|
1008
|
+
error: 2,
|
|
1009
|
+
start: 3,
|
|
1010
|
+
optNewlines: 4,
|
|
1011
|
+
VENN: 5,
|
|
1012
|
+
document: 6,
|
|
1013
|
+
EOF: 7,
|
|
1014
|
+
NEWLINE: 8,
|
|
1015
|
+
line: 9,
|
|
1016
|
+
statement: 10,
|
|
1017
|
+
TITLE: 11,
|
|
1018
|
+
SET: 12,
|
|
1019
|
+
identifier: 13,
|
|
1020
|
+
BRACKET_LABEL: 14,
|
|
1021
|
+
COLON: 15,
|
|
1022
|
+
NUMERIC: 16,
|
|
1023
|
+
UNION: 17,
|
|
1024
|
+
identifierList: 18,
|
|
1025
|
+
TEXT: 19,
|
|
1026
|
+
IDENTIFIER: 20,
|
|
1027
|
+
STRING: 21,
|
|
1028
|
+
INDENT_TEXT: 22,
|
|
1029
|
+
indentedTextTail: 23,
|
|
1030
|
+
STYLE: 24,
|
|
1031
|
+
stylesOpt: 25,
|
|
1032
|
+
styleField: 26,
|
|
1033
|
+
COMMA: 27,
|
|
1034
|
+
styleValue: 28,
|
|
1035
|
+
valueTokens: 29,
|
|
1036
|
+
valueToken: 30,
|
|
1037
|
+
HEXCOLOR: 31,
|
|
1038
|
+
RGBCOLOR: 32,
|
|
1039
|
+
RGBACOLOR: 33,
|
|
1040
|
+
$accept: 0,
|
|
1041
|
+
$end: 1
|
|
1042
|
+
},
|
|
1043
|
+
terminals_: {
|
|
1044
|
+
2: "error",
|
|
1045
|
+
5: "VENN",
|
|
1046
|
+
7: "EOF",
|
|
1047
|
+
8: "NEWLINE",
|
|
1048
|
+
11: "TITLE",
|
|
1049
|
+
12: "SET",
|
|
1050
|
+
14: "BRACKET_LABEL",
|
|
1051
|
+
15: "COLON",
|
|
1052
|
+
16: "NUMERIC",
|
|
1053
|
+
17: "UNION",
|
|
1054
|
+
19: "TEXT",
|
|
1055
|
+
20: "IDENTIFIER",
|
|
1056
|
+
21: "STRING",
|
|
1057
|
+
22: "INDENT_TEXT",
|
|
1058
|
+
24: "STYLE",
|
|
1059
|
+
27: "COMMA",
|
|
1060
|
+
31: "HEXCOLOR",
|
|
1061
|
+
32: "RGBCOLOR",
|
|
1062
|
+
33: "RGBACOLOR"
|
|
1063
|
+
},
|
|
1064
|
+
productions_: [
|
|
1065
|
+
0,
|
|
1066
|
+
[3, 4],
|
|
1067
|
+
[4, 0],
|
|
1068
|
+
[4, 2],
|
|
1069
|
+
[6, 0],
|
|
1070
|
+
[6, 2],
|
|
1071
|
+
[9, 1],
|
|
1072
|
+
[9, 1],
|
|
1073
|
+
[10, 1],
|
|
1074
|
+
[10, 2],
|
|
1075
|
+
[10, 3],
|
|
1076
|
+
[10, 4],
|
|
1077
|
+
[10, 5],
|
|
1078
|
+
[10, 2],
|
|
1079
|
+
[10, 3],
|
|
1080
|
+
[10, 4],
|
|
1081
|
+
[10, 5],
|
|
1082
|
+
[10, 3],
|
|
1083
|
+
[10, 3],
|
|
1084
|
+
[10, 3],
|
|
1085
|
+
[10, 4],
|
|
1086
|
+
[10, 4],
|
|
1087
|
+
[10, 2],
|
|
1088
|
+
[10, 3],
|
|
1089
|
+
[23, 1],
|
|
1090
|
+
[23, 1],
|
|
1091
|
+
[23, 1],
|
|
1092
|
+
[23, 2],
|
|
1093
|
+
[23, 2],
|
|
1094
|
+
[25, 1],
|
|
1095
|
+
[25, 3],
|
|
1096
|
+
[26, 3],
|
|
1097
|
+
[28, 1],
|
|
1098
|
+
[28, 1],
|
|
1099
|
+
[29, 1],
|
|
1100
|
+
[29, 2],
|
|
1101
|
+
[30, 1],
|
|
1102
|
+
[30, 1],
|
|
1103
|
+
[30, 1],
|
|
1104
|
+
[30, 1],
|
|
1105
|
+
[30, 1],
|
|
1106
|
+
[18, 1],
|
|
1107
|
+
[18, 3],
|
|
1108
|
+
[13, 1],
|
|
1109
|
+
[13, 1]
|
|
1110
|
+
],
|
|
1111
|
+
performAction: /* @__PURE__ */ w(function(g, v, k, p, x, o, _) {
|
|
1112
|
+
var I = o.length - 1;
|
|
1113
|
+
switch (x) {
|
|
1114
|
+
case 1:
|
|
1115
|
+
return o[I - 1];
|
|
1116
|
+
case 2:
|
|
1117
|
+
case 3:
|
|
1118
|
+
case 4:
|
|
1119
|
+
this.$ = [];
|
|
1120
|
+
break;
|
|
1121
|
+
case 5:
|
|
1122
|
+
o[I - 1].push(o[I]), this.$ = o[I - 1];
|
|
1123
|
+
break;
|
|
1124
|
+
case 6:
|
|
1125
|
+
this.$ = [];
|
|
1126
|
+
break;
|
|
1127
|
+
case 7:
|
|
1128
|
+
case 22:
|
|
1129
|
+
case 32:
|
|
1130
|
+
case 36:
|
|
1131
|
+
case 37:
|
|
1132
|
+
case 38:
|
|
1133
|
+
case 39:
|
|
1134
|
+
case 40:
|
|
1135
|
+
this.$ = o[I];
|
|
1136
|
+
break;
|
|
1137
|
+
case 8:
|
|
1138
|
+
p.setDiagramTitle(o[I].substr(6)), this.$ = o[I].substr(6);
|
|
1139
|
+
break;
|
|
1140
|
+
case 9:
|
|
1141
|
+
p.addSubsetData([o[I]], void 0, void 0), p.setIndentMode && p.setIndentMode(!0);
|
|
1142
|
+
break;
|
|
1143
|
+
case 10:
|
|
1144
|
+
p.addSubsetData([o[I - 1]], o[I], void 0), p.setIndentMode && p.setIndentMode(!0);
|
|
1145
|
+
break;
|
|
1146
|
+
case 11:
|
|
1147
|
+
p.addSubsetData([o[I - 2]], void 0, parseFloat(o[I])), p.setIndentMode && p.setIndentMode(!0);
|
|
1148
|
+
break;
|
|
1149
|
+
case 12:
|
|
1150
|
+
p.addSubsetData([o[I - 3]], o[I - 2], parseFloat(o[I])), p.setIndentMode && p.setIndentMode(!0);
|
|
1151
|
+
break;
|
|
1152
|
+
case 13:
|
|
1153
|
+
if (o[I].length < 2) throw new Error("union requires multiple identifiers");
|
|
1154
|
+
p.validateUnionIdentifiers && p.validateUnionIdentifiers(o[I]), p.addSubsetData(o[I], void 0, void 0), p.setIndentMode && p.setIndentMode(!0);
|
|
1155
|
+
break;
|
|
1156
|
+
case 14:
|
|
1157
|
+
if (o[I - 1].length < 2) throw new Error("union requires multiple identifiers");
|
|
1158
|
+
p.validateUnionIdentifiers && p.validateUnionIdentifiers(o[I - 1]), p.addSubsetData(o[I - 1], o[I], void 0), p.setIndentMode && p.setIndentMode(!0);
|
|
1159
|
+
break;
|
|
1160
|
+
case 15:
|
|
1161
|
+
if (o[I - 2].length < 2) throw new Error("union requires multiple identifiers");
|
|
1162
|
+
p.validateUnionIdentifiers && p.validateUnionIdentifiers(o[I - 2]), p.addSubsetData(o[I - 2], void 0, parseFloat(o[I])), p.setIndentMode && p.setIndentMode(!0);
|
|
1163
|
+
break;
|
|
1164
|
+
case 16:
|
|
1165
|
+
if (o[I - 3].length < 2) throw new Error("union requires multiple identifiers");
|
|
1166
|
+
p.validateUnionIdentifiers && p.validateUnionIdentifiers(o[I - 3]), p.addSubsetData(o[I - 3], o[I - 2], parseFloat(o[I])), p.setIndentMode && p.setIndentMode(!0);
|
|
1167
|
+
break;
|
|
1168
|
+
case 17:
|
|
1169
|
+
case 18:
|
|
1170
|
+
case 19:
|
|
1171
|
+
p.addTextData(o[I - 1], o[I], void 0);
|
|
1172
|
+
break;
|
|
1173
|
+
case 20:
|
|
1174
|
+
case 21:
|
|
1175
|
+
p.addTextData(o[I - 2], o[I - 1], o[I]);
|
|
1176
|
+
break;
|
|
1177
|
+
case 23:
|
|
1178
|
+
p.addStyleData(o[I - 1], o[I]);
|
|
1179
|
+
break;
|
|
1180
|
+
case 24:
|
|
1181
|
+
case 25:
|
|
1182
|
+
case 26:
|
|
1183
|
+
var z = p.getCurrentSets();
|
|
1184
|
+
if (!z) throw new Error("text requires set");
|
|
1185
|
+
p.addTextData(z, o[I], void 0);
|
|
1186
|
+
break;
|
|
1187
|
+
case 27:
|
|
1188
|
+
case 28:
|
|
1189
|
+
var z = p.getCurrentSets();
|
|
1190
|
+
if (!z) throw new Error("text requires set");
|
|
1191
|
+
p.addTextData(z, o[I - 1], o[I]);
|
|
1192
|
+
break;
|
|
1193
|
+
case 29:
|
|
1194
|
+
case 41:
|
|
1195
|
+
this.$ = [o[I]];
|
|
1196
|
+
break;
|
|
1197
|
+
case 30:
|
|
1198
|
+
case 42:
|
|
1199
|
+
this.$ = [...o[I - 2], o[I]];
|
|
1200
|
+
break;
|
|
1201
|
+
case 31:
|
|
1202
|
+
this.$ = [o[I - 2], o[I]];
|
|
1203
|
+
break;
|
|
1204
|
+
case 33:
|
|
1205
|
+
this.$ = o[I].join(" ");
|
|
1206
|
+
break;
|
|
1207
|
+
case 34:
|
|
1208
|
+
this.$ = [o[I]];
|
|
1209
|
+
break;
|
|
1210
|
+
case 35:
|
|
1211
|
+
o[I - 1].push(o[I]), this.$ = o[I - 1];
|
|
1212
|
+
break;
|
|
1213
|
+
case 43:
|
|
1214
|
+
case 44:
|
|
1215
|
+
this.$ = o[I];
|
|
1216
|
+
break;
|
|
1217
|
+
}
|
|
1218
|
+
}, "anonymous"),
|
|
1219
|
+
table: [
|
|
1220
|
+
t(n, [2, 2], {
|
|
1221
|
+
3: 1,
|
|
1222
|
+
4: 2
|
|
1223
|
+
}),
|
|
1224
|
+
{ 1: [3] },
|
|
1225
|
+
{
|
|
1226
|
+
5: [1, 3],
|
|
1227
|
+
8: [1, 4]
|
|
1228
|
+
},
|
|
1229
|
+
t(s, [2, 4], { 6: 5 }),
|
|
1230
|
+
t(n, [2, 3]),
|
|
1231
|
+
{
|
|
1232
|
+
7: [1, 6],
|
|
1233
|
+
8: [1, 8],
|
|
1234
|
+
9: 7,
|
|
1235
|
+
10: 9,
|
|
1236
|
+
11: [1, 10],
|
|
1237
|
+
12: [1, 11],
|
|
1238
|
+
17: [1, 12],
|
|
1239
|
+
19: [1, 13],
|
|
1240
|
+
22: [1, 14],
|
|
1241
|
+
24: [1, 15]
|
|
1242
|
+
},
|
|
1243
|
+
{ 1: [2, 1] },
|
|
1244
|
+
t(s, [2, 5]),
|
|
1245
|
+
t(s, [2, 6]),
|
|
1246
|
+
t(s, [2, 7]),
|
|
1247
|
+
t(s, [2, 8]),
|
|
1248
|
+
{
|
|
1249
|
+
13: 16,
|
|
1250
|
+
20: e,
|
|
1251
|
+
21: i
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
13: 20,
|
|
1255
|
+
18: 19,
|
|
1256
|
+
20: e,
|
|
1257
|
+
21: i
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
13: 20,
|
|
1261
|
+
18: 21,
|
|
1262
|
+
20: e,
|
|
1263
|
+
21: i
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
16: [1, 25],
|
|
1267
|
+
20: [1, 23],
|
|
1268
|
+
21: [1, 24],
|
|
1269
|
+
23: 22
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
13: 20,
|
|
1273
|
+
18: 26,
|
|
1274
|
+
20: e,
|
|
1275
|
+
21: i
|
|
1276
|
+
},
|
|
1277
|
+
t(s, [2, 9], {
|
|
1278
|
+
14: [1, 27],
|
|
1279
|
+
15: [1, 28]
|
|
1280
|
+
}),
|
|
1281
|
+
t(r, [2, 43]),
|
|
1282
|
+
t(r, [2, 44]),
|
|
1283
|
+
t(s, [2, 13], {
|
|
1284
|
+
14: [1, 29],
|
|
1285
|
+
15: [1, 30],
|
|
1286
|
+
27: a
|
|
1287
|
+
}),
|
|
1288
|
+
t(r, [2, 41]),
|
|
1289
|
+
{
|
|
1290
|
+
16: [1, 34],
|
|
1291
|
+
20: [1, 32],
|
|
1292
|
+
21: [1, 33],
|
|
1293
|
+
27: a
|
|
1294
|
+
},
|
|
1295
|
+
t(s, [2, 22]),
|
|
1296
|
+
t(s, [2, 24], { 14: [1, 35] }),
|
|
1297
|
+
t(s, [2, 25], { 14: [1, 36] }),
|
|
1298
|
+
t(s, [2, 26]),
|
|
1299
|
+
{
|
|
1300
|
+
20: c,
|
|
1301
|
+
25: 37,
|
|
1302
|
+
26: 38,
|
|
1303
|
+
27: a
|
|
1304
|
+
},
|
|
1305
|
+
t(s, [2, 10], { 15: [1, 40] }),
|
|
1306
|
+
{ 16: [1, 41] },
|
|
1307
|
+
t(s, [2, 14], { 15: [1, 42] }),
|
|
1308
|
+
{ 16: [1, 43] },
|
|
1309
|
+
{
|
|
1310
|
+
13: 44,
|
|
1311
|
+
20: e,
|
|
1312
|
+
21: i
|
|
1313
|
+
},
|
|
1314
|
+
t(s, [2, 17], { 14: [1, 45] }),
|
|
1315
|
+
t(s, [2, 18], { 14: [1, 46] }),
|
|
1316
|
+
t(s, [2, 19]),
|
|
1317
|
+
t(s, [2, 27]),
|
|
1318
|
+
t(s, [2, 28]),
|
|
1319
|
+
t(s, [2, 23], { 27: [1, 47] }),
|
|
1320
|
+
t(f, [2, 29]),
|
|
1321
|
+
{ 15: [1, 48] },
|
|
1322
|
+
{ 16: [1, 49] },
|
|
1323
|
+
t(s, [2, 11]),
|
|
1324
|
+
{ 16: [1, 50] },
|
|
1325
|
+
t(s, [2, 15]),
|
|
1326
|
+
t(r, [2, 42]),
|
|
1327
|
+
t(s, [2, 20]),
|
|
1328
|
+
t(s, [2, 21]),
|
|
1329
|
+
{
|
|
1330
|
+
20: c,
|
|
1331
|
+
26: 51
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
16: l,
|
|
1335
|
+
20: u,
|
|
1336
|
+
21: [1, 53],
|
|
1337
|
+
28: 52,
|
|
1338
|
+
29: 54,
|
|
1339
|
+
30: 55,
|
|
1340
|
+
31: d,
|
|
1341
|
+
32: h,
|
|
1342
|
+
33: b
|
|
1343
|
+
},
|
|
1344
|
+
t(s, [2, 12]),
|
|
1345
|
+
t(s, [2, 16]),
|
|
1346
|
+
t(f, [2, 30]),
|
|
1347
|
+
t(f, [2, 31]),
|
|
1348
|
+
t(f, [2, 32]),
|
|
1349
|
+
t(f, [2, 33], {
|
|
1350
|
+
30: 61,
|
|
1351
|
+
16: l,
|
|
1352
|
+
20: u,
|
|
1353
|
+
31: d,
|
|
1354
|
+
32: h,
|
|
1355
|
+
33: b
|
|
1356
|
+
}),
|
|
1357
|
+
t(y, [2, 34]),
|
|
1358
|
+
t(y, [2, 36]),
|
|
1359
|
+
t(y, [2, 37]),
|
|
1360
|
+
t(y, [2, 38]),
|
|
1361
|
+
t(y, [2, 39]),
|
|
1362
|
+
t(y, [2, 40]),
|
|
1363
|
+
t(y, [2, 35])
|
|
1364
|
+
],
|
|
1365
|
+
defaultActions: { 6: [2, 1] },
|
|
1366
|
+
parseError: /* @__PURE__ */ w(function(g, v) {
|
|
1367
|
+
if (v.recoverable) this.trace(g);
|
|
1368
|
+
else {
|
|
1369
|
+
var k = new Error(g);
|
|
1370
|
+
throw k.hash = v, k;
|
|
1371
|
+
}
|
|
1372
|
+
}, "parseError"),
|
|
1373
|
+
parse: /* @__PURE__ */ w(function(g) {
|
|
1374
|
+
var v = this, k = [0], p = [], x = [null], o = [], _ = this.table, I = "", z = 0, N = 0, K = 0, B = 2, A = 1, C = o.slice.call(arguments, 1), E = Object.create(this.lexer), j = { yy: {} };
|
|
1375
|
+
for (var R in this.yy) Object.prototype.hasOwnProperty.call(this.yy, R) && (j.yy[R] = this.yy[R]);
|
|
1376
|
+
E.setInput(g, j.yy), j.yy.lexer = E, j.yy.parser = this, typeof E.yylloc > "u" && (E.yylloc = {});
|
|
1377
|
+
var F = E.yylloc;
|
|
1378
|
+
o.push(F);
|
|
1379
|
+
var W = E.options && E.options.ranges;
|
|
1380
|
+
typeof j.yy.parseError == "function" ? this.parseError = j.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
1381
|
+
function H(G) {
|
|
1382
|
+
k.length = k.length - 2 * G, x.length = x.length - G, o.length = o.length - G;
|
|
1383
|
+
}
|
|
1384
|
+
w(H, "popStack");
|
|
1385
|
+
function Y() {
|
|
1386
|
+
var G = p.pop() || E.lex() || A;
|
|
1387
|
+
return typeof G != "number" && (G instanceof Array && (p = G, G = p.pop()), G = v.symbols_[G] || G), G;
|
|
1388
|
+
}
|
|
1389
|
+
w(Y, "lex");
|
|
1390
|
+
for (var D, q, L, P, M, O = {}, Q, V, Z, nt; ; ) {
|
|
1391
|
+
if (L = k[k.length - 1], this.defaultActions[L] ? P = this.defaultActions[L] : ((D === null || typeof D > "u") && (D = Y()), P = _[L] && _[L][D]), typeof P > "u" || !P.length || !P[0]) {
|
|
1392
|
+
var rt = "";
|
|
1393
|
+
nt = [];
|
|
1394
|
+
for (Q in _[L]) this.terminals_[Q] && Q > B && nt.push("'" + this.terminals_[Q] + "'");
|
|
1395
|
+
E.showPosition ? rt = "Parse error on line " + (z + 1) + `:
|
|
1396
|
+
` + E.showPosition() + `
|
|
1397
|
+
Expecting ` + nt.join(", ") + ", got '" + (this.terminals_[D] || D) + "'" : rt = "Parse error on line " + (z + 1) + ": Unexpected " + (D == A ? "end of input" : "'" + (this.terminals_[D] || D) + "'"), this.parseError(rt, {
|
|
1398
|
+
text: E.match,
|
|
1399
|
+
token: this.terminals_[D] || D,
|
|
1400
|
+
line: E.yylineno,
|
|
1401
|
+
loc: F,
|
|
1402
|
+
expected: nt
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
if (P[0] instanceof Array && P.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + D);
|
|
1406
|
+
switch (P[0]) {
|
|
1407
|
+
case 1:
|
|
1408
|
+
k.push(D), x.push(E.yytext), o.push(E.yylloc), k.push(P[1]), D = null, q ? (D = q, q = null) : (N = E.yyleng, I = E.yytext, z = E.yylineno, F = E.yylloc, K > 0 && K--);
|
|
1409
|
+
break;
|
|
1410
|
+
case 2:
|
|
1411
|
+
if (V = this.productions_[P[1]][1], O.$ = x[x.length - V], O._$ = {
|
|
1412
|
+
first_line: o[o.length - (V || 1)].first_line,
|
|
1413
|
+
last_line: o[o.length - 1].last_line,
|
|
1414
|
+
first_column: o[o.length - (V || 1)].first_column,
|
|
1415
|
+
last_column: o[o.length - 1].last_column
|
|
1416
|
+
}, W && (O._$.range = [o[o.length - (V || 1)].range[0], o[o.length - 1].range[1]]), M = this.performAction.apply(O, [
|
|
1417
|
+
I,
|
|
1418
|
+
N,
|
|
1419
|
+
z,
|
|
1420
|
+
j.yy,
|
|
1421
|
+
P[1],
|
|
1422
|
+
x,
|
|
1423
|
+
o
|
|
1424
|
+
].concat(C)), typeof M < "u") return M;
|
|
1425
|
+
V && (k = k.slice(0, -1 * V * 2), x = x.slice(0, -1 * V), o = o.slice(0, -1 * V)), k.push(this.productions_[P[1]][0]), x.push(O.$), o.push(O._$), Z = _[k[k.length - 2]][k[k.length - 1]], k.push(Z);
|
|
1426
|
+
break;
|
|
1427
|
+
case 3:
|
|
1428
|
+
return !0;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
return !0;
|
|
1432
|
+
}, "parse")
|
|
1433
|
+
};
|
|
1434
|
+
S.lexer = /* @__PURE__ */ (function() {
|
|
1435
|
+
return {
|
|
1436
|
+
EOF: 1,
|
|
1437
|
+
parseError: /* @__PURE__ */ w(function(g, v) {
|
|
1438
|
+
if (this.yy.parser) this.yy.parser.parseError(g, v);
|
|
1439
|
+
else throw new Error(g);
|
|
1440
|
+
}, "parseError"),
|
|
1441
|
+
setInput: /* @__PURE__ */ w(function(m, g) {
|
|
1442
|
+
return this.yy = g || this.yy || {}, this._input = m, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
1443
|
+
first_line: 1,
|
|
1444
|
+
first_column: 0,
|
|
1445
|
+
last_line: 1,
|
|
1446
|
+
last_column: 0
|
|
1447
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
1448
|
+
}, "setInput"),
|
|
1449
|
+
input: /* @__PURE__ */ w(function() {
|
|
1450
|
+
var m = this._input[0];
|
|
1451
|
+
return this.yytext += m, this.yyleng++, this.offset++, this.match += m, this.matched += m, m.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), m;
|
|
1452
|
+
}, "input"),
|
|
1453
|
+
unput: /* @__PURE__ */ w(function(m) {
|
|
1454
|
+
var g = m.length, v = m.split(/(?:\r\n?|\n)/g);
|
|
1455
|
+
this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - g), this.offset -= g;
|
|
1456
|
+
var k = this.match.split(/(?:\r\n?|\n)/g);
|
|
1457
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), v.length - 1 && (this.yylineno -= v.length - 1);
|
|
1458
|
+
var p = this.yylloc.range;
|
|
1459
|
+
return this.yylloc = {
|
|
1460
|
+
first_line: this.yylloc.first_line,
|
|
1461
|
+
last_line: this.yylineno + 1,
|
|
1462
|
+
first_column: this.yylloc.first_column,
|
|
1463
|
+
last_column: v ? (v.length === k.length ? this.yylloc.first_column : 0) + k[k.length - v.length].length - v[0].length : this.yylloc.first_column - g
|
|
1464
|
+
}, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - g]), this.yyleng = this.yytext.length, this;
|
|
1465
|
+
}, "unput"),
|
|
1466
|
+
more: /* @__PURE__ */ w(function() {
|
|
1467
|
+
return this._more = !0, this;
|
|
1468
|
+
}, "more"),
|
|
1469
|
+
reject: /* @__PURE__ */ w(function() {
|
|
1470
|
+
if (this.options.backtrack_lexer) this._backtrack = !0;
|
|
1471
|
+
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
1472
|
+
` + this.showPosition(), {
|
|
1473
|
+
text: "",
|
|
1474
|
+
token: null,
|
|
1475
|
+
line: this.yylineno
|
|
1476
|
+
});
|
|
1477
|
+
return this;
|
|
1478
|
+
}, "reject"),
|
|
1479
|
+
less: /* @__PURE__ */ w(function(m) {
|
|
1480
|
+
this.unput(this.match.slice(m));
|
|
1481
|
+
}, "less"),
|
|
1482
|
+
pastInput: /* @__PURE__ */ w(function() {
|
|
1483
|
+
var m = this.matched.substr(0, this.matched.length - this.match.length);
|
|
1484
|
+
return (m.length > 20 ? "..." : "") + m.substr(-20).replace(/\n/g, "");
|
|
1485
|
+
}, "pastInput"),
|
|
1486
|
+
upcomingInput: /* @__PURE__ */ w(function() {
|
|
1487
|
+
var m = this.match;
|
|
1488
|
+
return m.length < 20 && (m += this._input.substr(0, 20 - m.length)), (m.substr(0, 20) + (m.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
1489
|
+
}, "upcomingInput"),
|
|
1490
|
+
showPosition: /* @__PURE__ */ w(function() {
|
|
1491
|
+
var m = this.pastInput(), g = new Array(m.length + 1).join("-");
|
|
1492
|
+
return m + this.upcomingInput() + `
|
|
1493
|
+
` + g + "^";
|
|
1494
|
+
}, "showPosition"),
|
|
1495
|
+
test_match: /* @__PURE__ */ w(function(m, g) {
|
|
1496
|
+
var v, k, p;
|
|
1497
|
+
if (this.options.backtrack_lexer && (p = {
|
|
1498
|
+
yylineno: this.yylineno,
|
|
1499
|
+
yylloc: {
|
|
1500
|
+
first_line: this.yylloc.first_line,
|
|
1501
|
+
last_line: this.last_line,
|
|
1502
|
+
first_column: this.yylloc.first_column,
|
|
1503
|
+
last_column: this.yylloc.last_column
|
|
1504
|
+
},
|
|
1505
|
+
yytext: this.yytext,
|
|
1506
|
+
match: this.match,
|
|
1507
|
+
matches: this.matches,
|
|
1508
|
+
matched: this.matched,
|
|
1509
|
+
yyleng: this.yyleng,
|
|
1510
|
+
offset: this.offset,
|
|
1511
|
+
_more: this._more,
|
|
1512
|
+
_input: this._input,
|
|
1513
|
+
yy: this.yy,
|
|
1514
|
+
conditionStack: this.conditionStack.slice(0),
|
|
1515
|
+
done: this.done
|
|
1516
|
+
}, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), k = m[0].match(/(?:\r\n?|\n).*/g), k && (this.yylineno += k.length), this.yylloc = {
|
|
1517
|
+
first_line: this.yylloc.last_line,
|
|
1518
|
+
last_line: this.yylineno + 1,
|
|
1519
|
+
first_column: this.yylloc.last_column,
|
|
1520
|
+
last_column: k ? k[k.length - 1].length - k[k.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + m[0].length
|
|
1521
|
+
}, this.yytext += m[0], this.match += m[0], this.matches = m, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(m[0].length), this.matched += m[0], v = this.performAction.call(this, this.yy, this, g, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), v) return v;
|
|
1522
|
+
if (this._backtrack) {
|
|
1523
|
+
for (var x in p) this[x] = p[x];
|
|
1524
|
+
return !1;
|
|
1525
|
+
}
|
|
1526
|
+
return !1;
|
|
1527
|
+
}, "test_match"),
|
|
1528
|
+
next: /* @__PURE__ */ w(function() {
|
|
1529
|
+
if (this.done) return this.EOF;
|
|
1530
|
+
this._input || (this.done = !0);
|
|
1531
|
+
var m, g, v, k;
|
|
1532
|
+
this._more || (this.yytext = "", this.match = "");
|
|
1533
|
+
for (var p = this._currentRules(), x = 0; x < p.length; x++)
|
|
1534
|
+
if (v = this._input.match(this.rules[p[x]]), v && (!g || v[0].length > g[0].length)) {
|
|
1535
|
+
if (g = v, k = x, this.options.backtrack_lexer) {
|
|
1536
|
+
if (m = this.test_match(v, p[x]), m !== !1) return m;
|
|
1537
|
+
if (this._backtrack) {
|
|
1538
|
+
g = !1;
|
|
1539
|
+
continue;
|
|
1540
|
+
} else return !1;
|
|
1541
|
+
} else if (!this.options.flex) break;
|
|
1542
|
+
}
|
|
1543
|
+
return g ? (m = this.test_match(g, p[k]), m !== !1 ? m : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
1544
|
+
` + this.showPosition(), {
|
|
1545
|
+
text: "",
|
|
1546
|
+
token: null,
|
|
1547
|
+
line: this.yylineno
|
|
1548
|
+
});
|
|
1549
|
+
}, "next"),
|
|
1550
|
+
lex: /* @__PURE__ */ w(function() {
|
|
1551
|
+
var g = this.next();
|
|
1552
|
+
return g || this.lex();
|
|
1553
|
+
}, "lex"),
|
|
1554
|
+
begin: /* @__PURE__ */ w(function(g) {
|
|
1555
|
+
this.conditionStack.push(g);
|
|
1556
|
+
}, "begin"),
|
|
1557
|
+
popState: /* @__PURE__ */ w(function() {
|
|
1558
|
+
return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
1559
|
+
}, "popState"),
|
|
1560
|
+
_currentRules: /* @__PURE__ */ w(function() {
|
|
1561
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
1562
|
+
}, "_currentRules"),
|
|
1563
|
+
topState: /* @__PURE__ */ w(function(g) {
|
|
1564
|
+
return g = this.conditionStack.length - 1 - Math.abs(g || 0), g >= 0 ? this.conditionStack[g] : "INITIAL";
|
|
1565
|
+
}, "topState"),
|
|
1566
|
+
pushState: /* @__PURE__ */ w(function(g) {
|
|
1567
|
+
this.begin(g);
|
|
1568
|
+
}, "pushState"),
|
|
1569
|
+
stateStackSize: /* @__PURE__ */ w(function() {
|
|
1570
|
+
return this.conditionStack.length;
|
|
1571
|
+
}, "stateStackSize"),
|
|
1572
|
+
options: { "case-insensitive": !0 },
|
|
1573
|
+
performAction: /* @__PURE__ */ w(function(g, v, k, p) {
|
|
1574
|
+
switch (k) {
|
|
1575
|
+
case 0:
|
|
1576
|
+
break;
|
|
1577
|
+
case 1:
|
|
1578
|
+
break;
|
|
1579
|
+
case 2:
|
|
1580
|
+
break;
|
|
1581
|
+
case 3:
|
|
1582
|
+
if (g.getIndentMode && g.getIndentMode())
|
|
1583
|
+
return g.consumeIndentText = !0, this.begin("INITIAL"), 22;
|
|
1584
|
+
break;
|
|
1585
|
+
case 4:
|
|
1586
|
+
break;
|
|
1587
|
+
case 5:
|
|
1588
|
+
g.setIndentMode && g.setIndentMode(!1), this.begin("INITIAL"), this.unput(v.yytext);
|
|
1589
|
+
break;
|
|
1590
|
+
case 6:
|
|
1591
|
+
return this.begin("bol"), 8;
|
|
1592
|
+
case 7:
|
|
1593
|
+
break;
|
|
1594
|
+
case 8:
|
|
1595
|
+
break;
|
|
1596
|
+
case 9:
|
|
1597
|
+
return 7;
|
|
1598
|
+
case 10:
|
|
1599
|
+
return 11;
|
|
1600
|
+
case 11:
|
|
1601
|
+
return 5;
|
|
1602
|
+
case 12:
|
|
1603
|
+
return 12;
|
|
1604
|
+
case 13:
|
|
1605
|
+
return 17;
|
|
1606
|
+
case 14:
|
|
1607
|
+
if (g.consumeIndentText) g.consumeIndentText = !1;
|
|
1608
|
+
else return 19;
|
|
1609
|
+
break;
|
|
1610
|
+
case 15:
|
|
1611
|
+
return 24;
|
|
1612
|
+
case 16:
|
|
1613
|
+
return v.yytext = v.yytext.slice(2, -2), 14;
|
|
1614
|
+
case 17:
|
|
1615
|
+
return v.yytext = v.yytext.slice(1, -1).trim(), 14;
|
|
1616
|
+
case 18:
|
|
1617
|
+
return 16;
|
|
1618
|
+
case 19:
|
|
1619
|
+
return 31;
|
|
1620
|
+
case 20:
|
|
1621
|
+
return 33;
|
|
1622
|
+
case 21:
|
|
1623
|
+
return 32;
|
|
1624
|
+
case 22:
|
|
1625
|
+
return 20;
|
|
1626
|
+
case 23:
|
|
1627
|
+
return 21;
|
|
1628
|
+
case 24:
|
|
1629
|
+
return 27;
|
|
1630
|
+
case 25:
|
|
1631
|
+
return 15;
|
|
1632
|
+
}
|
|
1633
|
+
}, "anonymous"),
|
|
1634
|
+
rules: [
|
|
1635
|
+
/^(?:%%(?!\{)[^\n]*)/i,
|
|
1636
|
+
/^(?:[^\}]%%[^\n]*)/i,
|
|
1637
|
+
/^(?:[ \t]+(?=[\n\r]))/i,
|
|
1638
|
+
/^(?:[ \t]+(?=text\b))/i,
|
|
1639
|
+
/^(?:[ \t]+)/i,
|
|
1640
|
+
/^(?:[^ \t\n\r])/i,
|
|
1641
|
+
/^(?:[\n\r]+)/i,
|
|
1642
|
+
/^(?:%%[^\n]*)/i,
|
|
1643
|
+
/^(?:[ \t]+)/i,
|
|
1644
|
+
/^(?:$)/i,
|
|
1645
|
+
/^(?:title\s[^#\n;]+)/i,
|
|
1646
|
+
/^(?:venn-beta\b)/i,
|
|
1647
|
+
/^(?:set\b)/i,
|
|
1648
|
+
/^(?:union\b)/i,
|
|
1649
|
+
/^(?:text\b)/i,
|
|
1650
|
+
/^(?:style\b)/i,
|
|
1651
|
+
/^(?:\["[^\"]*"\])/i,
|
|
1652
|
+
/^(?:\[[^\]\"]+\])/i,
|
|
1653
|
+
/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,
|
|
1654
|
+
/^(?:#[0-9a-fA-F]{3,8})/i,
|
|
1655
|
+
/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,
|
|
1656
|
+
/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,
|
|
1657
|
+
/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,
|
|
1658
|
+
/^(?:"[^\"]*")/i,
|
|
1659
|
+
/^(?:,)/i,
|
|
1660
|
+
/^(?::)/i
|
|
1661
|
+
],
|
|
1662
|
+
conditions: {
|
|
1663
|
+
bol: {
|
|
1664
|
+
rules: [
|
|
1665
|
+
0,
|
|
1666
|
+
1,
|
|
1667
|
+
2,
|
|
1668
|
+
3,
|
|
1669
|
+
4,
|
|
1670
|
+
5,
|
|
1671
|
+
6,
|
|
1672
|
+
7,
|
|
1673
|
+
8,
|
|
1674
|
+
9,
|
|
1675
|
+
10,
|
|
1676
|
+
11,
|
|
1677
|
+
12,
|
|
1678
|
+
13,
|
|
1679
|
+
14,
|
|
1680
|
+
15,
|
|
1681
|
+
16,
|
|
1682
|
+
17,
|
|
1683
|
+
18,
|
|
1684
|
+
19,
|
|
1685
|
+
20,
|
|
1686
|
+
21,
|
|
1687
|
+
22,
|
|
1688
|
+
23,
|
|
1689
|
+
24,
|
|
1690
|
+
25
|
|
1691
|
+
],
|
|
1692
|
+
inclusive: !0
|
|
1693
|
+
},
|
|
1694
|
+
INITIAL: {
|
|
1695
|
+
rules: [
|
|
1696
|
+
0,
|
|
1697
|
+
1,
|
|
1698
|
+
6,
|
|
1699
|
+
7,
|
|
1700
|
+
8,
|
|
1701
|
+
9,
|
|
1702
|
+
10,
|
|
1703
|
+
11,
|
|
1704
|
+
12,
|
|
1705
|
+
13,
|
|
1706
|
+
14,
|
|
1707
|
+
15,
|
|
1708
|
+
16,
|
|
1709
|
+
17,
|
|
1710
|
+
18,
|
|
1711
|
+
19,
|
|
1712
|
+
20,
|
|
1713
|
+
21,
|
|
1714
|
+
22,
|
|
1715
|
+
23,
|
|
1716
|
+
24,
|
|
1717
|
+
25
|
|
1718
|
+
],
|
|
1719
|
+
inclusive: !0
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
})();
|
|
1724
|
+
function T() {
|
|
1725
|
+
this.yy = {};
|
|
1726
|
+
}
|
|
1727
|
+
return w(T, "Parser"), T.prototype = S, S.Parser = T, new T();
|
|
1728
|
+
})();
|
|
1729
|
+
yt.parser = yt;
|
|
1730
|
+
var _e = yt, pt = [], mt = [], bt = [], vt = /* @__PURE__ */ new Set(), kt, It = !1, Te = /* @__PURE__ */ w((t, n, s) => {
|
|
1731
|
+
const e = it(t).sort(), i = s ?? 10 / Math.pow(t.length, 2);
|
|
1732
|
+
kt = e, e.length === 1 && vt.add(e[0]), pt.push({
|
|
1733
|
+
sets: e,
|
|
1734
|
+
size: i,
|
|
1735
|
+
label: n ? et(n) : void 0
|
|
1736
|
+
});
|
|
1737
|
+
}, "addSubsetData"), Ee = /* @__PURE__ */ w(() => pt, "getSubsetData"), et = /* @__PURE__ */ w((t) => {
|
|
1738
|
+
const n = t.trim();
|
|
1739
|
+
return n.length >= 2 && n.startsWith('"') && n.endsWith('"') ? n.slice(1, -1) : n;
|
|
1740
|
+
}, "normalizeText"), ze = /* @__PURE__ */ w((t) => t && et(t), "normalizeStyleValue"), Ae = /* @__PURE__ */ w((t, n, s) => {
|
|
1741
|
+
const e = et(n);
|
|
1742
|
+
mt.push({
|
|
1743
|
+
sets: it(t).sort(),
|
|
1744
|
+
id: e,
|
|
1745
|
+
label: s ? et(s) : void 0
|
|
1746
|
+
});
|
|
1747
|
+
}, "addTextData"), De = /* @__PURE__ */ w((t, n) => {
|
|
1748
|
+
const s = it(t).sort(), e = {};
|
|
1749
|
+
for (const [i, r] of n) e[i] = ze(r) ?? r;
|
|
1750
|
+
bt.push({
|
|
1751
|
+
targets: s,
|
|
1752
|
+
styles: e
|
|
1753
|
+
});
|
|
1754
|
+
}, "addStyleData"), Ce = /* @__PURE__ */ w(() => bt, "getStyleData"), it = /* @__PURE__ */ w((t) => t.map((n) => et(n)), "normalizeIdentifierList"), Re = /* @__PURE__ */ w((t) => {
|
|
1755
|
+
const n = it(t).filter((s) => !vt.has(s));
|
|
1756
|
+
if (n.length > 0) throw new Error(`unknown set identifier: ${n.join(", ")}`);
|
|
1757
|
+
}, "validateUnionIdentifiers"), Oe = /* @__PURE__ */ w(() => mt, "getTextData"), Ne = /* @__PURE__ */ w(() => kt, "getCurrentSets"), je = /* @__PURE__ */ w(() => It, "getIndentMode"), Fe = /* @__PURE__ */ w((t) => {
|
|
1758
|
+
It = t;
|
|
1759
|
+
}, "setIndentMode"), Pe = Qt.venn;
|
|
1760
|
+
function Ut() {
|
|
1761
|
+
return re(Pe, _t().venn);
|
|
1762
|
+
}
|
|
1763
|
+
w(Ut, "getConfig");
|
|
1764
|
+
var Le = {
|
|
1765
|
+
getConfig: Ut,
|
|
1766
|
+
clear: /* @__PURE__ */ w(() => {
|
|
1767
|
+
Xt(), pt.length = 0, mt.length = 0, bt.length = 0, vt.clear(), kt = void 0, It = !1;
|
|
1768
|
+
}, "customClear"),
|
|
1769
|
+
setAccTitle: Yt,
|
|
1770
|
+
getAccTitle: ie,
|
|
1771
|
+
setDiagramTitle: Ht,
|
|
1772
|
+
getDiagramTitle: se,
|
|
1773
|
+
getAccDescription: ne,
|
|
1774
|
+
setAccDescription: Wt,
|
|
1775
|
+
addSubsetData: Te,
|
|
1776
|
+
getSubsetData: Ee,
|
|
1777
|
+
addTextData: Ae,
|
|
1778
|
+
addStyleData: De,
|
|
1779
|
+
validateUnionIdentifiers: Re,
|
|
1780
|
+
getTextData: Oe,
|
|
1781
|
+
getStyleData: Ce,
|
|
1782
|
+
getCurrentSets: Ne,
|
|
1783
|
+
getIndentMode: je,
|
|
1784
|
+
setIndentMode: Fe
|
|
1785
|
+
}, Ve = /* @__PURE__ */ w((t) => `
|
|
1786
|
+
.venn-title {
|
|
1787
|
+
font-size: 32px;
|
|
1788
|
+
fill: ${t.vennTitleTextColor};
|
|
1789
|
+
font-family: ${t.fontFamily};
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
.venn-circle text {
|
|
1793
|
+
font-size: 48px;
|
|
1794
|
+
font-family: ${t.fontFamily};
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.venn-intersection text {
|
|
1798
|
+
font-size: 48px;
|
|
1799
|
+
fill: ${t.vennSetTextColor};
|
|
1800
|
+
font-family: ${t.fontFamily};
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
.venn-text-node {
|
|
1804
|
+
font-family: ${t.fontFamily};
|
|
1805
|
+
color: ${t.vennSetTextColor};
|
|
1806
|
+
}
|
|
1807
|
+
`, "getStyles");
|
|
1808
|
+
function qt(t) {
|
|
1809
|
+
const n = /* @__PURE__ */ new Map();
|
|
1810
|
+
for (const s of t) {
|
|
1811
|
+
const e = s.targets.join("|"), i = n.get(e);
|
|
1812
|
+
i ? Object.assign(i, s.styles) : n.set(e, { ...s.styles });
|
|
1813
|
+
}
|
|
1814
|
+
return n;
|
|
1815
|
+
}
|
|
1816
|
+
w(qt, "buildStyleByKey");
|
|
1817
|
+
var Be = /* @__PURE__ */ w((t, n, s, e) => {
|
|
1818
|
+
const i = e.db, r = i.getConfig?.(), { themeVariables: a, look: c, handDrawnSeed: f } = _t(), l = c === "handDrawn", u = [
|
|
1819
|
+
a.venn1,
|
|
1820
|
+
a.venn2,
|
|
1821
|
+
a.venn3,
|
|
1822
|
+
a.venn4,
|
|
1823
|
+
a.venn5,
|
|
1824
|
+
a.venn6,
|
|
1825
|
+
a.venn7,
|
|
1826
|
+
a.venn8
|
|
1827
|
+
].filter(Boolean), d = i.getDiagramTitle?.(), h = i.getSubsetData(), b = i.getTextData(), y = qt(i.getStyleData()), S = Gt(h), T = r?.width ?? 800, m = r?.height ?? 450, g = T / 1600, v = d ? 48 * g : 0, k = a.primaryTextColor ?? a.textColor, p = oe(n);
|
|
1828
|
+
p.attr("viewBox", `0 0 ${T} ${m}`), d && p.append("text").text(d).attr("class", "venn-title").attr("font-size", `${32 * g}px`).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("x", "50%").attr("y", 32 * g).style("fill", a.vennTitleTextColor || a.titleColor);
|
|
1829
|
+
const x = ot(document.createElement("div")), o = ke().width(T).height(m - v);
|
|
1830
|
+
x.datum(S).call(o);
|
|
1831
|
+
const _ = l ? ae.svg(x.select("svg").node()) : void 0, I = we(S, {
|
|
1832
|
+
width: T,
|
|
1833
|
+
height: m - v,
|
|
1834
|
+
padding: r?.padding ?? 15
|
|
1835
|
+
}), z = /* @__PURE__ */ new Map();
|
|
1836
|
+
for (const A of I) {
|
|
1837
|
+
const C = J([...A.data.sets].sort());
|
|
1838
|
+
z.set(C, A);
|
|
1839
|
+
}
|
|
1840
|
+
b.length > 0 && Kt(r, z, x, b, g, y);
|
|
1841
|
+
const N = te(a.background || "#f4f4f4");
|
|
1842
|
+
x.selectAll(".venn-circle").each(function(A, C) {
|
|
1843
|
+
const E = ot(this), j = J([...A.sets].sort()), R = y.get(j), F = R?.fill || u[C % u.length] || a.primaryColor;
|
|
1844
|
+
E.classed(`venn-set-${C % 8}`, !0);
|
|
1845
|
+
const W = R?.["fill-opacity"] ?? 0.1, H = R?.stroke || F, Y = R?.["stroke-width"] || `${5 * g}`;
|
|
1846
|
+
if (l && _) {
|
|
1847
|
+
const q = z.get(j);
|
|
1848
|
+
if (q && q.circles.length > 0) {
|
|
1849
|
+
const L = q.circles[0], P = _.circle(L.x, L.y, L.radius * 2, {
|
|
1850
|
+
roughness: 0.7,
|
|
1851
|
+
seed: f,
|
|
1852
|
+
fill: Mt(F, 0.7),
|
|
1853
|
+
fillStyle: "hachure",
|
|
1854
|
+
fillWeight: 2,
|
|
1855
|
+
hachureGap: 8,
|
|
1856
|
+
hachureAngle: -41 + C * 60,
|
|
1857
|
+
stroke: H,
|
|
1858
|
+
strokeWidth: parseFloat(String(Y))
|
|
1859
|
+
});
|
|
1860
|
+
E.select("path").remove(), E.node()?.insertBefore(P, E.select("text").node());
|
|
1861
|
+
}
|
|
1862
|
+
} else E.select("path").style("fill", F).style("fill-opacity", W).style("stroke", H).style("stroke-width", Y).style("stroke-opacity", 0.95);
|
|
1863
|
+
const D = R?.color || (N ? ee(F, 30) : Jt(F, 30));
|
|
1864
|
+
E.select("text").style("font-size", `${48 * g}px`).style("fill", D);
|
|
1865
|
+
}), l && _ ? x.selectAll(".venn-intersection").each(function(A) {
|
|
1866
|
+
const C = ot(this), E = J([...A.sets].sort()), j = y.get(E), R = j?.fill;
|
|
1867
|
+
if (R) {
|
|
1868
|
+
const F = C.select("path"), W = F.attr("d");
|
|
1869
|
+
if (W) {
|
|
1870
|
+
const H = _.path(W, {
|
|
1871
|
+
roughness: 0.7,
|
|
1872
|
+
seed: f,
|
|
1873
|
+
fill: Mt(R, 0.3),
|
|
1874
|
+
fillStyle: "cross-hatch",
|
|
1875
|
+
fillWeight: 2,
|
|
1876
|
+
hachureGap: 6,
|
|
1877
|
+
hachureAngle: 60,
|
|
1878
|
+
stroke: "none"
|
|
1879
|
+
}), Y = F.node();
|
|
1880
|
+
Y?.parentNode?.insertBefore(H, Y), F.remove();
|
|
1881
|
+
}
|
|
1882
|
+
} else C.select("path").style("fill-opacity", 0);
|
|
1883
|
+
C.select("text").style("font-size", `${48 * g}px`).style("fill", j?.color ?? a.vennSetTextColor ?? k);
|
|
1884
|
+
}) : (x.selectAll(".venn-intersection text").style("font-size", `${48 * g}px`).style("fill", (A) => {
|
|
1885
|
+
const C = J([...A.sets].sort());
|
|
1886
|
+
return y.get(C)?.color ?? a.vennSetTextColor ?? k;
|
|
1887
|
+
}), x.selectAll(".venn-intersection path").style("fill-opacity", (A) => {
|
|
1888
|
+
const C = J([...A.sets].sort());
|
|
1889
|
+
return y.get(C)?.fill ? 1 : 0;
|
|
1890
|
+
}).style("fill", (A) => {
|
|
1891
|
+
const C = J([...A.sets].sort());
|
|
1892
|
+
return y.get(C)?.fill ?? "transparent";
|
|
1893
|
+
}));
|
|
1894
|
+
const K = p.append("g").attr("transform", `translate(0, ${v})`), B = x.select("svg").node();
|
|
1895
|
+
if (B && "childNodes" in B) for (const A of [...B.childNodes]) K.node()?.appendChild(A);
|
|
1896
|
+
Zt(p, m, T, r?.useMaxWidth ?? !0);
|
|
1897
|
+
}, "draw");
|
|
1898
|
+
function J(t) {
|
|
1899
|
+
return t.join("|");
|
|
1900
|
+
}
|
|
1901
|
+
w(J, "stableSetsKey");
|
|
1902
|
+
function Kt(t, n, s, e, i, r) {
|
|
1903
|
+
const a = t?.useDebugLayout ?? !1, c = s.select("svg").append("g").attr("class", "venn-text-nodes"), f = /* @__PURE__ */ new Map();
|
|
1904
|
+
for (const l of e) {
|
|
1905
|
+
const u = J(l.sets), d = f.get(u);
|
|
1906
|
+
d ? d.push(l) : f.set(u, [l]);
|
|
1907
|
+
}
|
|
1908
|
+
for (const [l, u] of f.entries()) {
|
|
1909
|
+
const d = n.get(l);
|
|
1910
|
+
if (!d?.text) continue;
|
|
1911
|
+
const h = d.text.x, b = d.text.y, y = Math.min(...d.circles.map((N) => N.radius)), S = Math.min(...d.circles.map((N) => N.radius - Math.hypot(h - N.x, b - N.y)));
|
|
1912
|
+
let T = Number.isFinite(S) ? Math.max(0, S) : 0;
|
|
1913
|
+
T === 0 && Number.isFinite(y) && (T = y * 0.6);
|
|
1914
|
+
const m = c.append("g").attr("class", "venn-text-area").attr("font-size", `${40 * i}px`);
|
|
1915
|
+
a && m.append("circle").attr("class", "venn-text-debug-circle").attr("cx", h).attr("cy", b).attr("r", T).attr("fill", "none").attr("stroke", "purple").attr("stroke-width", 1.5 * i).attr("stroke-dasharray", `${6 * i} ${4 * i}`);
|
|
1916
|
+
const g = Math.max(80 * i, T * 2 * 0.95), v = Math.max(60 * i, T * 2 * 0.95), k = (d.data.label && d.data.label.length > 0 ? Math.min(32 * i, T * 0.25) : 0) + (u.length <= 2 ? 30 * i : 0), p = h - g / 2, x = b - v / 2 + k, o = Math.max(1, Math.ceil(Math.sqrt(u.length))), _ = Math.max(1, Math.ceil(u.length / o)), I = g / o, z = v / _;
|
|
1917
|
+
for (const [N, K] of u.entries()) {
|
|
1918
|
+
const B = N % o, A = Math.floor(N / o), C = p + I * (B + 0.5), E = x + z * (A + 0.5);
|
|
1919
|
+
a && m.append("rect").attr("class", "venn-text-debug-cell").attr("x", p + I * B).attr("y", x + z * A).attr("width", I).attr("height", z).attr("fill", "none").attr("stroke", "teal").attr("stroke-width", 1 * i).attr("stroke-dasharray", `${4 * i} ${3 * i}`);
|
|
1920
|
+
const j = I * 0.9, R = z * 0.9, F = m.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", j).attr("height", R).attr("x", C - j / 2).attr("y", E - R / 2).attr("overflow", "visible"), W = r.get(K.id)?.color, H = F.append("xhtml:span").attr("class", "venn-text-node").style("display", "flex").style("width", "100%").style("height", "100%").style("white-space", "normal").style("align-items", "center").style("justify-content", "center").style("text-align", "center").style("overflow-wrap", "normal").style("word-break", "normal").text(K.label ?? K.id);
|
|
1921
|
+
W && H.style("color", W);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
w(Kt, "renderTextNodes");
|
|
1926
|
+
function Gt(t) {
|
|
1927
|
+
const n = new Set(t.map((i) => [...i.sets].sort().join("|"))), s = new Map(t.filter((i) => i.sets.length === 1 && i.size !== void 0).map((i) => [i.sets[0], i.size])), e = [];
|
|
1928
|
+
for (const i of t) {
|
|
1929
|
+
if (i.sets.length < 3) continue;
|
|
1930
|
+
const r = [...i.sets].sort();
|
|
1931
|
+
for (let a = 0; a < r.length - 1; a++) for (let c = a + 1; c < r.length; c++) {
|
|
1932
|
+
const f = [r[a], r[c]], l = f.join("|");
|
|
1933
|
+
if (!n.has(l)) {
|
|
1934
|
+
n.add(l);
|
|
1935
|
+
const u = s.get(f[0]), d = s.get(f[1]), h = u !== void 0 && d !== void 0 ? Math.min(u, d) / 4 : 2.5;
|
|
1936
|
+
e.push({
|
|
1937
|
+
sets: f,
|
|
1938
|
+
size: h,
|
|
1939
|
+
label: ""
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
return e.length > 0 ? [...t, ...e] : t;
|
|
1945
|
+
}
|
|
1946
|
+
w(Gt, "ensurePairwiseSubsets");
|
|
1947
|
+
var Ye = {
|
|
1948
|
+
parser: _e,
|
|
1949
|
+
db: Le,
|
|
1950
|
+
renderer: { draw: Be },
|
|
1951
|
+
styles: Ve
|
|
1952
|
+
};
|
|
1953
|
+
export {
|
|
1954
|
+
Ye as diagram
|
|
1955
|
+
};
|