allyhub 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/command.js +1 -1
- package/dist/commands/dev.js +5 -5
- package/dist/commands/index.js +1 -1
- package/dist/commands/list.js +1 -1
- package/dist/commands/schedule.js +4 -0
- package/dist/commands.json +1 -1
- package/dist/main.js +8 -8
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/blocks/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/scheduled-tasks.js +2 -0
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/scheduled-tasks.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +5 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +15 -15
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-D6qI3rai.js → abnfDiagram-WEYOIA3C-OIbGwO0P.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-B3V6ggq8.js → architecture-WOLXFQ4H-i87EDk8h.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-IauNyxXn.js → architectureDiagram-ZHVYKT53-DRsgKDbu.js} +1 -1
- package/editor-web/assets/article-BVbLqhwK.js +3 -0
- package/editor-web/assets/article-BxkgemqI.js +7 -0
- package/editor-web/assets/bar-button-BJ-_6g-F.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-yXhlfxbH.js → blockDiagram-RJAE7QA3-k_lanKyI.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-B-anrhvt.js → c4Diagram-XDPPPE54-BFJTpM5w.js} +1 -1
- package/editor-web/assets/channel-CDJSUIp1.js +1 -0
- package/editor-web/assets/chevron-right-7tjLd0X4.js +1 -0
- package/editor-web/assets/chip-lvclIKGj.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-QPOni4XB.js → chunk-2E7WHVMD-Bbfj2q42.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-DG1FCRRI.js → chunk-4EMNKR2T-iKWsgYqL.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-mKuMXpnC.js → chunk-55XCU76K-WwcsywWu.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-CgZAazgt.js → chunk-7S6XSTFO-BEEtZTsQ.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BRU84phF.js → chunk-AQDTSKZB-ZT2PBdLK.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-zku9oeG3.js → chunk-DSNLSHJZ-BDlY4xos.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-CaUkBv_0.js → chunk-HAGFOTED-Yp6V4sx6.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-BQz4ZCJf.js → chunk-HNE4Q36P-C6IdGLw2.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CHVBEDkg.js → chunk-NQOKRVIF-D3gs_SMr.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-DrYeJo1e.js → chunk-UHW7PFBP-Byf0dX4X.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-D8ToVCUe.js → chunk-VQ5W62QI-n9lsvBOX.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-DZ0tyi9F.js → chunk-WQQL4CDK-BW540sO1.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-BLe7PXER.js → chunk-YZO67HFG-CWL9cioT.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-ByaeSIre.js → chunk-ZAUX2LTX-D9zlkFeQ.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-DdMJr_t5.js → chunk-ZCHMQSOR-nieSgKB5.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DDpq7fFC.js → classDiagram-v2-4MYWR3UA-BXamBIDc.js} +1 -1
- package/editor-web/assets/{color-picker-CDeICDN5.js → color-picker-XpkmmKxv.js} +1 -1
- package/editor-web/assets/context-menu-pSruvRyd.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-CMivy2fr.js → cynefin-EF2NZ3EQ-CVKVgqFb.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-GtxT_9wW.js → cynefinDiagram-WF24UDRP-r0bqUe5X.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-Bn1O2Hjl.js → dagre-NK4GIZVX-4q_IUjiM.js} +1 -1
- package/editor-web/assets/deck-cyd6f3QU.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-W715PWZw.js → diagram-CBK3MWTC-CDh12DaH.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-BKObZPn2.js → diagram-I5XIIV2D-C_sqASp8.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-UtQxEPoW.js → diagram-ODIL2UCW-QgoMb-iS.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-CpLGEK-k.js → diagram-PFBEJUXE-Djhv4RT6.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-DGyMXoHb.js → diagram-RJA3I4VV-CvVswF4l.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Dy_Ewr8V.js → diagram-TYUNFSNR-DLnbV741.js} +1 -1
- package/editor-web/assets/dist-BK-WZ2ce.js +3 -0
- package/editor-web/assets/dist-CQ8-PJqF.js +16 -0
- package/editor-web/assets/dist-CQElMvxC.js +4 -0
- package/editor-web/assets/{dist-H9rTuNhb.js → dist-D49XAtID.js} +1 -1
- package/editor-web/assets/{dist-DNMKDcLg.js → dist-DDQLLUz5.js} +1 -1
- package/editor-web/assets/{dist-oeSWr2LE.js → dist-DO2VygfS.js} +3 -3
- package/editor-web/assets/dist-DOoUVqs_.js +24 -0
- package/editor-web/assets/{dist-B0rUvCi2.js → dist-DUyJ8AI0.js} +1 -1
- package/editor-web/assets/dist-DlDgR_Er.js +1 -0
- package/editor-web/assets/dist-Dw7AH_ip.js +6 -0
- package/editor-web/assets/{dist-0I0Obj60.js → dist-Dx3tLwZ1.js} +17 -17
- package/editor-web/assets/{dist-DptBQzJR.js → dist-F7lLi27Y.js} +1 -1
- package/editor-web/assets/dist-OfUZ68xY.js +547 -0
- package/editor-web/assets/{dist-D7M5YTq2.js → dist-OyPpS4AG.js} +28 -28
- package/editor-web/assets/dist-QCvBWMrp.js +5 -0
- package/editor-web/assets/{dist-CKD_paj_.js → dist-RppJbSHJ.js} +1 -1
- package/editor-web/assets/dist-ZFgjTFWK.js +19 -0
- package/editor-web/assets/{dist-Cc8v9lfc.js → dist-onYtssQw.js} +1 -1
- package/editor-web/assets/{docx-draw-B5cM77hc.js → docx-draw-BBI4k72R.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-GPYcx6dU.js → ebnfDiagram-V4P3TTPT-BoiJRPsL.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Bi0r4UFM.js → elk-QONTBCTQ-BDiBwn0f.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-DrOSrnci.js → erDiagram-KYQIGQAA-DaA3jdNm.js} +1 -1
- package/editor-web/assets/{esm-jIPnpbBD.js → esm-BWIRT8Yl.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-Dw-MjgUb.js → eventmodeling-K75KTNOO-j7ZSOAed.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-Cb-xQSAJ.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-Bwe8cQqi.js → ganttDiagram-R7GPNTJY-CyNcjwUZ.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-DsAcAKP0.js → gitGraph-VSP46ZUC-BuzoK22Z.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-aObRwdru.js → gitGraphDiagram-PDYL7XHY--lzum_QP.js} +1 -1
- package/editor-web/assets/index-BSd85XUU.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-DBPN8JFr.js → info-OHQRW6UA-rs42SY_Y.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-Bx26Hq7M.js → infoDiagram-MVDRKAX5-BjedWKrM.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js → ishikawaDiagram-HPEHV2GE-Dtqm_gq7.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-B5g4W2Dx.js → journeyDiagram-BOSHW7O7-J0dA2yU0.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-U8YNlxN7.js → kanban-definition-FNSA4HC5-DV13v0Uf.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-DYLQlYDo.js → mermaid-parser.core-B7bZFHzS.js} +3 -3
- package/editor-web/assets/{mermaid.core-qNJmZ0b4.js → mermaid.core-DQ10-Otk.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CI5aBWbK.js → mindmap-definition-6OY57UG3-DgdXGBCF.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-BBclMGlJ.js → packet-JDAUHWVQ-ZNSLC_YL.js} +1 -1
- package/editor-web/assets/{panes-BShVq38A.js → panes-1hRg6CCN.js} +2 -2
- package/editor-web/assets/{pegDiagram-ECIUJNBX-B3pljPTu.js → pegDiagram-ECIUJNBX-nBIsHepE.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-B7WzimHm.js → pie-XZMESJXO-CXen6okO.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-tM1Da50-.js → pieDiagram-GNMPY74T-BlimMsUq.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-BEq_Shj9.js → quadrantDiagram-D57K4MC3-D_B7p8XB.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-v2jJSW5T.js → radar-ABXABTNO-DFfRPPEM.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-6W3Z4F8Y.js → railroad-I3PHUGI6-DS8ly7WZ.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-DxIN7Zrt.js → railroad-abnf-LNEFI6M7-Coohlgpw.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js → railroad-ebnf-DWYD2UWJ-CvcfKbZc.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-i2LjEP5t.js → railroad-peg-JR7BVNR7-jRtVHKtg.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-DhsyVKbG.js → railroadDiagram-Y72NRBL7-kWUIDPHg.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-Du2k7i1E.js → requirementDiagram-EQYSW5RA-C39Gfdi-.js} +1 -1
- package/editor-web/assets/ribbon-tabs-5R-_EtHp.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-CDnRMu7J.js → sankeyDiagram-SY24JHO5-DtSQ2N2q.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-BUXBhWYW.js → sequenceDiagram-BLEHNHQU-BZx9gAR1.js} +1 -1
- package/editor-web/assets/{session--OJYv_B7.js → session-2pd0mFQm.js} +1 -1
- package/editor-web/assets/{snapshots-DYooVfOx.js → snapshots-8hCkRemI.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Enb8LZUA.js → stateDiagram-v2-A6IESKWZ-E9qhWPa3.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-pnpjgTrl.js → swimlanes-B3ENRKFQ-C6vD9fmU.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-D_DL_JP0.js +8 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-C4pR18kd.js → timeline-definition-JXYKGLGB-CT8AKsKE.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-kzNGeAv6.js → treeView-D4JQ5SDB-DA2iE5aC.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-Buhb5wzt.js → treemap-SAJKECNS-RgrBf6Sq.js} +1 -1
- package/editor-web/assets/{updating-Cbxw83_O.js → updating--4wIxO0k.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-CL-xLQWl.js → usecaseDiagram-WPOLBNNX-DfIcy0_F.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-bwsyCcdK.js → vennDiagram-Q3Y3IDCW-DxTSyNH7.js} +1 -1
- package/editor-web/assets/{video-8MxWX9f5.js → video-yjnj5UY2.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-DXsLgedI.js → wardley-7MLQ67FV-pow5gWxU.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-Cn0ph953.js → wardleyDiagram-IVAIDKWA-Dar0j9HS.js} +1 -1
- package/editor-web/assets/{workbook-BDWkQ149.js → workbook-7fUt0Qgy.js} +1 -1
- package/editor-web/assets/{xychartDiagram-4URNHDU4-CfXnqGWZ.js → xychartDiagram-4URNHDU4-qCxuQZMj.js} +1 -1
- package/editor-web/index.html +4 -3
- package/package.json +2 -2
- package/editor-web/assets/article-BHjKp5We.js +0 -3
- package/editor-web/assets/article-BlNKv1Cn.js +0 -7
- package/editor-web/assets/bar-button-CJmpgNg4.js +0 -1
- package/editor-web/assets/channel-Bhb-_8v6.js +0 -1
- package/editor-web/assets/chip-pNQlYa2W.js +0 -1
- package/editor-web/assets/deck-Cohd-G5m.js +0 -1
- package/editor-web/assets/dist-6ugUm4dS.js +0 -6
- package/editor-web/assets/dist-CKUW5NzS.js +0 -3
- package/editor-web/assets/dist-Ca9Gsuu0.js +0 -24
- package/editor-web/assets/dist-CynBNzYv.js +0 -1
- package/editor-web/assets/dist-D9tsFc2N.js +0 -16
- package/editor-web/assets/dist-Doj7_HUI.js +0 -547
- package/editor-web/assets/dist-DzKB210A.js +0 -5
- package/editor-web/assets/dist-RyGsFHE0.js +0 -4
- package/editor-web/assets/dist-wD_hHJ8_.js +0 -19
- package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +0 -1
- package/editor-web/assets/index-D-MNVykg.js +0 -28
- package/editor-web/assets/ribbon-tabs-Bxuj_hct.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +0 -8
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{Et as s,ht as c,kt as l,n as u,t as d}from"./x-BAJilkKD.js";import{t as f}from"./session-2pd0mFQm.js";import{t as p}from"./jsx-runtime-DePvh3-m.js";import{h as m}from"./bar-button-BJ-_6g-F.js";import{a as h,c as g,d as _,m as v,u as y}from"./dist-Dw7AH_ip.js";import{n as ee,t as b}from"./italic-BV7iHxoP.js";import{t as x}from"./code-Ch6AB5bZ.js";import{c as S,d as C,i as te,l as ne,n as re,o as ie,r as ae,s as oe,t as se,u as ce}from"./panes-1hRg6CCN.js";import{t as w}from"./link-CFOv3nz-.js";import{D as T,O as le}from"./dist-DQ6RpEJD.js";import{t as E}from"./minus-ngE8owxs.js";import{O as D,T as O,n as k,nt as ue,o as A,s as de,t as fe,ut as j}from"./dist-QLXI7XGS.js";import{n as M,t as N}from"./undo-2-DCbMWoug.js";import{t as P}from"./sigma-B4AWtnVA.js";import{n as F,t as I}from"./table-BW43XXVd.js";import{A as pe,a as me,c as he,o as ge,u as L,y as _e}from"./index-BSd85XUU.js";import{n as ve,t as ye}from"./updating--4wIxO0k.js";import{t as be}from"./collaborator-CbTacvkB.js";import{t as xe}from"./row-DqS4-5b1.js";import{c as Se,n as Ce,s as we,t as Te}from"./dist-DIJnhQFK.js";import{i as Ee,n as De,r as Oe,t as ke}from"./dist-B8_6sJ_V.js";import{S as Ae,_ as je,a as Me,c as Ne,g as R,h as Pe,i as Fe,m as Ie,o as Le,r as Re,s as ze,t as z,u as B,v as Be,x as Ve}from"./words-B2jQwWpp.js";var V=e(n(),1),H=p(),He=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ue(e,t){if(e.title!==t.title||!He(e.cover,t.cover))return{head:!0};for(let n=0;n<t.blocks.length;n++)if(!He(e.blocks[n],t.blocks[n]))return{block:n};if(e.blocks.length>t.blocks.length&&t.blocks.length>0)return{block:t.blocks.length-1}}function We(e,t){let n=R(e),r=e=>e.from<=t.to&&t.from<=e.to;if(n.head&&r(n.head))return{head:!0};let i=n.lines.findIndex(r);return i<0?void 0:{block:i}}function Ge(e,t){if(e.from!==void 0&&e.path===t.path)return We(t.text,{from:e.from,to:e.to??e.from})}var U=new Se(`xArticleAgent`),Ke=O.create({name:`xArticleAgent`,addProseMirrorPlugins(){return[new we({key:U,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(U);return n===void 0?t:n}},props:{decorations(e){let t=U.getState(e);if(!t)return null;let n;return e.doc.forEach((e,r,i)=>{i===t.block&&(n=Te.node(r,r+e.nodeSize,{class:`ak-x-agent`,"data-agent":t.label,"data-testid":`x-agent-block`}))}),n?Ce.create(e.doc,[n]):null}}})]}});function qe(e,t){e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(U,t))}var W={image:`xImage`,post:`xPost`,link:`xLink`,latex:`xLatex`,markdown:`xMarkdown`};function Je(e){let t=[];return e.bold===!0&&t.push({type:`bold`}),e.italic===!0&&t.push({type:`italic`}),e.strike===!0&&t.push({type:`strike`}),e.link!==void 0&&t.push({type:`link`,attrs:{href:e.link}}),{type:`text`,text:e.text,...t.length>0?{marks:t}:{}}}var G=e=>({type:`paragraph`,...e.length>0?{content:e.filter(e=>e.text!==``).map(Je)}:{}});function K(e){let t=e.map(e=>{switch(e.type){case`paragraph`:return G(e.runs);case`h1`:case`h2`:return{type:`heading`,attrs:{level:e.type===`h1`?1:2},...e.runs.length>0?{content:e.runs.map(Je)}:{}};case`quote`:return{type:`blockquote`,content:[G(e.runs)]};case`ul`:case`ol`:return{type:e.type===`ul`?`bulletList`:`orderedList`,content:e.items.map(e=>({type:`listItem`,content:[G(e)]}))};case`image`:return{type:W.image,attrs:{file:e.file,alt:e.alt??``,caption:e.caption??``}};case`post`:return{type:W.post,attrs:{url:e.url,id:e.id}};case`link`:return{type:W.link,attrs:{url:e.url}};case`divider`:return{type:`horizontalRule`};case`latex`:return{type:W.latex,attrs:{tex:e.tex}};case`markdown`:return{type:W.markdown,attrs:{markdown:e.markdown}}}});return{type:`doc`,content:t.length>0?t:[{type:`paragraph`}]}}function Ye(e){let t=e.marks??[],n=e=>t.some(t=>t.type===e),r=t.find(e=>e.type===`link`)?.attrs?.href;return{text:e.text??``,...n(`bold`)?{bold:!0}:{},...n(`italic`)?{italic:!0}:{},...n(`strike`)?{strike:!0}:{},...r===void 0?{}:{link:r}}}var q=e=>(e?.content??[]).map(e=>e.type===`hardBreak`?{text:` `}:Ye(e)),J=(e,t)=>{let n=e.attrs?.[t];return typeof n==`string`?n:``};function Y(e){let t=[];for(let n of e.content??[])switch(n.type){case`paragraph`:t.push({type:`paragraph`,runs:q(n)});break;case`heading`:{let e=Number(n.attrs?.level??1);t.push({type:e<=1?`h1`:`h2`,runs:q(n)});break}case`blockquote`:for(let e of n.content??[])t.push({type:`quote`,runs:q(e)});break;case`bulletList`:case`orderedList`:t.push({type:n.type===`bulletList`?`ul`:`ol`,items:(n.content??[]).map(e=>(e.content??[]).flatMap(e=>q(e)))});break;case`horizontalRule`:t.push({type:`divider`});break;case W.image:{let e=J(n,`alt`),r=J(n,`caption`);t.push({type:`image`,file:J(n,`file`),...e===``?{}:{alt:e},...r===``?{}:{caption:r}});break}case W.post:t.push({type:`post`,url:J(n,`url`),id:J(n,`id`)});break;case W.link:t.push({type:`link`,url:J(n,`url`)});break;case W.latex:t.push({type:`latex`,tex:J(n,`tex`)});break;case W.markdown:t.push({type:`markdown`,markdown:J(n,`markdown`)})}let n=t[0];return t.length===1&&n?.type===`paragraph`&&n.runs.every(e=>e.text===``)?[]:t}var Xe=new Se(`x-found`);function Ze(e){let t=[];return e.descendants((e,n)=>{if(!e.isTextblock)return!0;let r=e.textContent;for(let e of Ve(r))t.push(Te.inline(n+1+e.start,n+1+e.end,{class:`ak-x-link`}));return!1}),Ce.create(e,t)}var Qe=O.create({name:`xFound`,addProseMirrorPlugins(){return[new we({key:Xe,state:{init:(e,t)=>Ze(t.doc),apply:(e,t)=>e.docChanged?Ze(e.doc):t},props:{decorations:e=>Xe.getState(e)}})]}}),$e=(0,V.createContext)(()=>void 0),X=e=>typeof e==`string`?e:``;function et({node:e,updateAttributes:t}){let n=z(),r=(0,V.useContext)($e),i=X(e.attrs.file),a=r(i),o=Be(i.split(`#`)[0]?.split(`.`).pop()??``);return(0,H.jsxs)(k,{as:`figure`,"data-x":`image`,className:`relative`,children:[(0,H.jsxs)(`div`,{className:`ak-x-a-picture`,children:[a===void 0?(0,H.jsx)(`div`,{className:`ak-x-made`,children:i}):o===`video`?(0,H.jsx)(S,{src:a,file:i,controls:!0,muted:!0,playsInline:!0,className:`w-full`}):(0,H.jsx)(`img`,{src:a,alt:X(e.attrs.alt)}),(0,H.jsxs)(`div`,{className:`ak-x-labels`,contentEditable:!1,children:[o===`gif`?(0,H.jsx)(`span`,{className:`ak-x-label`,children:n.gif}):null,(0,H.jsx)(ce,{most:Ae.alt,alt:X(e.attrs.alt),onAlt:e=>{t({alt:e})},trigger:(0,H.jsx)(u,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,"aria-label":n.altText,children:n.alt})})]})]}),(0,H.jsx)(`input`,{className:`mt-2 w-full bg-transparent text-left text-[13px] leading-4 text-[var(--ak-x-caption)] outline-none`,value:X(e.attrs.caption),placeholder:n.caption,"aria-label":n.caption,dir:`auto`,onChange:e=>{t({caption:e.target.value})}})]})}function tt({node:e}){return(0,H.jsx)(k,{"data-x":`link`,children:(0,H.jsx)(ze,{url:X(e.attrs.url)})})}function nt({node:e}){return(0,H.jsx)(k,{className:`ak-x-a-post`,"data-x":`post`,children:Pe(X(e.attrs.url))})}function rt(e){return function({node:t,updateAttributes:n,selected:r}){let i=z(),a=e===`tex`?i.article.equation:i.article.code,o=X(t.attrs[e]);return!r&&o.trim()!==``?(0,H.jsx)(k,{"data-x":e,children:e===`tex`?(0,H.jsx)(Le,{tex:o}):(0,H.jsx)(Ne,{markdown:o})}):(0,H.jsx)(k,{as:`pre`,"data-latex":e===`tex`?``:void 0,children:(0,H.jsx)(`textarea`,{className:`block w-full resize-none bg-transparent font-[inherit] outline-none [field-sizing:content]`,value:o,"aria-label":a,placeholder:a,spellCheck:!1,onChange:t=>{n({[e]:t.target.value})}})})}}function Z(e,t,n){return D.create({name:e,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return Object.fromEntries(t.map(e=>[e,{default:``}]))},parseHTML(){return[{tag:`div[data-node="${e}"]`}]},renderHTML({HTMLAttributes:t}){return[`div`,ue(t,{"data-node":e})]},addNodeView(){return A(n)}})}var it=[Z(W.image,[`file`,`alt`,`caption`],et),Z(W.post,[`url`,`id`],nt),Z(W.link,[`url`],tt),Z(W.latex,[`tex`],rt(`tex`)),Z(W.markdown,[`markdown`],rt(`markdown`))],at=/^https?:\/\/(?:www\.)?(?:x|twitter)\.com\/[A-Za-z0-9_]+\/status\/([0-9]{1,19})/u,ot=3e4;function Q(e){return R(e).issues.some(e=>e.rule===`article-markup`||e.rule===`format`)}var st=class{head;listeners=new Set;body;show;session;constructor(e){this.session=e;let{article:t}=R(e.text);this.head={title:t.title,cover:t.cover,state:e.state,held:Q(e.text)},e.attach({save:e=>{let t=this.article();if(t===void 0||Q(e))return;let n=je(t);return n===je(R(e).article)?void 0:n},take:(e,t,n)=>{let{article:r}=R(e),i=n?.kind===`agent`?Ue(R(t).article,r):void 0;this.set({title:r.title,cover:r.cover,held:Q(e),...i===void 0?{}:{landed:{spot:i,at:Date.now()}}}),this.show?.(r)}}),e.onState(e=>{this.set({state:e})})}get read(){return R(this.session.text).article}bind(e,t){this.body=e,this.show=t}article(){if(this.body!==void 0)return{title:this.head.title,...this.head.cover?{cover:this.head.cover}:{},blocks:this.body()}}get(){return this.head}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}set(e){this.head={...this.head,...e};for(let e of this.listeners)e()}edited(e={}){Object.keys(e).length>0&&this.set(e),this.session.edited()}};function $(e){return(0,H.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,"aria-pressed":e.on,disabled:e.disabled,className:c(e.on===!0&&`bg-here`),onMouseDown:e=>{e.preventDefault()},onClick:e.onClick,children:e.children})}function ct(e){let t=z(),[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(``),o=i.trim()===``?void 0:e.check?.(i.trim());return(0,H.jsxs)(g,{open:n,onOpenChange:e=>{r(e),e&&a(``)},children:[(0,H.jsx)(_,{asChild:!0,children:(0,H.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,disabled:e.disabled,children:e.icon})}),(0,H.jsx)(y,{className:`w-80`,align:`start`,children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:t=>{t.preventDefault(),i.trim()!==``&&o===void 0&&(e.onAnswer(i.trim()),r(!1))},children:[(0,H.jsx)(me,{autoFocus:!0,value:i,placeholder:e.hint,"aria-label":e.hint,onChange:e=>{a(e.target.value)}}),o===void 0?null:(0,H.jsx)(`p`,{className:`text-destructive text-xs`,children:o}),(0,H.jsx)(u,{type:`submit`,size:`sm`,className:`self-end`,disabled:i.trim()===``||o!==void 0,children:t.article.add})]})})]})}function lt({dir:e,entry:t,insert:n,divider:r}){let i=z().article,[a,o]=(0,V.useState)(!1),[s,l]=(0,V.useState)(`menu`),[d,f]=(0,V.useState)(``),p=()=>{o(!1)},h=(e,t,n)=>(0,H.jsx)(xe,{size:`dense`,icon:t,onClick:n,children:e}),v=(e,t,n)=>{let r=d.trim()===``?void 0:t(d.trim());return(0,H.jsxs)(`form`,{className:`flex w-80 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),d.trim()!==``&&r===void 0&&(n(d.trim()),p())},children:[(0,H.jsx)(me,{autoFocus:!0,value:d,placeholder:e,"aria-label":e,onChange:e=>{f(e.target.value)}}),r===void 0?null:(0,H.jsx)(`p`,{className:`text-destructive text-xs`,children:r}),(0,H.jsx)(u,{type:`submit`,size:`sm`,className:`self-end`,disabled:d.trim()===``||r!==void 0,children:i.add})]})};return(0,H.jsxs)(g,{open:a,onOpenChange:e=>{o(e),e&&(l(`menu`),f(``))},children:[(0,H.jsx)(_,{asChild:!0,children:(0,H.jsxs)(u,{variant:`ghost`,size:`sm`,className:`gap-1 px-2`,children:[i.insert,(0,H.jsx)(m,{})]})}),(0,H.jsx)(y,{className:c(s===`menu`?`w-48 p-1`:`w-auto`),align:`start`,children:s===`menu`?(0,H.jsxs)(`div`,{role:`menu`,children:[h(i.media,(0,H.jsx)(C,{}),()=>{l(`media`)}),h(i.post,(0,H.jsx)(pe,{}),()=>{l(`post`)}),h(i.linkCard,(0,H.jsx)(w,{}),()=>{l(`link`)}),h(i.divider,(0,H.jsx)(E,{}),()=>{r(),p()}),h(i.code,(0,H.jsx)(x,{}),()=>{n(W.markdown,{markdown:"```\n\n```"}),p()}),h(i.equation,(0,H.jsx)(P,{}),()=>{n(W.latex,{tex:``}),p()}),h(i.table,(0,H.jsx)(I,{}),()=>{n(W.markdown,{markdown:`| A | B |
|
|
2
|
+
| - | - |
|
|
3
|
+
| | |`}),p()})]}):s===`media`?(0,H.jsx)(te,{self:t,types:Fe,testId:`x-picker`,onPick:t=>{n(W.image,{file:oe(e,t),alt:``,caption:``}),p()}}):s===`post`?v(i.postHint,e=>at.test(e)?void 0:i.notPost,e=>{n(W.post,{url:e,id:at.exec(e)?.[1]??``})}):v(i.linkHint,e=>/^https?:\/\/\S+$/u.test(e)?void 0:i.notLink,e=>{n(W.link,{url:e})})})]})}function ut({editor:e}){let t=z().article,n=()=>e.chain().focus(),r=e.isActive(`heading`,{level:1})?t.heading:e.isActive(`heading`,{level:2})?t.subheading:t.paragraph;return(0,H.jsxs)(ge,{children:[(0,H.jsx)(_e,{asChild:!0,children:(0,H.jsxs)(u,{variant:`ghost`,size:`sm`,className:`w-32 justify-between gap-1 px-2`,onMouseDown:e=>{e.preventDefault()},children:[r,(0,H.jsx)(m,{})]})}),(0,H.jsxs)(he,{align:`start`,className:`ak-x w-48`,children:[(0,H.jsx)(L,{className:`text-[31px] leading-10 font-extrabold`,onSelect:()=>n().setHeading({level:1}).run(),children:t.heading}),(0,H.jsx)(L,{className:`text-[26px] leading-9 font-extrabold`,onSelect:()=>n().setHeading({level:2}).run(),children:t.subheading}),(0,H.jsx)(L,{className:`text-[15px] font-bold`,onSelect:()=>n().setParagraph().run(),children:t.paragraph})]})]})}function dt({editor:e,dir:t,entry:n}){let r=z(),i=r.article,[,a]=(0,V.useState)(0);(0,V.useEffect)(()=>{let t=()=>{a(e=>e+1)};return e.on(`transaction`,t),()=>{e.off(`transaction`,t)}},[e]);let o=()=>e.chain().focus(),s=(t,n)=>{let{$from:r}=e.state.selection;r.depth>1?o().insertContentAt(r.after(1),{type:t,attrs:n}).run():o().insertContent({type:t,attrs:n}).run()},c=e.getText().split(/\s+/u).filter(e=>e!==``).length;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)($,{label:r.undo,disabled:!e.can().undo(),onClick:()=>o().undo().run(),children:(0,H.jsx)(N,{})}),(0,H.jsx)($,{label:r.redo,disabled:!e.can().redo(),onClick:()=>o().redo().run(),children:(0,H.jsx)(M,{})}),(0,H.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),(0,H.jsx)($,{label:i.bold,on:e.isActive(`bold`),onClick:()=>o().toggleBold().run(),children:(0,H.jsx)(ee,{})}),(0,H.jsx)($,{label:i.italic,on:e.isActive(`italic`),onClick:()=>o().toggleItalic().run(),children:(0,H.jsx)(b,{})}),(0,H.jsx)($,{label:i.strike,on:e.isActive(`strike`),onClick:()=>o().toggleStrike().run(),children:(0,H.jsx)(F,{})}),(0,H.jsx)(ut,{editor:e}),(0,H.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),(0,H.jsx)($,{label:i.quote,on:e.isActive(`blockquote`),onClick:()=>o().toggleBlockquote().run(),children:(0,H.jsx)(j,{})}),(0,H.jsx)($,{label:i.bullets,on:e.isActive(`bulletList`),onClick:()=>o().toggleBulletList().run(),children:(0,H.jsx)(T,{})}),(0,H.jsx)($,{label:i.numbers,on:e.isActive(`orderedList`),onClick:()=>o().toggleOrderedList().run(),children:(0,H.jsx)(le,{})}),(0,H.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),e.isActive(`link`)?(0,H.jsx)($,{label:i.removeLink,on:!0,onClick:()=>o().extendMarkRange(`link`).unsetLink().run(),children:(0,H.jsx)(d,{})}):(0,H.jsx)(ct,{label:i.link,hint:i.linkHint,icon:(0,H.jsx)(w,{}),disabled:e.state.selection.empty,onAnswer:e=>{o().extendMarkRange(`link`).setLink({href:e}).run()}}),(0,H.jsx)(lt,{dir:t,entry:n,insert:s,divider:()=>o().setHorizontalRule().run()}),(0,H.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs tabular-nums`,children:i.words(c)})]})}function ft({doc:e,dir:n,entry:o}){let c=z(),f=r(),p=a(),[m,ee]=ae(),b=(0,V.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),x=p||b.held,S=(0,V.useMemo)(()=>e.read,[e]),[ce,w]=(0,V.useState)(()=>S.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),T=de({textDirection:`auto`,editable:!x,immediatelyRender:!0,extensions:[ke.configure({heading:{levels:[1,2]},listItem:!1,blockquote:!1,code:!1,codeBlock:!1,underline:!1,hardBreak:!1,link:{openOnClick:!1,autolink:!0}}),De.extend({content:`paragraph`}),Oe.extend({content:`paragraph`}),Ee.configure({placeholder:c.article.body}),Qe,Ke,...it],content:K(S.blocks),onUpdate:({editor:t,transaction:n})=>{n.docChanged&&(w(Y(t.getJSON()).flatMap(e=>e.type===`image`?[e.file]:[])),e.edited())}}),[le,E]=(0,V.useState)(()=>S.blocks);(0,V.useEffect)(()=>{e.bind(()=>Y(T.getJSON()),e=>{T.commands.setContent(K(e.blocks),{emitUpdate:!1}),w(e.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),E(e.blocks)})},[e,T]),(0,V.useEffect)(()=>{T.setEditable(!x)},[T,x]),(0,V.useEffect)(()=>{let e=()=>{E(Y(T.getJSON()))};return T.on(`update`,e),()=>{T.off(`update`,e)}},[T]);let D=(0,V.useDeferredValue)(le),{agent:O,following:k}=t(),ue=v(),A=(()=>{if(O?.doing===void 0)return;let t=b.landed,n=t!==void 0&&t.at>=O.at-ot;return n&&O.source?.path===o?t.spot:(O.source?Ge(O.source,{path:o,text:e.session.text}):void 0)??(n?t.spot:void 0)})(),j=A&&`block`in A?A.block:void 0,M=A!==void 0&&`head`in A,N=O?ue(O):``,P=(0,V.useRef)(null),F=(0,V.useRef)(null);(0,V.useEffect)(()=>{qe(T,j===void 0?null:{block:j,label:N})},[T,j,N]),(0,V.useEffect)(()=>{let e=F.current;if(e){for(let t of e.querySelectorAll(`[data-agent]`))t.removeAttribute(`data-agent`);(M?e.querySelector(`.ak-x-a-title`):j===void 0?null:e.querySelector(`.ak-x-a-body`)?.children[j])?.setAttribute(`data-agent`,``)}},[j,M,D,b.title]),(0,V.useEffect)(()=>{k&&A!==void 0&&((M?P.current?.querySelector(`.ak-x-a-title`):P.current?.querySelector(`[data-testid="x-agent-block"]`))?.scrollIntoView({block:`nearest`}),F.current?.querySelector(`[data-agent]`)?.scrollIntoView({block:`nearest`}))},[k,A,M,b.landed]),i({hold:()=>Promise.resolve({key:`${o}@${String(e.session.text.length)}`,what:`The X article ${o}`,source:{path:o}}),locate:t=>{let n=R(e.session.text),r=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},i=s(t)[0],a=e=>e!==void 0&&i!==void 0&&i.x>=e.x&&i.x<=e.x+e.width&&i.y>=e.y&&i.y<=e.y+e.height,c=[{as:`where it is written`,head:[`.ak-x-a-cover`,`.ak-x-a-title`].map(e=>P.current?.querySelector(e)),blocks:[...P.current?.querySelector(`.ak-x-a-body .ProseMirror`)?.children??[]]},{as:`as X will show it`,head:[`.ak-x-a-cover`,`.ak-x-a-title`].map(e=>F.current?.querySelector(e)),blocks:[...F.current?.querySelector(`.ak-x-a-body`)?.children??[]]}],u=e=>e===void 0?{}:{line:e.from,...e.to>e.from?{endLine:e.to}:{}},d=c.some(e=>e.head.some(e=>{let n=r(e);return n!==void 0&&l(t,n)})),f=new Set;for(let e of c)e.blocks.forEach((e,n)=>{let i=r(e);i&&l(t,i)&&f.add(n)});let p=[...d?[{name:`the article's head: its cover and title`,source:{path:o,...u(n.head)},...b.title===``?{}:{text:b.title}}]:[],...[...f].sort((e,t)=>e-t).map(e=>{let t=c.map(t=>t.blocks[e]?.textContent.trim()??``).find(e=>e!==``)??``;return{name:`block ${String(e+1)} of the article`,source:{path:o,...u(n.lines[e])},...t===``?{}:{text:t}}})],m=c.flatMap(e=>{if(e.head.some(e=>a(r(e))))return[`in the article's head, ${e.as}`];let t=e.blocks.findIndex(e=>a(r(e)));return t<0?[]:[`in block ${String(t+1)}, ${e.as}`]}).at(0);return Promise.resolve({elements:p,...m===void 0?{}:{where:m}})}});let I=ie(n,[...b.cover?[b.cover.file]:[],...ce]),pe=(0,V.useMemo)(()=>e=>I.get(e),[I]),[me,he]=(0,V.useState)(!1),ge=b.cover===void 0?void 0:I.get(b.cover.file),L=f?.theme===`dark`,_e=(0,H.jsxs)(g,{open:me,onOpenChange:he,children:[(0,H.jsx)(`div`,{className:`group/cover ak-x-a-cover relative`,children:b.cover===void 0?x?null:(0,H.jsx)(_,{asChild:!0,children:(0,H.jsxs)(u,{variant:`ghost`,className:`size-full flex-col gap-2 rounded-none text-[13px] font-normal text-[var(--ak-x-muted)]`,"aria-label":c.article.addCover,children:[(0,H.jsx)(`span`,{className:`grid size-10 place-items-center rounded-full bg-[var(--ak-x-muted)] text-[var(--ak-x-bg)]`,children:(0,H.jsx)(C,{className:`size-5`})}),c.article.coverHint]})}):(0,H.jsxs)(H.Fragment,{children:[ge===void 0?(0,H.jsx)(`div`,{className:`ak-x-made`,children:b.cover.file}):(0,H.jsx)(`img`,{src:ge,alt:b.cover.alt??``}),x?null:(0,H.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1`,children:[(0,H.jsx)(_,{asChild:!0,children:(0,H.jsxs)(u,{variant:`secondary`,size:`sm`,className:`bg-media/75 text-on-media`,children:[(0,H.jsx)(C,{}),c.article.changeCover]})}),(0,H.jsx)(u,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media`,"aria-label":c.article.removeCover,title:c.article.removeCover,onClick:()=>{e.edited({cover:void 0})},children:(0,H.jsx)(d,{})})]})]})}),(0,H.jsx)(y,{className:`w-auto`,align:`center`,children:(0,H.jsx)(te,{self:o,types:Re,testId:`x-picker`,onPick:t=>{he(!1),e.edited({cover:{file:oe(n,t)}})}})})]}),ye=(0,H.jsxs)(`div`,{ref:P,className:`ak-x ak-x-editing min-h-full`,"data-theme":L?`dark`:`light`,children:[_e,(0,H.jsxs)(`div`,{className:`ak-x-e-page`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(`textarea`,{className:`ak-x-a-title block w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-[var(--ak-x-muted)]`,value:b.title,placeholder:c.article.title,"aria-label":c.article.title,readOnly:x,dir:`auto`,"data-testid":`x-article-title`,onChange:t=>{x||e.edited({title:t.target.value.replace(/\n/gu,` `)})}}),O&&M?(0,H.jsx)(be,{"data-testid":`x-agent-head`,label:N,className:`-inset-1`}):null]}),(0,H.jsxs)(`div`,{className:`ak-x-e-by`,children:[(0,H.jsx)(`div`,{className:`ak-x-avatar`,"aria-hidden":`true`,children:B.name.slice(0,1)}),(0,H.jsx)(`span`,{className:`ak-x-name`,children:B.name}),(0,H.jsxs)(`span`,{className:`ak-x-handle`,children:[`@`,B.handle]})]}),(0,H.jsx)($e.Provider,{value:pe,children:(0,H.jsx)(`div`,{className:`ak-x-a-body`,"data-testid":`x-article-body`,children:(0,H.jsx)(fe,{editor:T,className:`[&_.ProseMirror]:outline-none`})})})]})]}),xe=(0,H.jsx)(`div`,{ref:F,className:`ak-x ak-x-column`,"data-theme":L?`dark`:`light`,children:(0,H.jsx)(Me,{article:{title:b.title,...b.cover?{cover:b.cover}:{},blocks:D},source:pe})});return(0,H.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`x-article-editor`,children:[(0,H.jsx)(h,{start:(0,H.jsxs)(H.Fragment,{children:[x||m!==`edit`?null:(0,H.jsx)(dt,{editor:T,dir:n,entry:o}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.jsx)(se,{pane:m,onPane:ee})]}),saved:{state:b.state},exports:{}}),(0,H.jsx)(Ie.Provider,{value:ne,children:(0,H.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[b.held?(0,H.jsx)(ve,{}):null,(0,H.jsx)(re,{pane:m,edit:ye,preview:xe,width:600,background:L?`#000000`:`#ffffff`,testId:`x-preview`})]})})]})}function pt(){let e=z(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,V.useState)(),[l,u]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return f.open(t,i).then(t=>{n?(e=t,c(new st(t))):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,H.jsx)(`div`,{className:`flex size-full`,"data-testid":`x-article-editor`,"data-state":`updating`,children:(0,H.jsx)(ye,{})}):!s||i===void 0?(0,H.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`x-article-editor`,"data-state":`loading`,children:e.article.loading}):(0,H.jsx)(ft,{doc:s,dir:a,entry:i})}export{pt as XArticleEditor,pt as default,Y as fromDoc,K as toDoc};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{Et as s,ht as c,kt as l,n as u,t as ee}from"./x-BAJilkKD.js";import{C as d,S as f,T as p}from"./schemas-DlRAoVtq.js";import{t as te}from"./session-2pd0mFQm.js";import{t as m}from"./jsx-runtime-DePvh3-m.js";import{g as h,h as g}from"./bar-button-BJ-_6g-F.js";import{a as ne,c as _,d as v,m as re,u as y}from"./dist-Dw7AH_ip.js";import{t as b}from"./createLucideIcon-euu7Wcd9.js";import{n as x,t as S}from"./italic-BV7iHxoP.js";import{t as ie}from"./copy-SoaMYqsN.js";import{d as ae,i as oe,l as se,n as ce,o as le,r as ue,s as de,t as fe,u as C}from"./panes-1hRg6CCN.js";import{t as pe}from"./link-CFOv3nz-.js";import{D as w,O as me}from"./dist-DQ6RpEJD.js";import{t as he}from"./minus-ngE8owxs.js";import{O as T,T as E,n as D,nt as O,o as k,s as ge,t as _e,ut as A}from"./dist-QLXI7XGS.js";import{n as j,t as M}from"./undo-2-DCbMWoug.js";import{N as ve,a as N,c as P,o as F,u as I,y as ye}from"./index-BSd85XUU.js";import{n as be,t as xe}from"./updating--4wIxO0k.js";import{t as Se}from"./collaborator-CbTacvkB.js";import{S as Ce,h as we,i as Te,n as Ee,p as De,r as Oe,t as ke}from"./syntax-C0iPON60.js";import{i as Ae,n as je,t as Me}from"./syntax-BIEjjMZL.js";import{r as Ne,t as Pe}from"./browser-DEGNhKTV.js";import{n as Fe,r as Ie,t as Le}from"./lib-KOEbW83T.js";import{c as Re,n as ze,s as Be,t as Ve}from"./dist-DIJnhQFK.js";import{i as He,n as Ue,r as We,t as Ge}from"./dist-B8_6sJ_V.js";import{d as Ke,l as qe,o as Je,p as Ye,r as Xe,s as Ze,t as L,v as Qe}from"./words-DgMuEmDO.js";var $e=b(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),et=b(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),tt=f({title:d().optional(),cover:p([d().min(1),f({file:d().min(1),alt:d().optional()})]).optional()}),nt=/^<br\s*\/?>$/iu,rt=/^https?:\/\/\S+$/u,it={extensions:[Ie([`yaml`]),Ee(),ke(),Oe(),Me()],mdastExtensions:[Le([`yaml`]),we(),De(),Te(),je()]},at={extensions:[Fe([`yaml`])],bullet:`-`,emphasis:`*`,strong:`*`,rule:`-`,fences:!0},ot=e=>`${e.bold===!0?`b`:``}${e.italic===!0?`i`:``}|${e.link??``}`;function R(e){let t=[];for(let n of e){if(n.text===``)continue;let e=t.at(-1);e&&ot(e)===ot(n)?t[t.length-1]={...e,text:e.text+n.text}:t.push(n)}return t}function z(e,t,n,r={}){let i=[];for(let a of e)switch(a.type){case`text`:i.push({...r,text:a.value.replace(/\n/gu,` `)});break;case`break`:i.push({...r,text:` `});break;case`strong`:i.push(...z(a.children,t,n,{...r,bold:!0}));break;case`emphasis`:i.push(...z(a.children,t,n,{...r,italic:!0}));break;case`delete`:t(a,`strikethrough, which LinkedIn's article editor does not have: its words are kept plain`),i.push(...z(a.children,t,n,r));break;case`link`:i.push(...z(a.children,t,n,{...r,link:a.url}));break;case`linkReference`:{let e=n.get(a.identifier.toLowerCase());i.push(...z(a.children,t,n,e===void 0?r:{...r,link:e}));break}case`footnoteReference`:t(a,`a footnote, which LinkedIn's blocks do not hold: write the source in the words, or as a link`);break;case`inlineCode`:t(a,`inline code, which LinkedIn's article editor does not style: write it as words, or as a code snippet`),i.push({...r,text:a.value});break;case`image`:t(a,`a picture inside a line: LinkedIn takes a picture as a block of its own, on a line of its own`);break;case`inlineMath`:t(a,`an equation, which LinkedIn's article editor does not have`),i.push({...r,text:a.value});break;case`html`:/^<!--[\s\S]*-->$/u.test(a.value.trim())||t(a,`HTML, which LinkedIn's blocks do not hold`);break;default:t(a,`${a.type}, which LinkedIn's blocks do not hold`)}return i}var st=e=>e.map(e=>`value`in e?e.value:`children`in e?st(e.children):``).join(``);function B(e){let t=[],n=(e,n)=>{t.push({rule:`article-markup`,line:e.position?.start.line,message:`${n[0]?.toUpperCase()??``}${n.slice(1)}.`})},r=Ce(e,it),i=new Map;for(let e of r.children)e.type===`definition`&&i.set(e.identifier.toLowerCase(),e.url);let a=``,o,s=[],c=e=>{switch(e.type){case`yaml`:{let n;try{n=Pe(e.value)}catch(n){t.push({rule:`format`,line:e.position?.start.line,message:`Its front matter is not YAML: ${n.message.split(`
|
|
2
|
+
`)[0]??``}`});break}let r=tt.safeParse(n??{});if(!r.success){t.push({rule:`format`,line:e.position?.start.line,message:`Its front matter takes a title and a cover (a file, or { file, alt }): ${r.error.issues.map(e=>e.message).join(`; `)}`});break}a=r.data.title??``;let i=r.data.cover;o=i===void 0?void 0:typeof i==`string`?{file:i}:{file:i.file,...i.alt===void 0?{}:{alt:i.alt}};break}case`paragraph`:{let t=e.children.filter(e=>e.type===`image`),r=e.children.filter(e=>e.type!==`image`&&e.type!==`break`&&(e.type!==`text`||e.value.trim()!==``));if(t.length>0&&r.length===0){for(let e of t)s.push({type:`image`,file:e.url,...e.alt?{alt:e.alt}:{},...e.title?{caption:e.title}:{}});break}let a=st(e.children).trim();if(!a.includes(` `)&&rt.test(a)){s.push({type:`embed`,url:a});break}s.push({type:`paragraph`,runs:R(z(e.children,n,i))});break}case`heading`:e.depth>2&&n(e,`a heading of level ${String(e.depth)}: LinkedIn has a Heading (#) and a Subheading (##)`),s.push({type:e.depth===1?`h1`:`h2`,runs:R(z(e.children,n,i))});break;case`blockquote`:for(let t of e.children)t.type===`paragraph`?s.push({type:`quote`,runs:R(z(t.children,n,i))}):n(t,`${t.type} inside a quote, which LinkedIn's blocks do not hold`);break;case`list`:{let t=[],r=()=>{t.length>0&&s.push({type:e.ordered===!0?`ol`:`ul`,items:t}),t=[]};e.ordered===!0&&(e.start??1)!==1&&n(e,`a numbered list starting at ${String(e.start)}: LinkedIn numbers every list from 1`);for(let a of e.children){let[e,...o]=a.children;t.push(e?.type===`paragraph`?R(z(e.children,n,i)):[]),e!==void 0&&e.type!==`paragraph`&&o.unshift(e);for(let e of o)e.type===`list`?n(e,`a list inside a list: LinkedIn's lists are one level deep`):(r(),c(e))}r();break}case`thematicBreak`:s.push({type:`divider`});break;case`code`:s.push({type:`code`,code:e.value,...e.lang?{lang:e.lang}:{}});break;case`math`:n(e,`an equation, which LinkedIn's article editor does not have`);break;case`table`:n(e,`a table, which LinkedIn's article editor does not have: a picture of it, or a list`);break;case`html`:if(nt.test(e.value.trim())){s.push({type:`paragraph`,runs:[]});break}if(/^<!--[\s\S]*-->$/u.test(e.value.trim()))break;n(e,`HTML, which LinkedIn's blocks do not hold (an empty line is <br /> alone)`);break;case`definition`:break;case`footnoteDefinition`:n(e,`a footnote, which LinkedIn's blocks do not hold: write the source in the words, or as a link`);break;default:n(e,`${e.type}, which LinkedIn's blocks do not hold`)}},l=[],u;for(let e of r.children){let t=s.length;c(e);let n=e.position&&{from:e.position.start.line,to:e.position.end.line};if(n){e.type===`yaml`&&(u=n);for(let e=t;e<s.length;e++)l.push(n)}}return a.trim()===``&&t.push({rule:`article-title`,line:1,message:`It has no title: LinkedIn's article needs one (front matter: title: …).`}),{article:{title:a,...o?{cover:o}:{},blocks:s},issues:t,lines:l,head:u}}function V(e){return e.map(e=>{let t={type:`text`,value:e.text};return e.italic===!0&&(t={type:`emphasis`,children:[t]}),e.bold===!0&&(t={type:`strong`,children:[t]}),e.link!==void 0&&(t={type:`link`,url:e.link,children:[t]}),t})}function ct(e){switch(e.type){case`paragraph`:return e.runs.every(e=>e.text===``)?[{type:`html`,value:`<br />`}]:[{type:`paragraph`,children:V(e.runs)}];case`h1`:case`h2`:return[{type:`heading`,depth:e.type===`h1`?1:2,children:V(e.runs)}];case`quote`:return[{type:`blockquote`,children:[{type:`paragraph`,children:V(e.runs)}]}];case`ul`:case`ol`:return[{type:`list`,ordered:e.type===`ol`,spread:!1,children:e.items.map(e=>({type:`listItem`,spread:!1,children:[{type:`paragraph`,children:V(e)}]}))}];case`image`:return[{type:`paragraph`,children:[{type:`image`,url:e.file,alt:e.alt??``,title:e.caption??null}]}];case`embed`:return[{type:`paragraph`,children:[{type:`text`,value:e.url}]}];case`divider`:return[{type:`thematicBreak`}];case`code`:return[{type:`code`,lang:e.lang??null,value:e.code}]}}function lt(e){let t={title:e.title};e.cover&&(t.cover=e.cover.alt===void 0?e.cover.file:{file:e.cover.file,alt:e.cover.alt});let n={type:`root`,children:[{type:`yaml`,value:Ne(t,{lineWidth:0}).trimEnd()},...e.blocks.flatMap(ct)]};return Ae(n,at)}var H=e=>e.replace(/&/gu,`&`).replace(/</gu,`<`).replace(/>/gu,`>`).replace(/"/gu,`"`);function U(e){return e.map(e=>{let t=H(e.text);return e.italic===!0&&(t=`<em>${t}</em>`),e.bold===!0&&(t=`<strong>${t}</strong>`),e.link!==void 0&&(t=`<a href="${H(e.link)}">${t}</a>`),t}).join(``)}function ut(e,t){switch(e.type){case`paragraph`:return e.runs.length===0?`<p><br></p>`:`<p>${U(e.runs)}</p>`;case`h1`:return`<h1>${U(e.runs)}</h1>`;case`h2`:return`<h2>${U(e.runs)}</h2>`;case`quote`:return`<blockquote><p>${U(e.runs)}</p></blockquote>`;case`ul`:case`ol`:return`<${e.type}>${e.items.map(e=>`<li>${U(e)}</li>`).join(``)}</${e.type}>`;case`code`:return`<pre><code>${H(e.code)}</code></pre>`;case`divider`:return`<hr>`;case`embed`:return`<p><a href="${H(e.url)}">${H(e.url)}</a></p>`;case`image`:{let n=t(e.file);return n===void 0?``:`<figure><img src="${H(n)}" alt="${H(e.alt??``)}">${e.caption===void 0?``:`<figcaption>${H(e.caption)}</figcaption>`}</figure>`}}}function dt(e,t=()=>void 0){return e.blocks.map(e=>ut(e,t)).filter(e=>e!==``).join(`
|
|
3
|
+
`)}function ft(e){return e.blocks.map(e=>{switch(e.type){case`ul`:return e.items.map(e=>`• ${e.map(e=>e.text).join(``)}`).join(`
|
|
4
|
+
`);case`ol`:return e.items.map((e,t)=>`${String(t+1)}. ${e.map(e=>e.text).join(``)}`).join(`
|
|
5
|
+
`);case`code`:return e.code;case`divider`:return`---`;case`embed`:return e.url;case`image`:return e.caption??``;default:return e.runs.map(e=>e.text).join(``)}}).join(`
|
|
6
|
+
|
|
7
|
+
`)}var W=e(n(),1),G=m(),pt=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function mt(e,t){if(e.title!==t.title||!pt(e.cover,t.cover))return{head:!0};for(let n=0;n<t.blocks.length;n++)if(!pt(e.blocks[n],t.blocks[n]))return{block:n};if(e.blocks.length>t.blocks.length&&t.blocks.length>0)return{block:t.blocks.length-1}}function ht(e,t){let n=B(e),r=e=>e.from<=t.to&&t.from<=e.to;if(n.head&&r(n.head))return{head:!0};let i=n.lines.findIndex(r);return i<0?void 0:{block:i}}function gt(e,t){if(e.from!==void 0&&e.path===t.path)return ht(t.text,{from:e.from,to:e.to??e.from})}var K=new Re(`liArticleAgent`),_t=E.create({name:`liArticleAgent`,addProseMirrorPlugins(){return[new Be({key:K,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(K);return n===void 0?t:n}},props:{decorations(e){let t=K.getState(e);if(!t)return null;let n;return e.doc.forEach((e,r,i)=>{i===t.block&&(n=Ve.node(r,r+e.nodeSize,{class:`ak-li-agent`,"data-agent":t.label,"data-testid":`linkedin-agent-block`}))}),n?ze.create(e.doc,[n]):null}}})]}});function vt(e,t){e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(K,t))}var q={image:`liImage`,embed:`liEmbed`};function yt(e){let t=[];return e.bold===!0&&t.push({type:`bold`}),e.italic===!0&&t.push({type:`italic`}),e.link!==void 0&&t.push({type:`link`,attrs:{href:e.link}}),{type:`text`,text:e.text,...t.length>0?{marks:t}:{}}}var J=e=>({type:`paragraph`,...e.length>0?{content:e.filter(e=>e.text!==``).map(yt)}:{}});function bt(e){let t=e.map(e=>{switch(e.type){case`paragraph`:return J(e.runs);case`h1`:case`h2`:return{type:`heading`,attrs:{level:e.type===`h1`?1:2},...e.runs.length>0?{content:e.runs.map(yt)}:{}};case`quote`:return{type:`blockquote`,content:[J(e.runs)]};case`ul`:case`ol`:return{type:e.type===`ul`?`bulletList`:`orderedList`,content:e.items.map(e=>({type:`listItem`,content:[J(e)]}))};case`code`:return{type:`codeBlock`,attrs:{language:e.lang??null},...e.code===``?{}:{content:[{type:`text`,text:e.code}]}};case`image`:return{type:q.image,attrs:{file:e.file,alt:e.alt??``,caption:e.caption??``}};case`embed`:return{type:q.embed,attrs:{url:e.url}};case`divider`:return{type:`horizontalRule`}}});return{type:`doc`,content:t.length>0?t:[{type:`paragraph`}]}}function xt(e){let t=e.marks??[],n=e=>t.some(t=>t.type===e),r=t.find(e=>e.type===`link`)?.attrs?.href;return{text:e.text??``,...n(`bold`)?{bold:!0}:{},...n(`italic`)?{italic:!0}:{},...r===void 0?{}:{link:r}}}var Y=e=>(e?.content??[]).map(e=>e.type===`hardBreak`?{text:` `}:xt(e)),X=(e,t)=>{let n=e.attrs?.[t];return typeof n==`string`?n:``};function Z(e){let t=[];for(let n of e.content??[])switch(n.type){case`paragraph`:t.push({type:`paragraph`,runs:Y(n)});break;case`heading`:{let e=Number(n.attrs?.level??1);t.push({type:e<=1?`h1`:`h2`,runs:Y(n)});break}case`blockquote`:for(let e of n.content??[])t.push({type:`quote`,runs:Y(e)});break;case`bulletList`:case`orderedList`:t.push({type:n.type===`bulletList`?`ul`:`ol`,items:(n.content??[]).map(e=>(e.content??[]).flatMap(e=>Y(e)))});break;case`codeBlock`:{let e=X(n,`language`);t.push({type:`code`,code:(n.content??[]).map(e=>e.text??``).join(``),...e===``?{}:{lang:e}});break}case`horizontalRule`:t.push({type:`divider`});break;case q.image:{let e=X(n,`alt`),r=X(n,`caption`);t.push({type:`image`,file:X(n,`file`),...e===``?{}:{alt:e},...r===``?{}:{caption:r}});break}case q.embed:t.push({type:`embed`,url:X(n,`url`)})}let n=t[0];return t.length===1&&n?.type===`paragraph`&&n.runs.every(e=>e.text===``)?[]:t}var St=(0,W.createContext)(()=>void 0),Q=e=>typeof e==`string`?e:``;function Ct({node:e,updateAttributes:t}){let n=L(),r=(0,W.useContext)(St),i=Q(e.attrs.file),a=r(i);return(0,G.jsxs)(D,{as:`figure`,"data-li":`image`,className:`relative`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[a===void 0?(0,G.jsx)(`div`,{className:`ak-li-made`,children:i}):(0,G.jsx)(`img`,{src:a,alt:Q(e.attrs.alt)}),(0,G.jsx)(`div`,{className:`absolute bottom-2 left-2`,contentEditable:!1,children:(0,G.jsx)(C,{most:Qe.alt,alt:Q(e.attrs.alt),onAlt:e=>{t({alt:e})},trigger:(0,G.jsx)(u,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,children:n.alt})})})]}),(0,G.jsx)(`input`,{className:`mt-2 w-full bg-transparent text-center text-sm text-[var(--ak-li-muted)] outline-none`,value:Q(e.attrs.caption),placeholder:n.article.caption,"aria-label":n.article.caption,dir:`auto`,onChange:e=>{t({caption:e.target.value})}})]})}function wt({node:e}){return(0,G.jsx)(D,{"data-li":`embed`,children:(0,G.jsx)(Ke,{url:Q(e.attrs.url)})})}function Tt(e,t,n){return T.create({name:e,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return Object.fromEntries(t.map(e=>[e,{default:``}]))},parseHTML(){return[{tag:`div[data-node="${e}"]`}]},renderHTML({HTMLAttributes:t}){return[`div`,O(t,{"data-node":e})]},addNodeView(){return k(n)}})}var Et=[Tt(q.image,[`file`,`alt`,`caption`],Ct),Tt(q.embed,[`url`],wt)],Dt=3e4;function Ot(e){return B(e).issues.some(e=>e.rule===`article-markup`||e.rule===`format`)}var kt=class{head;listeners=new Set;body;show;session;constructor(e){this.session=e;let{article:t}=B(e.text);this.head={title:t.title,cover:t.cover,state:e.state,held:Ot(e.text)},e.attach({save:e=>{let t=this.article();if(t===void 0||Ot(e))return;let n=lt(t);return n===lt(B(e).article)?void 0:n},take:(e,t,n)=>{let{article:r}=B(e),i=n?.kind===`agent`?mt(B(t).article,r):void 0;this.set({title:r.title,cover:r.cover,held:Ot(e),...i===void 0?{}:{landed:{spot:i,at:Date.now()}}}),this.show?.(r)}}),e.onState(e=>{this.set({state:e})})}get read(){return B(this.session.text).article}bind(e,t){this.body=e,this.show=t}article(){if(this.body!==void 0)return{title:this.head.title,...this.head.cover?{cover:this.head.cover}:{},blocks:this.body()}}get(){return this.head}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}set(e){this.head={...this.head,...e};for(let e of this.listeners)e()}edited(e={}){Object.keys(e).length>0&&this.set(e),this.session.edited()}};function $(e){return(0,G.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,"aria-pressed":e.on,disabled:e.disabled,className:c(e.on===!0&&`bg-here`),onMouseDown:e=>{e.preventDefault()},onClick:e.onClick,children:e.children})}function At(e){let t=L(),[n,r]=(0,W.useState)(!1),[i,a]=(0,W.useState)(``),o=i.trim()===``||/^https?:\/\/\S+$/u.test(i.trim())?void 0:t.article.notLink;return(0,G.jsxs)(_,{open:n,onOpenChange:e=>{r(e),e&&a(``)},children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,disabled:e.disabled,children:e.icon})}),(0,G.jsx)(y,{className:`w-80`,align:`start`,children:(0,G.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:t=>{t.preventDefault(),i.trim()!==``&&o===void 0&&(e.onAnswer(i.trim()),r(!1))},children:[(0,G.jsx)(N,{autoFocus:!0,value:i,placeholder:e.hint,"aria-label":e.hint,onChange:e=>{a(e.target.value)}}),o===void 0?null:(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:o}),(0,G.jsx)(u,{type:`submit`,size:`sm`,className:`self-end`,disabled:i.trim()===``||o!==void 0,children:t.article.add})]})})]})}function jt({editor:e}){let t=L().article,n=()=>e.chain().focus(),r=e.isActive(`heading`,{level:1})?t.heading:e.isActive(`heading`,{level:2})?t.subheading:t.normal;return(0,G.jsxs)(F,{children:[(0,G.jsx)(ye,{asChild:!0,children:(0,G.jsxs)(u,{variant:`ghost`,size:`sm`,className:`w-28 justify-between gap-1 px-2`,"aria-label":t.style,onMouseDown:e=>{e.preventDefault()},children:[r,(0,G.jsx)(g,{})]})}),(0,G.jsxs)(P,{align:`start`,className:`w-44`,children:[(0,G.jsx)(I,{className:`text-sm`,onSelect:()=>n().setParagraph().run(),children:t.normal}),(0,G.jsx)(I,{className:`text-base font-semibold`,onSelect:()=>n().setHeading({level:1}).run(),children:t.heading}),(0,G.jsx)(I,{className:`text-sm font-semibold`,onSelect:()=>n().setHeading({level:2}).run(),children:t.subheading})]})]})}function Mt({article:e}){let t=L().article,[n,r]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>{r(!1)},4e3);return()=>{clearTimeout(e)}},[n]),(0,G.jsxs)(u,{variant:`outline`,size:`sm`,className:`gap-1`,title:n?t.copied:t.copy,"data-testid":`linkedin-copy`,onClick:()=>{let t=e(),n=dt(t),i=ft(t);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([n],{type:`text/html`}),"text/plain":new Blob([i],{type:`text/plain`})})]).then(()=>{r(!0)})},children:[n?(0,G.jsx)(h,{}):(0,G.jsx)(ie,{}),n?t.copied:t.copy]})}function Nt({editor:e,dir:t,entry:n}){let r=L(),i=r.article,[,a]=(0,W.useState)(0);(0,W.useEffect)(()=>{let t=()=>{a(e=>e+1)};return e.on(`transaction`,t),()=>{e.off(`transaction`,t)}},[e]);let[o,s]=(0,W.useState)(!1),c=()=>e.chain().focus(),l=(t,n)=>{let{$from:r}=e.state.selection;r.depth>1?c().insertContentAt(r.after(1),{type:t,attrs:n}).run():c().insertContent({type:t,attrs:n}).run()},d=e.getText().split(/\s+/u).filter(e=>e!==``).length;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($,{label:r.undo,disabled:!e.can().undo(),onClick:()=>c().undo().run(),children:(0,G.jsx)(M,{})}),(0,G.jsx)($,{label:r.redo,disabled:!e.can().redo(),onClick:()=>c().redo().run(),children:(0,G.jsx)(j,{})}),(0,G.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),(0,G.jsx)(jt,{editor:e}),(0,G.jsx)($,{label:i.bold,on:e.isActive(`bold`),onClick:()=>c().toggleBold().run(),children:(0,G.jsx)(x,{})}),(0,G.jsx)($,{label:i.italic,on:e.isActive(`italic`),onClick:()=>c().toggleItalic().run(),children:(0,G.jsx)(S,{})}),(0,G.jsx)($,{label:i.bullets,on:e.isActive(`bulletList`),onClick:()=>c().toggleBulletList().run(),children:(0,G.jsx)(w,{})}),(0,G.jsx)($,{label:i.numbers,on:e.isActive(`orderedList`),onClick:()=>c().toggleOrderedList().run(),children:(0,G.jsx)(me,{})}),(0,G.jsx)($,{label:i.quote,on:e.isActive(`blockquote`),onClick:()=>c().toggleBlockquote().run(),children:(0,G.jsx)(A,{})}),(0,G.jsx)($,{label:i.code,on:e.isActive(`codeBlock`),onClick:()=>c().toggleCodeBlock().run(),children:(0,G.jsx)($e,{})}),(0,G.jsx)($,{label:i.divider,onClick:()=>c().setHorizontalRule().run(),children:(0,G.jsx)(he,{})}),e.isActive(`link`)?(0,G.jsx)($,{label:i.removeLink,on:!0,onClick:()=>c().extendMarkRange(`link`).unsetLink().run(),children:(0,G.jsx)(ee,{})}):(0,G.jsx)(At,{label:i.link,hint:i.linkHint,icon:(0,G.jsx)(pe,{}),disabled:e.state.selection.empty,onAnswer:e=>{c().extendMarkRange(`link`).setLink({href:e}).run()}}),(0,G.jsx)(At,{label:i.embed,hint:i.embedHint,icon:(0,G.jsx)(et,{}),onAnswer:e=>{l(q.embed,{url:e})}}),(0,G.jsxs)(_,{open:o,onOpenChange:s,children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":i.image,title:i.image,children:(0,G.jsx)(ve,{})})}),(0,G.jsx)(y,{className:`w-auto`,align:`start`,children:(0,G.jsx)(oe,{self:n,types:Je,testId:`linkedin-picker`,onPick:e=>{s(!1),l(q.image,{file:de(t,e),alt:``,caption:``})}})})]}),(0,G.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs tabular-nums`,children:i.words(d)})]})}function Pt({doc:e,dir:n,entry:o}){let c=L(),d=r(),f=a(),[p,te]=ue(),m=(0,W.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),h=f||m.held,g=(0,W.useMemo)(()=>e.read,[e]),[b,x]=(0,W.useState)(()=>g.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),S=ge({textDirection:`auto`,editable:!h,immediatelyRender:!0,extensions:[Ge.configure({heading:{levels:[1,2]},listItem:!1,blockquote:!1,code:!1,strike:!1,underline:!1,hardBreak:!1,link:{openOnClick:!1,autolink:!0}}),Ue.extend({content:`paragraph`}),We.extend({content:`paragraph`}),He.configure({placeholder:c.article.body}),_t,...Et],content:bt(g.blocks),onUpdate:({editor:t,transaction:n})=>{n.docChanged&&(x(Z(t.getJSON()).flatMap(e=>e.type===`image`?[e.file]:[])),e.edited())}}),[ie,C]=(0,W.useState)(()=>g.blocks);(0,W.useEffect)(()=>{e.bind(()=>Z(S.getJSON()),e=>{S.commands.setContent(bt(e.blocks),{emitUpdate:!1}),x(e.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),C(e.blocks)})},[e,S]),(0,W.useEffect)(()=>{S.setEditable(!h)},[S,h]),(0,W.useEffect)(()=>{let e=()=>{C(Z(S.getJSON()))};return S.on(`update`,e),()=>{S.off(`update`,e)}},[S]);let pe=(0,W.useDeferredValue)(ie),{agent:w,following:me}=t(),he=re(),T=(()=>{if(w?.doing===void 0)return;let t=m.landed,n=t!==void 0&&t.at>=w.at-Dt;return n&&w.source?.path===o?t.spot:(w.source?gt(w.source,{path:o,text:e.session.text}):void 0)??(n?t.spot:void 0)})(),E=T&&`block`in T?T.block:void 0,D=T!==void 0&&`head`in T,O=w?he(w):``,k=(0,W.useRef)(null),A=(0,W.useRef)(null);(0,W.useEffect)(()=>{vt(S,E===void 0?null:{block:E,label:O})},[S,E,O]),(0,W.useEffect)(()=>{let e=A.current;if(e){for(let t of e.querySelectorAll(`[data-agent]`))t.removeAttribute(`data-agent`);(D?e.querySelector(`.ak-li-a-title`):E===void 0?null:e.querySelector(`.ak-li-a-body`)?.children[E])?.setAttribute(`data-agent`,``)}},[E,D,pe,m.title]),(0,W.useEffect)(()=>{me&&T!==void 0&&((D?k.current?.querySelector(`.ak-li-a-title`):k.current?.querySelector(`[data-testid="linkedin-agent-block"]`))?.scrollIntoView({block:`nearest`}),A.current?.querySelector(`[data-agent]`)?.scrollIntoView({block:`nearest`}))},[me,T,D,m.landed]),i({hold:()=>Promise.resolve({key:`${o}@${String(e.session.text.length)}`,what:`The LinkedIn article ${o}`,source:{path:o}}),locate:t=>{let n=B(e.session.text),r=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},i=s(t)[0],a=e=>e!==void 0&&i!==void 0&&i.x>=e.x&&i.x<=e.x+e.width&&i.y>=e.y&&i.y<=e.y+e.height,c=[{as:`where it is written`,head:[`.ak-li-a-cover`,`.ak-li-a-title`].map(e=>k.current?.querySelector(e)),blocks:[...k.current?.querySelector(`.ak-li-a-body .ProseMirror`)?.children??[]]},{as:`as LinkedIn will show it`,head:[`.ak-li-a-cover`,`.ak-li-a-title`].map(e=>A.current?.querySelector(e)),blocks:[...A.current?.querySelector(`.ak-li-a-body`)?.children??[]]}],u=e=>e===void 0?{}:{line:e.from,...e.to>e.from?{endLine:e.to}:{}},ee=c.some(e=>e.head.some(e=>{let n=r(e);return n!==void 0&&l(t,n)})),d=new Set;for(let e of c)e.blocks.forEach((e,n)=>{let i=r(e);i&&l(t,i)&&d.add(n)});let f=[...ee?[{name:`the article's head: its cover and title`,source:{path:o,...u(n.head)},...m.title===``?{}:{text:m.title}}]:[],...[...d].sort((e,t)=>e-t).map(e=>{let t=c.map(t=>t.blocks[e]?.textContent.trim()??``).find(e=>e!==``)??``;return{name:`block ${String(e+1)} of the article`,source:{path:o,...u(n.lines[e])},...t===``?{}:{text:t}}})],p=c.flatMap(e=>{if(e.head.some(e=>a(r(e))))return[`in the article's head, ${e.as}`];let t=e.blocks.findIndex(e=>a(r(e)));return t<0?[]:[`in block ${String(t+1)}, ${e.as}`]}).at(0);return Promise.resolve({elements:f,...p===void 0?{}:{where:p}})}});let j=le(n,[...m.cover?[m.cover.file]:[],...b]),M=(0,W.useMemo)(()=>e=>j.get(e),[j]),[ve,N]=(0,W.useState)(!1),P=m.cover===void 0?void 0:j.get(m.cover.file),F=d?.theme===`dark`,I=(0,G.jsxs)(_,{open:ve,onOpenChange:N,children:[(0,G.jsx)(`div`,{className:`ak-li-a-cover ak-li-e-cover relative`,children:m.cover===void 0?h?null:(0,G.jsx)(v,{asChild:!0,children:(0,G.jsxs)(u,{variant:`ghost`,className:`size-full flex-col gap-2 rounded-none text-sm font-normal text-[var(--ak-li-muted)]`,children:[(0,G.jsx)(ae,{className:`size-6`}),c.article.addCover]})}):(0,G.jsxs)(G.Fragment,{children:[P===void 0?(0,G.jsx)(`div`,{className:`ak-li-made`,children:m.cover.file}):/\.mp4$/iu.test(m.cover.file)?(0,G.jsx)(`video`,{src:P,muted:!0,playsInline:!0,className:`w-full`}):(0,G.jsx)(`img`,{src:P,alt:m.cover.alt??``}),h?null:(0,G.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1`,children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsxs)(u,{variant:`secondary`,size:`sm`,className:`bg-media/75 text-on-media`,children:[(0,G.jsx)(ae,{}),c.article.changeCover]})}),(0,G.jsx)(u,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media`,"aria-label":c.article.removeCover,title:c.article.removeCover,onClick:()=>{e.edited({cover:void 0})},children:(0,G.jsx)(ee,{})})]})]})}),(0,G.jsx)(y,{className:`w-auto`,align:`center`,children:(0,G.jsx)(oe,{self:o,types:Xe,testId:`linkedin-picker`,onPick:t=>{N(!1),e.edited({cover:{file:de(n,t)}})}})})]}),ye=(0,G.jsxs)(`div`,{ref:k,className:`ak-li ak-li-editing min-h-full`,"data-theme":F?`dark`:`light`,children:[I,(0,G.jsxs)(`div`,{className:`ak-li-e-page`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(`textarea`,{className:`ak-li-a-title block w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-[var(--ak-li-muted)]`,value:m.title,placeholder:c.article.title,"aria-label":c.article.title,readOnly:h,dir:`auto`,"data-testid":`linkedin-article-title`,onChange:t=>{h||e.edited({title:t.target.value.replace(/\n/gu,` `)})}}),w&&D?(0,G.jsx)(Se,{"data-testid":`linkedin-agent-head`,label:O,className:`-inset-1`}):null]}),(0,G.jsx)(qe,{}),(0,G.jsx)(St.Provider,{value:M,children:(0,G.jsx)(`div`,{className:`ak-li-a-body`,"data-testid":`linkedin-article-body`,children:(0,G.jsx)(_e,{editor:S,className:`[&_.ProseMirror]:outline-none`})})})]})]}),xe=()=>({title:m.title,...m.cover?{cover:m.cover}:{},blocks:Z(S.getJSON())}),Ce=(0,G.jsx)(`div`,{ref:A,className:`ak-li ak-li-page`,"data-theme":F?`dark`:`light`,children:(0,G.jsx)(Ze,{article:{title:m.title,...m.cover?{cover:m.cover}:{},blocks:pe},source:M})});return(0,G.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`linkedin-article-editor`,children:[(0,G.jsx)(ne,{start:(0,G.jsxs)(G.Fragment,{children:[h||p!==`edit`?null:(0,G.jsx)(Nt,{editor:S,dir:n,entry:o}),(0,G.jsx)(`span`,{className:`flex-1`}),(0,G.jsx)(fe,{pane:p,onPane:te}),(0,G.jsx)(Mt,{article:xe})]}),saved:{state:m.state},exports:{}}),(0,G.jsx)(Ye.Provider,{value:se,children:(0,G.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[m.held?(0,G.jsx)(be,{}):null,(0,G.jsx)(ce,{pane:p,edit:ye,preview:Ce,width:632,background:F?`#000000`:`#f4f2ee`,testId:`linkedin-preview`})]})})]})}function Ft(){let e=L(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,W.useState)(),[l,u]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return te.open(t,i).then(t=>{n?(e=t,c(new kt(t))):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,G.jsx)(`div`,{className:`flex size-full`,"data-testid":`linkedin-article-editor`,"data-state":`updating`,children:(0,G.jsx)(xe,{})}):!s||i===void 0?(0,G.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`linkedin-article-editor`,"data-state":`loading`,children:e.article.loading}):(0,G.jsx)(Pt,{doc:s,dir:a,entry:i})}export{Ft as LinkedInArticleEditor,Ft as default,Z as fromDoc,bt as toDoc};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t}from"./react-Byupo4pA.js";import{J as n,K as r,X as i,Y as a,at as o,ct as s,et as c,ft as l,ht as u,i as d,it as f,jt as p,mt as m,n as h,nt as g,o as _,ot as v,q as y,r as b,rt as x,s as S,st as C,tt as w,ut as T}from"./x-BAJilkKD.js";import{t as E}from"./jsx-runtime-DePvh3-m.js";import{t as D}from"./createLucideIcon-euu7Wcd9.js";var O=e(t(),1),k=E(),A=Object.defineProperty,j=(e,t)=>A(e,`name`,{value:t,configurable:!0});function M(e){let t=e+`CollectionProvider`,[n,r]=C(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=j(e=>{let{scope:t,children:n}=e,r=O.useRef(null),a=O.useRef(new Map).current;return(0,k.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=l(s),u=O.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=m(t,i.collectionRef);return(0,k.jsx)(c,{ref:o,children:r})});u.displayName=s;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=l(d),h=O.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=O.useRef(null),s=m(t,o),c=a(d,n);return O.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,k.jsx)(p,{[f]:``,ref:s,children:r})});h.displayName=d;function g(t){let n=a(e+`CollectionConsumer`,t);return O.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return j(g,`useCollection`),[{Provider:o,Slot:u,ItemSlot:h},g,r]}j(M,`createCollection`);var N=new WeakMap,P=class e extends Map{static{j(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],N.set(this,!0)}set(e,t){return N.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=L(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=F(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=F(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return F(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function F(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=I(e,t);return n===-1?void 0:e[n]}j(F,`at`);function I(e,t){let n=e.length,r=L(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}j(I,`toSafeIndex`);function L(e){return e!==e||e===0?0:Math.trunc(e)}j(L,`toSafeInteger`);function R(e){let t=e+`CollectionProvider`,[n,r]=C(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new P,setItemMap:j(()=>void 0,`setItemMap`)}),o=j(({state:e,...t})=>e?(0,k.jsx)(c,{...t,state:e}):(0,k.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=j(e=>{let t=_();return(0,k.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=j(e=>{let{scope:t,children:n,state:r}=e,a=O.useRef(null),[o,s]=O.useState(null),c=m(a,s),[l,u]=r;return O.useEffect(()=>{if(!o)return;let e=V(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,k.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=l(u),f=O.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(u,n),o=m(t,i.collectionRef);return(0,k.jsx)(d,{ref:o,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,h=l(p),g=O.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=O.useRef(null),[s,c]=O.useState(null),l=m(t,o,c),{setItemMap:u}=a(p,n),d=O.useRef(i);ee(d.current,i)||(d.current=i);let f=d.current;return O.useEffect(()=>{let e=f;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(B):(t.set(s,{...e,element:s}),t.toSorted(B)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new P(e)))}},[s,f,u]),(0,k.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=p;function _(){return O.useState(new P)}j(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return j(v,`useCollection`),[{Provider:o,Slot:f,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}j(R,`createCollection`);function ee(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}j(ee,`shallowEqual`);function z(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}j(z,`isElementPreceding`);function B(e,t){return!e[1].element||!t[1].element?0:z(e[1].element,t[1].element)?-1:1}j(B,`sortByDocumentPosition`);function V(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}j(V,`getChildListObserver`);var te=Object.defineProperty,H=(e,t)=>te(e,`name`,{value:t,configurable:!0}),ne={LTR:`ltr`,RTL:`rtl`},re=O.createContext(void 0);function U(e){let t=O.useContext(re);return e||t||ne.LTR}H(U,`useDirection`);var ie=Object.defineProperty,ae=(e,t)=>ie(e,`name`,{value:t,configurable:!0}),W=!1;function oe(){let[e,t]=O.useState(W);return O.useEffect(()=>{W||(W=!0,t(!0))},[]),e}ae(oe,`useIsHydrated`);var G=O.useSyncExternalStore;function se(){return()=>{}}ae(se,`subscribe`);function ce(){return G(se,()=>!0,()=>!1)}ae(ce,`useIsHydratedModern`);var le=typeof G==`function`?ce:oe,ue=Object.defineProperty,K=(e,t)=>ue(e,`name`,{value:t,configurable:!0}),de=`rovingFocusGroup.onEntryFocus`,fe={bubbles:!1,cancelable:!0},pe=`RovingFocusGroup`,[q,me,he]=M(pe),[ge,_e]=C(pe,[he]),J={Vertical:`vertical`,Horizontal:`horizontal`},ve={LTR:`ltr`,RTL:`rtl`},[ye,Y]=ge(pe),be=O.forwardRef(K(function(e,t){return(0,k.jsx)(q.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,k.jsx)(q.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,k.jsx)(xe,{...e,ref:t})})})},`RovingFocusGroup`)),xe=O.forwardRef(K(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=O.useRef(null),h=m(t,p),g=U(a),[_,y]=f({prop:o,defaultProp:s??null,onChange:c,caller:pe}),[b,x]=O.useState(!1),S=w(l),C=me(n),E=O.useRef(!1),[D,A]=O.useState(0);return O.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(de,S),()=>e.removeEventListener(de,S)},[S]),(0,k.jsx)(ye,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:O.useCallback(e=>y(e),[y]),onItemShiftTab:O.useCallback(()=>x(!0),[]),onFocusableItemAdd:O.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:O.useCallback(()=>A(e=>e-1),[]),children:(0,k.jsx)(T.div,{tabIndex:b||D===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:`none`,...e.style},onMouseDown:v(e.onMouseDown,()=>{E.current=!0}),onFocus:v(e.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(de,fe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);De([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}E.current=!1}),onBlur:v(e.onBlur,()=>x(!1))})})},`RovingFocusGroupImpl`)),Se=`RovingFocusGroupItem`,Ce=O.forwardRef(K(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...c}=e,l=g(),u=a||l,d=Y(Se,n),f=d.currentTabStopId===u,p=me(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:_}=d,y=le();return o(()=>{if(y&&r)return m(),()=>h()},[y,r,m,h]),O.useEffect(()=>{if(!y&&r)return m(),()=>h()},[y,r,m,h]),(0,k.jsx)(q.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,k.jsx)(T.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:v(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:v(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:v(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ee(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Oe(n,r+1):n.slice(r+1)}setTimeout(()=>De(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:_!=null}):s})})},`RovingFocusGroupItem`)),we={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Te(e,t){return t===ve.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}K(Te,`getDirectionAwareKey`);function Ee(e,t,n){let r=Te(e.key,n);if(!(t===J.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===J.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return we[r]}K(Ee,`getFocusIntent`);function De(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}K(De,`focusFirst`);function Oe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}K(Oe,`wrapArray`);var ke=e(p(),1),Ae=Object.defineProperty,je=(e,t)=>Ae(e,`name`,{value:t,configurable:!0});function Me(e){let t=O.useRef({value:e,previous:e});return O.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}je(Me,`usePrevious`);var Ne=Object.defineProperty,Pe=(e,t)=>Ne(e,`name`,{value:t,configurable:!0});function Fe(e,[t,n]){return Math.min(n,Math.max(t,e))}Pe(Fe,`clamp`);var Ie=Object.defineProperty,X=(e,t)=>Ie(e,`name`,{value:t,configurable:!0}),Le={ItemAligned:`item-aligned`,Popper:`popper`},Re={LTR:`ltr`,RTL:`rtl`},ze=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Be=[` `,`Enter`],Ve=`Select`,[He,Ue,We]=M(Ve),[Ge,Ke]=C(Ve,[We,S]),qe=S(),[Je,Ye]=Ge(Ve),[Xe,Ze]=Ge(Ve);function Qe(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:p,required:m,form:h,internal_do_not_use_render:_}=e,v=qe(t),[y,x]=O.useState(null),[S,C]=O.useState(null),[w,T]=O.useState(!1),E=U(l),[D,A]=f({prop:r,defaultProp:i??!1,onChange:a,caller:Ve}),[j,M]=f({prop:o,defaultProp:s,onChange:c,caller:Ve}),N=O.useRef(null),P=O.useRef(j);O.useEffect(()=>{let e=h?y?.ownerDocument.getElementById(h):y?.form;if(e instanceof HTMLFormElement){let t=X(()=>M(P.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,y,M]);let F=!y||!!h||!!y.closest(`form`),[I,L]=O.useState(new Set),R=g(),ee=Array.from(I).map(e=>e.props.value).join(`;`),z=O.useCallback(e=>{L(t=>new Set(t).add(e))},[]),B=O.useCallback(e=>{L(t=>{let n=new Set(t);return n.delete(e),n})},[]),V={required:m,trigger:y,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:R,value:j,onValueChange:M,open:D,onOpenChange:A,dir:E,triggerPointerDownPosRef:N,disabled:p,name:u,autoComplete:d,form:h,nativeOptions:I,nativeSelectKey:ee,isFormControl:F};return(0,k.jsx)(b,{...v,children:(0,k.jsx)(Je,{scope:t,...V,children:(0,k.jsx)(He.Provider,{scope:t,children:(0,k.jsx)(Xe,{scope:t,onNativeOptionAdd:z,onNativeOptionRemove:B,children:zt(_)?_(V):n})})})})}X(Qe,`SelectProvider`);var $e=X(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,k.jsx)(Qe,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,k.jsxs)(k.Fragment,{children:[n,e?(0,k.jsx)(Rt,{__scopeSelect:t}):null]})})},`Select`),et=`SelectTrigger`,tt=O.forwardRef(X(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=qe(n),o=Ye(et,n),s=o.disabled||r,c=m(t,o.onTriggerChange),l=Ue(n),u=O.useRef(`touch`),[f,p,h]=Vt(e=>{let t=l().filter(e=>!e.disabled),n=Ht(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=X(e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,k.jsx)(d,{asChild:!0,...a,children:(0,k.jsx)(T.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Bt(o.value)?``:void 0,...i,ref:c,onClick:v(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&g(e)}),onPointerDown:v(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:v(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&ze.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),nt=`SelectValue`,rt=O.forwardRef(X(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:s=``,...c}=e,l=Ye(nt,n),{onValueNodeHasChildrenChange:u}=l,d=a!==void 0,f=m(t,l.onValueNodeChange);o(()=>{u(d)},[u,d]);let p=Bt(l.value);return(0,k.jsx)(T.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,k.jsx)(O.Fragment,{children:p?s:a},p?`placeholder`:`value`)})},`SelectValue`)),it=O.forwardRef(X(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,k.jsx)(T.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[at,ot]=Ge(`SelectPortal`,{forceMount:void 0}),st=X(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,k.jsx)(at,{scope:e.__scopeSelect,forceMount:n,children:(0,k.jsx)(a,{asChild:!0,...r})})},`SelectPortal`),ct=`SelectContent`,lt=O.forwardRef(X(function(e,t){let n=ot(ct,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Ye(ct,e.__scopeSelect),[s,c]=O.useState();return o(()=>{c(new DocumentFragment)},[]),(0,k.jsx)(x,{present:r||a.open,children:({present:e})=>e?(0,k.jsx)(mt,{...i,ref:t}):(0,k.jsx)(ut,{...i,fragment:s})})},`SelectContent`)),ut=O.forwardRef(X(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?ke.createPortal((0,k.jsx)(dt,{scope:n,children:(0,k.jsx)(He.Slot,{scope:n,children:(0,k.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Z=10,[dt,ft]=Ge(ct),pt=l(`SelectContent.RemoveScroll`),mt=O.forwardRef(X(function(e,t){let{__scopeSelect:a}=e,{position:o=Le.ItemAligned,onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:f,align:p,alignOffset:h,arrowPadding:g,collisionBoundary:_,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=Ye(ct,a),[E,D]=O.useState(null),[A,j]=O.useState(null),M=m(t,D),[N,P]=O.useState(null),[F,I]=O.useState(null),L=Ue(a),[R,ee]=O.useState(!1),z=O.useRef(!1);O.useEffect(()=>{if(E)return r(E)},[E]),n();let B=O.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&A&&(A.scrollTop=0),n===r&&A&&(A.scrollTop=A.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,A]),V=O.useCallback(()=>B([N,E]),[B,N,E]);O.useEffect(()=>{R&&V()},[R,V]);let{onOpenChange:te,triggerPointerDownPosRef:H}=T;O.useEffect(()=>{if(E){let e={x:0,y:0},t=X(t=>{e={x:Math.abs(Math.round(t.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(H.current?.y??0))}},`handlePointerMove`),n=X(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||te(!1),document.removeEventListener(`pointermove`,t),H.current=null},`handlePointerUp`);return H.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,te,H]),O.useEffect(()=>{let e=X(()=>te(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[ne,re]=Vt(e=>{let t=L().filter(e=>!e.disabled),n=Ht(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),U=O.useCallback((e,t,n)=>{let r=!z.current&&!n;(T.value!==void 0&&T.value===t||r)&&(P(e),r&&(z.current=!0))},[T.value]),ie=O.useCallback(()=>E?.focus(),[E]),ae=O.useCallback((e,t,n)=>{let r=!z.current&&!n;(T.value!==void 0&&T.value===t||r)&&I(e)},[T.value]),W=o===Le.Popper?gt:ht,oe=W===gt?{side:d,sideOffset:f,align:p,alignOffset:h,arrowPadding:g,collisionBoundary:_,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,k.jsx)(dt,{scope:a,content:E,viewport:A,onViewportChange:j,itemRefCallback:U,selectedItem:N,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:V,selectedItemText:F,position:o,isPositioned:R,searchRef:ne,children:(0,k.jsx)(y,{as:pt,allowPinchZoom:!0,children:(0,k.jsx)(i,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:v(s,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,k.jsx)(c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,k.jsx)(W,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...oe,onPlaced:()=>ee(!0),ref:M,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:v(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ht=O.forwardRef(X(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ye(ct,n),s=ft(ct,n),[c,l]=O.useState(null),[u,d]=O.useState(null),f=m(t,d),p=Ue(n),h=O.useRef(!1),g=O.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=O.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==Re.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,d=Fe(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,d=Fe(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let o=p(),s=window.innerHeight-Z*2,l=_.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+m+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Z,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+m+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,c,u,_,v,y,a.dir,r]);o(()=>x(),[x]);let[S,C]=O.useState();o(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);let w=O.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,k.jsx)(_t,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:w,children:(0,k.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,k.jsx)(T.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),gt=O.forwardRef(X(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Z,...a}=e,o=qe(n);return(0,k.jsx)(_,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[_t,vt]=Ge(ct,{}),yt=`SelectViewport`,bt=O.forwardRef(X(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=ft(yt,n),o=vt(yt,n),s=m(t,a.onViewportChange),c=O.useRef(0);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,k.jsx)(He.Slot,{scope:n,children:(0,k.jsx)(T.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:v(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Z*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[xt,St]=Ge(`SelectGroup`),Ct=`SelectItem`,[wt,Tt]=Ge(Ct),Et=O.forwardRef(X(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Ye(Ct,n),c=ft(Ct,n),l=s.value===r,[u,d]=O.useState(a??``),[f,p]=O.useState(!1),h=w(e=>c.itemRefCallback?.(e,r,i)),_=m(t,h),y=g(),b=O.useRef(`touch`),x=X(()=>{s.onValueChange(r),s.onOpenChange(!1)},`handleSelect`);return(0,k.jsx)(wt,{scope:n,value:r,disabled:i,textId:y,isSelected:l,onItemTextChange:O.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,k.jsx)(He.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,k.jsx)(T.div,{role:`option`,"aria-labelledby":y,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:v(o.onFocus,()=>p(!0)),onBlur:v(o.onBlur,()=>p(!1)),onClick:v(o.onClick,()=>{i||b.current!==`mouse`&&x()}),onPointerUp:v(o.onPointerUp,()=>{i||b.current===`mouse`&&x()}),onPointerDown:v(o.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:v(o.onPointerMove,e=>{b.current=e.pointerType,i?c.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:v(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:v(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Be.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Dt=`SelectItemText`,Ot=O.forwardRef(X(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,s=Ye(Dt,n),c=ft(Dt,n),l=Tt(Dt,n),u=Ze(Dt,n),[d,f]=O.useState(null),p=w(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),h=m(t,f,l.onItemTextChange,p),g=d?.textContent,_=O.useMemo(()=>(0,k.jsx)(`option`,{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return o(()=>(v(_),()=>y(_)),[v,y,_]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(T.span,{id:l.textId,...a,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Bt(s.value)?ke.createPortal(a.children,s.valueNode):null]})},`SelectItemText`)),kt=`SelectItemIndicator`,At=O.forwardRef(X(function(e,t){let{__scopeSelect:n,...r}=e;return Tt(kt,n).isSelected?(0,k.jsx)(T.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),jt=`SelectScrollUpButton`,Mt=O.forwardRef(X(function(e,t){let n=ft(jt,e.__scopeSelect),r=vt(jt,e.__scopeSelect),[i,a]=O.useState(!1),s=m(t,r.onScrollButtonChange);return o(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};X(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,k.jsx)(Ft,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Nt=`SelectScrollDownButton`,Pt=O.forwardRef(X(function(e,t){let n=ft(Nt,e.__scopeSelect),r=vt(Nt,e.__scopeSelect),[i,a]=O.useState(!1),s=m(t,r.onScrollButtonChange);return o(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};X(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,k.jsx)(Ft,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Ft=O.forwardRef(X(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ft(`SelectScrollButton`,n),s=O.useRef(null),c=Ue(n),l=O.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return O.useEffect(()=>()=>l(),[l]),o(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,k.jsx)(T.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:v(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:v(i.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:v(i.onPointerLeave,()=>{l()})})},`SelectScrollButtonImpl`)),It=O.forwardRef(X(function(e,t){let{__scopeSelect:n,...r}=e;return(0,k.jsx)(T.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),Lt=`SelectBubbleInput`,Rt=O.forwardRef(X(function({__scopeSelect:e,...t},n){let r=Ye(Lt,e),{value:i,onValueChange:a,required:o,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,h=O.useRef(null),g=m(n,h),_=i??``,v=Me(_),y=Array.from(f).some(e=>(e.props.value??``)===``);return O.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,k.jsxs)(T.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>a(e.target.value),...t,style:{...s,...t.style},ref:g,defaultValue:_,children:[Bt(i)&&!y?(0,k.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function zt(e){return typeof e==`function`}X(zt,`isFunction`);function Bt(e){return e===``||e===void 0}X(Bt,`shouldShowPlaceholder`);function Vt(e){let t=w(e),n=O.useRef(``),r=O.useRef(0),i=O.useCallback(e=>{let i=n.current+e;t(i),X((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=O.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return O.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}X(Vt,`useTypeaheadSearch`);function Ht(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ut(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(Ht,`findNextItem`);function Ut(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Ut,`wrapArray`);var Wt=D(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Gt=D(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Kt=D(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),qt=D(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Jt=D(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function Yt(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Xt=e=>{switch(e){case`success`:return $t;case`info`:return tn;case`warning`:return en;case`error`:return nn;default:return null}},Zt=Array(12).fill(0),Qt=({visible:e,className:t})=>O.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},O.createElement(`div`,{className:`sonner-spinner`},Zt.map((e,t)=>O.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),$t=O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},O.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),en=O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},O.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),tn=O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},O.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),nn=O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},O.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),rn=O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},O.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),O.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),an=()=>{let[e,t]=O.useState(document.hidden);return O.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},on=1,sn=100,cn=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:on++,Q=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-sn;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=cn(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],O.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(un(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!O.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!O.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!O.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!O.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=cn(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},ln=(e,t)=>Q.message(e,t),un=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,dn=Object.assign(ln,{success:Q.success,info:Q.info,warning:Q.warning,error:Q.error,custom:Q.custom,message:Q.message,promise:Q.promise,dismiss:Q.dismiss,loading:Q.loading},{getHistory:()=>Q.toasts,getToasts:()=>Q.getActiveToasts()});Yt(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function fn(e){return e.label!==void 0}var pn=3,mn=`24px`,hn=`16px`,gn=4e3,_n=356,vn=14,yn=45,bn=200;function $(...e){return e.filter(Boolean).join(` `)}function xn(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Sn=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=O.useState(null),[k,A]=O.useState(null),[j,M]=O.useState(!1),[N,P]=O.useState(!1),[F,I]=O.useState(!1),[L,R]=O.useState(!1),[ee,z]=O.useState(!1),[B,V]=O.useState(0),[te,H]=O.useState(0),ne=O.useRef(n.duration||y||gn),re=O.useRef(null),U=O.useRef(null),ie=c===0,ae=c+1<=o,W=n.type,oe=W??`default`,G=n.dismissible!==!1,se=n.className||``,ce=n.descriptionClassName||``,le=O.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ue=O.useMemo(()=>n.closeButton??p,[n.closeButton,p]),K=O.useMemo(()=>n.duration||y||gn,[n.duration,y]),de=O.useRef(0),fe=O.useRef(0),pe=O.useRef(0),q=O.useRef(null),[me,he]=b.split(`-`),ge=O.useMemo(()=>s.reduce((e,t,n)=>n>=le?e:e+t.height,0),[s,le]),_e=an(),J=O.useMemo(()=>e.swipeDirections??xn(b),[e.swipeDirections,b]),ve=n.invert||t,ye=W===`loading`;fe.current=O.useMemo(()=>le*x+ge,[le,ge]),O.useEffect(()=>{ne.current=K},[K]),O.useEffect(()=>{M(!0)},[]),O.useEffect(()=>{let e=U.current;if(e){let t=e.getBoundingClientRect().height;return H(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),O.useLayoutEffect(()=>{if(!j)return;let e=U.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,H(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Y=O.useCallback(()=>{P(!0),V(fe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},bn)},[n,d,a,fe]);O.useEffect(()=>{if(n.promise&&W===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||_e?(()=>{if(pe.current<de.current){let e=new Date().getTime()-de.current;ne.current-=e}pe.current=new Date().getTime()})():ne.current!==1/0&&(de.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Y()},ne.current)),()=>clearTimeout(e)},[u,i,n,W,_e,Y]),O.useEffect(()=>{n.delete&&(Y(),n.onDismiss==null||n.onDismiss.call(n,n))},[Y,n.delete]);function be(){return w?.loading?O.createElement(`div`,{className:$(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":W===`loading`},w.loading):O.createElement(Qt,{className:$(C?.loader,n?.classNames?.loader),visible:W===`loading`})}let xe=n.icon||w?.[W]||Xt(W);return O.createElement(`li`,{tabIndex:0,ref:U,className:$(_,se,C?.toast,n?.classNames?.toast,C?.[oe],n?.classNames?.[oe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":N,"data-visible":ae,"data-y-position":me,"data-x-position":he,"data-index":c,"data-front":ie,"data-swiping":F,"data-dismissible":G,"data-type":W,"data-invert":ve,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||S&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?B:fe.current}px`,"--initial-height":S?`auto`:`${te}px`,...m,...n.style},onDragEnd:()=>{I(!1),D(null),q.current=null},onPointerDown:e=>{e.button!==2&&!ye&&G&&(re.current=new Date,V(fe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),q.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(L||!G)return;q.current=null;let e=Number(U.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(U.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-re.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?J.includes(e>0?`right`:`left`):J.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=yn||a>.11))V(fe.current),n.onDismiss==null||n.onDismiss.call(n,n),A(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Y(),R(!0);else{var o,s;(o=U.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=U.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),I(!1),D(null)}},onPointerMove:e=>{var t,n;if(!q.current||!G||window.getSelection()?.toString().length>0)return;let r=e.clientY-q.current.y,i=e.clientX-q.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(J.includes(`top`)||J.includes(`bottom`)){if(J.includes(`top`)&&r<0||J.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(J.includes(`left`)||J.includes(`right`))){if(J.includes(`left`)&&i<0||J.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&z(!0),(t=U.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=U.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ue&&!n.jsx&&W!==`loading`?O.createElement(`button`,{"aria-label":T,"data-disabled":ye,"data-close-button":!0,onClick:ye||!G?()=>{}:()=>{Y(),n.onDismiss==null||n.onDismiss.call(n,n)},className:$(C?.closeButton,n?.classNames?.closeButton)},w?.close??rn):null,(W||n.icon||n.promise)&&n.icon!==null&&(w?.[W]!==null||n.icon)?O.createElement(`div`,{"data-icon":``,className:$(C?.icon,n?.classNames?.icon)},W===`loading`?n.icon||be():n.promise?be():null,W===`loading`?null:xe):null,O.createElement(`div`,{"data-content":``,className:$(C?.content,n?.classNames?.content)},O.createElement(`div`,{"data-title":``,className:$(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?O.createElement(`div`,{"data-description":``,className:$(v,ce,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),O.isValidElement(n.cancel)?n.cancel:n.cancel&&fn(n.cancel)?O.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{fn(n.cancel)&&G&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Y())},className:$(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,O.isValidElement(n.action)?n.action:n.action&&fn(n.action)?O.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{fn(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Y())},className:$(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Cn(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function wn(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?hn:mn;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Tn=O.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=pn,toastOptions:g,dir:_=Cn(),gap:v=vn,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=O.useState([]),w=O.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=O.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=O.useState([]),[k,A]=O.useState(!1),[j,M]=O.useState(!1),[N,P]=O.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=O.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=O.useRef(null),R=O.useRef(!1),ee=O.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Q.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return O.useEffect(()=>Q.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{ke.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),O.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),O.useEffect(()=>{S.length<=1&&A(!1)},[S]),O.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),O.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),O.createElement(`section`,{ref:t,"aria-label":b??`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?O.createElement(`ol`,{key:t,dir:_===`auto`?Cn():_,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${_n}px`,"--gap":`${v}px`,...m,...wn(l,u)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>O.createElement(Sn,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ee,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:k,swipeDirections:e.swipeDirections}))):null}))});function En({...e}){return(0,k.jsx)($e,{"data-slot":`select`,...e})}function Dn({...e}){return(0,k.jsx)(rt,{"data-slot":`select-value`,...e})}function On({className:e,size:t=`default`,children:n,...r}){return(0,k.jsxs)(tt,{"data-slot":`select-trigger`,"data-size":t,className:u(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,k.jsx)(it,{asChild:!0,children:(0,k.jsx)(Gt,{className:`size-4 opacity-50`})})]})}function kn({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,k.jsx)(st,{children:(0,k.jsxs)(lt,{"data-slot":`select-content`,className:u(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,k.jsx)(Mn,{}),(0,k.jsx)(bt,{className:u(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,k.jsx)(Nn,{})]})})}function An({className:e,children:t,...n}){return(0,k.jsxs)(Et,{"data-slot":`select-item`,className:u(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,k.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,k.jsx)(At,{children:(0,k.jsx)(Wt,{className:`size-4`})})}),(0,k.jsx)(Ot,{children:t})]})}function jn({className:e,...t}){return(0,k.jsx)(It,{"data-slot":`select-separator`,className:u(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}function Mn({className:e,...t}){return(0,k.jsx)(Mt,{"data-slot":`select-scroll-up-button`,className:u(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,k.jsx)(Kt,{className:`size-4`})})}function Nn({className:e,...t}){return(0,k.jsx)(Pt,{"data-slot":`select-scroll-down-button`,className:u(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,k.jsx)(Gt,{className:`size-4`})})}function Pn({className:e,icon:t=!1,...n}){return(0,k.jsx)(h,{variant:`ghost`,size:t?`icon-sm`:`sm`,"data-bar":``,className:u(`text-dense font-normal text-lead hover:bg-hover hover:text-ink active:bg-press aria-expanded:bg-press aria-expanded:text-ink aria-pressed:bg-here aria-pressed:text-ink aria-selected:bg-here aria-selected:text-ink`,t?`size-7 [&_svg:not([class*='size-'])]:size-4`:`h-7 gap-1.5 px-2 [&_svg:not([class*='size-'])]:size-3.5`,e),...n})}function Fn({className:e,tone:t=`pencil`,...n}){return(0,k.jsx)(h,{variant:`link`,className:u(`h-auto gap-1 p-0 font-normal underline-offset-2 has-[>svg]:px-0 hover:underline [&_svg:not([class*='size-'])]:size-3`,t===`pencil`?`text-pencil-text`:`text-lead hover:text-ink`,e),...n})}function In({className:e,...t}){return(0,k.jsx)(On,{size:`sm`,"data-bar":``,className:u(`gap-1.5 px-2 text-dense font-normal text-lead shadow-none data-[size=sm]:h-7 hover:text-ink data-[state=open]:text-ink [&_svg:not([class*='size-'])]:size-3.5`,e),...t})}export{be as _,kn as a,U as b,On as c,dn as d,Jt as f,Wt as g,Gt as h,En as i,Dn as l,Kt as m,In as n,An as o,qt as p,Fn as r,jn as s,Pn as t,Tn as u,Ce as v,M as x,_e as y};
|
package/editor-web/assets/{blockDiagram-RJAE7QA3-yXhlfxbH.js → blockDiagram-RJAE7QA3-k_lanKyI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{a as r,b as i,c as a,it as o,s,y as c}from"./chunk-DSNLSHJZ-zku9oeG3.js";import{t as l}from"./channel-Bhb-_8v6.js";import"./chunk-YZO67HFG-BLe7PXER.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,K as y,L as b,M as x,N as S,O as C,P as w,R as T,S as E,T as D,U as O,V as k,W as A,b as j,j as M,k as ee,u as te,w as ne,z as re}from"./chunk-7S6XSTFO-CgZAazgt.js";import"./chunk-AQDTSKZB-BRU84phF.js";import{t as ie}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t as ae}from"./chunk-DUW6YSOI-Dgx8z5s3.js";import"./chunk-UHW7PFBP-DrYeJo1e.js";import{i as oe,n as se,o as ce,r as le,s as ue}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-HAGFOTED-CaUkBv_0.js";import{i as de,r as fe}from"./chunk-ZAUX2LTX-ByaeSIre.js";import{a as pe,c as me,i as he,l as ge}from"./chunk-WQQL4CDK-DZ0tyi9F.js";import{t as _e}from"./graphlib-DS17s2tU.js";function ve(e){return Array.isArray(e)}function ye(e){if(g(e))return e;let t=A(e);if(!be(e))return{};if(ve(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&y(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(j(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Se(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Ce(n,e),N(n,e),xe(n,e),n}function be(e){switch(A(e)){case E:case ne:case f:case m:case D:case p:case C:case ee:case x:case u:case M:case S:case w:case h:case v:case b:case T:case re:case _:case O:case d:case k:return!0;default:return!1}}function N(e,t){for(let n in t)y(t,n)&&(e[n]=t[n])}function xe(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function Se(e,t){let n=t.valueOf().length;for(let r in t)y(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Ce(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{a as r,b as i,c as a,it as o,s,y as c}from"./chunk-DSNLSHJZ-BDlY4xos.js";import{t as l}from"./channel-CDJSUIp1.js";import"./chunk-YZO67HFG-CWL9cioT.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,K as y,L as b,M as x,N as S,O as C,P as w,R as T,S as E,T as D,U as O,V as k,W as A,b as j,j as M,k as ee,u as te,w as ne,z as re}from"./chunk-7S6XSTFO-BEEtZTsQ.js";import"./chunk-AQDTSKZB-ZT2PBdLK.js";import{t as ie}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t as ae}from"./chunk-DUW6YSOI-Dgx8z5s3.js";import"./chunk-UHW7PFBP-Byf0dX4X.js";import{i as oe,n as se,o as ce,r as le,s as ue}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-HAGFOTED-Yp6V4sx6.js";import{i as de,r as fe}from"./chunk-ZAUX2LTX-D9zlkFeQ.js";import{a as pe,c as me,i as he,l as ge}from"./chunk-WQQL4CDK-BW540sO1.js";import{t as _e}from"./graphlib-DS17s2tU.js";function ve(e){return Array.isArray(e)}function ye(e){if(g(e))return e;let t=A(e);if(!be(e))return{};if(ve(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&y(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(j(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Se(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Ce(n,e),N(n,e),xe(n,e),n}function be(e){switch(A(e)){case E:case ne:case f:case m:case D:case p:case C:case ee:case x:case u:case M:case S:case w:case h:case v:case b:case T:case re:case _:case O:case d:case k:return!0;default:return!1}}function N(e,t){for(let n in t)y(t,n)&&(e[n]=t[n])}function xe(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function Se(e,t){let n=t.valueOf().length;for(let r in t)y(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Ce(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{H as r,U as i,_ as a,b as o,c as s,r as l,s as u,v as d,z as f}from"./chunk-DSNLSHJZ-zku9oeG3.js";import"./chunk-YZO67HFG-BLe7PXER.js";import{n as p,r as m,v as h}from"./chunk-7S6XSTFO-CgZAazgt.js";import"./chunk-AQDTSKZB-BRU84phF.js";import"./chunk-UHW7PFBP-DrYeJo1e.js";import{r as g,s as _}from"./chunk-HAGFOTED-CaUkBv_0.js";import{a as v}from"./chunk-55XCU76K-mKuMXpnC.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`:
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{H as r,U as i,_ as a,b as o,c as s,r as l,s as u,v as d,z as f}from"./chunk-DSNLSHJZ-BDlY4xos.js";import"./chunk-YZO67HFG-CWL9cioT.js";import{n as p,r as m,v as h}from"./chunk-7S6XSTFO-BEEtZTsQ.js";import"./chunk-AQDTSKZB-ZT2PBdLK.js";import"./chunk-UHW7PFBP-Byf0dX4X.js";import{r as g,s as _}from"./chunk-HAGFOTED-Yp6V4sx6.js";import{a as v}from"./chunk-55XCU76K-WwcsywWu.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`:
|
|
2
2
|
`+g.showPosition()+`
|
|
3
3
|
Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(u+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:r.push(C),a.push(g.yytext),o.push(g.yylloc),r.push(E[1]),C=null,w?(C=w,w=null):(d=g.yyleng,l=g.yytext,u=g.yylineno,y=g.yylloc,f>0&&f--);break;case 2:if(A=this.productions_[E[1]][1],O.$=a[a.length-A],O._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column},b&&(O._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]),D=this.performAction.apply(O,[l,d,u,_.yy,E[1],a,o].concat(h)),D!==void 0)return D;A&&(r=r.slice(0,-1*A*2),a=a.slice(0,-1*A),o=o.slice(0,-1*A)),r.push(this.productions_[E[1]][0]),a.push(O.$),o.push(O._$),j=s[r[r.length-2]][r[r.length-1]],r.push(j);break;case 3:return!0}}return!0},`parse`)};oe.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as e,ot as t}from"./chunk-DSNLSHJZ-BDlY4xos.js";var n=(n,r)=>t.lang.round(e.parse(n)[r]);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t}from"./react-Byupo4pA.js";import{$ as n,J as r,K as i,Q as a,X as o,Y as s,Z as c,dt as l,et as u,ft as d,i as f,mt as p,nt as m,o as ee,ot as h,q as te,r as g,rt as _,s as v,st as ne,tt as y,ut as b}from"./x-BAJilkKD.js";import{t as x}from"./jsx-runtime-DePvh3-m.js";import{_ as re,b as S,v as C,x as w,y as T}from"./bar-button-BJ-_6g-F.js";import{t as ie}from"./createLucideIcon-euu7Wcd9.js";var E=e(t(),1),D=x(),ae=Object.defineProperty,O=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),oe={LTR:`ltr`,RTL:`rtl`},k=[`Enter`,` `],A=[`ArrowDown`,`PageUp`,`Home`],se=[`ArrowUp`,`PageDown`,`End`],ce=[...A,...se],le={ltr:[...k,`ArrowRight`],rtl:[...k,`ArrowLeft`]},ue={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},j=`Menu`,[M,de,fe]=w(j),[N,P]=ne(j,[fe,v,T]),F=v(),pe=T(),[I,L]=N(j),[me,R]=N(j),z=O(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=F(t),[c,l]=E.useState(null),u=E.useRef(!1),d=y(a),f=S(i);return E.useEffect(()=>{let e=O(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=O(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),E.useEffect(()=>{if(!n)return;let e=O(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,D.jsx)(g,{...s,children:(0,D.jsx)(I,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,D.jsx)(me,{scope:t,onClose:E.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),B=E.forwardRef(O(function(e,t){let{__scopeMenu:n,...r}=e,i=F(n);return(0,D.jsx)(f,{...i,...r,ref:t})},`MenuAnchor`)),V=`MenuPortal`,[he,H]=N(V,{forceMount:void 0}),ge=O(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=L(V,t);return(0,D.jsx)(he,{scope:t,forceMount:n,children:(0,D.jsx)(_,{present:n||a.open,children:(0,D.jsx)(s,{asChild:!0,container:i,children:r})})})},`MenuPortal`),U=`MenuContent`,[_e,W]=N(U),G=E.forwardRef(O(function(e,t){let n=H(U,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=L(U,e.__scopeMenu),o=R(U,e.__scopeMenu);return(0,D.jsx)(M.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(_,{present:r||a.open,children:(0,D.jsx)(M.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(ve,{...i,ref:t}):(0,D.jsx)(ye,{...i,ref:t})})})})},`MenuContent`)),ve=E.forwardRef(O(function(e,t){let n=L(U,e.__scopeMenu),r=E.useRef(null),a=p(t,r);return E.useEffect(()=>{let e=r.current;if(e)return i(e)},[]),(0,D.jsx)(K,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ye=E.forwardRef(O(function(e,t){let n=L(U,e.__scopeMenu);return(0,D.jsx)(K,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),be=d(`MenuContent.ScrollLock`),K=E.forwardRef(O(function(e,t){let{__scopeMenu:i,loop:s=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:m,onEntryFocus:g,onEscapeKeyDown:_,onPointerDownOutside:v,onFocusOutside:ne,onInteractOutside:y,onDismiss:b,disableOutsideScroll:x,...S}=e,C=L(U,i),w=R(U,i),T=F(i),ie=pe(i),ae=de(i),[oe,k]=E.useState(null),A=E.useRef(null),[le,ue]=E.useState(null);a(le);let{nodes:j,registry:M}=n(),fe=!!(l||x),N=p(t,A,C.onContentChange,ue),P=E.useRef(0),I=E.useRef(``),me=E.useRef(0),z=E.useRef(null),B=E.useRef(`right`),V=E.useRef(0),he=E.useMemo(()=>x?[A,...j.map(e=>({current:e}))]:[],[A,j,x]),H=x?te:E.Fragment,ge=x?{as:be,allowPinchZoom:!0,shards:he}:void 0,W=O(e=>{let t=I.current+e,n=ae().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Ge(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;O((function e(t){I.current=t,window.clearTimeout(P.current),t!==``&&(P.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);E.useEffect(()=>()=>window.clearTimeout(P.current),[]),r();let G=E.useCallback(e=>B.current===z.current?.side&&qe(e,z.current?.area),[]);return(0,D.jsx)(_e,{scope:i,searchRef:I,onItemEnter:E.useCallback(e=>{G(e)&&e.preventDefault()},[G]),onItemLeave:E.useCallback(e=>{G(e)||(A.current?.focus(),k(null))},[G]),onTriggerLeave:E.useCallback(e=>{G(e)&&e.preventDefault()},[G]),pointerGraceTimerRef:me,onPointerGraceIntentChange:E.useCallback(e=>{z.current=e},[]),children:(0,D.jsx)(c,{registry:fe?M:null,children:(0,D.jsx)(H,{...ge,children:(0,D.jsx)(o,{asChild:!0,trapped:l,branches:j,onMountAutoFocus:h(d,e=>{e.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:(0,D.jsx)(u,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:_,onPointerDownOutside:v,onFocusOutside:ne,onInteractOutside:y,onDismiss:b,children:(0,D.jsx)(re,{asChild:!0,...ie,dir:w.dir,orientation:`vertical`,loop:s,currentTabStopId:oe,onCurrentTabStopIdChange:k,onEntryFocus:h(g,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(ee,{role:`menu`,"aria-orientation":`vertical`,"data-state":X(C.open),"data-radix-menu-content":``,dir:w.dir,...T,...S,ref:N,style:{outline:`none`,...S.style},onKeyDown:h(S.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&W(e.key));let i=A.current;if(e.target!==i||!ce.includes(e.key))return;e.preventDefault();let a=ae().filter(e=>!e.disabled).map(e=>e.ref.current);se.includes(e.key)&&a.reverse(),Ue(a)}),onBlur:h(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),I.current=``)}),onPointerMove:h(e.onPointerMove,$(e=>{let t=e.target,n=V.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>V.current?`right`:`left`;B.current=t,V.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),xe=E.forwardRef(O(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(b.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Se=E.forwardRef(O(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(b.div,{...r,ref:t})},`MenuLabel`)),q=`MenuItem`,Ce=`menu.itemSelect`,J=E.forwardRef(O(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=E.useRef(null),o=R(q,e.__scopeMenu),s=W(q,e.__scopeMenu),c=p(t,a),u=E.useRef(!1),d=O(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Ce,{bubbles:!0,cancelable:!0});e.addEventListener(Ce,e=>r?.(e),{once:!0}),l(e,t),t.defaultPrevented?u.current=!1:o.onClose()}},`handleSelect`);return(0,D.jsx)(we,{...i,ref:c,disabled:n,onClick:h(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:h(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:h(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&k.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),we=E.forwardRef(O(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=W(q,n),s=pe(n),c=E.useRef(null),l=p(t,c),[u,d]=E.useState(!1),[f,m]=E.useState(``);return E.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,D.jsx)(M.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,D.jsx)(C,{asChild:!0,...s,focusable:!r,children:(0,D.jsx)(b.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:h(e.onPointerMove,$(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:h(e.onPointerLeave,$(e=>o.onItemLeave(e))),onFocus:h(e.onFocus,()=>d(!0)),onBlur:h(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),Te=E.forwardRef(O(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Me,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":Z(n)?`mixed`:n,...i,ref:t,"data-state":Q(n),onSelect:h(i.onSelect,()=>r?.(Z(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Ee,De]=N(`MenuRadioGroup`,{value:void 0,onValueChange:O(()=>{},`onValueChange`)}),Oe=E.forwardRef(O(function(e,t){let{value:n,onValueChange:r,...i}=e,a=y(r);return(0,D.jsx)(Ee,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(xe,{...i,ref:t})})},`MenuRadioGroup`)),ke=`MenuRadioItem`,Ae=E.forwardRef(O(function(e,t){let{value:n,...r}=e,i=De(ke,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Me,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(J,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Q(a),onSelect:h(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),je=`MenuItemIndicator`,[Me,Ne]=N(je,{checked:!1}),Pe=E.forwardRef(O(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Ne(je,n);return(0,D.jsx)(_,{present:r||Z(a.checked)||a.checked===!0,children:(0,D.jsx)(b.span,{...i,ref:t,"data-state":Q(a.checked)})})},`MenuItemIndicator`)),Fe=E.forwardRef(O(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(b.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),Ie=`MenuSub`,[Le,Re]=N(Ie),ze=O(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=L(Ie,t),o=F(t),[s,c]=E.useState(null),[l,u]=E.useState(null),d=y(i);return E.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,D.jsx)(g,{...o,children:(0,D.jsx)(I,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,D.jsx)(Le,{scope:t,contentId:m(),triggerId:m(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),Y=`MenuSubTrigger`,Be=E.forwardRef(O(function(e,t){let n=L(Y,e.__scopeMenu),r=R(Y,e.__scopeMenu),i=Re(Y,e.__scopeMenu),a=W(Y,e.__scopeMenu),o=E.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=E.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);E.useEffect(()=>u,[u]),E.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=p(t,i.onTriggerChange);return(0,D.jsx)(B,{asChild:!0,...l,children:(0,D.jsx)(we,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":X(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:h(e.onPointerMove,$(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:h(e.onPointerLeave,$(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:h(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&le[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Ve=`MenuSubContent`,He=E.forwardRef(O(function(e,t){let n=H(U,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=L(U,e.__scopeMenu),s=R(U,e.__scopeMenu),c=Re(Ve,e.__scopeMenu),l=E.useRef(null),u=p(t,l);return(0,D.jsx)(M.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(_,{present:r||o.open,children:(0,D.jsx)(M.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(K,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===oe.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:h(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:h(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:h(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ue[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function X(e){return e?`open`:`closed`}O(X,`getOpenState`);function Z(e){return e===`indeterminate`}O(Z,`isIndeterminate`);function Q(e){return Z(e)?`indeterminate`:e?`checked`:`unchecked`}O(Q,`getCheckedState`);function Ue(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}O(Ue,`focusFirst`);function We(e,t){return e.map((n,r)=>e[(t+r)%e.length])}O(We,`wrapArray`);function Ge(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=We(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}O(Ge,`getNextMatch`);function Ke(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}O(Ke,`isPointInPolygon`);function qe(e,t){return t?Ke({x:e.clientX,y:e.clientY},t):!1}O(qe,`isPointerInGraceArea`);function $(e){return t=>t.pointerType===`mouse`?e(t):void 0}O($,`whenMouse`);var Je=ie(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{P as _,G as a,Pe as c,Oe as d,Ae as f,Be as g,He as h,Te as i,Se as l,ze as m,z as n,xe as o,Fe as p,B as r,J as s,Je as t,ge as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t,h as n,l as r,s as i}from"./react-Byupo4pA.js";import{ht as a}from"./x-BAJilkKD.js";import{t as o}from"./jsx-runtime-DePvh3-m.js";import{t as s}from"./switch-b6GCy_ix.js";import{t as c}from"./createLucideIcon-euu7Wcd9.js";import{J as l,a as u}from"./index-BSd85XUU.js";import{t as d}from"./textarea-Bu6uPEqT.js";var f=c(`align-vertical-justify-center`,[[`rect`,{width:`14`,height:`6`,x:`5`,y:`16`,rx:`2`,key:`1i8z2d`}],[`rect`,{width:`10`,height:`6`,x:`7`,y:`2`,rx:`2`,key:`ypihtt`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),p=c(`align-vertical-justify-end`,[[`rect`,{width:`14`,height:`6`,x:`5`,y:`12`,rx:`2`,key:`4l4tp2`}],[`rect`,{width:`10`,height:`6`,x:`7`,y:`2`,rx:`2`,key:`ypihtt`}],[`path`,{d:`M2 22h20`,key:`272qi7`}]]),m=c(`align-vertical-justify-start`,[[`rect`,{width:`14`,height:`6`,x:`5`,y:`16`,rx:`2`,key:`1i8z2d`}],[`rect`,{width:`10`,height:`6`,x:`7`,y:`6`,rx:`2`,key:`13squh`}],[`path`,{d:`M2 2h20`,key:`1ennik`}]]),h=c(`between-horizontal-end`,[[`rect`,{width:`13`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`11xb64`}],[`path`,{d:`m22 15-3-3 3-3`,key:`26chmm`}],[`rect`,{width:`13`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`k6ky7n`}]]),g=c(`between-vertical-end`,[[`rect`,{width:`7`,height:`13`,x:`3`,y:`3`,rx:`1`,key:`1fdu0f`}],[`path`,{d:`m9 22 3-3 3 3`,key:`17z65a`}],[`rect`,{width:`7`,height:`13`,x:`14`,y:`3`,rx:`1`,key:`1squn4`}]]),_=c(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),v=c(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),y=c(`panel-bottom`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),b=c(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),x=c(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),S=c(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),C=c(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),w=c(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),T=c(`ruler`,[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]),E=c(`sheet`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`line`,{x1:`3`,x2:`21`,y1:`9`,y2:`9`,key:`1vqk6q`}],[`line`,{x1:`3`,x2:`21`,y1:`15`,y2:`15`,key:`o2sbyz`}],[`line`,{x1:`9`,x2:`9`,y1:`9`,y2:`21`,key:`1ib60c`}],[`line`,{x1:`15`,x2:`15`,y1:`9`,y2:`21`,key:`1n26ft`}]]),D=c(`subscript`,[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]),O=c(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),k=c(`table-cells-split`,[[`path`,{d:`M12 15V9`,key:`8c7uyn`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),A=c(`text-align-justify`,[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]]),j=e(t(),1);function M(e,t,a){let o=i(),[s,c]=(0,j.useState)(),[u,d]=(0,j.useState)(0);r(`project/changed`,e=>{d(e.revision)});let f=n(s?.probe);return(0,j.useEffect)(()=>{if(!a||e===void 0)return;let n=!0;return l(o,`components/stage`,{item:e,...t===void 0?{}:{version:t}}).then(e=>{n&&c(t=>t?.url===e.url&&t.probe===e.probe?t:{url:e.url,probe:e.probe})},()=>void 0),()=>{n=!1}},[o,e,t,a,u]),s&&f!==void 0?{url:s.url,sandbox:f}:void 0}function N(e,t){let n=document.createElement(`img`);return n.src=t,n.alt=``,n.setAttribute(`aria-hidden`,`true`),n.dataset.akComponentStill=``,Object.assign(n.style,{position:`absolute`,left:`0px`,top:`0px`,width:`100%`,height:`100%`,pointerEvents:`none`}),e.prepend(n),n}function P(e,t,n,r={}){let i=document.createElement(`iframe`);i.src=t.url,t.sandbox&&i.setAttribute(`sandbox`,`allow-scripts`),i.tabIndex=-1,i.setAttribute(`aria-hidden`,`true`),i.dataset.akComponent=n.name;let a=n,o=!1;i.style.visibility=`hidden`;let s,c=!1,l=t=>{c||s!==void 0||(s=N(e,t))};r.still!==void 0&&l(r.still);let u=()=>{let t=e.clientWidth>0?e.clientWidth/a.width:1;Object.assign(i.style,{position:`absolute`,left:`0px`,top:`0px`,width:`${String(a.width)}px`,height:`${String(a.height)}px`,border:`0`,background:`transparent`,pointerEvents:`none`,transformOrigin:`0 0`,transform:`scale(${String(t)})`})},d=()=>{i.contentWindow?.postMessage({allyhub:!0,type:`component`,...a},`*`)},f=e=>{if(e.source!==i.contentWindow)return;let t=e.data;t.allyhub===!0&&(t.type===`component-ready`||t.type===`error`)&&(c=!0,i.style.visibility=``,s?.remove(),s=void 0,t.type===`component-ready`?r.onDrawn?.(t.component):r.onError?.(typeof t.message==`string`?t.message:``))};addEventListener(`message`,f);let p=new ResizeObserver(u);return p.observe(e),u(),i.addEventListener(`load`,()=>{o=!0,d()}),e.append(i),{draw(e){a=e,u(),o&&d()},showStillUntilDrawn:l,remove(){removeEventListener(`message`,f),p.disconnect(),c=!0,s?.remove(),i.remove()}}}function F(e,t,n){let r=i(),[a,o]=(0,j.useState)(new Map),s=JSON.stringify(n);return(0,j.useEffect)(()=>{if(e===void 0||n.length===0)return;let i=!0;return l(r,`components/stills`,{item:e,...t===void 0?{}:{version:t},components:n.slice(0,64).map(e=>({...e}))}).then(({stills:e})=>{i&&o(t=>{let r=new Map(t);return n.slice(0,64).forEach((t,n)=>{let i=e[n];i&&r.set(JSON.stringify(t),i.url)}),r})},()=>void 0),()=>{i=!1}},[r,e,t,s]),a}var I=o();function L(e,t,n){return e===void 0?n:typeof e==`string`?e:e[t]??e.en??Object.values(e)[0]??n}var R=e=>{try{return JSON.parse(e),!0}catch{return!1}};function z({name:e,type:t,value:n,locale:r,disabled:i,onChange:a}){let o=(0,j.useId)(),[c,l]=(0,j.useState)(n??``),f=L(t.label,r,e),p=e=>{e!==(n??``)&&a(e===``&&t.optional?void 0:e)};if(t.type===`boolean`)return(0,I.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-sm`,children:[(0,I.jsx)(`span`,{children:f}),(0,I.jsx)(s,{size:`sm`,disabled:i,checked:n===`true`,onCheckedChange:e=>{a(e?`true`:`false`)}})]});let m=t.type===`list`||t.type===`object`,h=m||t.multiline===!0;return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`label`,{htmlFor:o,className:`text-xs text-muted-foreground`,children:f}),h?(0,I.jsx)(d,{id:o,value:c,disabled:i,rows:m?4:3,className:m?`font-mono text-xs`:`text-sm`,"aria-invalid":m&&c!==``&&!R(c),onChange:e=>{l(e.target.value)},onBlur:()=>{p(c)}}):(0,I.jsx)(u,{id:o,value:c,disabled:i,inputMode:t.type===`number`?`decimal`:void 0,className:`h-8 text-sm`,...t.type===`number`?{type:`number`,...t.min===void 0?{}:{min:t.min},...t.max===void 0?{}:{max:t.max},...t.step===void 0?{}:{step:t.step}}:{},onChange:e=>{l(e.target.value)},onBlur:()=>{p(c)},onKeyDown:e=>{e.key===`Enter`&&p(c)}})]})}function B({types:e,values:t,locale:n,disabled:r=!1,onChange:i}){return(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:Object.entries(e).map(([e,a])=>(0,I.jsx)(z,{name:e,type:a,value:t[e],locale:n,disabled:r,onChange:t=>{i(e,t)}},`${e}\0${t[e]??``}`))})}function V({pressed:e,tone:t=`neutral`,className:n,...r}){return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":e,"data-slot":`chip`,...r,className:a(`inline-flex h-8 flex-none items-center gap-1.5 rounded-full border px-3.5 text-sm transition-colors focus-visible:outline focus-visible:outline-pencil [&_svg:not([class*='size-'])]:size-3.5`,t===`pencil`?`border-transparent bg-pencil-wash text-pencil-text hover:border-pencil/40 data-[state=open]:border-pencil/60`:e===!0?`border-transparent bg-here text-ink hover:bg-press`:`border-rule text-ink hover:border-rule-strong hover:bg-hover active:bg-press`,n)})}export{m as C,h as S,f as T,b as _,M as a,_ as b,k as c,E as d,T as f,x as g,S as h,N as i,O as l,C as m,B as n,F as o,w as p,P as r,A as s,V as t,D as u,y as v,p as w,g as x,v as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t}from"./d3-selection-COWvaQNI.js";import{E as n,a as r,b as i,c as a,y as o,z as s}from"./chunk-DSNLSHJZ-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t}from"./d3-selection-COWvaQNI.js";import{E as n,a as r,b as i,c as a,y as o,z as s}from"./chunk-DSNLSHJZ-BDlY4xos.js";import{a as c}from"./mermaid.core-DQ10-Otk.js";var l=``,u=``,d=``,f=[],p=new Map,m=e(e=>s(e,i()),`sanitizeText`),h=e(e=>{switch(e.type){case`terminal`:return{...e,value:m(e.value)};case`nonterminal`:return{...e,name:m(e.name)};case`sequence`:return{...e,elements:e.elements.map(h)};case`choice`:return{...e,alternatives:e.alternatives.map(h)};case`optional`:return{...e,element:h(e.element)};case`repetition`:return{...e,element:h(e.element),separator:e.separator?h(e.separator):void 0};case`special`:return{...e,text:m(e.text)}}},`sanitizeAstNode`),g=e(()=>{l=``,u=``,d=``,f.length=0,p.clear(),r(),t.debug(`[Railroad] Database cleared`)},`clear`),_=e(e=>{l=m(e),t.debug(`[Railroad] Title set:`,e)},`setTitle`),v=e(()=>l,`getTitle`),y={clear:g,setTitle:_,getTitle:v,addRule:e(e=>{let n={...e,name:m(e.name),definition:h(e.definition),comment:e.comment?m(e.comment):void 0};t.debug(`[Railroad] Adding rule:`,n.name),p.has(n.name)&&t.warn(`[Railroad] Rule '${n.name}' is already defined. Overwriting.`),f.push(n),p.set(n.name,n)},`addRule`),getRules:e(()=>f,`getRules`),getRule:e(e=>p.get(e),`getRule`),setAccTitle:e(e=>{u=m(e).replace(/^\s+/g,``),t.debug(`[Railroad] Accessibility title set:`,e)},`setAccTitle`),getAccTitle:e(()=>u,`getAccTitle`),setAccDescription:e(e=>{d=m(e).replace(/\n\s+/g,`
|
|
2
2
|
`),t.debug(`[Railroad] Accessibility description set:`,e)},`setAccDescription`),getAccDescription:e(()=>d,`getAccDescription`),setDiagramTitle:_,getDiagramTitle:v},b={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:`monospace`,terminalFill:`#FFFFC0`,terminalStroke:`#000000`,terminalTextColor:`#000000`,nonTerminalFill:`#FFFFFF`,nonTerminalStroke:`#000000`,nonTerminalTextColor:`#000000`,lineColor:`#000000`,strokeWidth:2,markerFill:`#000000`,commentFill:`#E8E8E8`,commentStroke:`#888888`,commentTextColor:`#666666`,specialFill:`#F0E0FF`,specialStroke:`#8800CC`,ruleNameColor:`#000066`,showMarkers:!0,markerRadius:5},x=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,S=/^[\w "',.-]+$/,C=new Set([`compactMode`,`padding`,`verticalSeparation`,`horizontalSeparation`,`arcRadius`,`fontSize`,`fontFamily`,`terminalFill`,`terminalStroke`,`terminalTextColor`,`nonTerminalFill`,`nonTerminalStroke`,`nonTerminalTextColor`,`lineColor`,`strokeWidth`,`markerFill`,`commentFill`,`commentStroke`,`commentTextColor`,`specialFill`,`specialStroke`,`ruleNameColor`,`showMarkers`,`markerRadius`]),w=e(e=>e?Object.keys(e).every(e=>e===`railroad`||C.has(e)):!1,`isRailroadStyleOptions`),T=e(e=>e?`railroad`in e&&e.railroad?e.railroad:w(e)?e:{}:{},`extractRailroadOverrides`),E=e(e=>{if(!e||w(e))return{};let{railroad:t,svgId:n,theme:r,look:i,...a}=e;return a},`extractThemeOverrides`),D=e((e,t)=>{if(typeof e!=`string`)return t;let n=e.trim();return x.test(n)?n:t},`sanitizeColorValue`),O=e((e,t)=>{if(typeof e!=`string`)return t;let n=e.trim();return S.test(n)?n:t},`sanitizeFontFamilyValue`),k=e((e,t)=>{let n=typeof e==`number`?e:typeof e==`string`?Number.parseFloat(e):NaN;return Number.isFinite(n)&&n>=0?n:t},`sanitizeNumberValue`),A=e(e=>{let t=typeof e==`number`?e:typeof e==`string`?Number.parseFloat(e):NaN;return Number.isFinite(t)&&t>0?t:void 0},`parseThemeFontSize`),j=e(e=>{let t=O(e.fontFamily,b.fontFamily),n=A(e.fontSize)??b.fontSize;return{...b,fontFamily:t,fontSize:n,terminalFill:D(e.secondBkg??e.secondaryColor,b.terminalFill),terminalStroke:D(e.secondaryBorderColor??e.lineColor,b.terminalStroke),terminalTextColor:D(e.secondaryTextColor??e.textColor,b.terminalTextColor),nonTerminalFill:D(e.mainBkg??e.background,b.nonTerminalFill),nonTerminalStroke:D(e.primaryBorderColor??e.lineColor,b.nonTerminalStroke),nonTerminalTextColor:D(e.primaryTextColor??e.textColor,b.nonTerminalTextColor),lineColor:D(e.lineColor,b.lineColor),markerFill:D(e.lineColor,b.markerFill),commentFill:D(e.labelBackground??e.tertiaryColor,b.commentFill),commentStroke:D(e.tertiaryBorderColor??e.lineColor,b.commentStroke),commentTextColor:D(e.tertiaryTextColor??e.textColor,b.commentTextColor),specialFill:D(e.tertiaryColor??e.secondaryColor,b.specialFill),specialStroke:D(e.tertiaryBorderColor??e.secondaryBorderColor,b.specialStroke),ruleNameColor:D(e.titleColor??e.textColor,b.ruleNameColor)}},`buildThemeDefaults`),M=e(e=>{let t=o(),r=j({...n(),...t.themeVariables??{},...E(e)}),i={...t.railroad??{},...T(e)};return{compactMode:i.compactMode??r.compactMode,padding:k(i.padding,r.padding),verticalSeparation:k(i.verticalSeparation,r.verticalSeparation),horizontalSeparation:k(i.horizontalSeparation,r.horizontalSeparation),arcRadius:k(i.arcRadius,r.arcRadius),fontSize:k(i.fontSize,r.fontSize),fontFamily:O(i.fontFamily,r.fontFamily),terminalFill:D(i.terminalFill,r.terminalFill),terminalStroke:D(i.terminalStroke,r.terminalStroke),terminalTextColor:D(i.terminalTextColor,r.terminalTextColor),nonTerminalFill:D(i.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:D(i.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:D(i.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:D(i.lineColor,r.lineColor),strokeWidth:k(i.strokeWidth,r.strokeWidth),markerFill:D(i.markerFill,r.markerFill),commentFill:D(i.commentFill,r.commentFill),commentStroke:D(i.commentStroke,r.commentStroke),commentTextColor:D(i.commentTextColor,r.commentTextColor),specialFill:D(i.specialFill,r.specialFill),specialStroke:D(i.specialStroke,r.specialStroke),ruleNameColor:D(i.ruleNameColor,r.ruleNameColor),showMarkers:i.showMarkers??r.showMarkers,markerRadius:k(i.markerRadius,r.markerRadius)}},`buildRailroadStyleOptions`),N=e(e=>{let{fontFamily:t,fontSize:n,terminalFill:r,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:s,nonTerminalTextColor:c,lineColor:l,strokeWidth:u,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:m,specialFill:h,specialStroke:g,ruleNameColor:_}=M(e);return`
|
|
3
3
|
.railroad-diagram {
|
|
4
4
|
font-family: ${t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{o as t}from"./chunk-WQQL4CDK-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{o as t}from"./chunk-WQQL4CDK-BW540sO1.js";var n=5,r=1e-5,i=2,a=.6,o=1e-6;function s(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}e(s,`buildSegmentList`);function c(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,s=r.x-n.x,c=r.y-n.y,l=i*c-a*s;if(l===0)return null;let u=n.x-e.x,d=n.y-e.y,f=(u*c-d*s)/l,p=(u*a-d*i)/l;return f<=o||f>=1-o||p<=o||p>=1-o?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}e(c,`segmentIntersection`);function l(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}e(l,`isHorizontalSeg`);function u(e,t,r){if(e.curve!==`rounded`)return!1;let i=e.points,a=i[t],o=i[t+1];if(!a||!o)return!1;let s=Math.hypot(o.x-a.x,o.y-a.y),c=r*s,l=t>0?_(i[t-1],a,o,n):null;if(l&&c<l.cutLen)return!0;let u=t+2<i.length?_(a,o,i[t+2],n):null;return u!==null&&s-c<u.cutLen}e(u,`crossingSitsInRoundedCorner`);function d(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=s(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=s(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=c(a.a,a.b,s.a,s.b);if(!o||u(r,e,o.tA)||u(n,i,o.tB))continue;let d=l(a);d!==l(s)&&d?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}e(d,`findEdgeIntersections`);function f(e){return`${Math.round(e*1e3)/1e3}`}e(f,`fmt`);function p(e){return`${f(e.x)},${f(e.y)}`}e(p,`pointToString`);function m(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}e(m,`getArcSweepFlag`);function h(e,n){if(e.length<2)return e.map(e=>({...e}));let r=e.map(e=>({...e})),i=n.arrowTypeStart&&t[n.arrowTypeStart];if(i){let t=e[0],n=e[1],a=Math.atan2(n.y-t.y,n.x-t.x);r[0].x=t.x+i*Math.cos(a),r[0].y=t.y+i*Math.sin(a)}let a=n.arrowTypeEnd&&t[n.arrowTypeEnd];if(a){let t=e.length,n=e[t-2],i=e[t-1],o=Math.atan2(i.y-n.y,i.x-n.x);r[t-1].x=i.x-a*Math.cos(o),r[t-1].y=i.y-a*Math.sin(o)}return r}e(h,`applyMarkerOffsets`);function g(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},c={x:a+t*e.r,y:o+n*e.r},l=[`L${p(s)}`];return i===`arc`?l.push(`A${f(e.r)},${f(e.r)} 0 0 ${r} ${p(c)}`):l.push(`M${p(c)}`),l}e(g,`emitJump`);function _(e,t,n,i){let a=t.x-e.x,o=t.y-e.y,s=n.x-t.x,c=n.y-t.y,l=Math.hypot(a,o),u=Math.hypot(s,c);if(l<r||u<r)return null;let d=a/l,f=o/l,p=s/u,m=c/u,h=d*p+f*m,g=Math.acos(Math.max(-1,Math.min(1,h)));if(g<r||Math.abs(Math.PI-g)<r)return null;let _=Math.min(i/Math.sin(g/2),l/2,u/2);return{startX:t.x-d*_,startY:t.y-f*_,endX:t.x+p*_,endY:t.y+m*_,ctrlX:t.x,ctrlY:t.y,cutLen:_}}e(_,`computeRoundedCorner`);function v(e,t,r){let o=e.points;if(o.length<2)return``;let c=h(o,e),l=e.curve===`rounded`,u=s(c),d=new Map;for(let e of t){let t=u[e.segIndex];if(!t)continue;let n=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=d.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*n,r:r.jumpRadius}),d.set(e.segIndex,i)}let v=[`M${p(c[0])}`];for(let e=0;e<u.length;e++){let t=u[e],o=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),s=o===0?0:(t.b.x-t.a.x)/o,h=o===0?0:(t.b.y-t.a.y)/o,y=m(t),b=0;if(l&&e>0){let t=_(c[e-1],c[e],c[e+1]??c[e],n);t&&(b=t.cutLen)}let x=o,S=null;l&&e<u.length-1&&(S=_(c[e],c[e+1],c[e+2]??c[e+1],n),S&&(x=o-S.cutLen));let C=r.jumpRadius*a,w=[...d.get(e)??[]].sort((e,t)=>e.t-t.t).filter(e=>{let t=Math.min(e.d-b,x-e.d)-i;return e.r=Math.min(e.r,t),e.r>=C});for(let e=0;e<w.length-1;e++){let t=w[e+1].d-w[e].d;if(w[e].r+w[e+1].r>t){let n=t/2;w[e].r=Math.min(w[e].r,n),w[e+1].r=Math.min(w[e+1].r,n)}}for(let e of w)e.r<C||v.push(...g(e,s,h,y,r.jumpStyle));l&&S?(v.push(`L${f(S.startX)},${f(S.startY)}`),v.push(`Q${f(S.ctrlX)},${f(S.ctrlY)} ${f(S.endX)},${f(S.endY)}`)):v.push(`L${p(t.b)}`)}return v.join(` `)}e(v,`rewriteEdgePath`);function y(e){return/^[\d\s+,.LMelm-]*$/.test(e)}e(y,`isStraightPath`);function b(e){return!e||e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`}e(b,`curveSupportsLineHops`);function x(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}e(x,`decodeDataPoints`);function S(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let a=new Map;for(let e of r.querySelectorAll(`path[data-id]`)){let t=e.getAttribute(`data-id`);t!==null&&!a.has(t)&&a.set(t,e)}let o=[];for(let e of t){let t=a.get(e.id);if(!t)continue;let n=x(t.getAttribute(`data-points`))??e.points;o.push({...e,points:n})}let s=d(o);if(s.length===0)return;let c=new Map;for(let e of s){let t=c.get(e.jumpEdgeId)??[];t.push(e),c.set(e.jumpEdgeId,t)}for(let e of o){let t=c.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!b(r))continue;let o=a.get(e.id);if(!o||r===void 0&&!y(o.getAttribute(`d`)??``))continue;let s=o.getAttribute(`style`)??``,l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),u=l?Number.parseFloat(l[1]):null,d=l?Number.parseFloat(l[2]):null,f=v(e,t,n);if(o.setAttribute(`d`,f),u!==null&&d!==null&&typeof o.getTotalLength==`function`){let e=o.getTotalLength(),t=`0 ${u} ${Math.max(0,e-u-d)} ${d}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);o.setAttribute(`style`,n)}}}e(S,`applyLineJumpsToSvg`);export{S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./d3-selection-COWvaQNI.js";import{A as n}from"./chunk-DSNLSHJZ-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./d3-selection-COWvaQNI.js";import{A as n}from"./chunk-DSNLSHJZ-BDlY4xos.js";import{t as r}from"./dist-DdXDFcej.js";var i=r(),a=e((e,t)=>{let n=e.append(`rect`);if(n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),t.name&&n.attr(`name`,t.name),t.rx&&n.attr(`rx`,t.rx),t.ry&&n.attr(`ry`,t.ry),t.attrs!==void 0)for(let e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr(`class`,t.class),n},`drawRect`),o=e((e,t)=>{a(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:`rect`}).lower()},`drawBackgroundRect`),s=e((e,t)=>{let r=t.text.replace(n,` `),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.attr(`class`,`legend`),i.style(`text-anchor`,t.anchor),t.class&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.text(r),i},`drawText`),c=e((e,t,n,r)=>{let a=e.append(`image`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,o)},`drawImage`),l=e((e,t,n,r)=>{let a=e.append(`use`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,`#${o}`)},`drawEmbeddedImage`),u=e(()=>({x:0,y:0,width:100,height:100,fill:`#EDF2AE`,stroke:`#666`,anchor:`start`,rx:0,ry:0}),`getNoteRect`),d=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":`start`,style:`#666`,textMargin:0,rx:0,ry:0,tspan:!0}),`getTextObj`),f=e(()=>{let e=t(`.mermaidTooltip`);return e.empty()&&(e=t(`body`).append(`div`).attr(`class`,`mermaidTooltip`).style(`opacity`,0).style(`position`,`absolute`).style(`text-align`,`center`).style(`max-width`,`200px`).style(`padding`,`2px`).style(`font-size`,`12px`).style(`background`,`#ffffde`).style(`border`,`1px solid #333`).style(`border-radius`,`2px`).style(`pointer-events`,`none`).style(`z-index`,`100`)),e},`createTooltip`);export{a,d as c,c as i,o as n,s as o,l as r,u as s,f as t};
|