collabmd 0.1.34 → 0.1.36
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/client/assets/{CodeMirrorEditor-UCMRAMCV-Bg0dawOb.js → CodeMirrorEditor-UCMRAMCV-DnBV8gCm.js} +1 -1
- package/dist/client/assets/_baseFor-BSErPbF2.js +1 -0
- package/dist/client/assets/{ar-SA-NXDWD63E-WivLHHDW.js → ar-SA-NXDWD63E-CTf_wpt3.js} +1 -1
- package/dist/client/assets/arc-DD8jaAGl.js +1 -0
- package/dist/client/assets/architecture-YZFGNWBL-DWWrde02.js +1 -0
- package/dist/client/assets/{architectureDiagram-2XIMDMQ5-kYbOThe4.js → architectureDiagram-Q4EWVU46-BftXiJA8.js} +4 -4
- package/dist/client/assets/{az-AZ-MXSORGZV-DOdq1TKC.js → az-AZ-MXSORGZV-C_C9i9u3.js} +1 -1
- package/dist/client/assets/{bg-BG-O6MV2KSF-CYucKuDS.js → bg-BG-O6MV2KSF-YmfvQf63.js} +1 -1
- package/dist/client/assets/blockDiagram-DXYQGD6D-6UN-nR8-.js +132 -0
- package/dist/client/assets/{bn-IN-MMW2ORAC-DYr8kqNL.js → bn-BD-T2VJNT7N-BD0ob0JE.js} +1 -1
- package/dist/client/assets/{bn-BD-T2VJNT7N-2OKWLCYa.js → bn-IN-MMW2ORAC-BTEFR4Ed.js} +1 -1
- package/dist/client/assets/c4Diagram-AHTNJAMY-Gz7ZAK0d.js +10 -0
- package/dist/client/assets/{ca-ES-MKBCGNOG-B9Aeb43I.js → ca-ES-MKBCGNOG-aLX_cjA0.js} +1 -1
- package/dist/client/assets/channel-XGCkuPi6.js +1 -0
- package/dist/client/assets/chunk-2KRD3SAO-CFcF2aNP.js +1 -0
- package/dist/client/assets/chunk-336JU56O-DvrrHsJT.js +2 -0
- package/dist/client/assets/chunk-426QAEUC-CEbmCgux.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-2e7V-uuE.js → chunk-4BX2VUAB-D5YiFdu1.js} +1 -1
- package/dist/client/assets/chunk-4TB4RGXK-CoouNThi.js +206 -0
- package/dist/client/assets/{chunk-55IACEB6-CpncB3ru.js → chunk-55IACEB6-VHgZjidg.js} +1 -1
- package/dist/client/assets/chunk-5FUZZQ4R-CxIIxXPy.js +62 -0
- package/dist/client/assets/chunk-5PVQY5BW-ciE7eHID.js +2 -0
- package/dist/client/assets/chunk-67CJDMHE-CW-fbgQB.js +1 -0
- package/dist/client/assets/chunk-7N4EOEYR-DbAW6XnF.js +1 -0
- package/dist/client/assets/chunk-AA7GKIK3-ClDHDAza.js +1 -0
- package/dist/client/assets/chunk-BSJP7CBP-D2KkrA_B.js +1 -0
- package/dist/client/assets/chunk-CIAEETIT-BnB8a6HR.js +1 -0
- package/dist/client/assets/{chunk-KX2RTZJC-BTiOJb7N.js → chunk-EDXVE4YY-M4QxyGNt.js} +1 -1
- package/dist/client/assets/chunk-ENJZ2VHE-BQj_1YA_.js +10 -0
- package/dist/client/assets/{chunk-FMBD7UC4-CMahlBa_.js → chunk-FMBD7UC4-qQT7MtX2.js} +1 -1
- package/dist/client/assets/chunk-FOC6F5B3-Bw6XfKDP.js +1 -0
- package/dist/client/assets/chunk-ICPOFSXX-DqJi89rc.js +122 -0
- package/dist/client/assets/chunk-K5T4RW27-CQtjKF2g.js +94 -0
- package/dist/client/assets/chunk-KGLVRYIC-BWSPiKjp.js +1 -0
- package/dist/client/assets/chunk-LIHQZDEY-DtYrHuCi.js +1 -0
- package/dist/client/assets/{chunk-AXZTUZBK-DuMiJYO9.js → chunk-LOOWOR4L-C5BUwXgZ.js} +2 -2
- package/dist/client/assets/chunk-ORNJ4GCN-Csga44e5.js +1 -0
- package/dist/client/assets/{chunk-NQ4KR5QH-CMJKI6Oj.js → chunk-OYMX7WX6-DvtmCasj.js} +25 -14
- package/dist/client/assets/chunk-QZHKN3VN-CHVH9_3S.js +1 -0
- package/dist/client/assets/{chunk-SRAX5OIU-CLVBQRWC.js → chunk-SRAX5OIU-yDw8XRsi.js} +1 -1
- package/dist/client/assets/{chunk-PU5JKC2W-D_6N6t8f.js → chunk-U2HBQHQK-BBXgsocS.js} +6 -6
- package/dist/client/assets/{chunk-PQ6SQG4A-D1AbThjy.js → chunk-X2U36JSP-D3OEPG7k.js} +1 -1
- package/dist/client/assets/{chunk-XPW4576I-DJr4_4Yy.js → chunk-XPW4576I-BUfyrOtN.js} +2 -2
- package/dist/client/assets/chunk-YHkbxXgt.js +1 -0
- package/dist/client/assets/chunk-YKPWT25G-GISHuloq.js +35 -0
- package/dist/client/assets/{chunk-JSJVCQXG-DPQ9cPJt.js → chunk-YZCP3GAM-D1jf1WUI.js} +1 -1
- package/dist/client/assets/{chunk-Z5NKEFVG-HOkYqaKa.js → chunk-Z5NKEFVG-Vu8zBV4H.js} +1 -1
- package/dist/client/assets/chunk-ZZ45TVLE-DGIhE_ST.js +1 -0
- package/dist/client/assets/classDiagram-6PBFFD2Q-D1KhAUL3.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-BSyyJpnR.js +1 -0
- package/dist/client/assets/clike-BFTLRaGS.js +1 -0
- package/dist/client/assets/clone-DI0bYZ1L.js +1 -0
- package/dist/client/assets/{coffeescript-B_7eyHAa.js → coffeescript-B7GZajzV.js} +1 -1
- package/dist/client/assets/{cose-bilkent-S5V4N54A-DASO2hrk.js → cose-bilkent-S5V4N54A-A8ssRFyt.js} +1 -1
- package/dist/client/assets/{cs-CZ-V77HGUP7-BDg-F0CJ.js → cs-CZ-V77HGUP7-Du3y53BB.js} +1 -1
- package/dist/client/assets/{cypher-DE6I2lIA.js → cypher-DEGl2llJ.js} +1 -1
- package/dist/client/assets/cytoscape.esm-BurByw8X.js +321 -0
- package/dist/client/assets/{d-BNkKjn0o.js → d-BspB0dox.js} +1 -1
- package/dist/client/assets/{da-DK-I5RFNTM4-wtSQ0Jxa.js → da-DK-I5RFNTM4-CDJtjf5s.js} +1 -1
- package/dist/client/assets/dagre-Dn6rkrte.js +1 -0
- package/dist/client/assets/dagre-KV5264BT-COzej2en.js +4 -0
- package/dist/client/assets/{de-CH-WLRDEVBV-C1swvmZy.js → de-CH-WLRDEVBV-CLV2tVw6.js} +1 -1
- package/dist/client/assets/{de-DE-DTI4WUSC-C0L6Nz8X.js → de-DE-DTI4WUSC-B53J0BQ8.js} +1 -1
- package/dist/client/assets/diagram-5BDNPKRD-BuK-UBuN.js +10 -0
- package/dist/client/assets/diagram-G4DWMVQ6-CbswIU9X.js +24 -0
- package/dist/client/assets/diagram-MMDJMWI5-BE-yOVGX.js +43 -0
- package/dist/client/assets/diagram-TYMM5635-CT8BdT4s.js +24 -0
- package/dist/client/assets/{dist-3uAMa5w5.js → dist-B98fHn5m.js} +1 -1
- package/dist/client/assets/{dist-BtnXjRx0.js → dist-BE8C_ouo.js} +1 -1
- package/dist/client/assets/{dist-rMhng5DK.js → dist-BEKQo64E.js} +1 -1
- package/dist/client/assets/{dist-DsL7sqZR.js → dist-BOP-dC-R.js} +1 -1
- package/dist/client/assets/{dist-DUvaQ-Bj.js → dist-BPEi1dEF.js} +1 -1
- package/dist/client/assets/{dist-B4uQVR_X.js → dist-BScEL4VP.js} +1 -1
- package/dist/client/assets/dist-BfVljg0L2.js +1 -0
- package/dist/client/assets/{dist-CGV1S_as.js → dist-BiCgLddE.js} +1 -1
- package/dist/client/assets/{dist-CxfohGIV.js → dist-Bn8WRPs1.js} +1 -1
- package/dist/client/assets/dist-Brrlevif.js +6 -0
- package/dist/client/assets/{dist-BLAlZer_.js → dist-CBEw2W2P.js} +1 -1
- package/dist/client/assets/{dist-B-02vKOA.js → dist-CJWCCWEW.js} +1 -1
- package/dist/client/assets/{dist-Dyt7n5Ui.js → dist-CQVTTk81.js} +1 -1
- package/dist/client/assets/dist-CaMl1R6P.js +13 -0
- package/dist/client/assets/dist-CcG3Y7Wp.js +1 -0
- package/dist/client/assets/dist-CghBwrO3.js +1 -0
- package/dist/client/assets/dist-Csbx9lQ-.js +1 -0
- package/dist/client/assets/dist-D34Xzrah.js +1 -0
- package/dist/client/assets/dist-DLyohOXi.js +1 -0
- package/dist/client/assets/{dist-Bc2ND6i3.js → dist-DPCUH5MO.js} +1 -1
- package/dist/client/assets/{dist-BzpfHRaE.js → dist-DQiph4qx.js} +1 -1
- package/dist/client/assets/{dist-CL-jjdvG.js → dist-DWRyOl2w.js} +1 -1
- package/dist/client/assets/{dist-CXpKYW9s.js → dist-DZ2t5lUX.js} +1 -1
- package/dist/client/assets/{dist-BzbYwa8m.js → dist-Dbg8P4C5.js} +1 -1
- package/dist/client/assets/{dist-k47-Io7D.js → dist-DdAqzGFU.js} +1 -1
- package/dist/client/assets/dist-DwvSvkOE.js +1 -0
- package/dist/client/assets/dist-WXLmfDGg.js +1 -0
- package/dist/client/assets/{dist-lDhnP-K1.js → dist-aE0_04fl.js} +1 -1
- package/dist/client/assets/{dist-E_jPb93e.js → dist-mPPUaHhq.js} +1 -1
- package/dist/client/assets/{dist-CjII8VDS.js → dist-v3i1ifes.js} +1 -1
- package/dist/client/assets/dist-wkd-N1L5.js +1 -0
- package/dist/client/assets/drawio-editor-D4Qoluwz.js +9 -0
- package/dist/client/assets/{drawioEditor-D6clB5OH.js → drawioEditor-B65FWq-b.js} +2 -2
- package/dist/client/assets/{ecl-M7Iek4lq.js → ecl-D9rhJ9-u.js} +1 -1
- package/dist/client/assets/editor-session-DV80PhYL.js +16 -0
- package/dist/client/assets/{el-GR-ZXDJ2OS4-BH0saXds.js → el-GR-ZXDJ2OS4-DFmRQv0o.js} +1 -1
- package/dist/client/assets/{en-IQZW2TQM-CzlcEpq3.js → en-CMP6EMR6-D9x8hVSu.js} +1 -1
- package/dist/client/assets/{erDiagram-INFDFZHY-DlIf-fb7.js → erDiagram-SMLLAGMA-6VFZA3Qb.js} +33 -18
- package/dist/client/assets/{es-ES-DYQHAD43-CyzL9Mni.js → es-ES-DYQHAD43-BiGWIrBG.js} +1 -1
- package/dist/client/assets/{eu-ES-QDSYU5Y3-D2-x316S.js → eu-ES-QDSYU5Y3-BjwS0kZi.js} +1 -1
- package/dist/client/assets/excalidraw-editor-BZCE9ydu.css +1 -0
- package/dist/client/assets/excalidraw-editor-hiJQt1cX.js +9 -0
- package/dist/client/assets/{excalidraw-mermaid-stub-Bwe-bKcT.js → excalidraw-mermaid-stub-Df0Q2qkW.js} +1 -1
- package/dist/client/assets/excalidraw-scene-MyNAJi2A.js +176 -0
- package/dist/client/assets/excalidrawEditor-BnbblxK4.js +2 -0
- package/dist/client/assets/{export-page-PeexH2QK.js → export-page-BKDarp9x.js} +3 -3
- package/dist/client/assets/exportDocument-CULEGKmb.js +2 -0
- package/dist/client/assets/{fa-IR-26LZG4PM-D8-trU2x.js → fa-IR-26LZG4PM-BgANg2TD.js} +1 -1
- package/dist/client/assets/{fcl-BWKK0S4-.js → fcl-CUXJFJn1.js} +1 -1
- package/dist/client/assets/{fi-FI-6YS4KDE4-CCdRVFDQ.js → fi-FI-6YS4KDE4-CBL5f3oN.js} +1 -1
- package/dist/client/assets/flatten-DjXjUsvv.js +1 -0
- package/dist/client/assets/flowDiagram-DWJPFMVM-DO9RH8YQ.js +162 -0
- package/dist/client/assets/{fr-FR-BRLLPTZC-Dqq-O5T_.js → fr-FR-BRLLPTZC-CRibNSLG.js} +1 -1
- package/dist/client/assets/ganttDiagram-T4ZO3ILL-B-NMvHWN.js +292 -0
- package/dist/client/assets/gitGraph-7Q5UKJZL-DWNinXu4.js +1 -0
- package/dist/client/assets/gitGraphDiagram-UUTBAWPF-B95qkCUx.js +106 -0
- package/dist/client/assets/{gl-ES-OKUZTLYG-BK7pbLbm.js → gl-ES-OKUZTLYG-DEDwa_xt.js} +1 -1
- package/dist/client/assets/graphlib-CAwOVCJc.js +1 -0
- package/dist/client/assets/{groovy-BEKazBrO.js → groovy-Di--Vb9Z.js} +1 -1
- package/dist/client/assets/{haxe-BY9d_5nB.js → haxe-CcPA1xnA.js} +1 -1
- package/dist/client/assets/{he-IL-26MGYIU7-C3BuYKyY.js → he-IL-26MGYIU7-47wxy70N.js} +1 -1
- package/dist/client/assets/{hi-IN-Q4ZOGTP2-BEvXWXnH.js → hi-IN-Q4ZOGTP2-bhV7c3dK.js} +1 -1
- package/dist/client/assets/{hu-HU-P2OXPSN5-BWWZeJNp.js → hu-HU-P2OXPSN5-xG-gBMzE.js} +1 -1
- package/dist/client/assets/{id-ID-2EIKXYN6-DxSKi_aJ.js → id-ID-2EIKXYN6-MQuYaNHo.js} +1 -1
- package/dist/client/assets/image-J2CAS7OM-DD4DaQTs.js +1 -0
- package/dist/client/assets/image-blob-reduce.esm-D8JQdTFk.js +2 -0
- package/dist/client/assets/{index-BLrtj9YM.js → index-BjdYZiBM.js} +2 -2
- package/dist/client/assets/{index-BIt5EZXz.css → index-BryqP9QY.css} +1 -1
- package/dist/client/assets/info-OMHHGYJF-DtYG_rX0.js +1 -0
- package/dist/client/assets/{infoDiagram-LFFYTUFH-DFTI0nfs.js → infoDiagram-42DDH7IO-C77Pt7T1.js} +1 -1
- package/dist/client/assets/isEmpty-CpfhGGBo.js +1 -0
- package/dist/client/assets/ishikawaDiagram-UXIWVN3A-Cy1fwvvg.js +70 -0
- package/dist/client/assets/{it-IT-4CFKVXI2-BmA8wW6q.js → it-IT-4CFKVXI2-v2kj-y7j.js} +1 -1
- package/dist/client/assets/{ja-JP-MAND2Z4V-CLS1jI9o.js → ja-JP-MAND2Z4V-BahXSQz-.js} +1 -1
- package/dist/client/assets/{javascript-CdiVhQeA.js → javascript-gTK9fxz6.js} +1 -1
- package/dist/client/assets/javascript-qUBHINSy.js +1 -0
- package/dist/client/assets/{journeyDiagram-4ABVD52K-DDur6iHm.js → journeyDiagram-VCZTEJTY-CYWaI6re.js} +2 -2
- package/dist/client/assets/{jsx-runtime-C2p7wRmT.js → jsx-runtime-1KUJVfx8.js} +1 -1
- package/dist/client/assets/{kaa-HQRTCXTJ-W15DEDPz.js → kaa-HQRTCXTJ-BF26ydFa.js} +1 -1
- package/dist/client/assets/{kab-KAB-JKIKKTGH-MLh1inqS.js → kab-KAB-JKIKKTGH-CEIH0F80.js} +1 -1
- package/dist/client/assets/{kanban-definition-K7BYSVSG-dA6NPLsg.js → kanban-definition-6JOO6SKY-DY1xE7tm.js} +2 -2
- package/dist/client/assets/{kk-KZ-HXQ63ZFC-BtFrPeLs.js → kk-KZ-HXQ63ZFC-CxWjc9Sf.js} +1 -1
- package/dist/client/assets/{km-KH-PKL3LSGX-xO5FyM9T.js → km-KH-PKL3LSGX-DJlCteEp.js} +1 -1
- package/dist/client/assets/{ko-KR-KXLREZX3-NZFoRybS.js → ko-KR-KXLREZX3-B1gtI_ci.js} +1 -1
- package/dist/client/assets/{ku-TR-MJ4IER3X-B5eVPIpK.js → ku-TR-MJ4IER3X-Bf41y2v2.js} +1 -1
- package/dist/client/assets/line-BCItEgq3.js +1 -0
- package/dist/client/assets/{linear-B2dOdA24.js → linear-dsIQT_iU.js} +1 -1
- package/dist/client/assets/{lt-LT-H6WFQ6FJ-D_7_OeJD.js → lt-LT-H6WFQ6FJ-DA1or-Eo.js} +1 -1
- package/dist/client/assets/{lua-kutgyRGY.js → lua-Cg0FqIlO.js} +1 -1
- package/dist/client/assets/{lv-LV-GOCK6SJW-CnpKr0oQ.js → lv-LV-GOCK6SJW-qa0BoYMm.js} +1 -1
- package/dist/client/assets/main-QJcxyvDa.js +1404 -0
- package/dist/client/assets/mermaid-parser.core-CsTVsPcD.js +4 -0
- package/dist/client/assets/mermaid-runtime-BGlnoUXY.js +11 -0
- package/dist/client/assets/{mindmap-definition-YRQLILUH-DjQcsPoe.js → mindmap-definition-QFDTVHPH-DB_M5r-j.js} +39 -11
- package/dist/client/assets/{mr-IN-IXVLDMEQ-Pht2X_GK.js → mr-IN-IXVLDMEQ-DXFRgvgb.js} +1 -1
- package/dist/client/assets/{my-MM-YG6MYTTD-Cgq4HhPO.js → my-MM-YG6MYTTD-BKDIfalJ.js} +1 -1
- package/dist/client/assets/{nb-NO-XGWJISD2-Bn_Bk2un.js → nb-NO-XGWJISD2-DbwbopH8.js} +1 -1
- package/dist/client/assets/{nl-NL-XVDVCPNC-YkWSJS94.js → nl-NL-XVDVCPNC-ChSneTSU.js} +1 -1
- package/dist/client/assets/{nn-NO-EMX5MJX5-DhP5eZJ7.js → nn-NO-EMX5MJX5-Cf7ZWKWZ.js} +1 -1
- package/dist/client/assets/{oc-FR-ROEINTVO-D3udMPnr.js → oc-FR-ROEINTVO-lM7Nl7hD.js} +1 -1
- package/dist/client/assets/{pa-IN-ZYN6SUDY-CR5YzFig.js → pa-IN-ZYN6SUDY-C9WNUTeR.js} +1 -1
- package/dist/client/assets/packet-4T2RLAQJ-CUVefhAv.js +1 -0
- package/dist/client/assets/percentages-5DKR754L-DuhOjTM2.js +1 -0
- package/dist/client/assets/pica-CgGaIJly.js +2 -0
- package/dist/client/assets/pie-ZZUOXDRM-BHBJ1dLX.js +1 -0
- package/dist/client/assets/pieDiagram-DEJITSTG-BOo-WzjZ.js +30 -0
- package/dist/client/assets/{pl-PL-6VTG7PHC-_wZuoIDM.js → pl-PL-6VTG7PHC-DqRVepnC.js} +1 -1
- package/dist/client/assets/{preview-diagram-utils-COt-IYMD.js → preview-diagram-utils-Nqpp4FNV.js} +1 -1
- package/dist/client/assets/preview-render-compiler-BCB8u6iM.js +1 -0
- package/dist/client/assets/{preview-render-compiler-BjLlHmiQ.js → preview-render-compiler-Tkc6JX1O.js} +2 -2
- package/dist/client/assets/{preview-render-profile-CR4dJZrp.js → preview-render-profile-Bf6R7v4w.js} +6 -6
- package/dist/client/assets/{preview-render-worker-B4dH2yxj.js → preview-render-worker-1LBLqgKu.js} +7 -7
- package/dist/client/assets/{pt-BR-5YFKRR5G-M7gIm2Hi.js → pt-BR-5YFKRR5G-CopLYEA6.js} +1 -1
- package/dist/client/assets/{pt-PT-GEIXXZ67-CcxWpkGj.js → pt-PT-GEIXXZ67-BjZ_Lphg.js} +1 -1
- package/dist/client/assets/{pug-DkUcLYWt.js → pug-lkTEco3G.js} +1 -1
- package/dist/client/assets/{python-CZtTmYkS.js → python-BUyhM0Ew.js} +1 -1
- package/dist/client/assets/{q-I27iQntV.js → q-Dls1OX0D.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-337W2JSQ-CYKgdx7K.js → quadrantDiagram-34T5L4WZ-2vfo0l5S.js} +1 -1
- package/dist/client/assets/{quick-switcher-controller-DcyllYpm.js → quick-switcher-controller-B1erSgJ1.js} +1 -1
- package/dist/client/assets/{r-DN_EydfL.js → r-DeZ8Mdev.js} +1 -1
- package/dist/client/assets/radar-PYXPWWZC-2jR4qZNU.js +1 -0
- package/dist/client/assets/reduce-ChpYjEUB.js +1 -0
- package/dist/client/assets/requirementDiagram-MS252O5E-CtUIQnWa.js +84 -0
- package/dist/client/assets/{ro-RO-E2P6TFZI-qR9noVzP.js → ro-RO-E2P6TFZI-DakDz5Xu.js} +1 -1
- package/dist/client/assets/{room-yJaBAoEU.js → room-z2w9b96b.js} +1 -1
- package/dist/client/assets/{ru-RU-YBIIY43T-CE4S_RX8.js → ru-RU-YBIIY43T-BMvCT-XT.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-WA2Y5GQK-CfHe3D6R.js → sankeyDiagram-XADWPNL6-tcSeuifE.js} +1 -1
- package/dist/client/assets/sequenceDiagram-FGHM5R23-DtF-1Kt2.js +157 -0
- package/dist/client/assets/{si-LK-673C2CI2-Bv6Avh3z.js → si-LK-673C2CI2-hGdH1S9E.js} +1 -1
- package/dist/client/assets/{sk-SK-CKZHQ4AP-Cnlpp55z.js → sk-SK-CKZHQ4AP-DiRA-fj8.js} +1 -1
- package/dist/client/assets/{sl-SI-557H2GWM-BfGq7AQF.js → sl-SI-557H2GWM-DN94n_1-.js} +1 -1
- package/dist/client/assets/{sparql-BOvq0dv7.js → sparql-vm8qNO8J.js} +1 -1
- package/dist/client/assets/sql-GL7dVWcd.js +1 -0
- package/dist/client/assets/src-BuiVcSz-.js +1 -0
- package/dist/client/assets/stateDiagram-FHFEXIEX-DKk7Sb0f.js +1 -0
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DJUaiADr.js +1 -0
- package/dist/client/assets/subset-shared.chunk-CWNYNLru.js +1 -0
- package/dist/client/assets/{subset-worker.chunk-BSCP6IiC.js → subset-worker.chunk-kj1e3wjW.js} +1 -1
- package/dist/client/assets/{sv-SE-XOPKKDWS-B2_Vk-sp.js → sv-SE-XOPKKDWS-CkHUNABj.js} +1 -1
- package/dist/client/assets/{swift-BCxe4-cw.js → swift-CKcKnWv9.js} +1 -1
- package/dist/client/assets/{ta-IN-XBH7DQI3-BXQMZZIx.js → ta-IN-XBH7DQI3-W-157oVK.js} +1 -1
- package/dist/client/assets/{th-TH-TOCWH3R4-C-ZIYMfH.js → th-TH-TOCWH3R4-BsU-Pydr.js} +1 -1
- package/dist/client/assets/timeline-definition-GMOUNBTQ-Bs6U53Mo.js +120 -0
- package/dist/client/assets/{tr-TR-GXW6CYY5-dl702PMA.js → tr-TR-GXW6CYY5-CTddyq89.js} +1 -1
- package/dist/client/assets/treeView-SZITEDCU-DN5dP2ol.js +1 -0
- package/dist/client/assets/treemap-W4RFUUIX-Dva7DBJR.js +1 -0
- package/dist/client/assets/{turtle-GBz_E4RG.js → turtle-BkP3ExOG.js} +1 -1
- package/dist/client/assets/{uk-UA-IJKTNUDG-CUYQvSSF.js → uk-UA-IJKTNUDG-1LzXkII3.js} +1 -1
- package/dist/client/assets/{uz-UZ-TBZZEA4V-B9qw0PXX.js → uz-UZ-TBZZEA4V-kqm-qcUj.js} +1 -1
- package/dist/client/assets/{vault-api-client-p7h7cXKM.js → vault-api-client-DSx3mWkH.js} +1 -1
- package/dist/client/assets/{vault-utils-5Xr0MXCb.js → vault-utils-CRpy8MQz.js} +1 -1
- package/dist/client/assets/vennDiagram-DHZGUBPP-DNnIjRae.js +34 -0
- package/dist/client/assets/{verilog-C4wTycyo.js → verilog-DSARZZPc.js} +1 -1
- package/dist/client/assets/{vhdl-Bwndeg44.js → vhdl-CnYyYTpa.js} +1 -1
- package/dist/client/assets/{vi-VN-MULSGNVB-DqxZ_sVc.js → vi-VN-MULSGNVB-C3H2AUhm.js} +1 -1
- package/dist/client/assets/wardley-RL74JXVD-CDZW5uzY.js +1 -0
- package/dist/client/assets/wardleyDiagram-NUSXRM2D-C-scJfPY.js +20 -0
- package/dist/client/assets/{xychartDiagram-JWTSCODW-C3vA70iJ.js → xychartDiagram-5P7HB3ND-D3nQoxhz.js} +6 -6
- package/dist/client/assets/yjs-provider-reset-guard-DSPzcvAO.js +4 -0
- package/dist/client/assets/{zh-CN-MVX3E32U-BM0aLuGc.js → zh-CN-MVX3E32U-BULPbsyl.js} +1 -1
- package/dist/client/assets/{zh-HK-JNU5RLIE-dmG_YD0d.js → zh-HK-JNU5RLIE-bNGmeSaW.js} +1 -1
- package/dist/client/assets/{zh-TW-LENVCA6T-LFgbiOi3.js → zh-TW-LENVCA6T-CQDp064P.js} +1 -1
- package/dist/client/drawio-editor.html +1 -1
- package/dist/client/excalidraw-editor.html +1 -1
- package/dist/client/export-document.html +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +15 -15
- package/src/client/application/app-shell/presence-feature.js +265 -34
- package/src/client/application/app-shell/ui-feature-shell.js +31 -5
- package/src/client/application/app-shell/ui-feature-tab-activity.js +1 -0
- package/src/client/application/app-shell/workspace-feature.js +5 -2
- package/src/client/application/app-shell-elements.js +3 -0
- package/src/client/application/diagram-preview-export.js +304 -0
- package/src/client/application/mermaid-preview-hydrator.js +153 -23
- package/src/client/application/plantuml-preview-hydrator.js +155 -20
- package/src/client/application/preview-diagram-utils.js +48 -8
- package/src/client/application/preview-renderer.js +2 -0
- package/src/client/application/quick-switcher-loader.js +42 -0
- package/src/client/application/workspace-route-controller.js +35 -2
- package/src/client/application/workspace-state-store.js +1 -0
- package/src/client/bootstrap/collabmd-app-shell.js +25 -20
- package/src/client/domain/diagram-action-icons.js +21 -0
- package/src/client/domain/excalidraw-api-scene-sync.js +70 -0
- package/src/client/domain/keyboard-shortcuts.js +8 -0
- package/src/client/drawio-editor.js +13 -0
- package/src/client/excalidraw-editor.js +119 -18
- package/src/client/infrastructure/excalidraw-room-client.js +42 -5
- package/src/client/infrastructure/workspace-sync-client.js +26 -3
- package/src/client/presentation/app-shell-template.js +18 -1
- package/src/client/presentation/comment-ui/comment-ui-card.js +83 -3
- package/src/client/presentation/comment-ui/comment-ui-state.js +25 -2
- package/src/client/presentation/drawio-embed-controller.js +18 -0
- package/src/client/presentation/excalidraw-embed-controller.js +7 -0
- package/src/client/presentation/file-explorer-controller.js +10 -0
- package/src/client/presentation/file-explorer-view.js +6 -0
- package/src/client/presentation/git-panel-controller.js +2 -0
- package/src/client/presentation/image-lightbox-controller.js +290 -29
- package/src/client/styles/features/collaboration-presence.css +212 -0
- package/src/client/styles/features/diagram-preview.css +71 -4
- package/src/client/styles/features/embedded-preview.css +4 -6
- package/src/client/styles/features/media-lightbox.css +2 -0
- package/src/server/config/env.js +4 -0
- package/src/server/create-app-server.js +2 -0
- package/src/server/domain/backlink-index.js +33 -72
- package/src/server/domain/bases/base-index-snapshot-store.js +46 -62
- package/src/server/domain/bases/base-query-service.js +89 -7
- package/src/server/domain/collaboration/collaboration-room.js +10 -1
- package/src/server/domain/markdown-reference-extractor.js +233 -0
- package/src/server/infrastructure/http/create-request-handler.js +1 -0
- package/src/server/infrastructure/http/create-vault-api-handler.js +2 -0
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +100 -26
- package/src/server/infrastructure/persistence/vault-file-store.js +175 -4
- package/src/server/infrastructure/workspace/file-system-sync-service.js +45 -21
- package/dist/client/assets/_basePickBy-Dv0sK1l7.js +0 -1
- package/dist/client/assets/_baseUniq-DKYX57ji.js +0 -1
- package/dist/client/assets/arc-DrfYGhWk.js +0 -1
- package/dist/client/assets/architecture-PBZL5I3N-DiglIZi9.js +0 -1
- package/dist/client/assets/blockDiagram-WCTKOSBZ-GIgTqnhk.js +0 -132
- package/dist/client/assets/c4Diagram-IC4MRINW-CkHO1i_L.js +0 -10
- package/dist/client/assets/channel-CgsU9TSN.js +0 -1
- package/dist/client/assets/chunk-7E7YKBS2-TdU92i9i.js +0 -1
- package/dist/client/assets/chunk-7R4GIKGN-mqd2GwMg.js +0 -80
- package/dist/client/assets/chunk-C72U2L5F-CJKQWBtz.js +0 -1
- package/dist/client/assets/chunk-DpHwWhuW.js +0 -1
- package/dist/client/assets/chunk-EGIJ26TM-C4nq20om.js +0 -1
- package/dist/client/assets/chunk-GEFDOKGD-Bs7FmFox.js +0 -2
- package/dist/client/assets/chunk-GLR3WWYH-qQe2O5VQ.js +0 -2
- package/dist/client/assets/chunk-HHEYEP7N-DlevL8bq.js +0 -1
- package/dist/client/assets/chunk-KYZI473N-CTSCuqRb.js +0 -53
- package/dist/client/assets/chunk-L3YUKLVL-CJZMBtKF.js +0 -1
- package/dist/client/assets/chunk-MX3YWQON-DQpSwRf6.js +0 -1
- package/dist/client/assets/chunk-NU2UP6EN-DlUENSHU.js +0 -35
- package/dist/client/assets/chunk-O4XLMI2P-CcVxZh41.js +0 -7
- package/dist/client/assets/chunk-OZEHJAEY-DjBZbgu0.js +0 -1
- package/dist/client/assets/chunk-QZHKN3VN-CgLPFSk5.js +0 -1
- package/dist/client/assets/chunk-R5LLSJPH-CkjKXM73.js +0 -1
- package/dist/client/assets/chunk-WL4C6EOR-axcuKSup.js +0 -189
- package/dist/client/assets/chunk-XIRO2GV7-4wqVHjs_.js +0 -1
- package/dist/client/assets/chunk-XZSTWKYB-C8Y_hIKZ.js +0 -94
- package/dist/client/assets/chunk-YBOYWFTD-CKg4ymFF.js +0 -1
- package/dist/client/assets/classDiagram-VBA2DB6C-BHZpvOxK.js +0 -1
- package/dist/client/assets/classDiagram-v2-RAHNMMFH-DA7HMUUs.js +0 -1
- package/dist/client/assets/clike-1_ZsiVV8.js +0 -1
- package/dist/client/assets/clone-Dgi8Z4IL.js +0 -1
- package/dist/client/assets/cytoscape.esm-Czjc507F.js +0 -321
- package/dist/client/assets/dagre-CfB3Fw33.js +0 -1
- package/dist/client/assets/dagre-KLK3FWXG-CC7tq2Ky.js +0 -4
- package/dist/client/assets/diagram-E7M64L7V-CMt7BN5M.js +0 -24
- package/dist/client/assets/diagram-IFDJBPK2-BFMBUGpd.js +0 -43
- package/dist/client/assets/diagram-P4PSJMXO-CviA1xXr.js +0 -24
- package/dist/client/assets/dist-3bQB_we3.js +0 -1
- package/dist/client/assets/dist-8Igu3Ee_2.js +0 -1
- package/dist/client/assets/dist-BU8uusJX.js +0 -1
- package/dist/client/assets/dist-BVB8rn7o.js +0 -1
- package/dist/client/assets/dist-D5QOYy7y.js +0 -6
- package/dist/client/assets/dist-DIi0uqLJ.js +0 -1
- package/dist/client/assets/dist-DJ16N7ol.js +0 -1
- package/dist/client/assets/dist-DWJL3_bF.js +0 -13
- package/dist/client/assets/dist-O1z0Ayg0.js +0 -1
- package/dist/client/assets/dist-OQE68wIX.js +0 -1
- package/dist/client/assets/dist-x7PIEmJu.js +0 -1
- package/dist/client/assets/drawio-editor-BMTwP5mD.js +0 -9
- package/dist/client/assets/editor-session-Dzy_85Wp.js +0 -16
- package/dist/client/assets/excalidraw-editor-CAP9F8CB.js +0 -9
- package/dist/client/assets/excalidraw-editor-Dj3i59LW.css +0 -1
- package/dist/client/assets/excalidraw-scene-BF_bT1OL.js +0 -176
- package/dist/client/assets/excalidrawEditor-DD4AvzYP.js +0 -2
- package/dist/client/assets/exportDocument-Zfwq1XVx.js +0 -2
- package/dist/client/assets/flowDiagram-PKNHOUZH-C_t-mkwb.js +0 -162
- package/dist/client/assets/ganttDiagram-A5KZAMGK-BtK9Tb--.js +0 -292
- package/dist/client/assets/gitGraph-HDMCJU4V-CT7YfbD3.js +0 -1
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-DULDLGiJ.js +0 -65
- package/dist/client/assets/graphlib-BgRST-Qg.js +0 -1
- package/dist/client/assets/image-XLNPCCAD-CFiKwiWK.js +0 -1
- package/dist/client/assets/image-blob-reduce.esm-DriR2zT9.js +0 -2
- package/dist/client/assets/info-3K5VOQVL-DUpNyDC-.js +0 -1
- package/dist/client/assets/isArrayLikeObject-BId_dPHM.js +0 -1
- package/dist/client/assets/isEmpty-CVvRj8fj.js +0 -1
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-DpBuDpC6.js +0 -70
- package/dist/client/assets/javascript-UJe68_xi.js +0 -1
- package/dist/client/assets/line-B2GMovaI.js +0 -1
- package/dist/client/assets/main-CfSHaGes.js +0 -1368
- package/dist/client/assets/math-B-LMBwub.js +0 -1
- package/dist/client/assets/mermaid-parser.core-B1ogGcR8.js +0 -4
- package/dist/client/assets/mermaid-runtime-Bn8A6DGx.js +0 -11
- package/dist/client/assets/packet-RMMSAZCW-DEwNbIrA.js +0 -1
- package/dist/client/assets/percentages-5DKR754L-D7n4T776.js +0 -1
- package/dist/client/assets/pica-C1TdTz-C.js +0 -2
- package/dist/client/assets/pie-UPGHQEXC-D5M_lSjo.js +0 -1
- package/dist/client/assets/pieDiagram-SKSYHLDU-jhHouFpk.js +0 -30
- package/dist/client/assets/preview-render-compiler-Duy_3IcP.js +0 -1
- package/dist/client/assets/radar-KQ55EAFF-AU1qh3Bw.js +0 -1
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-D9SHxoW7.js +0 -73
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-CZsMMqAJ.js +0 -145
- package/dist/client/assets/sql-DDFeQNTK.js +0 -1
- package/dist/client/assets/src-Pgt9Gp65.js +0 -1
- package/dist/client/assets/stateDiagram-RAJIS63D-CoNZjTYV.js +0 -1
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-1zOw6NmQ.js +0 -1
- package/dist/client/assets/subset-shared.chunk-C9HjwTXy.js +0 -1
- package/dist/client/assets/timeline-definition-YZTLITO2-DSe2mrG8.js +0 -61
- package/dist/client/assets/treemap-KZPCXAKY-C9UI2fwP.js +0 -1
- package/dist/client/assets/vennDiagram-LZ73GAT5-xSzaIpy1.js +0 -34
- package/dist/client/assets/yjs-provider-reset-guard-CtERLBID.js +0 -4
- /package/dist/client/assets/{drawio-room-DEivFyNV.js → drawio-room-1i6Nn0_Z.js} +0 -0
- /package/dist/client/assets/{excalidraw-mermaid-stub-BZPU4ZhU.js → excalidraw-mermaid-stub-DzxtBcQW.js} +0 -0
- /package/dist/client/assets/{file-kind-DBptLlF_.js → file-kind-DmKq2MvD.js} +0 -0
- /package/dist/client/assets/{rough.esm-DE_lJ5Ge.js → rough.esm-BU2knLt9.js} +0 -0
- /package/dist/client/assets/{runtime-config-CqhchMC4.js → runtime-config-DWTejofP.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,D as t,E as n,G as r,N as i,P as a,V as o,j as s,k as c,n as l,p as u,v as d,w as f,z as p}from"./isArrayLikeObject-BId_dPHM.js";import{C as m,E as ee,M as h,N as te,S as ne,a as g,c as re,d as ie,f as _,i as v,m as ae,n as y,p as oe,r as b,s as x,y as se}from"./_baseUniq-DKYX57ji.js";import{a as ce,c as le,d as ue,f as S,i as de,l as C,m as w,n as T,o as fe,r as pe,s as E,t as me,u as D}from"./_basePickBy-Dv0sK1l7.js";import{i as he,n as ge}from"./isEmpty-CVvRj8fj.js";import{k as O}from"./chunk-GEFDOKGD-Bs7FmFox.js";import{t as k}from"./graphlib-BgRST-Qg.js";function _e(e){return i(t(e,void 0,S),e+``)}var ve=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function ye(e){return ve.test(e)}var be=1,xe=4;function Se(e){return se(e,be|xe)}var Ce=function(){return r.Date.now()};function we(e,t){return e==null?e:l(e,re(t),u)}function Te(e,t){return e&&ie(e,re(t))}function Ee(e,t){return e>t}function A(e,t){var n={};return t=_(t,3),ie(e,function(e,r,i){s(n,r,t(e,r,i))}),n}function j(e){return e&&e.length?pe(e,p,Ee):void 0}function M(e,t){return e&&e.length?pe(e,_(t,2),de):void 0}function De(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Oe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=te(e),o=t!==void 0,s=t===null,c=t===t,l=te(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function ke(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Oe(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Ae(e,t,n){t=t.length?h(t,function(e){return o(e)?function(t){return m(t,e.length===1?e[0]:e)}:e}):[p];var r=-1;return t=h(t,d(_)),De(le(e,function(e,n,i){return{criteria:h(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return ke(e,t,n)})}var je=oe(`length`),Me=`\\ud800-\\udfff`,Ne=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Pe=`\\ufe0e\\ufe0f`,Fe=`[`+Me+`]`,N=`[`+Ne+`]`,P=`\\ud83c[\\udffb-\\udfff]`,Ie=`(?:`+N+`|`+P+`)`,Le=`[^`+Me+`]`,Re=`(?:\\ud83c[\\udde6-\\uddff]){2}`,ze=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Be=`\\u200d`,Ve=Ie+`?`,He=`[`+Pe+`]?`,Ue=`(?:`+Be+`(?:`+[Le,Re,ze].join(`|`)+`)`+He+Ve+`)*`,We=He+Ve+Ue,Ge=`(?:`+[Le+N+`?`,N,Re,ze,Fe].join(`|`)+`)`,Ke=RegExp(P+`(?=`+P+`)|`+Ge+We,`g`);function qe(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}function Je(e){return ye(e)?qe(e):je(e)}function Ye(e,t){return me(e,t,function(t,n){return ae(e,n)})}var F=_e(function(e,t){return e==null?{}:Ye(e,t)}),Xe=Math.ceil,Ze=Math.max;function Qe(e,t,n,r){for(var i=-1,a=Ze(Xe((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function $e(t){return function(n,r,i){return i&&typeof i!=`number`&&e(n,r,i)&&(r=i=void 0),n=w(n),r===void 0?(r=n,n=0):r=w(r),i=i===void 0?n<r?1:-1:w(i),Qe(n,r,i,t)}}var I=$e(),et=`[object Map]`,tt=`[object Set]`;function nt(e){if(e==null)return 0;if(f(e))return ce(e)?Je(e):e.length;var t=ge(e);return t==et||t==tt?e.size:he(e).length}var L=n(function(t,n){if(t==null)return[];var r=n.length;return r>1&&e(t,n[0],n[1])?n=[]:r>2&&e(n[0],n[1],n[2])&&(n=[n[0]]),Ae(t,ne(n,1),[])}),rt=0;function R(e){var t=++rt;return ee(e)+t}function it(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function at(e,t){return it(e||[],t||[],c)}var ot=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return st(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&st(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,ct)),n=n._prev;return`[`+e.join(`, `)+`]`}};function st(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ct(e,t){if(e!==`_next`&&e!==`_prev`)return t}var lt=a(1);function ut(e,t){if(e.nodeCount()<=1)return[];var n=ft(e,t||lt);return S(E(dt(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function dt(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)z(e,t,n,o);for(;o=i.dequeue();)z(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(z(e,t,n,o,!0));break}}}return r}function z(e,t,n,r,i){var a=i?[]:void 0;return x(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,B(t,n,s)}),x(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,B(t,n,o)}),e.removeNode(r.v),a}function ft(e,t){var n=new k,r=0,i=0;x(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),x(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=I(i+r+3).map(function(){return new ot}),o=r+1;return x(n.nodes(),function(e){B(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function B(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function pt(e){x(e.graph().acyclicer===`greedy`?ut(e,t(e)):mt(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,R(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function mt(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,x(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return x(e.nodes(),i),t}function ht(e){x(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function V(e,t,n,r){var i;do i=R(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function gt(e){var t=new k().setGraph(e.graph());return x(e.nodes(),function(n){t.setNode(n,e.node(n))}),x(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function _t(e){var t=new k({multigraph:e.isMultigraph()}).setGraph(e.graph());return x(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),x(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function vt(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function H(e){var t=E(I(St(e)+1),function(){return[]});return x(e.nodes(),function(n){var r=e.node(n),i=r.rank;b(i)||(t[i][r.order]=n)}),t}function yt(e){var t=T(E(e.nodes(),function(t){return e.node(t).rank}));x(e.nodes(),function(n){var r=e.node(n);fe(r,`rank`)&&(r.rank-=t)})}function bt(e){var t=T(E(e.nodes(),function(t){return e.node(t).rank})),n=[];x(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;x(n,function(t,n){b(t)&&n%i!==0?--r:r&&x(t,function(t){e.node(t).rank+=r})})}function xt(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),V(e,`border`,i,t)}function St(e){return j(E(e.nodes(),function(t){var n=e.node(t).rank;if(!b(n))return n}))}function Ct(e,t){var n={lhs:[],rhs:[]};return x(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function wt(e,t){var n=Ce();try{return t()}finally{console.log(e+` time: `+(Ce()-n)+`ms`)}}function Tt(e,t){return t()}function Et(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&x(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Dt(e,`borderLeft`,`_bl`,n,i,a),Dt(e,`borderRight`,`_br`,n,i,a)}}x(e.children(),t)}function Dt(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=V(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Ot(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&At(e)}function kt(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&jt(e),(t===`lr`||t===`rl`)&&(Mt(e),At(e))}function At(e){x(e.nodes(),function(t){U(e.node(t))}),x(e.edges(),function(t){U(e.edge(t))})}function U(e){var t=e.width;e.width=e.height,e.height=t}function jt(e){x(e.nodes(),function(t){W(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);x(n.points,W),Object.prototype.hasOwnProperty.call(n,`y`)&&W(n)})}function W(e){e.y=-e.y}function Mt(e){x(e.nodes(),function(t){G(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);x(n.points,G),Object.prototype.hasOwnProperty.call(n,`x`)&&G(n)})}function G(e){var t=e.x;e.x=e.y,e.y=t}function Nt(e){e.graph().dummyChains=[],x(e.edges(),function(t){Pt(e,t)})}function Pt(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=V(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Ft(e){x(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function K(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=T(E(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}x(e.sources(),n)}function q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function It(e){var t=new k({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Lt(t,e)<r;)i=Rt(t,e),a=t.hasNode(i.v)?q(e,i):-q(e,i),zt(t,e,a);return t}function Lt(e,t){function n(r){x(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return x(e.nodes(),n),e.nodeCount()}function Rt(e,t){return M(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return q(t,n)})}function zt(e,t,n){x(e.nodes(),function(e){t.node(e).rank+=n})}a(1),a(1),Bt.CycleException=J;function Bt(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new J;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,x(e.predecessors(a),i),delete n[a],r.push(a))}if(x(e.sinks(),i),nt(t)!==e.nodeCount())throw new J;return r}function J(){}J.prototype=Error();function Vt(e,t,n){o(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return x(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Ht(e,t,n===`post`,a,r,i)}),i}function Ht(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),x(i(t),function(t){Ht(e,t,n,r,i,a)}),n&&a.push(t))}function Ut(e,t){return Vt(e,t,`post`)}function Wt(e,t){return Vt(e,t,`pre`)}Y.initLowLimValues=Z,Y.initCutValues=X,Y.calcCutValue=Kt,Y.leaveEdge=Jt,Y.enterEdge=Yt,Y.exchangeEdges=Xt;function Y(e){e=gt(e),K(e);var t=It(e);Z(t),X(t,e);for(var n,r;n=Jt(t);)r=Yt(t,e,n),Xt(t,e,n,r)}function X(e,t){var n=Ut(e,e.nodes());n=n.slice(0,n.length-1),x(n,function(n){Gt(e,t,n)})}function Gt(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Kt(e,t,n)}function Kt(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,x(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Qt(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Z(e,t){arguments.length<2&&(t=e.nodes()[0]),qt(e,{},1,t)}function qt(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,x(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=qt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Jt(e){return C(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Yt(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),M(g(t.edges(),function(t){return c===$t(e,e.node(t.v),s)&&c!==$t(e,e.node(t.w),s)}),function(e){return q(t,e)})}function Xt(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Z(e),X(e,t),Zt(e,t)}function Zt(e,t){var n=Wt(e,C(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),x(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Qt(e,t,n){return e.hasEdge(t,n)}function $t(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function en(e){switch(e.graph().ranker){case`network-simplex`:rn(e);break;case`tight-tree`:nn(e);break;case`longest-path`:tn(e);break;default:rn(e)}}var tn=K;function nn(e){K(e),It(e)}function rn(e){Y(e)}function an(e){var t=V(e,`root`,{},`_root`),n=sn(e),r=j(v(n))-1,i=2*r+1;e.graph().nestingRoot=t,x(e.edges(),function(t){e.edge(t).minlen*=i});var a=cn(e)+1;x(e.children(),function(o){on(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function on(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=xt(e,`_bt`),l=xt(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,x(s,function(s){on(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function sn(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&x(a,function(e){n(e,i+1)}),t[r]=i}return x(e.children(),function(e){n(e,1)}),t}function cn(e){return y(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function ln(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,x(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function un(e,t,n){var r={},i;x(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function dn(e,t,n){var r=fn(e),i=new k({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return x(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),x(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=b(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function fn(e){for(var t;e.hasNode(t=R(`_root`)););return t}function pn(e,t){for(var n=0,r=1;r<t.length;++r)n+=mn(e,t[r-1],t[r]);return n}function mn(e,t,n){for(var r=at(n,E(n,function(e,t){return t})),i=S(E(t,function(t){return L(E(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=E(Array(o),function(){return 0}),c=0;return x(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function hn(e){var t={},n=g(e.nodes(),function(t){return!e.children(t).length}),r=E(I(j(E(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){fe(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),x(e.successors(n),i))}return x(L(n,function(t){return e.node(t).rank}),i),r}function gn(e,t){return E(t,function(t){var n=e.inEdges(t);if(n.length){var r=y(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}function _n(e,t){var n={};return x(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};b(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),x(t.edges(),function(e){var t=n[e.v],r=n[e.w];!b(t)&&!b(r)&&(r.indegree++,t.out.push(n[e.w]))}),vn(g(n,function(e){return!e.indegree}))}function vn(e){var t=[];function n(e){return function(t){t.merged||(b(t.barycenter)||b(e.barycenter)||t.barycenter>=e.barycenter)&&yn(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),x(i.in.reverse(),n(i)),x(i.out,r(i))}return E(g(t,function(e){return!e.merged}),function(e){return F(e,[`vs`,`i`,`barycenter`,`weight`])})}function yn(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function bn(e,t){var n=Ct(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=L(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Sn(!!t)),c=xn(a,i,c),x(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=xn(a,i,c)});var l={vs:S(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function xn(e,t,n){for(var r;t.length&&(r=D(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Sn(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function Cn(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=g(i,function(e){return e!==o&&e!==s}));var l=gn(e,i);x(l,function(t){if(e.children(t.v).length){var i=Cn(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Tn(t,i)}});var u=_n(l,n);wn(u,c);var d=bn(u,r);if(o&&(d.vs=S([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function wn(e,t){x(e,function(e){e.vs=S(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Tn(e,t){b(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function En(e){var t=St(e),n=Dn(e,I(1,t+1),`inEdges`),r=Dn(e,I(t-1,-1,-1),`outEdges`),i=hn(e);kn(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){On(s%2?n:r,s%4>=2),i=H(e);var l=pn(e,i);l<a&&(c=0,o=Se(i),a=l)}kn(e,o)}function Dn(e,t,n){return E(t,function(t){return dn(e,t,n)})}function On(e,t){var n=new k;x(e,function(e){var r=e.graph().root,i=Cn(e,r,n,t);x(i.vs,function(t,n){e.node(t).order=n}),un(e,n,i.vs)})}function kn(e,t){x(t,function(t){x(t,function(t,n){e.node(t).order=n})})}function An(e){var t=Mn(e);x(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=jn(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function jn(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Mn(e){var t={},n=0;function r(i){var a=n;x(e.children(i),r),t[i]={low:a,lim:n++}}return x(e.children(),r),t}function Nn(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=D(r);return x(r,function(t,c){var l=Fn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(x(r.slice(a,c+1),function(t){x(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&In(n,r,t)})}),a=c+1,i=u)}),r}return y(t,r),n}function Pn(e,t){var n={};function r(t,r,i,a,o){var s;x(I(r,i),function(r){s=t[r],e.node(s).dummy&&x(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&In(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return x(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return y(t,i),n}function Fn(e,t){if(e.node(t).dummy)return C(e.predecessors(t),function(t){return e.node(t).dummy})}function In(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ln(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Rn(e,t,n,r){var i={},a={},o={};return x(t,function(e){x(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),x(t,function(e){var t=-1;x(e,function(e){var s=r(e);if(s.length){s=L(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Ln(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function zn(e,t,n,r,i){var a={},o=Bn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),x(r,function(e){a[e]=a[n[e]]}),a}function Bn(e,t,n,r){var i=new k,a=e.graph(),o=Gn(a.nodesep,a.edgesep,r);return x(t,function(t){var r;x(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Vn(e,t){return M(v(t),function(t){var n=-1/0,r=1/0;return we(t,function(t,i){var a=Kn(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Hn(e,t){var n=v(t),r=T(n),i=j(n);x([`u`,`d`],function(n){x([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=v(s);c=a===`l`?r-T(l):i-j(l),c&&(e[o]=A(s,function(e){return e+c}))}})})}function Un(e,t){return A(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=L(E(e,r));return(i[1]+i[2])/2})}function Wn(e){var t=H(e),n=O(Nn(e,t),Pn(e,t)),r={},i;return x([`u`,`d`],function(a){i=a===`u`?t:v(t).reverse(),x([`l`,`r`],function(t){t===`r`&&(i=E(i,function(e){return v(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Rn(e,i,n,o),c=zn(e,i,s.root,s.align,t===`r`);t===`r`&&(c=A(c,function(e){return-e})),r[a+t]=c})}),Hn(r,Vn(e,r)),Un(r,e.graph().align)}function Gn(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function Kn(e,t){return e.node(t).width}function qn(e){e=_t(e),Jn(e),Te(Wn(e),function(t,n){e.node(n).x=t})}function Jn(e){var t=H(e),n=e.graph().ranksep,r=0;x(t,function(t){var i=j(E(t,function(t){return e.node(t).height}));x(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function Yn(e,t){var n=t&&t.debugTiming?wt:Tt;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>or(e));n(` runLayout`,()=>Xn(t,n)),n(` updateInputGraph`,()=>Zn(e,t))})}function Xn(e,t){t(` makeSpaceForEdgeLabels`,()=>sr(e)),t(` removeSelfEdges`,()=>gr(e)),t(` acyclic`,()=>pt(e)),t(` nestingGraph.run`,()=>an(e)),t(` rank`,()=>en(_t(e))),t(` injectEdgeLabelProxies`,()=>cr(e)),t(` removeEmptyRanks`,()=>bt(e)),t(` nestingGraph.cleanup`,()=>ln(e)),t(` normalizeRanks`,()=>yt(e)),t(` assignRankMinMax`,()=>lr(e)),t(` removeEdgeLabelProxies`,()=>ur(e)),t(` normalize.run`,()=>Nt(e)),t(` parentDummyChains`,()=>An(e)),t(` addBorderSegments`,()=>Et(e)),t(` order`,()=>En(e)),t(` insertSelfEdges`,()=>_r(e)),t(` adjustCoordinateSystem`,()=>Ot(e)),t(` position`,()=>qn(e)),t(` positionSelfEdges`,()=>vr(e)),t(` removeBorderNodes`,()=>hr(e)),t(` normalize.undo`,()=>Ft(e)),t(` fixupEdgeLabelCoords`,()=>pr(e)),t(` undoCoordinateSystem`,()=>kt(e)),t(` translateGraph`,()=>dr(e)),t(` assignNodeIntersects`,()=>fr(e)),t(` reversePoints`,()=>mr(e)),t(` acyclic.undo`,()=>ht(e))}function Zn(e,t){x(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),x(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Qn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],$n={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},er=[`acyclicer`,`ranker`,`rankdir`,`align`],tr=[`width`,`height`],nr={width:0,height:0},rr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],ir={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},ar=[`labelpos`];function or(e){var t=new k({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(O({},$n,Q(n,Qn),F(n,er))),x(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,ue(Q(r,tr),nr)),t.setParent(n,e.parent(n))}),x(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,O({},ir,Q(r,rr),F(r,ar)))}),t}function sr(e){var t=e.graph();t.ranksep/=2,x(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function cr(e){x(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);V(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function lr(e){var t=0;x(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=j(t,r.maxRank))}),e.graph().maxRank=t}function ur(e){x(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function dr(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}x(e.nodes(),function(t){c(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,x(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),x(e.edges(),function(n){var i=e.edge(n);x(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function fr(e){x(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(vt(r,a)),n.points.push(vt(i,o))})}function pr(e){x(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function mr(e){x(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function hr(e){x(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(D(n.borderLeft)),o=e.node(D(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),x(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function gr(e){x(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function _r(e){x(H(e),function(t){var n=0;x(t,function(t,r){var i=e.node(t);i.order=r+n,x(i.selfEdges,function(t){V(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function vr(e){x(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Q(e,t){return A(F(e,t),Number)}function $(e){var t={};return x(e,function(e,n){t[n.toLowerCase()]=e}),t}export{Yn as t};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./_baseUniq-DKYX57ji.js";import{s as t}from"./_basePickBy-Dv0sK1l7.js";import{t as n}from"./dagre-CfB3Fw33.js";import"./chunk-GEFDOKGD-Bs7FmFox.js";import{t as r}from"./clone-Dgi8Z4IL.js";import{t as i}from"./graphlib-BgRST-Qg.js";import{g as a,h as o}from"./src-Pgt9Gp65.js";import{b as s}from"./chunk-7R4GIKGN-mqd2GwMg.js";import"./chunk-PU5JKC2W-D_6N6t8f.js";import"./chunk-MX3YWQON-DQpSwRf6.js";import{n as c}from"./chunk-YBOYWFTD-CKg4ymFF.js";import"./chunk-PQ6SQG4A-D1AbThjy.js";import{a as l,c as u,i as d,l as f,n as p,t as m,u as h}from"./chunk-KYZI473N-CTSCuqRb.js";import{a as g,i as _,n as v,r as y,t as b}from"./chunk-O4XLMI2P-CcVxZh41.js";function x(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:S(t),edges:C(t)};return e(t.graph())||(n.value=r(t.graph())),n}function S(n){return t(n.nodes(),function(t){var r=n.node(t),i=n.parent(t),a={v:t};return e(r)||(a.value=r),e(i)||(a.parent=i),a})}function C(n){return t(n.edges(),function(t){var r=n.edge(t),i={v:t.v,w:t.w};return e(t.name)||(i.name=t.name),e(r)||(i.value=r),i})}var w=new Map,T=new Map,E=new Map,D=o(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=o((e,t)=>{let n=T.get(t)||[];return a.trace(`In isDescendant`,t,` `,e,` = `,n.includes(e)),n.includes(e)},`isDescendant`),k=o((e,t)=>{let n=T.get(t)||[];return a.info(`Descendants of `,t,` is `,n),a.info(`Edge is `,e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(a.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),A=o((e,t,n,r)=>{a.warn(`Copying children of `,e,`root`,r,`data`,t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),a.warn(`Copying (nodes) clusterId`,e,`nodes`,i),i.forEach(i=>{if(t.children(i).length>0)A(i,t,n,r);else{let o=t.node(i);a.info(`cp `,i,` to `,r,` with parent `,e),n.setNode(i,o),r!==t.parent(i)&&(a.warn(`Setting parent`,i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(a.debug(`Setting parent`,i,e),n.setParent(i,e)):(a.info(`In copy `,e,`root`,r,`data`,t.node(e),r),a.debug(`Not Setting parent for node=`,i,`cluster!==rootId`,e!==r,`node!==clusterId`,i!==e));let s=t.edges(i);a.debug(`Copying Edges`,s),s.forEach(i=>{a.info(`Edge`,i);let o=t.edge(i.v,i.w,i.name);a.info(`Edge data`,o,r);try{k(i,r)?(a.info(`Copying as `,i.v,i.w,o,i.name),n.setEdge(i.v,i.w,o,i.name),a.info(`newGraph edges `,n.edges(),n.edge(n.edges()[0]))):a.info(`Skipping copy of edge `,i.v,`-->`,i.w,` rootId: `,r,` clusterId:`,e)}catch(e){a.error(e)}})}a.debug(`Removing node`,i),t.removeNode(i)})},`copy`),j=o((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=o((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=o((e,t,n)=>{let r=t.children(e);if(a.trace(`Searching children of id `,e,r),r.length<1)return e;let i;for(let e of r){let r=N(e,t,n),a=M(t,n,r);if(r)if(a.length>0)i=r;else return r}return i},`findNonClusterChild`),P=o(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=o((e,t)=>{if(!e||t>10){a.debug(`Opting out, no graph `);return}else a.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(a.warn(`Cluster identified`,t,` Replacement id in edges: `,N(t,e,t)),T.set(t,j(t,e)),w.set(t,{id:N(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(a.debug(`Cluster identified`,t,T),r.forEach(e=>{O(e.v,t)^O(e.w,t)&&(a.warn(`Edge: `,e,` leaves cluster `,t),a.warn(`Descendants of XXX `,t,`: `,T.get(t)),w.get(t).externalConnections=!0)})):a.debug(`Not a cluster `,t,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r)}e.edges().forEach(function(t){let n=e.edge(t);a.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),a.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(a.warn(`Fix XXX`,w,`ids:`,t.v,t.w,`Translating: `,w.get(t.v),` --- `,w.get(t.w)),w.get(t.v)||w.get(t.w)){if(a.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),r=P(t.v),i=P(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);w.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);w.get(r).externalConnections=!0,n.toCluster=t.w}a.warn(`Fix Replacing with XXX`,r,i,t.name),e.setEdge(r,i,n,t.name)}}),a.warn(`Adjusted Graph`,x(e)),I(e,0),a.trace(w)},`adjustClustersAndEdges`),I=o((e,t)=>{if(a.warn(`extractor - `,t,x(e),e.children(`D`)),t>10){a.error(`Bailing out`);return}let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r||=n.length>0}if(!r){a.debug(`Done, no node has children`,e.nodes());return}a.debug(`Nodes = `,n,t);for(let r of n)if(a.debug(`Extracting node`,r,w,w.has(r)&&!w.get(r).externalConnections,!e.parent(r),e.node(r),e.children(`D`),` Depth `,t),!w.has(r))a.debug(`Not a cluster`,r,t);else if(!w.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){a.warn(`Cluster without external connections, without a parent and with children`,r,t);let n=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(r)?.clusterData?.dir&&(n=w.get(r).clusterData.dir,a.warn(`Fixing dir`,w.get(r).clusterData.dir,n));let o=new i({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});a.warn(`Old graph before copy`,x(e)),A(r,e,o,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:w.get(r).clusterData,label:w.get(r).label,graph:o}),a.warn(`New graph after copy node: (`,r,`)`,x(o)),a.debug(`Old graph after copy`,x(e))}else a.warn(`Cluster ** `,r,` **not meeting the criteria !externalConnections:`,!w.get(r).externalConnections,` no parent: `,!e.parent(r),` children `,e.children(r)&&e.children(r).length>0,e.children(`D`),t),a.debug(w);n=e.nodes(),a.warn(`New list of nodes`,n);for(let r of n){let n=e.node(r);a.warn(` Now next level`,r,n),n?.clusterNode&&I(n.graph,t+1)}},`extractor`),L=o((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=o(e=>L(e,e.children()),`sortNodesByHierarchy`),z=o(async(e,t,r,i,s,p)=>{a.warn(`Graph in recursive render:XAX`,x(t),s);let m=t.graph().rankdir;a.trace(`Dir in recursive render - dir:`,m);let _=e.insert(`g`).attr(`class`,`root`);t.nodes()?a.info(`Recursive render XXX`,t.nodes()):a.info(`No nodes found for`,t),t.edges().length>0&&a.info(`Recursive edges`,t.edge(t.edges()[0]));let b=_.insert(`g`).attr(`class`,`clusters`),S=_.insert(`g`).attr(`class`,`edgePaths`),C=_.insert(`g`).attr(`class`,`edgeLabels`),T=_.insert(`g`).attr(`class`,`nodes`);await Promise.all(t.nodes().map(async function(e){let n=t.node(e);if(s!==void 0){let n=JSON.parse(JSON.stringify(s.clusterData));a.trace(`Setting data for parent cluster XXX
|
|
2
|
-
Node.id = `,e,`
|
|
3
|
-
data=`,n.height,`
|
|
4
|
-
Parent cluster`,s.height),t.setNode(s.id,n),t.parent(e)||(a.trace(`Setting parent`,e,s.id),t.setParent(e,s.id,n))}if(a.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(t.node(e))),n?.clusterNode){a.info(`Cluster identified XBX`,e,n.width,t.node(e));let{ranksep:o,nodesep:s}=t.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let c=await z(T,n.graph,r,i,t.node(e),p),l=c.elem;h(n,l),n.diff=c.diff||0,a.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),f(l,n)}else t.children(e).length>0?(a.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,t),a.trace(N(n.id,t)),w.set(n.id,{id:N(n.id,t),node:n})):(a.trace(`Node - the non recursive path XAX`,e,T,t.node(e),m),await l(T,t.node(e),{config:p,dir:m}))})),await o(async()=>{let e=t.edges().map(async function(e){let n=t.edge(e.v,e.w,e.name);a.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),a.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(t.edge(e))),a.info(`Fix`,w,`ids:`,e.v,e.w,`Translating: `,w.get(e.v),w.get(e.w)),await y(C,n)});await Promise.all(e)},`processEdges`)(),a.info(`Graph before layout:`,JSON.stringify(x(t))),a.info(`############################################# XXX`),a.info(`### Layout ### XXX`),a.info(`############################################# XXX`),n(t),a.info(`Graph after layout:`,JSON.stringify(x(t)));let E=0,{subGraphTitleTotalMargin:D}=c(p);return await Promise.all(R(t).map(async function(e){let n=t.node(e);if(a.info(`Position XBX => `+e+`: (`+n.x,`,`+n.y,`) width: `,n.width,` height: `,n.height),n?.clusterNode)n.y+=D,a.info(`A tainted cluster node XBX1`,e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),w.get(n.id).node=n,u(n);else if(t.children(e).length>0){a.info(`A pure cluster node XBX1`,e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=D,t.node(n.parentId);let r=n?.padding/2||0,i=n?.labelBBox?.height||0,o=i-r||0;a.debug(`OffsetY`,o,`labelHeight`,i,`halfPadding`,r),await d(b,n),w.get(n.id).node=n}else{let e=t.node(n.parentId);n.y+=D/2,a.info(`A regular node XBX1 - using the padding`,n.id,`parent`,n.parentId,n.width,n.height,n.x,n.y,`offsetY`,n.offsetY,`parent`,e,e?.offsetY,n),u(n)}})),t.edges().forEach(function(e){let n=t.edge(e);a.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(n),n),n.points.forEach(e=>e.y+=D/2),g(n,v(S,n,w,r,t.node(e.v),t.node(e.w),i))}),t.nodes().forEach(function(e){let n=t.node(e);a.info(e,n.type,n.diff),n.isGroup&&(E=n.diff)}),a.warn(`Returning from recursive render XAX`,_,E),{elem:_,diff:E}},`recursiveRender`),B=o(async(e,t)=>{let n=new i({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{}}),r=t.select(`g`);_(r,e.markers,e.type,e.diagramId),p(),b(),m(),D(),e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),a.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e);o.label=``,o.arrowTypeEnd=`none`,o.id=t+`-cyclic-special-1`,s.arrowTypeStart=`none`,s.arrowTypeEnd=`none`,s.id=t+`-cyclic-special-mid`,c.label=``,a.isGroup&&(o.fromCluster=t,c.toCluster=t),c.id=t+`-cyclic-special-2`,c.arrowTypeStart=`none`,n.setEdge(t,r,o,t+`-cyclic-special-0`),n.setEdge(r,i,s,t+`-cyclic-special-1`),n.setEdge(i,t,c,t+`-cyc<lic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),a.warn(`Graph at first:`,JSON.stringify(x(n))),F(n),a.warn(`Graph after XAX:`,JSON.stringify(x(n)));let o=s();await z(r,n,e.type,e.diagramId,void 0,o)},`render`);export{B as render};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-GEFDOKGD-Bs7FmFox.js";import{g as t,h as n,p as r}from"./src-Pgt9Gp65.js";import{B as i,C as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-7R4GIKGN-mqd2GwMg.js";import{t as m}from"./ordinal-Dz3y_j0K.js";import{t as h}from"./defaultLocale-B_FbTTbl.js";import{t as g}from"./chunk-HHEYEP7N-DlevL8bq.js";import{t as _}from"./chunk-4BX2VUAB-2e7V-uuE.js";import{t as v}from"./mermaid-parser.core-B1ogGcR8.js";import{t as y}from"./chunk-KX2RTZJC-BTiOJb7N.js";import{i as b,n as x}from"./chunk-PQ6SQG4A-D1AbThjy.js";function S(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function C(){return this.eachAfter(S)}function w(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function T(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function E(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function D(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function O(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function k(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function A(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*I(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function L(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=B)):t===void 0&&(t=z);for(var n=new U(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new U(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(H)}function R(){return L(this).eachBefore(V)}function z(e){return e.children}function B(e){return Array.isArray(e)?e[1]:null}function V(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function H(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=L.prototype={constructor:U,count:C,each:w,eachAfter:E,eachBefore:T,find:D,sum:O,sort:k,path:A,ancestors:M,descendants:N,leaves:P,links:F,copy:R,[Symbol.iterator]:I};function W(e){if(typeof e!=`function`)throw Error();return e}function G(){return 0}function K(e){return function(){return e}}function q(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function J(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var te=(1+Math.sqrt(5))/2;function ne(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?J(c,n,r,i,h?r+=m*g/h:a):ee(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var re=(function e(t){function n(e,n,r,i,a){ne(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(te);function ie(){var e=re,t=!1,n=1,r=1,i=[0],a=G,o=G,s=G,c=G,l=G;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(q),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=W(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:K(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:K(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:K(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:K(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:K(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=f,this.setDiagramTitle=s,this.getDiagramTitle=a,this.getAccDescription=c,this.setAccDescription=i}static{n(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let t=d,n=p();return e({...t.treemap,...n.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{x(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){l(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}n(X,`buildHierarchy`);var ae=n((e,t)=>{_(e,t);let r=[];for(let n of e.TreemapRows??[])n.$type===`ClassDefStatement`&&t.addClass(n.className??``,n.styleText??``);for(let n of e.TreemapRows??[]){let e=n.item;if(!e)continue;let i=n.indent?parseInt(n.indent):0,a=oe(e),o=e.classSelector?t.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=n((e,n)=>{for(let r of e)t.addNode(r,n),r.children&&r.children.length>0&&a(r.children,n+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=n(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:n(async e=>{try{let n=await v(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);ae(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},se=10,Q=10,$=25,ce={draw:n((e,i,a,o)=>{let s=o.db,c=s.getConfig(),l=c.padding??se,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:_}=p();if(!f)return;let v=d?30:0,x=g(i),S=c.nodeWidth?c.nodeWidth*Q:960,C=c.nodeHeight?c.nodeHeight*Q:500,w=S,T=C+v;x.attr(`viewBox`,`0 0 ${w} ${T}`),u(x,T,w,c.useMaxWidth);let E;try{let e=c.valueFormat||`,`;if(e===`$0,0`)E=n(e=>`$`+h(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),r=t?t[0]:``;E=n(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=n(e=>`$`+h(t||``)(e),`valueFormat`)}else E=h(e)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,_.cScale0,_.cScale1,_.cScale2,_.cScale3,_.cScale4,_.cScale5,_.cScale6,_.cScale7,_.cScale8,_.cScale9,_.cScale10,_.cScale11]),O=m().range([`transparent`,_.cScalePeer0,_.cScalePeer1,_.cScalePeer2,_.cScalePeer3,_.cScalePeer4,_.cScalePeer5,_.cScalePeer6,_.cScalePeer7,_.cScalePeer8,_.cScalePeer9,_.cScalePeer10,_.cScalePeer11]),k=m().range([_.cScaleLabel0,_.cScaleLabel1,_.cScaleLabel2,_.cScaleLabel3,_.cScaleLabel4,_.cScaleLabel5,_.cScaleLabel6,_.cScaleLabel7,_.cScaleLabel8,_.cScaleLabel9,_.cScaleLabel10,_.cScaleLabel11]);d&&x.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(d);let A=x.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=L(f).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ie().size([S,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(l).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=b({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=r(this),n=e.data.name;t.text(n);let i=e.x1-e.x0,a;a=c.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),c.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);I.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>b({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),I.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),I.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=r(this),n=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=n-8,s=i-8;if(o<10||s<10){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>8;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(6,Math.min(28,Math.round(c*l))),d=c+2+u;for(;d>s&&c>8&&(c--,u=Math.max(6,Math.min(28,Math.round(c*l))),!(u<6&&c===8));)t.style(`font-size`,`${c}px`),d=c+2+u;t.style(`font-size`,`${c}px`),(a.getComputedTextLength()>o||c<8||s<c)&&t.style(`display`,`none`)}),c.showValues!==!1&&I.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=r(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let i=r(n).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(6,Math.min(28,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+2;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-8;t.node().getComputedTextLength()>u||s+o>l||o<6?t.style(`display`,`none`):t.style(`display`,null)}),y(x,c.diagramPadding??8,`flowchart`,c?.useMaxWidth||!1)},`draw`),getClasses:n(function(e,t){return t.db.getClasses()},`getClasses`)},le={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelColor:`black`,labelFontSize:`12px`,valueFontSize:`10px`,valueColor:`black`,titleColor:`black`,titleFontSize:`14px`},ue={parser:Z,get db(){return new Y},renderer:ce,styles:n(({treemap:t}={})=>{let n=e(le,t);return`
|
|
2
|
-
.treemapNode.section {
|
|
3
|
-
stroke: ${n.sectionStrokeColor};
|
|
4
|
-
stroke-width: ${n.sectionStrokeWidth};
|
|
5
|
-
fill: ${n.sectionFillColor};
|
|
6
|
-
}
|
|
7
|
-
.treemapNode.leaf {
|
|
8
|
-
stroke: ${n.leafStrokeColor};
|
|
9
|
-
stroke-width: ${n.leafStrokeWidth};
|
|
10
|
-
fill: ${n.leafFillColor};
|
|
11
|
-
}
|
|
12
|
-
.treemapLabel {
|
|
13
|
-
fill: ${n.labelColor};
|
|
14
|
-
font-size: ${n.labelFontSize};
|
|
15
|
-
}
|
|
16
|
-
.treemapValue {
|
|
17
|
-
fill: ${n.valueColor};
|
|
18
|
-
font-size: ${n.valueFontSize};
|
|
19
|
-
}
|
|
20
|
-
.treemapTitle {
|
|
21
|
-
fill: ${n.titleColor};
|
|
22
|
-
font-size: ${n.titleFontSize};
|
|
23
|
-
}
|
|
24
|
-
`},`getStyles`)};export{ue as diagram};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-GEFDOKGD-Bs7FmFox.js";import{g as t,h as n}from"./src-Pgt9Gp65.js";import{B as r,C as i,E as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-7R4GIKGN-mqd2GwMg.js";import{t as m}from"./chunk-HHEYEP7N-DlevL8bq.js";import{t as h}from"./chunk-4BX2VUAB-2e7V-uuE.js";import{t as g}from"./mermaid-parser.core-B1ogGcR8.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=d.radar,x=n(()=>e({...b,...p().radar}),`getConfig`),S=n(()=>y.axes,`getAxes`),C=n(()=>y.curves,`getCurves`),w=n(()=>y.options,`getOptions`),T=n(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=n(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=n(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:n(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:n(()=>{l(),y=structuredClone(v)},`clear`),setAccTitle:o,getAccTitle:f,setDiagramTitle:s,getDiagramTitle:i,getAccDescription:c,setAccDescription:r},k=n(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:n(async e=>{let n=await g(`radar`,e);t.debug(n),k(n)},`parse`)},j=n((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=n((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return u(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=n((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=n((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}n(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}n(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}n(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}n(R,`drawLegend`);var z={draw:j},B=n((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
|
|
2
|
-
.radarCurve-${r} {
|
|
3
|
-
color: ${i};
|
|
4
|
-
fill: ${i};
|
|
5
|
-
fill-opacity: ${t.curveOpacity};
|
|
6
|
-
stroke: ${i};
|
|
7
|
-
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
-
}
|
|
9
|
-
.radarLegendBox-${r} {
|
|
10
|
-
fill: ${i};
|
|
11
|
-
fill-opacity: ${t.curveOpacity};
|
|
12
|
-
stroke: ${i};
|
|
13
|
-
}
|
|
14
|
-
`}return n},`genIndexStyles`),V=n(t=>{let n=e(a(),p().themeVariables);return{themeVariables:n,radarOptions:e(n.radar,t)}},`buildRadarStyleOptions`),H={parser:A,db:O,renderer:z,styles:n(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=V(e);return`
|
|
15
|
-
.radarTitle {
|
|
16
|
-
font-size: ${t.fontSize};
|
|
17
|
-
color: ${t.titleColor};
|
|
18
|
-
dominant-baseline: hanging;
|
|
19
|
-
text-anchor: middle;
|
|
20
|
-
}
|
|
21
|
-
.radarAxisLine {
|
|
22
|
-
stroke: ${n.axisColor};
|
|
23
|
-
stroke-width: ${n.axisStrokeWidth};
|
|
24
|
-
}
|
|
25
|
-
.radarAxisLabel {
|
|
26
|
-
dominant-baseline: middle;
|
|
27
|
-
text-anchor: middle;
|
|
28
|
-
font-size: ${n.axisLabelFontSize}px;
|
|
29
|
-
color: ${n.axisColor};
|
|
30
|
-
}
|
|
31
|
-
.radarGraticule {
|
|
32
|
-
fill: ${n.graticuleColor};
|
|
33
|
-
fill-opacity: ${n.graticuleOpacity};
|
|
34
|
-
stroke: ${n.graticuleColor};
|
|
35
|
-
stroke-width: ${n.graticuleStrokeWidth};
|
|
36
|
-
}
|
|
37
|
-
.radarLegendText {
|
|
38
|
-
text-anchor: start;
|
|
39
|
-
font-size: ${n.legendFontSize}px;
|
|
40
|
-
dominant-baseline: hanging;
|
|
41
|
-
}
|
|
42
|
-
${B(t,n)}
|
|
43
|
-
`},`styles`)};export{H as diagram};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-GEFDOKGD-Bs7FmFox.js";import{g as t,h as n}from"./src-Pgt9Gp65.js";import{B as r,C as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-7R4GIKGN-mqd2GwMg.js";import{t as p}from"./chunk-HHEYEP7N-DlevL8bq.js";import{t as m}from"./chunk-4BX2VUAB-2e7V-uuE.js";import{t as h}from"./mermaid-parser.core-B1ogGcR8.js";var g=u.packet,_=class{constructor(){this.packet=[],this.setAccTitle=a,this.getAccTitle=d,this.setDiagramTitle=o,this.getDiagramTitle=i,this.getAccDescription=s,this.setAccDescription=r}static{n(this,`PacketDB`)}getConfig(){let t=e({...g,...f().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){c(),this.packet=[]}},v=1e4,y=n((e,n)=>{m(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=n((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:n(async e=>{let n=await h(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=n((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:c,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+s,h=m*(d.length+1)-(f?0:o),g=c*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),l(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=n((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:n(({packet:t}={})=>{let n=e(T,t);return`
|
|
2
|
-
.packetByte {
|
|
3
|
-
font-size: ${n.byteFontSize};
|
|
4
|
-
}
|
|
5
|
-
.packetByte.start {
|
|
6
|
-
fill: ${n.startByteColor};
|
|
7
|
-
}
|
|
8
|
-
.packetByte.end {
|
|
9
|
-
fill: ${n.endByteColor};
|
|
10
|
-
}
|
|
11
|
-
.packetLabel {
|
|
12
|
-
fill: ${n.labelColor};
|
|
13
|
-
font-size: ${n.labelFontSize};
|
|
14
|
-
}
|
|
15
|
-
.packetTitle {
|
|
16
|
-
fill: ${n.titleColor};
|
|
17
|
-
font-size: ${n.titleFontSize};
|
|
18
|
-
}
|
|
19
|
-
.packetBlock {
|
|
20
|
-
stroke: ${n.blockStrokeColor};
|
|
21
|
-
stroke-width: ${n.blockStrokeWidth};
|
|
22
|
-
fill: ${n.blockFillColor};
|
|
23
|
-
}
|
|
24
|
-
`},`styles`)};export{E as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./dist-D5QOYy7y.js";export{e as markdown};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./dist-B4uQVR_X.js";export{e as yaml};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ct as e,E as t,I as n,L as r,O as i,Ot as a,S as o,St as s,T as c,_t as l,at as u,ct as d,gt as f,it as p,j as m,n as h,rt as g,ut as _,vt as ee,wt as v,x as y,yt as b}from"./dist-DWJL3_bF.js";var te=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=S(e.state,n.from);return r.line?ne(e):r.block?ie(e):!1};function x(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var ne=x(se,0),re=x(w,0),ie=x((e,t)=>w(e,t,oe(t)),0);function S(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var C=50;function ae(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-C,r),o=e.sliceDoc(i,i+C),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*C?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+C),d=e.sliceDoc(i-C,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(u.charAt(f+t.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(d.charAt(m-1))?1:0}}:null}function oe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function w(e,t,n=t.selection.ranges){let r=n.map(e=>S(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>ae(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function se(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=S(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var T=g.define(),ce=g.define(),le=_.define(),ue=_.define({combine(e){return s(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),de=l.define({create(){return F.empty},update(e,t){let n=t.state.facet(ue),r=t.annotation(T);if(r){let i=k.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?A(o,o.length,n.minDepth,i):N(o,t.startState.selection),new F(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ce);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(b.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=k.fromTransaction(t),o=t.annotation(b.time),s=t.annotation(b.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new F(e.done.map(k.fromJSON),e.undone.map(k.fromJSON))}});function fe(e={}){return[de,ue.of(e),r.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?D:e.inputType==`historyRedo`?O:null;return n?(e.preventDefault(),n(t)):!1}})]}function E(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(de,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var D=E(0,!1),O=E(1,!1),pe=E(0,!0),me=E(1,!0),k=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&u.fromJSON(t.changes),[],t.mapped&&p.fromJSON(t.mapped),t.startSelection&&d.fromJSON(t.startSelection),t.selectionsAfter.map(d.fromJSON))}static fromTransaction(t,n){let r=M;for(let e of t.startState.facet(le)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,M)}static selection(t){return new e(void 0,M,void 0,void 0,t)}};function A(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function he(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function ge(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function j(e,t){return e.length?t.length?e.concat(t):e:t}var M=[],_e=200;function N(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_e));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),A(e,e.length-1,1e9,n.setSelAfter(r)))}else return[k.selection([t])]}function ve(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function P(e,t){if(!e.length)return e;let n=e.length,r=M;for(;n;){let i=ye(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[k.selection(r)]:M}function ye(e,t,n){let r=j(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):M,n);if(!e.changes)return k.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new k(i,f.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var be=/^(input\.type|delete)($|\.)/,F=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||be.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,he(s.changes,t.changes))||r==`input.type.compose`)?A(o,o.length-1,i.minDepth,new k(t.changes.compose(s.changes),j(f.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,M)):A(o,o.length,i.minDepth,t),new e(o,M,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:M;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&ge(a[a.length-1],t)?this:new e(N(this.done,t),this.undone,n,r)}addMapping(t){return new e(P(this.done,t),P(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:T.of({side:e,rest:ve(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?M:r.slice(0,r.length-1);return i.mapped&&(n=P(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:T.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};F.empty=new F(M,M);var xe=[{key:`Mod-z`,run:D,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:O,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:O,preventDefault:!0},{key:`Mod-u`,run:pe,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:me,preventDefault:!0}];function I(e,t){return d.create(e.ranges.map(t),e.mainIndex)}function L(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function R({state:e,dispatch:t},n){let r=I(e.selection,n);return r.eq(e.selection,!0)?!1:(t(L(e,r)),!0)}function z(e,t){return d.cursor(t?e.to:e.from)}function B(e,t){return R(e,n=>n.empty?e.moveByChar(n,t):z(n,t))}function V(e){return e.textDirectionAt(e.state.selection.main.head)==n.LTR}var Se=e=>B(e,!V(e)),Ce=e=>B(e,V(e));function we(e,t){return R(e,n=>n.empty?e.moveByGroup(n,t):z(n,t))}var Te=e=>we(e,!V(e)),Ee=e=>we(e,V(e));typeof Intl<`u`&&Intl.Segmenter;function De(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function H(e,t,n){let r=m(e).resolveInner(t.head),o=n?a.closedBy:a.openedBy;for(let i=t.head;;){let t=n?r.childAfter(i):r.childBefore(i);if(!t)break;De(e,t,o)?r=t:i=n?t.to:t.from}let s=r.type.prop(o),c,l;return l=s&&(c=n?i(e,r.from,1):i(e,r.to,-1))&&c.matched?n?c.end.to:c.end.from:n?r.to:r.from,d.cursor(l,n?-1:1)}var Oe=e=>R(e,t=>H(e.state,t,!V(e))),ke=e=>R(e,t=>H(e.state,t,V(e)));function Ae(e,t){return R(e,n=>{if(!n.empty)return z(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var je=e=>Ae(e,!1),Me=e=>Ae(e,!0);function U(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,a;if(t){for(let t of e.state.facet(r.scrollMargins)){let r=t(e);r?.top&&(n=Math.max(r?.top,n)),r?.bottom&&(i=Math.max(r?.bottom,i))}a=e.scrollDOM.clientHeight-n-i}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function Ne(e,t){let n=U(e),{state:i}=e,a=I(i.selection,r=>r.empty?e.moveVertically(r,t,n.height):z(r,t));if(a.eq(i.selection))return!1;let o;if(n.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),c=s.top+n.marginTop,l=s.bottom-n.marginBottom;t&&t.top>c&&t.bottom<l&&(o=r.scrollIntoView(a.main.head,{y:`start`,yMargin:t.top-c}))}return e.dispatch(L(i,a),{effects:o}),!0}var Pe=e=>Ne(e,!1),W=e=>Ne(e,!0);function G(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=d.cursor(r.from+n))}return i}var Fe=e=>R(e,t=>G(e,t,!0)),Ie=e=>R(e,t=>G(e,t,!1)),Le=e=>R(e,t=>G(e,t,!V(e))),Re=e=>R(e,t=>G(e,t,V(e))),ze=e=>R(e,t=>d.cursor(e.lineBlockAt(t.head).from,1)),Be=e=>R(e,t=>d.cursor(e.lineBlockAt(t.head).to,-1));function Ve(e,t,n){let r=!1,a=I(e.selection,t=>{let a=i(e,t.head,-1)||i(e,t.head,1)||t.head>0&&i(e,t.head-1,1)||t.head<e.doc.length&&i(e,t.head+1,-1);if(!a||!a.end)return t;r=!0;let o=a.start.from==t.head?a.end.to:a.end.from;return n?d.range(t.anchor,o):d.cursor(o)});return r?(t(L(e,a)),!0):!1}var He=({state:e,dispatch:t})=>Ve(e,t,!1);function K(e,t){let n=I(e.state.selection,e=>{let n=t(e);return d.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(L(e.state,n)),!0)}function Ue(e,t){return K(e,n=>e.moveByChar(n,t))}var We=e=>Ue(e,!V(e)),Ge=e=>Ue(e,V(e));function Ke(e,t){return K(e,n=>e.moveByGroup(n,t))}var qe=e=>Ke(e,!V(e)),Je=e=>Ke(e,V(e)),Ye=e=>K(e,t=>H(e.state,t,!V(e))),Xe=e=>K(e,t=>H(e.state,t,V(e)));function Ze(e,t){return K(e,n=>e.moveVertically(n,t))}var Qe=e=>Ze(e,!1),$e=e=>Ze(e,!0);function et(e,t){return K(e,n=>e.moveVertically(n,t,U(e).height))}var tt=e=>et(e,!1),nt=e=>et(e,!0),rt=e=>K(e,t=>G(e,t,!0)),it=e=>K(e,t=>G(e,t,!1)),at=e=>K(e,t=>G(e,t,!V(e))),ot=e=>K(e,t=>G(e,t,V(e))),st=e=>K(e,t=>d.cursor(e.lineBlockAt(t.head).from)),ct=e=>K(e,t=>d.cursor(e.lineBlockAt(t.head).to)),lt=({state:e,dispatch:t})=>(t(L(e,{anchor:0})),!0),ut=({state:e,dispatch:t})=>(t(L(e,{anchor:e.doc.length})),!0),dt=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:0})),!0),ft=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),pt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),mt=({state:e,dispatch:t})=>{let n=X(e).map(({from:t,to:n})=>d.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:d.create(n),userEvent:`select`})),!0},ht=({state:e,dispatch:t})=>{let n=I(e.selection,t=>{let n=m(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return d.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(L(e,n)),!0)};function gt(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(L(n,d.create(i,i.length-1))),!0)}var _t=e=>gt(e,!1),vt=e=>gt(e,!0),yt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=d.create([n.main]):n.main.empty||(r=d.create([d.cursor(n.main.head)])),r?(t(L(e,r)),!0):!1};function q(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:i}=e,a=i.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=J(e,o,!1)):o>i&&(n=`delete.forward`,o=J(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=J(e,i,!1),a=J(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:d.cursor(i,i<r.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(i.update(a,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?r.announce.of(i.phrase(`Selection deleted`)):void 0})),!0)}function J(e,t,n){if(e instanceof r)for(let i of e.state.facet(r.atomicRanges).map(t=>t(e)))i.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var bt=(t,n,r)=>q(t,i=>{let a=i.from,{state:o}=t,s=o.doc.lineAt(a),c,l;if(r&&!n&&a>s.from&&a<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,a-s.from))){if(c[c.length-1]==` `)return a-1;let t=e(c,o.tabSize)%y(o)||y(o);for(let e=0;e<t&&c[c.length-1-e]==` `;e++)a--;l=a}else l=v(s.text,a-s.from,n,n)+s.from,l==a&&s.number!=(n?o.doc.lines:1)?l+=n?1:-1:!n&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,a-s.from))&&(l=v(s.text,l-s.from,!1,!1)+s.from);return l}),Y=e=>bt(e,!1,!0),xt=e=>bt(e,!0,!1),St=(e,t)=>q(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=v(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Ct=e=>St(e,!1),wt=e=>St(e,!0),Tt=e=>q(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Et=e=>q(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Dt=e=>q(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ot=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:ee.of([``,``])},range:d.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},kt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:v(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:v(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:d.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function X(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function At(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of X(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(d.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(d.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:d.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var jt=({state:e,dispatch:t})=>At(e,t,!1),Mt=({state:e,dispatch:t})=>At(e,t,!0);function Nt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of X(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Pt=({state:e,dispatch:t})=>Nt(e,t,!1),Ft=({state:e,dispatch:t})=>Nt(e,t,!0),It=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(X(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=I(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Lt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=m(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(a.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var Rt=Bt(!1),zt=Bt(!0);function Bt(t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=n.changeByRange(r=>{let{from:i,to:a}=r,s=n.doc.lineAt(i),l=!t&&i==a&&Lt(n,i);t&&(i=a=(a<=s.to?s:n.doc.lineAt(a)).to);let u=new h(n,{simulateBreak:i,simulateDoubleBreak:!!l}),f=o(u,i);for(f??=e(/^\s*/.exec(n.doc.lineAt(i).text)[0],n.tabSize);a<s.to&&/\s/.test(s.text[a-s.from]);)a++;l?{from:i,to:a}=l:i>s.from&&i<s.from+100&&!/\S/.test(s.text.slice(0,i))&&(i=s.from);let p=[``,c(n,f)];return l&&p.push(c(n,u.lineIndent(s.from,-1))),{changes:{from:i,to:a,insert:ee.of(p)},range:d.cursor(i+1+p[1].length)}});return r(n.update(i,{scrollIntoView:!0,userEvent:`input`})),!0}}function Z(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:d.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Vt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new h(e,{overrideIndentation:e=>n[e]??-1}),i=Z(e,(t,i,a)=>{let s=o(r,t.from);if(s==null)return;/\S/.test(t.text)||(s=0);let l=/^\s*/.exec(t.text)[0],u=c(e,s);(l!=u||a.from<t.from+l.length)&&(n[t.from]=s,i.push({from:t.from,to:t.from+l.length,insert:u}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Q=({state:e,dispatch:n})=>e.readOnly?!1:(n(e.update(Z(e,(n,r)=>{r.push({from:n.from,insert:e.facet(t)})}),{userEvent:`input.indent`})),!0),$=({state:t,dispatch:n})=>t.readOnly?!1:(n(t.update(Z(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let a=e(i,t.tabSize),o=0,s=c(t,Math.max(0,a-y(t)));for(;o<i.length&&o<s.length&&i.charCodeAt(o)==s.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+i.length,insert:s.slice(o)})}),{userEvent:`delete.dedent`})),!0),Ht=e=>(e.setTabFocusMode(),!0),Ut=[{key:`Ctrl-b`,run:Se,shift:We,preventDefault:!0},{key:`Ctrl-f`,run:Ce,shift:Ge},{key:`Ctrl-p`,run:je,shift:Qe},{key:`Ctrl-n`,run:Me,shift:$e},{key:`Ctrl-a`,run:ze,shift:st},{key:`Ctrl-e`,run:Be,shift:ct},{key:`Ctrl-d`,run:xt},{key:`Ctrl-h`,run:Y},{key:`Ctrl-k`,run:Tt},{key:`Ctrl-Alt-h`,run:Ct},{key:`Ctrl-o`,run:Ot},{key:`Ctrl-t`,run:kt},{key:`Ctrl-v`,run:W}],Wt=[{key:`ArrowLeft`,run:Se,shift:We,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Te,shift:qe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Le,shift:at,preventDefault:!0},{key:`ArrowRight`,run:Ce,shift:Ge,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Ee,shift:Je,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Re,shift:ot,preventDefault:!0},{key:`ArrowUp`,run:je,shift:Qe,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:lt,shift:dt},{mac:`Ctrl-ArrowUp`,run:Pe,shift:tt},{key:`ArrowDown`,run:Me,shift:$e,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:ut,shift:ft},{mac:`Ctrl-ArrowDown`,run:W,shift:nt},{key:`PageUp`,run:Pe,shift:tt},{key:`PageDown`,run:W,shift:nt},{key:`Home`,run:Ie,shift:it,preventDefault:!0},{key:`Mod-Home`,run:lt,shift:dt},{key:`End`,run:Fe,shift:rt,preventDefault:!0},{key:`Mod-End`,run:ut,shift:ft},{key:`Enter`,run:Rt,shift:Rt},{key:`Mod-a`,run:pt},{key:`Backspace`,run:Y,shift:Y,preventDefault:!0},{key:`Delete`,run:xt,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Ct,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:wt,preventDefault:!0},{mac:`Mod-Backspace`,run:Et,preventDefault:!0},{mac:`Mod-Delete`,run:Dt,preventDefault:!0}].concat(Ut.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Gt=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Oe,shift:Ye},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:ke,shift:Xe},{key:`Alt-ArrowUp`,run:jt},{key:`Shift-Alt-ArrowUp`,run:Pt},{key:`Alt-ArrowDown`,run:Mt},{key:`Shift-Alt-ArrowDown`,run:Ft},{key:`Mod-Alt-ArrowUp`,run:_t},{key:`Mod-Alt-ArrowDown`,run:vt},{key:`Escape`,run:yt},{key:`Mod-Enter`,run:zt},{key:`Alt-l`,mac:`Ctrl-l`,run:mt},{key:`Mod-i`,run:ht,preventDefault:!0},{key:`Mod-[`,run:$},{key:`Mod-]`,run:Q},{key:`Mod-Alt-\\`,run:Vt},{key:`Shift-Mod-k`,run:It},{key:`Shift-Mod-\\`,run:He},{key:`Mod-/`,run:te},{key:`Alt-A`,run:re},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Ht}].concat(Wt),Kt={key:`Tab`,run:Q,shift:$};export{Q as a,D as c,$ as i,fe as n,Kt as o,xe as r,O as s,Gt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./dist-CxfohGIV.js";export{e as html};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{At as e,C as t,Ct as n,D as r,E as i,L as a,M as o,Mt as s,N as c,Nt as l,Ot as u,P as d,Pt as f,a as p,b as m,ct as h,ft as g,i as ee,j as _,kt as te,lt as ne,o as re,p as ie,q as ae,s as oe,y as v}from"./dist-DWJL3_bF.js";import{n as se,r as ce}from"./dist-CxfohGIV.js";import{t as le}from"./dist-DIi0uqLJ.js";var ue=class t{static create(e,n,r,i,a){return new t(e,n,r,i+(i<<8)+e+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[u.contextHash,r]]}addChild(e,t){e.prop(u.contextHash)!=this.hash&&(e=new l(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(t,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new l(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(t,n,r)=>new l(e.none,t,n,r,this.hashProp)})}},y;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(y||={});var de=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},fe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return x(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function pe(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==y.OrderedList?w:C)(n,t,!1);return r>0&&(e.type!=y.BulletList||S(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var me={[y.Blockquote](e,t,n){return n.next==62?(n.markers.push(L(y.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(b(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[y.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[y.OrderedList]:pe,[y.BulletList]:pe,[y.Document](){return!0}};function b(e){return e==32||e==9||e==10||e==13}function x(e,t=0){for(;t<e.length&&b(e.charCodeAt(t));)t++;return t}function he(e,t,n){for(;t>n&&b(e.charCodeAt(t-1));)t--;return t}function ge(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function _e(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function S(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!b(n))return-1}return n&&e.next==45&&be(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||r<3?-1:1}function ve(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function C(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||b(e.text.charCodeAt(e.pos+1)))&&(!n||ve(t,y.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function w(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!b(e.text.charCodeAt(r+1))||n&&!ve(t,y.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ye(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function be(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&b(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var T=/^[ \t]*$/,xe=/-->/,Se=/\?>/,E=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,xe],[/^\s*<\?/,Se],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,T],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,T]];function Ce(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=E.length-(n?1:0);e<t;e++)if(E[e][0].test(r))return e;return-1}function we(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function D(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==y.CodeText?e[r].to=n:e.push(L(y.CodeText,t,n))}var O={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(D(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){D(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==y.CodeText?D(o,e.from,e.to):o.push(e);s=[]}D(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&D(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=y.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(y.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ge(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=he(t.text,t.text.length,o),c=[L(y.CodeMark,r,r+a)];o<s&&c.push(L(y.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&D(c,e.lineStart-1,e.lineStart),c.push(L(y.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(D(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(D(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(y.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=_e(t);return n<0?!1:(e.startContext(y.Blockquote,t.pos),e.addNode(y.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(S(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(y.HorizontalRule,n),!0},BulletList(e,t){let n=C(t,e,!1);if(n<0)return!1;e.block.type!=y.BulletList&&e.startContext(y.BulletList,t.basePos,t.next);let r=we(t,t.pos+1);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=y.OrderedList&&e.startContext(y.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=we(t,t.pos+n);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ye(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=he(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!b(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(y.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(y.HeaderMark,o-r,a-r);let c=s.finish(y.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Ce(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=E[n][1],a=[],o=i!=T;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==xe?y.CommentBlock:i==Se?y.ProcessingInstructionBlock:y.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Te=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
2
|
-
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&x(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,L(y.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Be(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(L(y.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Re(e,x(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=x(e,this.pos),n=0;if(t>this.pos){let r=ze(e,t,this.start);if(r){let t=k(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=k(e,this.pos),n>0&&n<e.length?n:-1}else return k(e,this.pos)}};function k(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!b(n))return-1}return t}var Ee=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:be(t),i=t.next;if(r<0)return!1;let a=L(y.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,L(i==61?y.SetextHeading1:y.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},De={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Te(t):null},SetextHeading(){return new Ee}},Oe=[(e,t)=>ye(t)>=0,(e,t)=>ge(t)>=0,(e,t)=>_e(t)>=0,(e,t)=>C(t,e,!0)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>S(t,e,!0)>=0,(e,t)=>Ce(t,e,!0)>=0],ke={text:``,end:0},Ae=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new fe,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=ue.create(y.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new He(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new de(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
3
|
-
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Ue(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=ke;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+y[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
4
|
-
`?``:t;else{let e=t.indexOf(`
|
|
5
|
-
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=ue.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new l(this.parser.nodeSet.types[e],N,N,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(W(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?je(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=W(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(y.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?L(this.parser.getNodeType(e),t,n,r):new I(e,t)}get buffer(){return new P(this.parser.nodeSet)}};function je(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function u(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let l=n.firstChild;l;l=l.nextSibling){u(l.from+r,!0);let n=l.from+r,d,f=i.get(l.tree);f?d=f:l.to+r>a?(d=je(e,t,l,r,i),u(l.to+r,!1)):d=l.toTree(),o.push(d),s.push(n-c)}return u(n.to+r,!1),new l(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var Me=class t extends s{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Ae(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(n){let r=j(n);if(!r)return this;let{nodeSet:i,skipContextMarkup:a}=this,s=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),d=this.blockNames.slice(),f=this.inlineParsers.slice(),p=this.inlineNames.slice(),m=this.endLeafBlock.slice(),h=this.wrappers;if(A(r.defineNodes)){a=Object.assign({},a);let t=i.types.slice(),n;for(let i of r.defineNodes){let{name:r,block:s,composite:c,style:l}=typeof i==`string`?{name:i}:i;if(t.some(e=>e.name==r))continue;c&&(a[t.length]=(e,t,n)=>c(t,n,e.value));let d=t.length,f=c?[`Block`,`BlockContext`]:s?d>=y.ATXHeading1&&d<=y.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;t.push(e.define({id:d,name:r,props:f&&[[u.group,f]]})),l&&(n||={},Array.isArray(l)||l instanceof o?n[r]=l:Object.assign(n,l))}i=new te(t),n&&(i=i.extend(c(n)))}if(A(r.props)&&(i=i.extend(...r.props)),A(r.remove))for(let e of r.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(s[t]=l[t]=void 0),n>-1&&(f[n]=void 0)}if(A(r.parseBlock))for(let e of r.parseBlock){let t=d.indexOf(e.name);if(t>-1)s[t]=e.parse,l[t]=e.leaf;else{let t=e.before?M(d,e.before):e.after?M(d,e.after)+1:d.length-1;s.splice(t,0,e.parse),l.splice(t,0,e.leaf),d.splice(t,0,e.name)}e.endLeaf&&m.push(e.endLeaf)}if(A(r.parseInline))for(let e of r.parseInline){let t=p.indexOf(e.name);if(t>-1)f[t]=e.parse;else{let t=e.before?M(p,e.before):e.after?M(p,e.after)+1:p.length-1;f.splice(t,0,e.parse),p.splice(t,0,e.name)}}return r.wrap&&(h=h.concat(r.wrap)),new t(i,s,l,d,m,a,f,p,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new U(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function A(e){return e!=null&&e.length>0}function j(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=j(e[0]);if(e.length==1)return t;let n=j(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||N).concat(t||N),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function M(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Ne=[e.none];for(let t=1,n;n=y[t];t++)Ne[t]=e.define({id:t,name:n,props:t>=y.Escape?[]:[[u.group,t in me?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:n==`Document`});var N=[],P=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return l.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},F=class{constructor(e,t,n,r=N){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new P(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},I=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return N}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function L(e,t,n,r){return new F(e,t,n,r)}var Pe={resolve:`Emphasis`,mark:`EmphasisMark`},Fe={resolve:`Emphasis`,mark:`EmphasisMark`},R={},z={},B=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Ie=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,V=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{V=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var H={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Ie.charCodeAt(t)==r)return e.append(L(y.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(L(y.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(L(y.InlineCode,n,r+1,[L(y.CodeMark,n,n+i),L(y.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(L(y.Autolink,n,n+1+i[0].length,[L(y.LinkMark,n,n+1),L(y.URL,n+1,n+i[0].length),L(y.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(L(y.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(L(y.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(L(y.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=V.test(i),s=V.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new B(t==95?Pe:Fe,n,r,(f?1:0)|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(L(y.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(L(y.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new B(R,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new B(z,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof B&&(r.type==R||r.type==z)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Le(e,i,r.type==R?y.Link:y.Image,r.from,n+1);if(r.type==R)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof B&&t.type==R&&(t.side=0)}return a.to}}return-1}};function Le(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(L(y.LinkMark,r,r+(n==y.Image?2:1))),t.push(L(y.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Re(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=ze(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(L(y.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(L(y.LinkMark,n,s)))}else if(o==91){let n=Be(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return L(n,r,s,t)}function Re(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return L(y.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(b(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?L(y.URL,t+n,i+n):i==e.length?null:!1}}function ze(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return L(y.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function Be(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:L(y.LinkLabel,t+n,a+1+n);else{if(r&&!b(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var U=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new B(e,t,n,(r?1:0)|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof B&&(t.type==R||t.type==z))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof B&&n.type.resolve&&n.side&2))continue;let r=n.type==Pe||n.type==Fe,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof B&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof F&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new B(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new B(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof F&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof B&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof B?t:null}skipSpace(e){return x(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?L(this.parser.getNodeType(e),t,n,r):new I(e,t)}};U.linkStart=R,U.imageStart=z;function W(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof F&&(n[r]=new F(t.type,t.from,t.to,W(t.children,[e])))}else n.splice(r++,0,e)}return n}var Ve=[y.CodeBlock,y.ListItem,y.OrderedList,y.BulletList],He=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
6
|
-
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(u.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=Ue(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new l(e.parser.nodeSet.types[y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(Ve.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function Ue(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var We=c({"Blockquote/...":d.quote,HorizontalRule:d.contentSeparator,"ATXHeading1/... SetextHeading1/...":d.heading1,"ATXHeading2/... SetextHeading2/...":d.heading2,"ATXHeading3/...":d.heading3,"ATXHeading4/...":d.heading4,"ATXHeading5/...":d.heading5,"ATXHeading6/...":d.heading6,"Comment CommentBlock":d.comment,Escape:d.escape,Entity:d.character,"Emphasis/...":d.emphasis,"StrongEmphasis/...":d.strong,"Link/... Image/...":d.link,"OrderedList/... BulletList/...":d.list,"BlockQuote/...":d.quote,"InlineCode CodeText":d.monospace,"URL Autolink":d.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":d.processingInstruction,"CodeInfo LinkLabel":d.labelName,LinkTitle:d.string,Paragraph:d.content}),Ge=new Me(new te(Ne).extend(We),Object.keys(O).map(e=>O[e]),Object.keys(O).map(e=>De[e]),Object.keys(O),Oe,me,Object.keys(H).map(e=>H[e]),Object.keys(H),[]);function Ke(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function qe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:f((e,r)=>{let i=e.type.id;if(t&&(i==y.CodeBlock||i==y.FencedCode)){let n=``;if(i==y.FencedCode){let t=e.node.getChild(y.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==y.CodeText,bracketed:i==y.FencedCode}}else if(n&&(i==y.HTMLBlock||i==y.HTMLTag||i==y.CommentBlock))return{parser:n,overlay:Ke(e.node,e.from,e.to)};return null})}}var Je={resolve:`Strikethrough`,mark:`StrikethroughMark`},Ye={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":d.strikethrough}},{name:`StrikethroughMark`,style:d.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=V.test(r),c=V.test(i);return e.addDelimiter(Je,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function G(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Xe(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var Ze=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Qe=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Ze.test(r=t.text.slice(t.pos))){let i=[];G(e,n.content,0,i,n.start)==G(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];G(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},$e={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":d.heading}},`TableRow`,{name:`TableCell`,style:d.content},{name:`TableDelimiter`,style:d.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Xe(t.content,0)?new Qe:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof Qe)||!Xe(t.text,t.basePos))return!1;let r=e.peekLine();return Ze.test(r)&&G(e,t.text,t.basePos)==G(e,r,t.basePos)},before:`SetextHeading`}]},et=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},tt={defineNodes:[{name:`Task`,block:!0,style:d.list},{name:`TaskMarker`,style:d.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new et:null},after:`SetextHeading`}]},nt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,K=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,rt=/[\w-]+\.[\w-]+($|\/)/,it=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,at=/\/[a-zA-Z\d@.]+/gy;function ot(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function st(e,t){K.lastIndex=t;let n=K.exec(e);if(!n||rt.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ot(e,t,r,`)`)>ot(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ct(e,t){it.lastIndex=t;let n=it.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-(r==`.`?1:0)}var lt=[$e,tt,Ye,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;nt.lastIndex=r;let i=nt.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=st(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ct(e.text,r):(a=ct(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(at.lastIndex=a,i=at.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function ut(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),b(s))break}return-1}}var dt={defineNodes:[{name:`Superscript`,style:d.special(d.content)},{name:`SuperscriptMark`,style:d.processingInstruction}],parseInline:[{name:`Superscript`,parse:ut(94,`Superscript`,`SuperscriptMark`)}]},ft={defineNodes:[{name:`Subscript`,style:d.special(d.content)},{name:`SubscriptMark`,style:d.processingInstruction}],parseInline:[{name:`Subscript`,parse:ut(126,`Subscript`,`SubscriptMark`)}]},pt={defineNodes:[{name:`Emoji`,style:d.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},mt=ie({commentTokens:{block:{open:`<!--`,close:`-->`}}}),ht=new u,gt=Ge.configure({props:[v.add(e=>!e.is(`Block`)||e.is(`Document`)||q(e)!=null||_t(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),ht.add(q),t.add({Document:()=>null}),r.add({Document:mt})]});function q(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function _t(e){return e.name==`OrderedList`||e.name==`BulletList`}function vt(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=q(e.type))!=null&&r<=t)break;n=e}return n.to}var yt=m.of((e,t,n)=>{for(let r=_(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(ht);if(e==null)continue;let t=vt(r,e);if(t>n)return{from:n,to:t}}return null});function J(e){return new ee(mt,e,[],`markdown`)}var bt=J(gt),Y=J(gt.configure([lt,ft,dt,pt,{props:[v.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function xt(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):p.matchLanguageName(e,n,!0),t instanceof p)return t.support?t.support.language.parser:oe.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var X=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+Ct(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function St(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new X(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new X(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new X(i.parent,s,s+t,a[1],e,n,i))}}return r}function Ct(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Z(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Ct(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Q(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(i)!=` `)return e;let a=n(e,4,r),o=``;for(let e=a;e>0;)e>=4?(o+=` `,e-=4):(o+=` `,e--);return o+e.slice(r)}var wt=(e={})=>({state:t,dispatch:r})=>{let i=_(t),{doc:a}=t,o=null,s=t.changeByRange(r=>{if(!r.empty||!Y.isActiveAt(t,r.from,-1)&&!Y.isActiveAt(t,r.from,1))return o={range:r};let s=r.from,c=a.lineAt(s),l=St(i.resolveInner(s,-1),a);for(;l.length&&l[l.length-1].from>s-c.from;)l.pop();if(!l.length)return o={range:r};let u=l[l.length-1];if(u.to-u.spaceAfter.length>s-c.from)return o={range:r};let d=s>=u.to-u.spaceAfter.length&&!/\S/.test(c.text.slice(u.to));if(u.item&&d){let n=u.node.firstChild,r=u.node.getChild(`ListItem`,`ListItem`);if(n.to>=s||r&&r.to<s||c.from>0&&!/[^\s>]/.test(a.lineAt(c.from-1).text)||e.nonTightLists===!1){let e=l.length>1?l[l.length-2]:null,t,n=``;e&&e.item?(t=c.from+e.from,n=e.marker(a,1)):t=c.from+(e?e.to:0);let r=[{from:t,to:s,insert:n}];return u.node.name==`OrderedList`&&Z(u.item,a,r,-2),e&&e.node.name==`OrderedList`&&Z(e.item,a,r),{range:h.cursor(t+n.length),changes:r}}else{let e=Ot(l,t,c);return{range:h.cursor(s+e.length+1),changes:{from:c.from,insert:e+t.lineBreak}}}}if(u.node.name==`Blockquote`&&d&&c.from){let e=a.lineAt(c.from-1),n=/>\s*$/.exec(e.text);if(n&&n.index==u.from){let i=t.changes([{from:e.from+n.index,to:e.to},{from:c.from+u.from,to:c.to}]);return{range:r.map(i),changes:i}}}let f=[];u.node.name==`OrderedList`&&Z(u.item,a,f);let p=u.item&&u.item.from<c.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=u.to)for(let e=0,t=l.length-1;e<=t;e++)m+=e==t&&!p?l[e].marker(a,1):l[e].blank(e<t?n(c.text,4,l[e+1].from)-m.length:null);let g=s;for(;g>c.from&&/\s/.test(c.text.charAt(g-c.from-1));)g--;return m=Q(m,t),Dt(u.node,t.doc)&&(m=Ot(l,t,c)+t.lineBreak+m),f.push({from:g,to:s,insert:t.lineBreak+m}),{range:h.cursor(g+m.length+1),changes:f}});return o?!1:(r(t.update(s,{scrollIntoView:!0,userEvent:`input`})),!0)},Tt=wt();function Et(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Dt(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function Ot(e,t,r){let i=``;for(let t=0,a=e.length-2;t<=a;t++)i+=e[t].blank(t<a?n(r.text,4,e[t+1].from)-i.length:null,t<a);return Q(i,t)}function kt(e,t){let n=e.resolveInner(t,-1),r=t;Et(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(Et(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var At=({state:e,dispatch:t})=>{let r=_(e),i=null,a=e.changeByRange(t=>{let a=t.from,{doc:o}=e;if(t.empty&&Y.isActiveAt(e,t.from)){let t=o.lineAt(a),i=St(kt(r,a),o);if(i.length){let r=i[i.length-1],o=r.to-r.spaceAfter.length+(r.spaceAfter?1:0);if(a-t.from>o&&!/\S/.test(t.text.slice(o,a-t.from)))return{range:h.cursor(t.from+o),changes:{from:t.from+o,to:a}};if(a-t.from==o&&(!r.item||t.from<=r.item.from||!/\S/.test(t.text.slice(0,r.to)))){let i=t.from+r.from;if(r.item&&r.node.from<r.item.from&&/\S/.test(t.text.slice(r.from,r.to))){let a=r.blank(n(t.text,4,r.to)-n(t.text,4,r.from));return i==t.from&&(a=Q(a,e)),{range:h.cursor(i+a.length),changes:{from:i,to:t.from+r.to,insert:a}}}if(i<a)return{range:h.cursor(i),changes:{from:i,to:a}}}}}return i={range:t}});return i?!1:(t(e.update(a,{scrollIntoView:!0,userEvent:`delete`})),!0)},jt=[{key:`Enter`,run:Tt},{key:`Backspace`,run:At}],Mt=se({matchClosingTags:!1});function Nt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=bt,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=Mt}=e;if(!(i instanceof Me))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,yt],u;o&&l.push(Lt),n instanceof re?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?xt(t,u):void 0;c.push(qe({codeParser:d,htmlParser:s.language.parser})),r&&l.push(g.high(ae.of(jt)));let f=J(i.configure(c));return a&&l.push(f.data.of({autocomplete:Pt})),new re(f,l)}function Pt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=_(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:Ft(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var $=null;function Ft(){if($)return $;let e=ce(new le(ne.create({extensions:Mt}),0,!0));return $=e?e.options:[]}var It=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Lt=a.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Y.isActiveAt(t.state,n.from,1)))return!1;let i=_(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||It.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});export{Nt as a,Lt as c,wt as i,At as n,jt as o,Tt as r,Y as s,bt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e,F as t,I as n,L as r,R as i,St as a,Tt as o,U as s,Y as c,_t as l,bt as u,ct as d,dt as f,ft as p,gt as m,ht as h,j as g,ot as _,pt as v,q as y,rt as b,tt as x,ut as S,vt as ee,xt as C,yt as te,z as ne}from"./dist-DWJL3_bF.js";var w=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=g(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(D(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function re(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function ie(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=re(t)+re(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function ae(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:ie(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function oe(e,t){return n=>{for(let t=g(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var T=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function E(e){return e.selection.main.from}function D(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var O=b.define();function se(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:d.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var k=new WeakMap;function ce(e){if(!Array.isArray(e))return e;let t=k.get(e);return t||k.set(e,t=ae(e)),t}var A=m.define(),j=m.define(),le=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=u(e,t),r=C(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(u(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=u(e,0),i=C(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let s=e.indexOf(this.pattern);if(s==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,l=0;if(s<0){for(let i=0,a=Math.min(e.length,200);i<a&&l<c;){let a=u(e,i);(a==t[l]||a==n[l])&&(r[l++]=i),i+=C(a)}if(l<c)return null}let d=0,f=0,p=!1,m=0,h=-1,g=-1,_=/[a-z]/.test(e),v=!0;for(let r=0,l=Math.min(e.length,200),y=0;r<l&&f<c;){let l=u(e,r);s<0&&(d<c&&l==t[d]&&(i[d++]=r),m<c&&(l==t[m]||l==n[m]?(m==0&&(h=r),g=r+1,m++):m=0));let b,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(b=o(l))==b.toLowerCase()?b==b.toUpperCase()?0:2:1;(!r||x==1&&_||y==0&&x!=0)&&(t[f]==l||n[f]==l&&(p=!0)?a[f++]=r:a.length&&(v=!1)),y=x,r+=C(l)}return f==c&&a[0]==0&&v?this.result(-100+(p?-200:0),a,e):m==c&&h==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):m==c?this.ret(-900-e.length,[h,g]):f==c?this.result(-100+(p?-200:0)+-700+(v?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?C(u(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},ue=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},M=S.define({combine(e){return a(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:fe,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>de(e(n),t(n)),optionClass:(e,t)=>n=>de(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function de(e,t){return e?t?e+` `+t:e:t}function fe(e,t,r,i,a,o){let s=e.textDirection==n.RTL,c=s,l=!1,u=`top`,d,f,p=t.left-a.left,m=a.right-t.right,h=i.right-i.left,g=i.bottom-i.top;if(c&&p<Math.min(h,m)?c=!1:!c&&m<Math.min(h,p)&&(c=!0),h<=(c?p:m))d=Math.max(a.top,Math.min(r.top,a.bottom-g))-t.top,f=Math.min(400,c?p:m);else{l=!0,f=Math.min(400,(s?t.right:a.right-t.left)-30);let e=a.bottom-t.bottom;e>=g||e>t.top?d=r.bottom-t.top:(u=`bottom`,d=t.bottom-r.top)}let _=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${d/_}px; max-width: ${f/v}px`,class:`cm-completionInfo-`+(l?s?`left-narrow`:`right-narrow`:c?`left`:`right`)}}var N=m.define();function pe(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function P(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var me=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(M);this.optionContent=pe(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=P(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:N.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(M).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:j.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=P(r.length,i,e.state.facet(M).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=P(t.options.length,t.selected,this.view.state.facet(M).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>c(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&ge(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(M).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function he(e,t){return n=>new me(n,e,t)}function ge(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function F(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function _e(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(M);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new T(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new ue(n):new le(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new T(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):F(e.completion)>F(c)&&(s[s.length-1]=e),c=e.completion}return s}var ve=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,I(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=_e(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(M).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,I(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:Te,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},ye=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(Ce,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(M),i=(r.override||n.languageDataAt(`autocomplete`,E(n)).map(ce)).map(e=>(this.active.find(t=>t.source==e)||new R(e,this.active.some(e=>e.state!=0)?1:0)).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(B));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!be(i,this.active)||o?a=ve.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new R(e.source,0):e));for(let e of t.effects)e.is(N)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?xe:Se}};function be(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var xe={"aria-autocomplete":`list`},Se={};function I(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var Ce=[];function L(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(O);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var R=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=L(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(A))i=new e(i.source,1,n.value);else if(n.is(j))i=new e(i.source,0);else if(n.is(B))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(E(e.state))}},z=class e extends R{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=E(t.state);if(o>a||!r||n&2&&(E(t.startState)==this.from||o<this.limit))return new R(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return we(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new w(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??E(t.state)):new R(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new R(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function we(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):D(e,!0).test(i)}var B=m.define({map(e,t){return e.map(e=>e.map(t))}}),V=l.define({create(){return ye.start()},update(e,t){return e.update(t)},provide:e=>[x.from(e,e=>e.tooltip),r.contentAttributes.from(e,e=>e.attrs)]});function H(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(V).active.find(e=>e.source==t.source);return r instanceof z?(typeof n==`string`?e.dispatch({...se(e.state,n,r.from,r.to),annotations:O.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var Te=he(V,H);function U(e,t=`option`){return n=>{let r=n.state.field(V,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(M).interactionDelay)return!1;let i=1,a;t==`page`&&(a=s(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,c=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return c<0?c=t==`page`?0:o-1:c>=o&&(c=t==`page`?o-1:0),n.dispatch({effects:N.of(c)}),!0}}var Ee=e=>{let t=e.state.field(V,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(M).interactionDelay?!1:H(e,t.open.options[t.open.selected])},W=e=>e.state.field(V,!1)?(e.dispatch({effects:A.of(!0)}),!0):!1,De=e=>{let t=e.state.field(V,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:j.of(null)}),!0)},Oe=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},ke=50,Ae=1e3,je=i.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(V).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(V),n=e.state.facet(M);if(!e.selectionSet&&!e.docChanged&&e.startState.field(V)==t)return;let r=e.transactions.some(e=>{let t=L(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>ke&&Date.now()-n.time>Ae){for(let e of n.context.abortListeners)try{e()}catch(e){c(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(A)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(V);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(M).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new w(t,E(t),e.explicit,this.view),r=new Oe(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:j.of(null)}),c(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(M).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(M),n=this.view.state.field(V);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=E(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+(i.active.explicit?0:1)),a=new z(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new R(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:B.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(V,!1);if(t&&t.tooltip&&this.view.state.facet(M).closeOnBlur){let n=t.open&&s(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:j.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:A.of(!1)}),20),this.composing=0}}}),Me=typeof navigator==`object`&&/Win/.test(navigator.platform),Ne=p.highest(r.domEventHandlers({keydown(e,t){let n=t.state.field(V,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Me&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&H(t,r),!1}})),G=r.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),Pe=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Fe=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,f.TrackDel),r=t.mapPos(this.to,1,f.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},Ie=class t{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(t,n){let r=[],i=[n],a=t.doc.lineAt(n),o=/^\s*/.exec(a.text)[0];for(let a of this.lines){if(r.length){let r=o,s=/^\t*/.exec(a)[0].length;for(let n=0;n<s;n++)r+=t.facet(e);i.push(n+r.length-s),a=r+a.slice(s)}r.push(a),n+=a.length+1}return{text:r,ranges:this.fieldPositions.map(e=>new Fe(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(e){let n=[],r=[],i=[],a;for(let t of e.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(t);){let e=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let t=0;t<n.length;t++)(e==null?c&&n[t].name==c:n[t].seq==e)&&(s=t);if(s<0){let t=0;for(;t<n.length&&(e==null||n[t].seq!=null&&n[t].seq<e);)t++;n.splice(t,0,{seq:e,name:c}),s=t;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new Pe(s,r.length,a.index,a.index+c.length)),t=t.slice(0,a.index)+o+t.slice(a.index+a[0].length)}t=t.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(t)}return new t(r,i)}},Le=t.widget({widget:new class extends ne{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),Re=t.mark({class:`cm-snippetField`}),K=class e{constructor(e,n){this.ranges=e,this.active=n,this.deco=t.set(e.map(e=>(e.from==e.to?Le:Re).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},q=m.define({map(e,t){return e&&e.map(t)}}),ze=m.define(),J=l.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(q))return n.value;if(n.is(ze)&&e)return new K(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>r.decorations.from(e,e=>e?e.deco:t.none)});function Y(e,t){return d.create(e.filter(e=>e.field==t).map(e=>d.range(e.from,e.to)))}function Be(e){let t=Ie.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:ee.of(a)},scrollIntoView:!0,annotations:n?[O.of(n),te.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=Y(o,0)),o.some(e=>e.field>0)){let t=new K(o,0),n=c.effects=[q.of(t)];e.state.field(J,!1)===void 0&&n.push(m.appendConfig.of([J,We,Ke,G]))}e.dispatch(e.state.update(c))}}function Ve(e){return({state:t,dispatch:n})=>{let r=t.field(J,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:Y(r.ranges,i),effects:q.of(a?null:new K(r.ranges,i)),scrollIntoView:!0})),!0}}var He=[{key:`Tab`,run:Ve(1),shift:Ve(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(J,!1)?(t(e.update({effects:q.of(null)})),!0):!1}],Ue=S.define({combine(e){return e.length?e[0]:He}}),We=p.highest(y.compute([Ue],e=>e.facet(Ue)));function Ge(e,t){return{...t,apply:Be(e)}}var Ke=r.domEventHandlers({mousedown(e,t){let n=t.state.field(J,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:Y(n.ranges,i.field),effects:q.of(n.ranges.some(e=>e.field>i.field)?new K(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),X={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},Z=m.define({map(e,t){return t.mapPos(e,-1,f.TrackAfter)??void 0}}),Q=new class extends h{};Q.startSide=1,Q.endSide=-1;var qe=l.define({create(){return v.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Z)&&(e=e.update({add:[Q.range(n.value,n.value+1)]}));return e}});function Je(){return[$e,qe]}var Ye=`()[]{}<>«»»«[]{}`;function Xe(e){for(let t=0;t<16;t+=2)if(Ye.charCodeAt(t)==e)return Ye.charAt(t+1);return o(e<128?e:e+1)}function Ze(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||X}var Qe=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),$e=r.inputHandler.of((e,t,n,r)=>{if((Qe?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&C(u(r,0))==1||t!=i.from||n!=i.to)return!1;let a=tt(e.state,r);return a?(e.dispatch(a),!0):!1}),et=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Ze(e,e.selection.main.head).brackets||X.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=rt(e.doc,t.head);for(let i of n)if(i==r&&$(e.doc,t.head)==Xe(u(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:d.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function tt(e,t){let n=Ze(e,e.selection.main.head),r=n.brackets||X.brackets;for(let i of r){let a=Xe(u(i,0));if(t==i)return a==i?ot(e,i,r.indexOf(i+i+i)>-1,n):it(e,i,a,n.before||X.before);if(t==a&&nt(e,e.selection.main.from))return at(e,i,a)}return null}function nt(e,t){let n=!1;return e.field(qe).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function $(e,t){let n=e.sliceString(t,t+2);return n.slice(0,C(u(n,0)))}function rt(e,t){let n=e.sliceString(t-2,t);return C(u(n,0))==n.length?n:n.slice(1)}function it(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Z.of(a.to+t.length),range:d.range(a.anchor+t.length,a.head+t.length)};let o=$(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:Z.of(a.head+t.length),range:d.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function at(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&$(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:d.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function ot(e,t,n,r){let i=r.stringPrefixes||X.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Z.of(r.to+t.length),range:d.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=$(e.doc,o),c;if(s==t){if(st(e,o))return{changes:{insert:t+t,from:o},effects:Z.of(o+t.length),range:d.cursor(o+t.length)};if(nt(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:d.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=lt(e,o-2*t.length,i))>-1&&st(e,c))return{changes:{insert:t+t+t+t,from:o},effects:Z.of(o+t.length),range:d.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=_.Word&<(e,o,i)>-1&&!ct(e,o,t,i))return{changes:{insert:t+t,from:o},effects:Z.of(o+t.length),range:d.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function st(e,t){let n=g(e).resolveInner(t+1);return n.parent&&n.from==t}function ct(e,t,n,r){let i=g(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function lt(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=_.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=_.Word)return n}return-1}function ut(e={}){return[Ne,V,M.of(e),je,ft,G]}var dt=[{key:`Ctrl-Space`,run:W},{mac:"Alt-`",run:W},{mac:`Alt-i`,run:W},{key:`Escape`,run:De},{key:`ArrowDown`,run:U(!0)},{key:`ArrowUp`,run:U(!1)},{key:`PageDown`,run:U(!0,`page`)},{key:`PageUp`,run:U(!1,`page`)},{key:`Enter`,run:Ee}],ft=p.highest(y.computeN([M],e=>e.facet(M).defaultKeymap?[dt]:[]));export{ae as a,et as i,ut as n,oe as o,Je as r,Ge as s,w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./dist-B-02vKOA.js";export{e as css};
|