allyhub 0.13.0 → 0.15.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/CHANGELOG.md +14 -0
- package/dist/commands/frames.js +9 -11
- 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/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/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/tools.js +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/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/files.d.ts +9 -2
- package/dist/node_modules/@allyhub/formats/dist/files.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +9 -0
- package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
- package/dist/node_modules/@allyhub/formats/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 +39 -1
- package/dist/node_modules/@allyhub/model/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/tools.d.ts +36 -0
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -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/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/markup/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/markup/markup.json +19 -0
- package/dist/node_modules/@allyhub/text-extension/markup/notes/launch.md +9 -0
- package/dist/node_modules/@allyhub/text-extension/package.json +64 -0
- 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 +12 -12
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-D70jg8mE.js → abnfDiagram-WEYOIA3C-BHI0AbUY.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-CrXS3E8e.js → architecture-WOLXFQ4H-BMQS-OKZ.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-JrBljCOx.js → architectureDiagram-ZHVYKT53-DZp9CM6P.js} +1 -1
- package/editor-web/assets/{article-BWrfVMRA.js → article-C_mBG5a1.js} +4 -4
- package/editor-web/assets/{article-hxHjqzV1.js → article-DWBxNvX0.js} +2 -2
- package/editor-web/assets/{blockDiagram-RJAE7QA3-BzfC1xTS.js → blockDiagram-RJAE7QA3-h6LWaev4.js} +1 -1
- package/editor-web/assets/{textarea-DBwRbOyF.js → browser-C9NP0ZYz.js} +47 -47
- package/editor-web/assets/button-BVQH7zxz.js +41 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-s2TpXKgH.js → c4Diagram-XDPPPE54-BvSMs7J4.js} +1 -1
- package/editor-web/assets/channel-BFHB0S0f.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-DyE9v6UX.js → chunk-2E7WHVMD-0EJTAmDF.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-CCunMMcT.js → chunk-4EMNKR2T-BeYB4AEY.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-CZgJYrN4.js → chunk-55XCU76K-BPFOPTBe.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-B01FlTFf.js → chunk-7S6XSTFO-CZ2C7ULu.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-latWUvVu.js → chunk-AQDTSKZB-B5RtsZkj.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-BHFiQInN.js → chunk-DSNLSHJZ-_3G4hddj.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-C4hR36ab.js → chunk-HAGFOTED-DO5b4ll2.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-CNrxiD2Q.js → chunk-HNE4Q36P-C6XNI71Q.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-DpyEHKEY.js → chunk-NQOKRVIF-nDCX29rQ.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-SIEJdixh.js → chunk-UHW7PFBP-CRCOiitq.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-CxWnQRxx.js → chunk-VQ5W62QI-hNPKKjCN.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-CbRuCBm6.js → chunk-WQQL4CDK-KlnVtIDc.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-Cgu-EQvs.js → chunk-YZO67HFG-B76hDUrM.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-pAl5CV3o.js → chunk-ZAUX2LTX-D9m1N0wI.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-Du5hY-FP.js → chunk-ZCHMQSOR-443euxzo.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-CevU94T6.js → classDiagram-v2-4MYWR3UA-Bbw-8Ons.js} +1 -1
- package/editor-web/assets/{collaborator-C6IJkcGR.js → collaborator-2qfw-8OJ.js} +1 -1
- package/editor-web/assets/{cynefin-EF2NZ3EQ-DBHwpMRJ.js → cynefin-EF2NZ3EQ-C4E7TlUr.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-CxUzpjvG.js → cynefinDiagram-WF24UDRP-PBPGa_HS.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-BAJNBDYO.js → dagre-NK4GIZVX-DwXdEtQG.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-BQW9Fbw-.js → diagram-CBK3MWTC-BE3FwdX7.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-DQBROUfn.js → diagram-I5XIIV2D-BPl2ZY33.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-DEoK31qy.js → diagram-ODIL2UCW-BLVPYSzw.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BTCa2We1.js → diagram-PFBEJUXE-BVZk62FO.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-DNM8qWC3.js → diagram-RJA3I4VV-Z75LSbxH.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-BcKpED4d.js → diagram-TYUNFSNR-BynGqDAg.js} +1 -1
- package/editor-web/assets/{dist-RkxskWGK.js → dist--ijXGgvi.js} +4 -4
- package/editor-web/assets/dist-BrGYx10E.js +2 -0
- package/editor-web/assets/{dist-Dpet39Yp.js → dist-C-yi9AAi.js} +27 -27
- package/editor-web/assets/dist-CIQUbiAd.js +38 -0
- package/editor-web/assets/{dist-BSPs7tZR.js → dist-Ch34PllS.js} +1 -1
- package/editor-web/assets/dist-CxlIyluY.js +43 -0
- package/editor-web/assets/{dist-DMZ1VHPK.js → dist-D9N4Fxqr.js} +1 -1
- package/editor-web/assets/dist-DWKEqAou.js +6 -0
- package/editor-web/assets/{dist-aANR6S2I.js → dist-DX0VLTRV.js} +3 -3
- package/editor-web/assets/dist-D_xVYGnk.js +45 -0
- package/editor-web/assets/dist-Nc_h0Jye.js +4 -0
- package/editor-web/assets/dist-UG2TIZxP.js +16 -0
- package/editor-web/assets/dist-VP4ECMOk.js +1 -0
- package/editor-web/assets/dist-cUeSwqws.js +1 -0
- package/editor-web/assets/dist-xpAaABxb.js +24 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-D-1x27Eh.js → ebnfDiagram-V4P3TTPT-SwhqbeK4.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-BJSCxiTH.js → elk-QONTBCTQ-Bb1GSt2Z.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-C7Q357iD.js → erDiagram-KYQIGQAA-qUy0NDKn.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-kXrQLSF5.js → eventmodeling-K75KTNOO-BYBYso_j.js} +1 -1
- package/editor-web/assets/file-exclamation-point-C_fX4fpI.js +1 -0
- package/editor-web/assets/flowDiagram-IUGLLWBU-BSCBBtP3.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-Bt3SRgK7.js → ganttDiagram-R7GPNTJY-Cw-BkZT8.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-DS4CkhfK.js → gitGraph-VSP46ZUC-CTXzWPq_.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BgfmSVdI.js → gitGraphDiagram-PDYL7XHY-Jd9HU3WA.js} +1 -1
- package/editor-web/assets/{hint-BmRKl2nL.js → hint-mQB8slJ2.js} +1 -1
- package/editor-web/assets/index-Br4a-QEv.css +2 -0
- package/editor-web/assets/index-CglHrLRS.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-BZjctF3x.js → info-OHQRW6UA-C4oj5BpF.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-BAp5oUXk.js → infoDiagram-MVDRKAX5-D09aYJ28.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-DGL7ZfUu.js → ishikawaDiagram-HPEHV2GE-BEdXoXb2.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-DOOoBGx-.js → journeyDiagram-BOSHW7O7-DE-_0aww.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-lbLuUiMW.js → kanban-definition-FNSA4HC5-Cn3_bvPS.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-RkCFmJcg.js → mermaid-parser.core-BK52JMZH.js} +3 -3
- package/editor-web/assets/{mermaid.core-BVUl-afX.js → mermaid.core-CmfBU89G.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-C3DC4T1J.js → mindmap-definition-6OY57UG3-CtUhkv9I.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-Bkd6YpX8.js → packet-JDAUHWVQ-C7nciBNp.js} +1 -1
- package/editor-web/assets/pdf-BHx8b9rl.js +54 -0
- package/editor-web/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
- package/editor-web/assets/pdf.worker.min-DI4FfYVf.js +1 -0
- package/editor-web/assets/{pegDiagram-ECIUJNBX-B5Seh4Oe.js → pegDiagram-ECIUJNBX-DUkbAcTs.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-BNbb4Q8k.js → pie-XZMESJXO-BIGyKhav.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-_hnbUloZ.js → pieDiagram-GNMPY74T-DrYj-JeG.js} +1 -1
- package/editor-web/assets/{progress-D6wSFdpY.js → progress-udl4pNsP.js} +1 -1
- package/editor-web/assets/{props-form-BfwEi6jW.js → props-form-DrZYDmSM.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-1rbqW-KO.js → quadrantDiagram-D57K4MC3-qkBoh1ep.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-BWSnhBSp.js → radar-ABXABTNO-BkJmvR6a.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-BNB-OKs1.js → railroad-I3PHUGI6-BFH-ip4B.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-BKgidf_B.js → railroad-abnf-LNEFI6M7-BBlzHL6Z.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-CNCnxtHp.js → railroad-ebnf-DWYD2UWJ-CCVsG0ui.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CyBW6_0o.js → railroad-peg-JR7BVNR7-Puo7BFPl.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-Cud3SJ7O.js → railroadDiagram-Y72NRBL7-DCwfkv35.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-BrSCcpqV.js → requirementDiagram-EQYSW5RA-DSTcDj32.js} +1 -1
- package/editor-web/assets/{row-VwyPfa1b.js → row-dgHEAE7h.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-rJV4dJFn.js → sankeyDiagram-SY24JHO5-Kqq4fCvG.js} +1 -1
- package/editor-web/assets/schemas-B89k2jEC.js +1 -0
- package/editor-web/assets/scissors-BURkYWPv.js +1 -0
- package/editor-web/assets/search-jKDvFIEU.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-CEUuD2n6.js → sequenceDiagram-BLEHNHQU-B1uodEgL.js} +1 -1
- package/editor-web/assets/{session-DE0fvAcs.js → session-CUCSWPTE.js} +1 -1
- package/editor-web/assets/{slides-BgacyjJW.js → slides-BdaWgL_N.js} +1 -1
- package/editor-web/assets/{snapshots-D8TtZp1x.js → snapshots-CTS2iez5.js} +1 -1
- package/editor-web/assets/{split-Cx2MMnC_.js → split-Cu0fidVK.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-BRE_C2he.js → stateDiagram-v2-A6IESKWZ-B6gG3vUm.js} +1 -1
- package/editor-web/assets/surface-D9qJjJQL.js +1 -0
- package/editor-web/assets/swatch-S8YuBYyj.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-BEPqWgVe.js → swimlanes-B3ENRKFQ-CZayRtvU.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B9tLTrym.js +8 -0
- package/editor-web/assets/{switch-DaG6OuAi.js → switch-D5kPl2jO.js} +1 -1
- package/editor-web/assets/syntax-DSsHrzWF.js +1 -0
- package/editor-web/assets/{syntax-CLaCSmoi.js → syntax-PERQ2szW.js} +1 -1
- package/editor-web/assets/tabs-B_K0Db1I.js +1 -0
- package/editor-web/assets/textarea-mzr9Kfuf.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-p8Qeg4pS.js → timeline-definition-JXYKGLGB-5YoY8Xhw.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-C9FTdXKq.js → treeView-D4JQ5SDB-Brd_NUPx.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-XAeLVOtI.js → treemap-SAJKECNS-DmfdnlWl.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-BV3AMRuH.js → usecaseDiagram-WPOLBNNX-lcAkMviI.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CJdKcYyA.js → vennDiagram-Q3Y3IDCW-DY_n48hQ.js} +1 -1
- package/editor-web/assets/{video-He8p6dr6.js → video-Bv3rETBU.js} +1 -1
- package/editor-web/assets/w3c-keyname-BOAvb0qz.js +1 -0
- package/editor-web/assets/{wardley-7MLQ67FV-DZh6Mf22.js → wardley-7MLQ67FV-DzIFSBQz.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-XtvKSX-m.js → wardleyDiagram-IVAIDKWA-CsXNajIg.js} +1 -1
- package/editor-web/assets/whole-word-6DliXke2.js +1 -0
- package/editor-web/assets/{words-CjW-1tZI.js → words-BTRrBFUo.js} +1 -1
- package/editor-web/assets/{words-CPHp_0tt.js → words-ll_94CD2.js} +1 -1
- package/editor-web/assets/{xychartDiagram-4URNHDU4-CGkL42sz.js → xychartDiagram-4URNHDU4-DDpGFEum.js} +1 -1
- package/editor-web/index.html +4 -4
- package/package.json +2 -8
- package/dist/commands/frames/report.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/dist/build.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/dist/check.js +0 -3
- package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +0 -5
- package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +0 -30
- package/dist/node_modules/@allyhub/report-extension/dist/export.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/dist/inline.js +0 -58
- package/dist/node_modules/@allyhub/report-extension/dist/page.js +0 -21
- package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +0 -21
- package/dist/node_modules/@allyhub/report-extension/dist/styles.js +0 -5
- package/dist/node_modules/@allyhub/report-extension/dist/theme.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/dist/tools.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +0 -2
- package/dist/node_modules/@allyhub/report-extension/package.json +0 -182
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +0 -139
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +0 -109
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +0 -17
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +0 -40
- package/editor-web/assets/button-EftXSfev.js +0 -41
- package/editor-web/assets/channel-BFbXY6R0.js +0 -1
- package/editor-web/assets/dist-90dg0B0d.js +0 -2
- package/editor-web/assets/dist-CP9XwbBS.js +0 -45
- package/editor-web/assets/dist-CRxtC7DG.js +0 -24
- package/editor-web/assets/dist-Cmnq14RO.js +0 -6
- package/editor-web/assets/dist-CrZwqOm2.js +0 -1
- package/editor-web/assets/dist-CzUWTcvC.js +0 -38
- package/editor-web/assets/dist-DYnXIW8F.js +0 -16
- package/editor-web/assets/dist-Dre4Cwpz.js +0 -1
- package/editor-web/assets/dist-qSuFWuVB.js +0 -4
- package/editor-web/assets/flowDiagram-IUGLLWBU-GSC4btef.js +0 -1
- package/editor-web/assets/index-D8qc_ipi.js +0 -28
- package/editor-web/assets/index-DDtZpLDF.css +0 -2
- package/editor-web/assets/palette-INFK0Zsr.js +0 -1
- package/editor-web/assets/scissors-D9WmgvNP.js +0 -1
- package/editor-web/assets/swatch-lxK4C8fD.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DAcNszZ6.js +0 -8
- package/editor-web/assets/syntax-9LD8MzGy.js +0 -1
- package/editor-web/assets/tabs-DjhzblAG.js +0 -1
- package/editor-web/assets/trash-2-DrnRa91l.js +0 -1
- /package/dist/node_modules/@allyhub/{report-extension → text-extension}/LICENSE +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,d as n,m as r,o as i,s as a,u as o,v as s}from"./react-Bk7NnOLX.js";import{Dt as c,Et as l,Ot as u,Tt as d,yt as f}from"./button-BVQH7zxz.js";import{A as p,B as m,H as h,P as g,Q as _,R as v,S as y,U as b,V as x,W as S,X as C,Y as w,b as T,et as E,g as ee,it as D,nt as O,q as k,rt as A,tt as j,x as te}from"./snapshots-CTS2iez5.js";import{t as ne}from"./jsx-runtime-DePvh3-m.js";import{_ as re,a as ie,c as ae,d as oe,i as M,l as se,n as ce,o as le,p as ue,r as de,u as fe,w as pe}from"./dist-DWKEqAou.js";import{E as me,S as N,_ as P,f as he,h as F,p as ge,t as I,ut as _e}from"./index-CglHrLRS.js";import{t as ve}from"./collaborator-2qfw-8OJ.js";var L=ne(),ye=f({en:{loading:`Drawing the boards`,noBoards:`This image has no boards yet`,boards:`Boards`,zoom:`Zoom`,zoomIn:`Zoom In`,zoomOut:`Zoom Out`,zoomFit:`Zoom to Fit`,zoomActual:`Actual Size`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`The boards could not be drawn: ${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>e===1?`1 board`:`${String(e)} boards`},"zh-cn":{loading:`正在绘制画板`,noBoards:`这张图片还没有画板`,boards:`画板`,zoom:`缩放`,zoomIn:`放大`,zoomOut:`缩小`,zoomFit:`缩放到适合`,zoomActual:`实际大小`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`无法绘制画板:${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>`${String(e)} 个画板`},"zh-tw":{loading:`正在繪製畫板`,noBoards:`這張圖片還沒有畫板`,boards:`畫板`,zoom:`縮放`,zoomIn:`放大`,zoomOut:`縮小`,zoomFit:`縮放至適合大小`,zoomActual:`實際大小`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`無法繪製畫板:${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>`${String(e)} 個畫板`},ja:{loading:`ボードを描画中`,noBoards:`この画像にはまだボードがありません`,boards:`ボード`,zoom:`ズーム`,zoomIn:`拡大`,zoomOut:`縮小`,zoomFit:`全体を表示`,zoomActual:`実寸`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`ボードを描画できませんでした:${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>`${String(e)} 枚のボード`},ko:{loading:`보드를 그리는 중`,noBoards:`이 이미지에는 아직 보드가 없습니다`,boards:`보드`,zoom:`확대/축소`,zoomIn:`확대`,zoomOut:`축소`,zoomFit:`화면에 맞추기`,zoomActual:`실제 크기`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`보드를 그리지 못했습니다: ${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>`보드 ${String(e)}개`},es:{loading:`Dibujando las mesas de trabajo`,noBoards:`Esta imagen aún no tiene mesas de trabajo`,boards:`Mesas de trabajo`,zoom:`Zoom`,zoomIn:`Acercar`,zoomOut:`Alejar`,zoomFit:`Ajustar a la ventana`,zoomActual:`Tamaño real`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`No se pudieron dibujar las mesas de trabajo: ${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>e===1?`1 mesa de trabajo`:`${String(e)} mesas de trabajo`},fr:{loading:`Dessin des plans de travail`,noBoards:`Cette image n’a pas encore de plan de travail`,boards:`Plans de travail`,zoom:`Zoom`,zoomIn:`Zoom avant`,zoomOut:`Zoom arrière`,zoomFit:`Ajuster à la fenêtre`,zoomActual:`Taille réelle`,percent:e=>`${String(e)}\u202f%`,couldNotDraw:e=>`Les plans de travail n’ont pas pu être dessinés : ${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>e===1?`1 plan de travail`:`${String(e)} plans de travail`},de:{loading:`Zeichenflächen werden gezeichnet`,noBoards:`Dieses Bild hat noch keine Zeichenflächen`,boards:`Zeichenflächen`,zoom:`Zoom`,zoomIn:`Vergrößern`,zoomOut:`Verkleinern`,zoomFit:`An Fenster anpassen`,zoomActual:`Originalgröße`,percent:e=>`${String(e)}\u00a0%`,couldNotDraw:e=>`Die Zeichenflächen konnten nicht gezeichnet werden: ${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>e===1?`1 Zeichenfläche`:`${String(e)} Zeichenflächen`},pt:{loading:`Desenhando as pranchetas`,noBoards:`Esta imagem ainda não tem pranchetas`,boards:`Pranchetas`,zoom:`Zoom`,zoomIn:`Ampliar`,zoomOut:`Reduzir`,zoomFit:`Ajustar à janela`,zoomActual:`Tamanho real`,percent:e=>`${String(e)}%`,couldNotDraw:e=>`Não foi possível desenhar as pranchetas: ${e}`,size:(e,t)=>`${String(e)} × ${String(t)}`,boardCount:e=>e===1?`1 prancheta`:`${String(e)} pranchetas`}});function be(){return ye.of(a()?.locale)}var xe=typeof navigator<`u`&&navigator.userAgent.includes(`Mac`)?`⌘`:`Ctrl+`;function Se(e){let t=be();return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(ce,{id:`zoom`,priority:3,children:(0,L.jsxs)(ge,{children:[(0,L.jsx)(me,{asChild:!0,children:(0,L.jsxs)(I,{"aria-label":t.zoom,title:t.zoom,className:`tabular-nums`,"data-testid":`image-zoom`,children:[t.percent(Math.round(e.zoom*100)),(0,L.jsx)(_e,{className:`size-3`})]})}),(0,L.jsxs)(F,{align:`start`,children:[(0,L.jsx)(`div`,{className:`px-1 pb-1`,children:(0,L.jsx)(he,{"aria-label":t.zoom,className:`h-7 tabular-nums`,inputMode:`decimal`,defaultValue:t.percent(Math.round(e.zoom*100)),"data-testid":`image-zoom-typed`,onKeyDown:t=>{if(t.stopPropagation(),t.key!==`Enter`)return;let n=parseFloat(t.currentTarget.value.replace(`,`,`.`));Number.isFinite(n)&&n>0&&e.onZoom(n/100)}},Math.round(e.zoom*100))}),(0,L.jsxs)(P,{onSelect:()=>{e.onZoom(`in`)},children:[t.zoomIn,(0,L.jsx)(N,{children:`${xe}+`})]}),(0,L.jsxs)(P,{onSelect:()=>{e.onZoom(`out`)},children:[t.zoomOut,(0,L.jsx)(N,{children:`${xe}−`})]}),(0,L.jsxs)(P,{"data-testid":`image-zoom-fit`,onSelect:()=>{e.onZoom(`fit`)},children:[t.zoomFit,(0,L.jsx)(N,{children:`⇧1`})]}),(0,L.jsxs)(P,{"data-testid":`image-zoom-actual`,onSelect:()=>{e.onZoom(1)},children:[t.zoomActual,(0,L.jsx)(N,{children:`⇧0`})]})]})]})})})}var Ce=`normal.dissolve.darken.multiply.colorBurn.linearBurn.darkerColor.lighten.screen.colorDodge.linearDodge.lighterColor.overlay.softLight.hardLight.vividLight.linearLight.pinLight.hardMix.difference.exclusion.subtract.divide.hue.saturation.color.luminosity.passThrough`.split(`.`),we=e=>typeof e==`object`&&!!e&&(`__allyhubMedia`in e||`sha256`in e),R=w().min(0).max(1),Te=O([R,R,R,R]).refine(([e,t,n,r])=>n>0&&r>0&&e+n<=1+1e-9&&t+r<=1+1e-9,`[x, y, w, h] as shares of the frame, inside it, its sides more than 0`),z=A([j().min(1),h(we,`an imported picture`)]),B=w().min(0).max(100).refine(Number.isFinite,`a percent from 0 to 100`),V=w().min(0).max(1e3).refine(Number.isFinite),H=w().min(-360).max(360),U=v(Ce),Ee=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/iu,De=/^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([^()]*\)$/iu;function Oe(e){if(typeof e!=`string`)return!1;let t=e.trim();if(Ee.test(t)||De.test(t))return!0;if(!/^[a-z]+$/iu.test(t))return!1;let n=globalThis.CSS;return n?n.supports(`color`,t):t.length>2}var W=j().refine(Oe,`a CSS colour (#rrggbb, rgb(…), hsl(…) or a colour's name)`),ke=C({color:W,location:B,midpoint:B.optional()}),Ae=C({stops:m(ke).min(2),style:v([`linear`,`radial`,`angle`,`reflected`,`diamond`]).optional(),angle:H.optional(),scale:w().min(10).max(1e3).optional(),reverse:x().optional()});A([C({color:W}),C({gradient:Ae}),C({pattern:z,scale:w().min(1).max(1e3).optional()})]);var je=C({src:z.optional(),path:j().min(1).optional(),box:Te.optional(),mode:v([`alpha`,`luminance`]).optional(),density:B.optional(),feather:V.optional(),invert:x().optional(),enabled:x().optional()}),Me=A([z,je]),G={enabled:x().optional(),blendMode:U.optional(),opacity:B.optional()},Ne={...G,color:W.optional(),angle:H.optional(),distance:V.optional(),size:V.optional()},Pe=C({dropShadow:C({...Ne,spread:B.optional()}).optional(),innerShadow:C({...Ne,choke:B.optional()}).optional(),outerGlow:C({...G,color:W.optional(),spread:B.optional(),size:V.optional()}).optional(),innerGlow:C({...G,color:W.optional(),choke:B.optional(),size:V.optional(),source:v([`edge`,`center`]).optional()}).optional(),stroke:C({...G,color:W.optional(),size:V.optional(),position:v([`outside`,`inside`,`center`]).optional()}).optional(),colorOverlay:C({...G,color:W.optional()}).optional(),gradientOverlay:C({...G,gradient:Ae.optional()}).optional(),patternOverlay:C({...G,pattern:z,scale:w().min(1).max(1e3).optional()}).optional(),satin:C({...G,color:W.optional(),angle:H.optional(),distance:V.optional(),size:V.optional(),invert:x().optional()}).optional(),bevelEmboss:C({...G,style:v([`innerBevel`,`outerBevel`,`emboss`,`pillowEmboss`,`strokeEmboss`]).optional(),technique:v([`smooth`,`chiselHard`,`chiselSoft`]).optional(),depth:w().min(1).max(1e3).optional(),direction:v([`up`,`down`]).optional(),size:V.optional(),soften:V.optional(),angle:H.optional(),altitude:w().min(0).max(90).optional(),highlightMode:U.optional(),highlightColor:W.optional(),highlightOpacity:B.optional(),shadowMode:U.optional(),shadowColor:W.optional(),shadowOpacity:B.optional()}).optional()}),Fe=C({rotation:w().min(-360).max(360).optional(),flipH:x().optional(),flipV:x().optional()});C({blendMode:U.optional(),opacity:B.optional(),fillOpacity:B.optional(),clipping:x().optional(),mask:Me.optional(),effects:Pe.optional(),transform:Fe.optional(),visible:x().optional()});var K=w().min(0).max(255),Ie=C({inputBlack:K.optional(),inputWhite:K.optional(),gamma:w().min(.1).max(9.99).optional(),outputBlack:K.optional(),outputWhite:K.optional()}),Le=O([K,K]),Re=m(Le).min(2).max(16);b(`kind`,[C({kind:k(`levels`),rgb:Ie.optional(),red:Ie.optional(),green:Ie.optional(),blue:Ie.optional()}),C({kind:k(`curves`),rgb:Re.optional(),red:Re.optional(),green:Re.optional(),blue:Re.optional()}),C({kind:k(`brightnessContrast`),brightness:w().min(-150).max(150).optional(),contrast:w().min(-50).max(100).optional(),useLegacy:x().optional()}),C({kind:k(`hueSaturation`),hue:w().min(-180).max(180).optional(),saturation:w().min(-100).max(100).optional(),lightness:w().min(-100).max(100).optional(),colorize:x().optional()}),C({kind:k(`vibrance`),vibrance:w().min(-100).max(100).optional(),saturation:w().min(-100).max(100).optional()}),C({kind:k(`colorBalance`),shadows:O([w(),w(),w()]).optional(),midtones:O([w(),w(),w()]).optional(),highlights:O([w(),w(),w()]).optional(),preserveLuminosity:x().optional()}),C({kind:k(`blackAndWhite`),reds:w().min(-200).max(300).optional(),yellows:w().min(-200).max(300).optional(),greens:w().min(-200).max(300).optional(),cyans:w().min(-200).max(300).optional(),blues:w().min(-200).max(300).optional(),magentas:w().min(-200).max(300).optional()}),C({kind:k(`photoFilter`),color:W.optional(),density:B.optional(),preserveLuminosity:x().optional()}),C({kind:k(`invert`)}),C({kind:k(`threshold`),level:w().int().min(1).max(255).optional()}),C({kind:k(`gradientMap`),gradient:Ae.optional(),reverse:x().optional()}),C({kind:k(`exposure`),exposure:w().min(-20).max(20).optional(),offset:w().min(-.5).max(.5).optional(),gammaCorrection:w().min(.01).max(9.99).optional()})]),C({color:W.optional(),width:V.optional(),alignment:v([`inside`,`center`,`outside`]).optional(),dashes:m(w().min(0).max(1e3)).max(8).optional(),cap:v([`butt`,`round`,`square`]).optional(),join:v([`miter`,`round`,`bevel`]).optional(),opacity:B.optional()}),C({font:j().min(1).optional(),weight:w().int().min(100).max(900).optional(),italic:x().optional(),size:w().min(1).max(4096).optional(),color:W.optional(),tracking:w().min(-1e3).max(1e4).optional(),leading:A([w().min(0).max(5e3),k(`auto`)]).optional(),capitalization:v([`normal`,`allCaps`,`smallCaps`]).optional(),underline:x().optional(),strikeThrough:x().optional()}),C({justification:v([`left`,`center`,`right`,`justifyLeft`,`justifyCenter`,`justifyRight`,`justifyAll`]).optional(),firstLineIndent:w().min(-1296).max(1296).optional(),leftIndent:w().min(0).max(1296).optional(),rightIndent:w().min(0).max(1296).optional(),spaceBefore:w().min(0).max(1296).optional(),spaceAfter:w().min(0).max(1296).optional()});var ze=[`pixel`,`type`,`shape`,`smartObject`,`adjustment`,`fill`,`group`],q=e(s(),1),J=O([w(),w(),w(),w()]),Be=E({text:j(),box:J,size:w(),capHeight:w().optional(),color:j(),font:j(),weight:j(),lineHeight:w(),align:j(),letterSpacing:w().optional()}),Ve=E({key:j(),component:j(),kind:v(ze),parent:j().optional(),hidden:x(),style:_(j(),D()),box:J.optional(),words:m(E({prop:j(),key:j(),text:j()})),texts:m(Be),picture:E({file:j(),source:O([w(),w()]),whole:J,box:J,fit:j(),position:O([w(),w()]),crop:J.optional()}).optional()}),He=E({key:j(),title:j().optional(),width:S().positive(),height:S().positive(),background:j(),picture:y,layers:m(Ve)}),Ue=E({from:S().positive(),to:S().positive()}),We=Ue.extend({key:j().min(1)}),Ge=Ue.extend({key:j().min(1),layers:m(We)}),Ke={"image/versions":g(E({item:p}),E({piece:j(),title:j().optional(),script:j().min(1).optional(),versions:m(E({key:j(),lang:j().optional(),variant:j().optional(),script:p.optional()}))}),`An image's versions, one per combo, and its script in each version's language.`),"image/boards":g(E({...T,height:S().min(16).max(2048).optional()}),E({image:y,width:S().positive(),height:S().positive(),boards:m(E({key:j(),width:S().positive(),height:S().positive(),x:S().nonnegative()}))}),`An image version's boards drawn side by side, in order, at one height: its card and its preview.`),"image/edit":g(E({...T,scale:w().min(.05).max(2).optional()}),E({piece:j(),boards:m(He)}),`An image version's boards as its viewer shows them: each drawn, and its named layers with what each draws, the messages it shows and its picture (what Mark up finds under a mark).`),"image/stage":g(E({...T,board:j().min(1).optional()}),ee,"The address of an image version's stage page, for its viewer's sandboxed frame: a board drawn live, as large as the frame holds it, which moves to another board (`seek` by `part`)."),"image/sources":g(E({item:p}),E({path:p,boards:m(Ge)}),`Where each board and its layers are written in the image's module, by line: what a change to those lines changes.`)},qe=te(Ke),Je=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ye(e,t){for(let n of t){let t=e.find(e=>e.key===n.key);if(!t)return{board:n.key};for(let e of n.layers){let r=t.layers.find(t=>t.key===e.key);if(!r||!Je(r,e))return{board:n.key,layer:e.key}}if(t.layers.length!==n.layers.length)return{board:n.key}}}var Xe=(e,t)=>e.from<=t.to&&t.from<=e.to,Ze=(e,t)=>e.filter(e=>Xe(e,t)).sort((e,t)=>e.to-e.from-(t.to-t.from))[0];function Qe(e,t,n=t){let r={from:t,to:n},i=Ze(e,r);if(!i)return;let a=Ze(i.layers,r);return{board:i.key,...a?{layer:a.key}:{}}}var $e=1,et=e=>`data:${e.mime};base64,${e.data}`;function tt(e){let t=i(),[n,r]=(0,q.useState)(),[a,o]=(0,q.useState)([]),[s,c]=(0,q.useState)(new Map),[l,u]=(0,q.useState)(),[d,f]=(0,q.useState)(0),[p,m]=(0,q.useState)(),[h,g]=(0,q.useState)(),[_,v]=(0,q.useState)(0),y=(0,q.useRef)(0),b=(0,q.useRef)(new Map);return(0,q.useEffect)(()=>t.on(`project/changed`,e=>{y.current=e.revision,v(e=>e+1)}),[t]),(0,q.useEffect)(()=>{if(e===void 0)return;let n={on:!0},i=y.current;return qe(t,`image/sources`,{item:e}).then(e=>{n.on&&m(e)},()=>void 0),(async()=>{let a=(await qe(t,`image/versions`,{item:e})).versions.map(e=>({key:e.key,lang:e.lang,variant:e.variant})),s=new Map,l;for(let n of a){let r=await qe(t,`image/edit`,{item:e,version:n.key,scale:$e});l=r.piece,s.set(n.key,{version:n,boards:r.boards})}if(n.on){for(let[e,t]of s){let n=b.current.get(e),r=n&&Ye(n.boards,t.boards);if(r){g({spot:r,version:e,at:Date.now()});break}}b.current=s,r(l),o(a),c(s),u(void 0),f(i)}})().catch(e=>{n.on&&u(e instanceof Error?e.message:String(e))}),()=>{n.on=!1}},[t,e,_]),{item:e,piece:n,versions:a,drawn:s,revision:d,sources:p,landed:h,error:l}}var nt=e=>typeof e==`object`&&!!e&&e.allyhub===!0&&typeof e.type==`string`;function rt(e){let t=i(),[n,a]=(0,q.useState)(),o=r(n),[s,c]=(0,q.useState)(new Map),l=(0,q.useRef)(new Map),u=(0,q.useRef)(1),d=e.wanted.map(e=>e.id).join(`
|
|
2
|
+
`);return(0,q.useEffect)(()=>{if(e.item===void 0)return;let n=!0,r=e.item;return Promise.all(e.wanted.slice(0,8).map(e=>qe(t,`image/stage`,{item:r,version:e.version,board:e.board}).then(t=>({w:e,r:t}),()=>void 0))).then(e=>{if(!n)return;let t=e.find(e=>e!==void 0);t&&a(t.r.probe),c(t=>{let n=new Map;for(let r of e){if(!r)continue;let e=t.get(r.w.id),i=()=>({n:u.current++,src:r.r.url,drawn:!1});e?.shown?e.shown.src===r.r.url?n.set(r.w.id,e):n.set(r.w.id,{shown:e.shown,pending:e.pending?.src===r.r.url?e.pending:i()}):n.set(r.w.id,{shown:i(),pending:void 0})}return n})}),()=>{n=!1}},[t,e.item,d,e.revision]),(0,q.useEffect)(()=>{let e=e=>{if(!nt(e.data)||e.data.type!==`ready`)return;let t;for(let[n,r]of l.current)r.contentWindow===e.source&&(t=n);t!==void 0&&c(e=>{let n=!1,r=new Map(e);for(let[i,a]of e)a.shown?.n===t&&!a.shown.drawn?(r.set(i,{...a,shown:{...a.shown,drawn:!0}}),n=!0):a.pending?.n===t&&(r.set(i,{shown:{...a.pending,drawn:!0},pending:void 0}),n=!0);return n?r:e})};return addEventListener(`message`,e),()=>{removeEventListener(`message`,e)}},[]),{frame:(e,t)=>{let n=s.get(e);return!n||o===void 0?null:(0,L.jsx)(at,{frames:n,sandbox:o,els:l,picture:t})},drawn:e=>s.get(e)?.shown?.drawn===!0}}function it(e){let t=/^data:([^;,]+);base64,(.*)$/su.exec(e);return t?.[1]!==void 0&&t[2]!==void 0?{mime:t[1],data:t[2]}:void 0}function at({frames:e,sandbox:t,els:n,picture:r}){let i=(0,q.useRef)(null),a=()=>{let e=i.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0};o({element:()=>i.current,pictures:()=>{let e=a(),t=it(r);return Promise.resolve(e&&t?[{rect:e,...t}]:[])}});let s=(e,r)=>(0,L.jsx)(`iframe`,{ref:t=>{t?n.current.set(e.n,t):n.current.delete(e.n),r||(i.current=t)},src:e.src,title:``,tabIndex:-1,...t?{sandbox:`allow-scripts`}:{},"data-testid":r?`image-live-pending`:`image-live`,"data-drawn":e.drawn?``:void 0,className:`pointer-events-none absolute inset-0 size-full border-0`,style:{opacity:!r&&e.drawn?1:0}},e.n);return(0,L.jsxs)(L.Fragment,{children:[e.shown?s(e.shown,!1):null,e.pending?s(e.pending,!0):null]})}function ot(e,t,n,r){let i=e=>({x:(e.x-t.x)/t.zoom,y:(e.y-t.y)/t.zoom}),a=c(n,i),o=t=>st(e,t),s=[...e.layers].reverse(),l=e=>!e.hidden&&e.shown!==void 0&&u(n,{x:t.x+e.shown.left*t.zoom,y:t.y+e.shown.top*t.zoom,width:e.shown.width*t.zoom,height:e.shown.height*t.zoom}),d=s.filter(e=>e.kind!==`group`&&!o(e)&&l(e)),f=d.length>0?d:s.filter(e=>e.kind!==`group`&&l(e)),p=new Set,m=new Map(e.layers.map(e=>[e.key,e.parent]));for(let e of f)for(let t=e.parent;t!==void 0;t=m.get(t))p.add(t);let h=new Set([...f.map(e=>e.key),...p]);return s.filter(e=>h.has(e.key)).map(o=>{let s=[{in:`board ${e.key}`,width:e.width,height:e.height,...a,scale:1/t.zoom}],l=o.info.picture;if(l&&l.whole[2]>0&&l.whole[3]>0){let[e,r,a,o]=l.whole,[u,d]=l.source;s.push({in:`the picture`,file:l.file,width:u,height:d,...c(n,t=>{let n=i(t);return{x:(n.x-e)*u/a,y:(n.y-r)*d/o}}),scale:u/a/t.zoom})}return{...ct(e,o,r),regions:s}})}var st=(e,t)=>(t.kind===`adjustment`||t.kind===`fill`)&&t.box!==void 0&&t.box.left<=0&&t.box.top<=0&&t.box.left+t.box.width>=e.width&&t.box.top+t.box.height>=e.height;function ct(e,t,n){let r=t.info.picture,i=t.info.words[0]?.text??t.info.texts[0]?.text,a=n.lineOf(t.key);return{name:`layer ${t.name===t.key?`"${t.key}"`:`"${t.key}" (${t.name})`}, a ${t.kind}${r?` of ${r.file}`:``}, of board ${e.key}`,source:{path:n.file,...a===void 0?{}:{line:a}},...i===void 0?{}:{text:i}}}function lt(e,t,n){let r=(n.x-t.x)/t.zoom,i=(n.y-t.y)/t.zoom,a=e=>!e.hidden&&e.kind!==`group`&&e.shown!==void 0&&r>=e.shown.left&&r<=e.shown.left+e.shown.width&&i>=e.shown.top&&i<=e.shown.top+e.shown.height,o=[...e.layers].reverse();return o.find(t=>a(t)&&!st(e,t))??o.find(a)}function ut(e,t,n,r){if(n.shown!==void 0)return{element:ct(e,n,r),outline:l({x:t.x+n.shown.left*t.zoom,y:t.y+n.shown.top*t.zoom,width:n.shown.width*t.zoom,height:n.shown.height*t.zoom})}}function dt(e,t){let n=e.split(`
|
|
3
|
+
`).findIndex(e=>RegExp(`key:\\s*["'\`]${t.replace(/[.*+?^${}()|[\]\\]/gu,`\\$&`)}["'\`]`,`u`).test(e));return n<0?void 0:n+1}var ft=e=>e===void 0?void 0:{left:e[0],top:e[1],width:e[2],height:e[3]};function pt(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.left+e.width,t.left+t.width),a=Math.min(e.top+e.height,t.top+t.height);return i>n&&a>r?{left:n,top:r,width:i-n,height:a-r}:void 0}function mt(e){let t=new Map;for(let n of e){let e=n.info.style.clipping===!0&&n.kind!==`group`,r=e?t.get(n.parent):void 0;n.shown=r===void 0?n.box:r.shown&&n.box?pt(n.box,r.shown):void 0,e||t.set(n.parent,n)}}function ht(e,t,n){let r=t.layers.map(e=>({key:e.key,name:e.key,component:e.component,kind:e.kind,hidden:e.hidden,parent:e.parent,box:ft(e.box),shown:void 0,info:e}));return mt(r),{version:e,key:t.key,title:t.title??t.key,width:t.width,height:t.height,background:t.background,picture:n,layers:r}}function gt(e,t,n){return e.flatMap(e=>{let r=t.get(e.key);return r?[r.boards.map(t=>ht(e,t,n(t.picture)))]:[]})}var Y=48,_t=80,vt=20,yt=22,bt=26,X=40,Z=(e,t)=>`${e} ${t}`;function xt(e){let t=[];for(let n of e)n.forEach((e,n)=>{t[n]=Math.max(t[n]??0,e.width)});return t}var St=e=>Math.max(vt,_t*e);function Ct(e,t){let n=xt(e),r=e.length>1;return{width:n.reduce((e,n)=>e+n*t,0)+St(t)*Math.max(0,n.length-1)+96,height:e.reduce((e,n)=>e+Math.max(0,...n.map(e=>e.height))*t+yt+(r?bt:0),0)+X*Math.max(0,e.length-1)+96}}function wt(e,t,n,r){let i=xt(e),a=St(t),o=Ct(e,t),s=Math.max(0,((r?.width??0)-o.width)/2),c=Math.max(0,((r?.height??0)-o.height)/2),l=new Map,u=[],d=c+Y,f=0,p=e.length>1;for(let r of e){let e=r[0];p&&e&&(u.push({x:s+Y,y:d,label:n(e)}),d+=bt);let o=d;d+=yt;let c=s+Y,m=0;r.forEach((e,n)=>{l.set(Z(e.version.key,e.key),{x:c,y:d,labelY:o}),c+=(i[n]??e.width)*t+a,m=Math.max(m,e.height*t)}),f=Math.max(f,c-a+Y+s),d+=m+X}return{width:f,height:d-X+Y+c,boards:l,rows:u}}function Tt(e,t){let n=xt(e);if(n.length===0||t.width<=0||t.height<=0)return 1;let r=n.reduce((e,t)=>e+t,0),i=n.length-1,a=(t.width-96)/(r+_t*i),o=_t*a>=vt?a:(t.width-96-vt*i)/r,s=e.reduce((e,t)=>e+Math.max(...t.map(e=>e.height)),0),c=e.length*(yt+(e.length>1?bt:0))+X*(e.length-1),l=Math.min(o,(t.height-96-c)/s,1);return Math.max(.02,l)}var Q=e=>`${String(e)}px`,$=e=>`${String(e*100)}%`;function Et(e){let t=e.board.layers.find(t=>t.key===e.layer)?.shown;return t?(0,L.jsx)(`div`,{"data-note-chrome":``,"data-testid":e.selected?`image-selected`:`image-hovered`,"data-layer":e.layer,className:e.selected?`outline-pencil absolute shadow-[0_0_0_4px_var(--color-sheet),inset_0_0_0_2px_var(--color-sheet)] outline-2`:`outline-pencil absolute shadow-[0_0_0_2px_var(--color-sheet),inset_0_0_0_1px_var(--color-sheet)] outline-1`,style:{left:$(t.left/e.board.width),top:$(t.top/e.board.height),width:$(t.width/e.board.width),height:$(t.height/e.board.height)},children:e.selected&&e.bar!==void 0?(0,L.jsx)(`div`,{className:`pointer-events-auto absolute top-full left-1/2 mt-2 -translate-x-1/2`,children:e.bar}):null}):null}function Dt(e){let t=(e.agent.layer===void 0?void 0:e.board.layers.find(t=>t.key===e.agent.layer))?.box;return t?(0,L.jsx)(ve,{"data-testid":`image-agent`,label:e.agent.label,style:{left:$(t.left/e.board.width),top:$(t.top/e.board.height),width:$(t.width/e.board.width),height:$(t.height/e.board.height)}}):(0,L.jsx)(ve,{"data-testid":`image-agent`,label:e.agent.label,flag:`end`,className:`inset-0`})}function Ot(e){let t=be(),{board:n,zoom:r}=e;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`text-lead text-micro absolute flex h-5 items-end gap-2 truncate`,style:{left:Q(e.at.x),top:Q(e.at.labelY),width:Q(n.width*r)},"data-testid":`image-board-label`,children:[(0,L.jsx)(`span`,{className:`text-ink truncate font-medium`,children:n.title}),n.title.replace(/\s/gu,``).toLowerCase().replace(`×`,`x`).includes(`${String(n.width)}x${String(n.height)}`)?null:(0,L.jsx)(`span`,{className:`tabular-nums`,children:t.size(n.width,n.height)})]}),(0,L.jsxs)(`div`,{className:`bg-sheet absolute overflow-hidden shadow-[0_0_0_1px_var(--color-rule)]`,style:{left:Q(e.at.x),top:Q(e.at.y),width:Q(n.width*r),height:Q(n.height*r)},"data-testid":`image-board`,"data-board":n.key,"data-version":n.version.key,children:[(0,L.jsx)(`img`,{src:n.picture,alt:``,draggable:!1,className:`absolute inset-0 size-full max-w-none select-none`}),e.frame]}),e.agent||e.hovered!==void 0||e.selected!==void 0?(0,L.jsxs)(`div`,{className:`pointer-events-none absolute`,style:{left:Q(e.at.x),top:Q(e.at.y),width:Q(n.width*r),height:Q(n.height*r)},children:[e.agent?(0,L.jsx)(Dt,{board:n,agent:e.agent}):null,e.hovered===void 0?null:(0,L.jsx)(Et,{board:n,layer:e.hovered,selected:!1}),e.selected===void 0?null:(0,L.jsx)(Et,{board:n,layer:e.selected,selected:!0,bar:e.selectionBar})]}):null]})}function kt({ref:e,...t}){let n=(0,q.useRef)(null),r=(0,q.useCallback)(t=>{n.current=t,typeof e==`function`?e(t):e&&(e.current=t)},[e]),i=(0,q.useRef)(t.onZoomAt);return(0,q.useEffect)(()=>{i.current=t.onZoomAt}),(0,q.useEffect)(()=>{let e=n.current;if(!e)return;let t=t=>{if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let n=e.getBoundingClientRect();i.current(Math.exp(-t.deltaY/200),{x:t.clientX-n.left,y:t.clientY-n.top})};return e.addEventListener(`wheel`,t,{passive:!1}),()=>{e.removeEventListener(`wheel`,t)}},[]),(0,L.jsx)(`div`,{ref:r,className:`bg-stone focus-visible:outline-pencil relative min-h-0 min-w-0 flex-1 overflow-auto outline-none focus-visible:-outline-offset-1 focus-visible:outline-1`,tabIndex:0,role:`application`,"aria-label":t.label,"data-testid":`image-surface`,style:{cursor:t.cursor},onPointerDown:t.onPointerDown,onPointerMove:t.onPointerMove,onPointerUp:t.onPointerUp,onPointerCancel:t.onPointerUp,onLostPointerCapture:t.onPointerUp,onPointerLeave:t.onPointerLeave,onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,children:(0,L.jsxs)(`div`,{className:`relative`,style:{width:Q(t.layout.width),height:Q(t.layout.height)},"data-testid":`image-world`,children:[t.layout.rows.map(e=>(0,L.jsx)(`div`,{className:`text-lead absolute text-xs font-medium`,style:{left:Q(e.x),top:Q(e.y)},"data-testid":`image-row-label`,children:e.label},e.y)),t.rows.flatMap(e=>e.map(e=>{let n=Z(e.version.key,e.key),r=t.layout.boards.get(n);return r?(0,L.jsx)(Ot,{board:e,zoom:t.zoom,at:r,frame:t.frame?.(n,e.picture),agent:t.agent?.id===n?{label:t.agent.label,layer:t.agent.layer}:void 0,hovered:t.hovered?.id===n?t.hovered.layer:void 0,selected:t.selected?.id===n?t.selected.layer:void 0,selectionBar:t.selectionBar},n):null}))]})})}function At(e,t){if(e!==void 0)try{return new Intl.DisplayNames([t??`en`],{type:`language`}).of(e)}catch{return e}}var jt=3e4;function Mt(e){let t=e?.board??e?.part;if(typeof t!=`string`)return;let n=e?.layer;return typeof n==`string`?{board:t,layer:n}:{board:t}}var Nt=e=>e instanceof Element&&e.closest(`input, textarea, [contenteditable='true'], [role='combobox']`)!==null;function Pt(e){return e.bar(e.tools)}function Ft(e){let r=be(),o=i(),s=a(),c=(0,q.useMemo)(()=>gt(e.data.versions,e.data.drawn,et),[e.data.versions,e.data.drawn]),l=c.flat(),u=(0,q.useRef)(null),[f,p]=(0,q.useState)(),[m,h]=(0,q.useState)(!0),[g,_]=(0,q.useState)(`default`),[v,y]=(0,q.useState)(!1),b=(0,q.useRef)(void 0),x=e=>[At(e.version.lang,s?.locale),e.version.variant].filter(e=>e!==void 0).join(` · `)||e.version.key,[S,C]=(0,q.useState)();(0,q.useLayoutEffect)(()=>{let e=u.current;if(!e)return;let t=()=>{C(t=>t?.width===e.offsetWidth&&t.height===e.offsetHeight?t:{width:e.offsetWidth,height:e.offsetHeight})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let w=m&&S&&c.length>0?Tt(c,S):f??1,T=(0,q.useMemo)(()=>wt(c,w,x,S),[c,w,s?.locale,S]),E=(0,q.useRef)(void 0);(0,q.useLayoutEffect)(()=>{let e=u.current,t=E.current;if(!e||!t)return;E.current=void 0;let n=w/t.from;e.scrollLeft=(e.scrollLeft+t.at.x)*n-t.at.x,e.scrollTop=(e.scrollTop+t.at.y)*n-t.at.y},[w]);let ee=(0,q.useRef)(!1);(0,q.useEffect)(()=>{if(ee.current||e.board===void 0||c.length===0)return;let t=u.current?.querySelector(`[data-testid="image-board"][data-board="${CSS.escape(e.board)}"]`);t&&(ee.current=!0,t.scrollIntoView({block:`nearest`,inline:`nearest`}))},[e.board,c.length,T]);let{agent:D,following:O}=t(),k=pe(),A=(()=>{if(D?.doing===void 0)return;let{landed:t,sources:n}=e.data,r=D.source,i=r?.path!==void 0&&r.path===n?.path&&r.from!==void 0?Qe(n.boards,r.from,r.to):void 0,a=t&&t.at>=D.at-jt?t:void 0,o=Mt(D.place)??i??a?.spot;if(!o)return;let s=l.filter(e=>e.key===o.board),c=s.find(e=>e.version.key===a?.version)??s[0];if(!c)return;let u=c.layers.some(e=>e.key===o.layer)?o.layer:void 0;return{id:Z(c.version.key,c.key),layer:u,label:k(D)}})(),j=O&&A?`${A.id}\n${A.layer??``}`:void 0;(0,q.useEffect)(()=>{let e=u.current;if(j===void 0||!e)return;let[t=``,n=``]=j.split(`
|
|
4
|
+
`),r=l.find(e=>Z(e.version.key,e.key)===t),i=T.boards.get(t);if(!r||!i)return;let a=r.layers.find(e=>e.key===n)?.box??{left:0,top:0,width:r.width,height:r.height},o=(e,t,n,r)=>t+96>r||e-48<n?e-48:e+t+48>n+r?e+t+48-r:n;e.scrollTo({left:o(i.x+a.left*w,a.width*w,e.scrollLeft,e.clientWidth),top:o(i.y+a.top*w,a.height*w,e.scrollTop,e.clientHeight)})},[j]);let te=rt({item:e.data.item,wanted:l.map(e=>({id:Z(e.version.key,e.key),version:e.version.key,board:e.key})),revision:e.data.revision}),ne=(e,t)=>{h(!1);let n=u.current;E.current={at:t??{x:(n?.clientWidth??0)/2,y:(n?.clientHeight??0)/2},from:w},p(Math.min(8,Math.max(.02,e)))},M=e=>{e===`fit`?h(!0):ne(typeof e==`number`?e:w*(e===`in`?1.25:.8))},ce=(e,t)=>u.current?.querySelector(`[data-testid="image-board"][data-version="${CSS.escape(e)}"][data-board="${CSS.escape(t)}"]`)?.getBoundingClientRect(),de=(0,q.useRef)(``),me=e=>{for(let t of l){let n=ce(t.version.key,t.key);if(n&&e.x>=n.left&&e.x<=n.right&&e.y>=n.top&&e.y<=n.bottom)return{b:t,r:n}}},N=ae()!==void 0,[P,he]=(0,q.useState)(),[F,ge]=(0,q.useState)(),I=(e,t)=>({x:e.x,y:e.y,zoom:e.width/t.width}),_e=e=>{let t=me(e),n=t?lt(t.b,I(t.r,t.b),e):void 0;return t&&n?{id:Z(t.b.version.key,t.b.key),layer:n.key}:void 0},ve=(e,t)=>e?.id===t?.id&&e?.layer===t?.layer,ye={file:e.entry,lineOf:e=>dt(de.current,e)},xe=t=>{let n=At(t.version.lang,`en`);return`on board ${t.key}${n===void 0||e.data.versions.length<2?``:` (${n})`}`},Se=e=>{u.current?.focus({preventScroll:!0});let t=u.current;if(N&&!v&&e.button!==1){let t=_e({x:e.clientX,y:e.clientY});(e.button===0||t)&&ge(t)}(v||e.button===1)&&t&&(e.currentTarget.setPointerCapture(e.pointerId),b.current={x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop},_(`grabbing`))},Ce=()=>{b.current&&(b.current=void 0,_(v?`grab`:`default`))};return n({hold:async()=>(de.current=await o[`files/read`]({path:e.entry}).then(e=>e.text,()=>``),{key:`${e.entry}@${String(e.data.revision)}`,what:`The image ${e.entry}, its boards side by side${e.data.versions.length>1?`, a version a row`:``}`,source:{path:e.entry}}),locate:t=>{let n=d(t)[0],r=n?me(n):void 0;if(!n||!r)return Promise.resolve({elements:[]});let i=At(r.b.version.lang,`en`),a=e=>`${String(Math.round(Math.min(1,Math.max(0,e))*100))}%`,o=a((n.x-r.r.x)/r.r.width),s=a((n.y-r.r.y)/r.r.height);return Promise.resolve({elements:ot(r.b,{x:r.r.x,y:r.r.y,zoom:r.r.width/r.b.width},t,{file:e.entry,lineOf:e=>dt(de.current,e)}),where:`on board ${r.b.key}${i===void 0||e.data.versions.length<2?``:` (${i})`}, at ${o} across and ${s} down it`})},pick:e=>{let t=me(e),n=t?lt(t.b,I(t.r,t.b),e):void 0,r=t&&n?ut(t.b,I(t.r,t.b),n,ye):void 0;return Promise.resolve(t&&r?{...r,where:xe(t.b)}:void 0)},selected:()=>{let e=l.find(e=>Z(e.version.key,e.key)===F?.id),t=e?.layers.find(e=>e.key===F?.layer),n=e?ce(e.version.key,e.key):void 0,r=e&&t&&n?ut(e,I(n,e),t,ye):void 0;return Promise.resolve(e&&r?[{...r,where:xe(e)}]:[])}}),(0,L.jsxs)(`div`,{className:`relative flex size-full min-h-0 flex-col`,"data-testid":`image-viewer`,children:[(0,L.jsx)(Pt,{bar:e.bar,tools:{zoom:w,onZoom:M}}),(0,L.jsxs)(se,{children:[(0,L.jsx)(re,{asChild:!0,children:(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,L.jsx)(kt,{ref:u,rows:c,layout:T,zoom:w,cursor:v&&g==="default"?`grab`:g,frame:te.frame,agent:A,hovered:ve(P,F)?void 0:P,selected:F,selectionBar:(0,L.jsx)(ie,{}),onPointerLeave:()=>{he(void 0)},onPointerDown:Se,onPointerMove:e=>{let t=b.current,n=u.current;if(t&&e.buttons===0){Ce();return}if(t&&n){n.scrollLeft=t.left-(e.clientX-t.x),n.scrollTop=t.top-(e.clientY-t.y);return}if(!N)return;let r=v||e.buttons!==0?void 0:_e({x:e.clientX,y:e.clientY});ve(r,P)||he(r)},onPointerUp:Ce,onKeyDown:e=>{if(Nt(e.target))return;let t=e.metaKey||e.ctrlKey,n=e.key===`Escape`&&F?()=>{ge(void 0)}:e.key===` `?()=>{e.repeat||y(!0),_(`grab`)}:e.shiftKey&&e.code===`Digit1`?()=>{M(`fit`)}:e.shiftKey&&e.code===`Digit0`?()=>{M(1)}:t&&(e.key===`=`||e.key===`+`)?()=>{M(`in`)}:t&&e.key===`-`?()=>{M(`out`)}:void 0;n&&(e.preventDefault(),n())},onKeyUp:e=>{e.key===` `&&(y(!1),_(`default`))},onZoomAt:(e,t)=>{ne(w*e,t)},label:r.boards})})}),(0,L.jsxs)(fe,{className:`w-60`,"data-testid":`image-menu`,children:[(0,L.jsxs)(oe,{onSelect:()=>{M(`fit`)},children:[r.zoomFit,(0,L.jsx)(ue,{children:`⇧1`})]}),(0,L.jsx)(le,{})]})]})]})}var It=e=>typeof e==`object`&&!!e&&typeof e.board==`string`;function Lt(){let e=be(),t=a(),n=tt(t?.item.id);if(n.piece===void 0||t===void 0)return(0,L.jsx)(`div`,{className:`text-lead flex size-full items-center justify-center text-sm`,"data-testid":`image-editor`,"data-state":n.error===void 0?`loading`:`error`,children:n.error===void 0?e.loading:e.couldNotDraw(n.error)});let r=It(t.place)?t.place:void 0;return(0,L.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col`,"data-testid":`image-editor`,"data-state":`ready`,children:[(0,L.jsx)(Ft,{entry:t.item.entry,data:n,board:r?.board,bar:t=>(0,L.jsx)(M,{start:(0,L.jsx)(de,{testid:`image-bar`,"aria-label":e.zoom,children:(0,L.jsx)(Se,{...t})}),exports:{versions:n.versions.map(e=>({key:e.key,label:e.lang??e.key})),facts:e.boardCount(n.drawn.values().next().value?.boards.length??0)}})}),n.drawn.size>0&&[...n.drawn.values()].every(e=>e.boards.length===0)?(0,L.jsx)(`p`,{className:`text-lead p-6 text-sm`,children:e.noBoards}):null]})}export{Lt as ImageEditor,Lt as default,ye as WORDS};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./rolldown-runtime-COiEfhsA.js";import{a as r,d as i,f as a,o,s,v as c}from"./react-Bk7NnOLX.js";import{Et as l,Ot as u,Tt as d,gt as f,yt as p}from"./button-BVQH7zxz.js";import{T as m}from"./snapshots-CTS2iez5.js";import{t as h}from"./session-CUCSWPTE.js";import{t as g}from"./jsx-runtime-DePvh3-m.js";import{t as _}from"./createLucideIcon-REX213UO.js";import{t as v}from"./audio-lines-1s1eRs4Q.js";import{D as ee,_ as te,b as ne,c as re,d as ie,f as ae,i as oe,l as se,o as ce,p as le,u as ue,v as y,w as de,x as b}from"./dist-DWKEqAou.js";import{t as fe}from"./file-exclamation-point-C_fX4fpI.js";import{t as x}from"./group-pebHQTdP.js";import{c as pe,i as S,l as me,n as he,o as ge,r as _e,t as ve}from"./syntax-DSsHrzWF.js";import{t as ye}from"./minus-D1tgAHbU.js";import{n as be,t as xe}from"./undo-2-DUGGyBdX.js";import{t as Se}from"./sticky-note-C5qUDHhC.js";import{n as Ce,t as C}from"./swatch-S8YuBYyj.js";import{K as we,Q as Te,_t as w,f as Ee,nt as De,rt as T,t as E,tt as D}from"./index-CglHrLRS.js";import{c as Oe,l as ke,n as Ae,o as je,r as Me,t as Ne}from"./dist-D2a_y4AE.js";import{t as Pe}from"./collaborator-2qfw-8OJ.js";import{t as O}from"./row-dgHEAE7h.js";import{A as k,F as A,L as Fe,M as Ie,R as j,S as Le,_ as Re,a as ze,b as M,g as Be,h as Ve,i as He,j as Ue,m as We,n as Ge,p as Ke,r as qe,t as Je,v as Ye,x as Xe,y as Ze,z as Qe}from"./syntax-C0iPON60.js";var $e={".html":`text/html; charset=utf-8`,".js":`text/javascript; charset=utf-8`,".mjs":`text/javascript; charset=utf-8`,".css":`text/css; charset=utf-8`,".json":`application/json; charset=utf-8`,".txt":`text/plain; charset=utf-8`,".md":`text/plain; charset=utf-8`,".mdx":`text/plain; charset=utf-8`,".csv":`text/plain; charset=utf-8`,".yaml":`text/plain; charset=utf-8`,".svg":`image/svg+xml`,".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".webp":`image/webp`,".gif":`image/gif`,".avif":`image/avif`,".woff2":`font/woff2`,".woff":`font/woff`,".ttf":`font/ttf`,".otf":`font/otf`,".mp3":`audio/mpeg`,".wav":`audio/wav`,".m4a":`audio/mp4`,".ogg":`audio/ogg`,".aac":`audio/aac`,".flac":`audio/flac`,".mp4":`video/mp4`,".webm":`video/webm`,".mov":`video/quicktime`,".pdf":`application/pdf`,".wasm":`application/wasm`,".glb":`model/gltf-binary`,".gltf":`model/gltf+json`,".bin":`application/octet-stream`,".ktx2":`image/ktx2`,".hdr":`image/vnd.radiance`,".exr":`image/x-exr`,".htm":`text/html; charset=utf-8`,".map":`application/json; charset=utf-8`,".webmanifest":`application/manifest+json`,".xml":`application/xml`,".rss":`application/rss+xml`,".atom":`application/atom+xml`,".ico":`image/x-icon`,".vtt":`text/vtt; charset=utf-8`,".zip":`application/zip`},et=e=>$e[/\.[^./]+$/u.exec(e)?.[0].toLowerCase()??``]??`application/octet-stream`,tt=_(`focus`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]),nt=_(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),rt=_(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),it=_(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),at=[`1`,`2`,`3`,`4`,`5`,`6`],ot=[`top`,`right`,`bottom`,`left`],N=[`none`,`arrow`],P={nodes:[],edges:[],top:{}},F=e=>typeof e==`object`&&!!e&&!Array.isArray(e),I=e=>typeof e==`string`?e:void 0,st=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,ct=(e,t)=>typeof t==`string`&&e.includes(t)?t:void 0;function lt(e){let t=I(e.id),n=I(e.type),r=st(e.x),i=st(e.y),a=st(e.width),o=st(e.height);if(t!==void 0&&t!==``&&n!==void 0&&r!==void 0&&i!==void 0&&a!==void 0&&o!==void 0)return{id:t,type:n,x:r,y:i,width:a,height:o,color:I(e.color),text:I(e.text),file:I(e.file),subpath:I(e.subpath),url:I(e.url),label:I(e.label),background:I(e.background),backgroundStyle:I(e.backgroundStyle),raw:e}}function ut(e){let t=I(e.id),n=I(e.fromNode),r=I(e.toNode);if(t&&n&&r)return{id:t,fromNode:n,fromSide:ct(ot,e.fromSide),fromEnd:ct(N,e.fromEnd)??`none`,toNode:r,toSide:ct(ot,e.toSide),toEnd:ct(N,e.toEnd)??`arrow`,color:I(e.color),label:I(e.label),raw:e}}var L=e=>{let t=e.id;return typeof t==`string`&&t!==``?t:void 0};function dt(e){if(e.trim()===``)return{canvas:P,problems:[],readable:!0};let t;try{t=JSON.parse(e)}catch(e){return{canvas:P,readable:!1,problems:[{at:`file`,message:`It is not JSON: ${e instanceof Error?e.message:String(e)}`}]}}if(!F(t))return{canvas:P,readable:!1,problems:[{at:`file`,message:`It is not a JSON object.`}]};let n=[],r=e=>{let r=t[e];return r===void 0?[]:Array.isArray(r)?r.flatMap((t,r)=>F(t)?[t]:(n.push({at:e===`nodes`?`node`:`edge`,index:r,message:`Its ${e} entry ${String(r)} is not an object.`}),[])):(n.push({at:e,message:`Its "${e}" is not a list.`}),[])},i=r(`nodes`),a=r(`edges`);return i.forEach((e,t)=>{if(lt(e))return;let r=L(e);n.push({at:`node`,index:t,...r===void 0?{}:{id:r},message:`Its node ${r??String(t)} is not drawn: a node has an id, a type, and x, y, width and height as numbers.`})}),a.forEach((e,t)=>{if(ut(e))return;let r=L(e);n.push({at:`edge`,index:t,...r===void 0?{}:{id:r},message:`Its edge ${r??String(t)} is not drawn: an edge has an id, a fromNode and a toNode.`})}),{canvas:{nodes:i,edges:a,top:t},problems:n,readable:!0}}var ft=e=>e.nodes.flatMap(e=>{let t=lt(e);return t?[t]:[]}),pt=e=>e.edges.flatMap(e=>{let t=ut(e);return t?[t]:[]});function mt(e){let t=e=>e.length===0?`[]`:`[\n${e.map(e=>`\t\t${JSON.stringify(e)}`).join(`,
|
|
2
|
+
`)}\n\t]`;return`{\n${[`\t"nodes":${t(e.nodes)}`,`\t"edges":${t(e.edges)}`,...Object.entries(e.top).filter(([e])=>e!==`nodes`&&e!==`edges`).map(([e,t])=>`\t${JSON.stringify(e)}:${JSON.stringify(t)}`)].join(`,
|
|
3
|
+
`)}\n}`}function ht(e,t=Math.random){let n=new Set([...e.nodes,...e.edges].flatMap(e=>L(e)??[]));for(;;){let e=``;for(let n=0;n<16;n++)e+=Math.floor(t()*16).toString(16);if(!n.has(e))return e}}var R=e=>Math.round(e);function z(e,t){let n=new Set(Object.entries(t).filter(([,e])=>e===void 0).map(([e])=>e)),r=Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);return r}var gt=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function _t(e,t,n){if(gt(t,e))return n;if(gt(n,e))return t;if(t===void 0||n===void 0)return t??n;if(e===void 0)return t;let r=[...new Set([...Object.keys(t),...Object.keys(e)])].filter(n=>!gt(t[n],e[n]));return z(n,Object.fromEntries(r.map(e=>[e,t[e]])))}function vt(e,t,n){let r=e=>{let t=new Map;for(let n of e){let e=L(n);e!==void 0&&!t.has(e)&&t.set(e,n)}return t},i=r(e),a=r(t),o=r(n),s=[],c=new Set;for(let e of n){let t=L(e);if(t===void 0){s.push(e);continue}if(c.has(t))continue;c.add(t);let n=_t(i.get(t),a.get(t),e);n&&s.push(n)}let l;for(let e of t){let t=L(e);if(t!==void 0){if(!c.has(t)){c.add(t);let n=_t(i.get(t),e,o.get(t));if(n){let e=l===void 0?-1:s.findIndex(e=>L(e)===l);s.splice(e+1,0,n)}}s.some(e=>L(e)===t)&&(l=t)}}return s}function yt(e,t,n){let r=_t(e.top,t.top,n.top)??{};return{nodes:vt(e.nodes,t.nodes,n.nodes),edges:vt(e.edges,t.edges,n.edges),top:r}}function B(e,t,n){let r=[...e];for(let e of n===`after`?t:[...t].reverse()){let t=n===`after`?e.after:e.before,i=r.findIndex(t=>L(t)===e.id);t===void 0?i>=0&&r.splice(i,1):i>=0?r[i]=t:r.splice(Math.min(e.index,r.length),0,t)}return r}function bt(e,t,n){return{...e,nodes:B(e.nodes,t.nodes,n),edges:B(e.edges,t.edges,n)}}function xt(e,t){let n=(e,t)=>{let n=[],r=new Map;e.forEach((e,t)=>{let n=L(e);n!==void 0&&r.set(n,{raw:e,index:t})});let i=new Set;t.forEach((e,t)=>{let a=L(e);if(a===void 0)return;i.add(a);let o=r.get(a);o?JSON.stringify(o.raw)!==JSON.stringify(e)&&n.push({id:a,before:o.raw,after:e,index:t}):n.push({id:a,after:e,index:t})});for(let[e,t]of r)i.has(e)||n.push({id:e,before:t.raw,index:t.index});return n};return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges)}}var St=e=>e.nodes.length===0&&e.edges.length===0;function Ct(e,t){let n=`"id":${JSON.stringify(t)}`,r=`"id": ${JSON.stringify(t)}`,i=e.split(`
|
|
4
|
+
`).findIndex(e=>e.includes(n)||e.includes(r));return i<0?void 0:i+1}function wt(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Tt=/[ \t\n\f\r]/g;function Et(e){return typeof e==`object`?e.type===`text`&&Dt(e.value):Dt(e)}function Dt(e){return e.replace(Tt,``)===``}var Ot=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ot.prototype.normal={},Ot.prototype.property={},Ot.prototype.space=void 0;function kt(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ot(n,r,t)}function At(e){return e.toLowerCase()}var V=class{constructor(e,t){this.attribute=t,this.property=e}};V.prototype.attribute=``,V.prototype.booleanish=!1,V.prototype.boolean=!1,V.prototype.commaOrSpaceSeparated=!1,V.prototype.commaSeparated=!1,V.prototype.defined=!1,V.prototype.mustUseProperty=!1,V.prototype.number=!1,V.prototype.overloadedBoolean=!1,V.prototype.property=``,V.prototype.spaceSeparated=!1,V.prototype.space=void 0;var jt=t({boolean:()=>H,booleanish:()=>U,commaOrSpaceSeparated:()=>K,commaSeparated:()=>Pt,number:()=>W,overloadedBoolean:()=>Nt,spaceSeparated:()=>G}),Mt=0,H=Ft(),U=Ft(),Nt=Ft(),W=Ft(),G=Ft(),Pt=Ft(),K=Ft();function Ft(){return 2**++Mt}var It=Object.keys(jt),Lt=class extends V{constructor(e,t,n,r){let i=-1;if(super(e,t),Rt(this,`space`,r),typeof n==`number`)for(;++i<It.length;){let e=It[i];Rt(this,It[i],(n&jt[e])===jt[e])}}};Lt.prototype.defined=!0;function Rt(e,t,n){n&&(e[t]=n)}function zt(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Lt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[At(r)]=r,n[At(a.attribute)]=r}return new Ot(t,n,e.space)}var Bt=zt({properties:{ariaActiveDescendant:null,ariaAtomic:U,ariaAutoComplete:null,ariaBusy:U,ariaChecked:U,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:U,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:U,ariaFlowTo:G,ariaGrabbed:U,ariaHasPopup:null,ariaHidden:U,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:W,ariaLive:null,ariaModal:U,ariaMultiLine:U,ariaMultiSelectable:U,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:U,ariaReadOnly:U,ariaRelevant:null,ariaRequired:U,ariaRoleDescription:G,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:U,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Vt(e,t){return t in e?e[t]:t}function Ht(e,t){return Vt(e,t.toLowerCase())}var Ut=zt({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Pt,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:H,allowPaymentRequest:H,allowUserMedia:H,alpha:H,alt:null,as:null,async:H,autoCapitalize:null,autoComplete:G,autoFocus:H,autoPlay:H,blocking:G,capture:null,charSet:null,checked:H,cite:null,className:G,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:U,controls:H,controlsList:G,coords:W|Pt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:H,defer:H,dir:null,dirName:null,disabled:H,download:Nt,draggable:U,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:H,formTarget:null,headers:G,height:W,hidden:Nt,high:W,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:H,inputMode:null,integrity:null,is:null,isMap:H,itemId:null,itemProp:G,itemRef:G,itemScope:H,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:H,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:H,muted:H,name:null,nonce:null,noModule:H,noValidate:H,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:H,optimum:W,pattern:null,ping:G,placeholder:null,playsInline:H,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:H,referrerPolicy:null,rel:G,required:H,reversed:H,rows:W,rowSpan:W,sandbox:G,scope:null,scoped:H,seamless:H,selected:H,shadowRootClonable:H,shadowRootCustomElementRegistry:H,shadowRootDelegatesFocus:H,shadowRootMode:null,shadowRootSerializable:H,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:U,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:H,useMap:null,value:U,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:H,declare:H,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:H,noHref:H,noShade:H,noWrap:H,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:U,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:H,disablePictureInPicture:H,disableRemotePlayback:H,exportParts:Pt,part:G,prefix:null,property:null,results:W,security:null,unselectable:null},space:`html`,transform:Ht}),Wt=zt({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:K,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:G,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:H,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pt,g2:Pt,glyphName:Pt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:K,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:K,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:K,rev:K,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:K,requiredFeatures:K,requiredFonts:K,requiredFormats:K,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:K,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:K,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:K,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Vt}),Gt=zt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Kt=zt({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ht}),qt=zt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Jt={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Yt=/[A-Z]/g,Xt=/-[a-z]/g,Zt=/^data[-\w.:]+$/i;function Qt(e,t){let n=At(t),r=t,i=V;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Zt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Xt,en);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Xt.test(e)){let n=e.replace(Yt,$t);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Lt}return new i(r,t)}function $t(e){return`-`+e.toLowerCase()}function en(e){return e.charAt(1).toUpperCase()}var tn=kt([Bt,Ut,Gt,Kt,qt],`html`),nn=kt([Bt,Wt,Gt,Kt,qt],`svg`);function rn(e){return e.join(` `).trim()}var an=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
5
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=ee();)t!==!1&&e.push(t);return e}function ee(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function te(){var e=p(),t=g(a);if(t){if(ee(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function ne(){var e=[];v(e);for(var t;t=te();)t!==!1&&(e.push(t),v(e));return e}return _(),ne()}function d(e){return e?e.replace(l,``):``}t.exports=u})),on=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(an());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),sn=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),cn=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(on()),i=sn();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),ln=dn(`end`),un=dn(`start`);function dn(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function fn(e){let t=un(e),n=ln(e);if(t&&n)return{start:t,end:n}}var pn=e(cn(),1),mn={}.hasOwnProperty,hn=new Map,gn=/[A-Z]/g,_n=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),vn=new Set([`td`,`th`]),yn=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function bn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=jn(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=An(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?nn:tn,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=xn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function xn(e,t,n){if(t.type===`element`)return Sn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Cn(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Tn(e,t,n);if(t.type===`mdxjsEsm`)return wn(e,t);if(t.type===`root`)return En(e,t,n);if(t.type===`text`)return Dn(e,t)}function Sn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=nn,e.schema=i),e.ancestors.push(t);let a=Ln(e,t.tagName,!1),o=Mn(e,t),s=Pn(e,t);return _n.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Et(e)})),On(e,o,a,t),kn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Cn(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Rn(e,t.position)}function wn(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rn(e,t.position)}function Tn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=nn,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ln(e,t.name,!0),o=Nn(e,t),s=Pn(e,t);return On(e,o,a,t),kn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function En(e,t,n){let r={};return kn(r,Pn(e,t)),e.create(t,e.Fragment,r,n)}function Dn(e,t){return t.value}function On(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function An(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function jn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=un(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Mn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&mn.call(t.properties,i)){let a=Fn(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&vn.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Nn(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rn(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Rn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Pn(e,t){let n=[],r=-1,i=e.passKeys?new Map:hn;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=xn(e,a,o);s!==void 0&&n.push(s)}return n}function Fn(e,t,n){let r=Qt(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wt(n):rn(n)),r.property===`style`){let t=typeof n==`object`?n:In(e,String(n));return e.stylePropertyNameCase===`css`&&(t=zn(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Jt[r.property]||r.property:r.attribute,n]}}function In(e,t){try{return(0,pn.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new S("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=yn+`#cannot-parse-style-attribute`,r}}function Ln(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ge(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ge(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return mn.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rn(e)}function Rn(e,t){let n=new S("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=yn+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function zn(e){let t={},n;for(n in e)mn.call(e,n)&&(t[Bn(n)]=e[n]);return t}function Bn(e){let t=e.replace(gn,Vn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Vn(e){return`-`+e.toLowerCase()}var Hn={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function Un(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ue(e.charCodeAt(n+1))&&Ue(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Wn(e){let t=this;t.parser=n;function n(n){return Le(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Gn(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Kn(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
+
`}]}function qn(e,t){let n=t.value?t.value+`
|
|
7
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Jn(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yn(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xn(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Un(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Zn(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qn(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $n(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function er(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $n(e,t);let i={src:Un(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function tr(e,t){let n={src:Un(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function nr(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function rr(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $n(e,t);let i={href:Un(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function ir(e,t){let n={href:Un(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ar(e,t,n){let r=e.all(t),i=n?or(n):sr(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
8
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
9
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function or(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=sr(n[r])}return t}function sr(e){return e.spread??e.children.length>1}function cr(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function lr(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ur(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dr(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fr(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=un(t.children[1]),o=ln(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function pr(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function mr(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var hr=9,gr=32;function _r(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(vr(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(vr(t.slice(i),i>0,!1)),a.join(``)}function vr(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===hr||t===gr;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===hr||t===gr;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function yr(e,t){let n={type:`text`,value:_r(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function br(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var xr={blockquote:Gn,break:Kn,code:qn,delete:Jn,emphasis:Yn,footnoteReference:Xn,heading:Zn,html:Qn,imageReference:er,image:tr,inlineCode:nr,linkReference:rr,link:ir,listItem:ar,list:cr,paragraph:lr,root:ur,strong:dr,table:fr,tableCell:mr,tableRow:pr,text:yr,thematicBreak:br,toml:Sr,yaml:Sr,definition:Sr,footnoteDefinition:Sr};function Sr(){}var{defineProperty:Cr}=Object,wr=typeof self==`object`?self:globalThis,Tr=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new wr[e](t)},Er=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Cr(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof wr[e]==`function`?Tr(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Tr(a,o),i)};return r},Dr=e=>Er(new Map,e)(0),Or=``,{toString:kr}={},{keys:Ar,is:jr}=Object,Mr=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=kr.call(e).slice(8,-1);switch(n){case`Array`:return[1,Or];case`Object`:return[2,Or];case`Date`:return[3,Or];case`RegExp`:return[4,Or];case`Map`:return[5,Or];case`Set`:return[6,Or];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Nr=([e,t])=>e===0&&(t===`function`||t===`symbol`),Pr=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Mr(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&jr(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Ar(o))(e||!Nr(Mr(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Or:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Nr(Mr(n))||Nr(Mr(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Nr(Mr(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Fr=(e,{json:t,lossy:n}={})=>{let r=[];return Pr(!(t||n),!!t,new Map,r)(e),r},Ir=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Dr(Fr(e,t)):structuredClone(e):(e,t)=>Dr(Fr(e,t));function Lr(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Rr(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function zr(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Lr,r=e.options.footnoteBackLabel||Rr,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Un(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Ir(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
10
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
11
|
+
`}]}}var Br={}.hasOwnProperty,Vr={};function Hr(e,t){let n=t||Vr,r=new Map,i=new Map,a={all:s,applyData:Wr,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...xr,...n.handlers},one:o,options:n,patch:Ur,wrap:Kr};return Ye(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Br.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Ir(n);return r.children=a.all(e),r}return Ir(e)}return(a.options.unknownHandler||Gr)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=qr(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=qr(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Ur(e,t){e.position&&(t.position=fn(e))}function Wr(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Ir(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Gr(e,t){let n=t.data||{},r=`value`in t&&!(Br.call(n,`hProperties`)||Br.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Kr(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
12
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
13
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
14
|
+
`}),n}function qr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Jr(e,t){let n=Hr(e,t),r=n.one(e,void 0),i=zr(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
15
|
+
`},i)),a}function Yr(e,t){return e&&`run`in e?async function(n,r){let i=Jr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Jr(n,{file:r,...e||t})}}function Xr(e){if(e)throw e}var Zr=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Qr(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $r(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?ei(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function ei(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var q={basename:ti,dirname:ni,extname:ri,join:ii,sep:`/`};function ti(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);si(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ni(e){if(si(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ri(e){si(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function ii(...e){let t=-1,n;for(;++t<e.length;)si(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ai(n)}function ai(e){si(e);let t=e.codePointAt(0)===47,n=oi(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function oi(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function si(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var ci={cwd:li};function li(){return`/`}function ui(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function di(e){if(typeof e==`string`)e=new URL(e);else if(!ui(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return fi(e)}function fi(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var pi=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],mi=class{constructor(e){let t;t=e?ui(e)?{path:e}:typeof e==`string`||vi(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ci.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<pi.length;){let e=pi[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)pi.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?q.basename(this.path):void 0}set basename(e){gi(e,`basename`),hi(e,`basename`),this.path=q.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?q.dirname(this.path):void 0}set dirname(e){_i(this.basename,`dirname`),this.path=q.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?q.extname(this.path):void 0}set extname(e){if(hi(e,`extname`),_i(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=q.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ui(e)&&(e=di(e)),gi(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?q.basename(this.path,this.extname):void 0}set stem(e){gi(e,`stem`),hi(e,`stem`),this.path=q.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new S(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function hi(e,t){if(e&&e.includes(q.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+q.sep+"`")}function gi(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function _i(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function vi(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var yi=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),bi=e(Zr(),1),xi={}.hasOwnProperty,Si=new class e extends yi{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$r()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,bi.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Ti(`data`,this.frozen),this.namespace[e]=t,this):xi.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ti(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Oi(e),n=this.parser||this.Parser;return Ci(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ci(`process`,this.parser||this.Parser),wi(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Oi(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Ai(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Ci(`processSync`,this.parser||this.Parser),wi(`processSync`,this.compiler||this.Compiler),this.process(e,r),Di(`processSync`,`process`,t),n;function r(e,r){t=!0,Xr(e),n=r}}run(e,t,n){Ei(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Oi(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Di(`runSync`,`run`,n),r;function i(e,t){Xr(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Oi(t),r=this.compiler||this.Compiler;return wi(`stringify`,r),Ei(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Ti(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,bi.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Qr(o)&&Qr(r)&&(r=(0,bi.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ci(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function wi(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Ti(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ei(e){if(!Qr(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Di(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Oi(e){return ki(e)?e:new mi(e)}function ki(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Ai(e){return typeof e==`string`||ji(e)}function ji(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var J=g(),Y=e(c(),1),Mi=[],Ni={allowDangerousHtml:!0},Pi=/^(https?|ircs?|mailto|xmpp)$/i,Fi=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ii(e){let t=Li(e),n=Ri(e);return zi(t.runSync(t.parse(n),n),e)}function Li(e){let t=e.rehypePlugins||Mi,n=e.remarkPlugins||Mi,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ni}:Ni;return Si().use(Wn).use(n).use(Yr,r).use(t)}function Ri(e){let t=e.children||``,n=new mi;return typeof t==`string`?n.value=t:``+t,n}function zi(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Bi;for(let e of Fi)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Ye(e,l),bn(e,{Fragment:J.Fragment,components:i,ignoreInvalidStyle:!0,jsx:J.jsx,jsxs:J.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Hn)if(Object.hasOwn(Hn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Hn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Bi(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Pi.test(e.slice(0,t))?e:``}function Vi(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Hi(e,t,n){let r=Xe((n||{}).ignore||[]),i=Ui(t),a=-1;for(;++a<i.length;)M(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return Ze}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function Ui(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Wi(e[0]),Gi(e[1])])}return t}function Wi(e){return typeof e==`string`?new RegExp(Re(e),`g`):e}function Gi(e){return typeof e==`function`?e:function(){return e}}var Ki=`phrasing`,qi=[`autolink`,`link`,`image`,`label`];function Ji(){return{transforms:[na],enter:{literalAutolink:Xi,literalAutolinkEmail:Zi,literalAutolinkHttp:Zi,literalAutolinkWww:Zi},exit:{literalAutolink:ta,literalAutolinkEmail:ea,literalAutolinkHttp:Qi,literalAutolinkWww:$i}}}function Yi(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Ki,notInConstruct:qi},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Ki,notInConstruct:qi},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Ki,notInConstruct:qi}]}}function Xi(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Zi(e){this.config.enter.autolinkProtocol.call(this,e)}function Qi(e){this.config.exit.autolinkProtocol.call(this,e)}function $i(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function ea(e){this.config.exit.autolinkEmail.call(this,e)}function ta(e){this.exit(e)}function na(e){Hi(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ra],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ia]],{ignore:[`link`,`linkReference`]})}function ra(e,t,n,r,i){let a=``;if(!sa(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!aa(n)))return!1;let o=oa(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function ia(e,t,n,r){return!sa(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function aa(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function oa(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Vi(e,`(`),a=Vi(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function sa(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||j(n)||Fe(n))&&(!t||n!==47)}function ca(){return[Ji(),Ve(),Ke(),He(),he()]}function la(e){return{extensions:[Yi(),Be(e),We(),ze(e),_e()]}}var ua={tokenize:Sa,partial:!0},da={tokenize:Ca,partial:!0},fa={tokenize:wa,partial:!0},pa={tokenize:Ta,partial:!0},ma={tokenize:Ea,partial:!0},ha={name:`wwwAutolink`,tokenize:ba,previous:Da},ga={name:`protocolAutolink`,tokenize:xa,previous:Oa},X={name:`emailAutolink`,tokenize:ya,previous:ka},Z={};function _a(){return{text:Z}}for(var va=48;va<123;)Z[va]=X,va++,va===58?va=65:va===91&&(va=97);Z[43]=X,Z[45]=X,Z[46]=X,Z[95]=X,Z[72]=[X,ga],Z[104]=[X,ga],Z[87]=[X,ha],Z[119]=[X,ha];function ya(e,t,n){let r=this,i,a;return o;function o(t){return!Aa(t)||!ka.call(r,r.previous)||ja(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Aa(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ma,u,l)(t):t===45||t===95||Ue(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&k(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ba(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Da.call(r,r.previous)||ja(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(ua,e.attempt(da,e.attempt(fa,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function xa(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Oa.call(r,r.previous)&&!ja(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(k(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Ie(t)||A(t)||j(t)||Fe(t)?n(t):e.attempt(da,e.attempt(fa,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Sa(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Ca(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(pa,c,s)(t):t===null||A(t)||j(t)||t!==45&&Fe(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function wa(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(pa,t,a)(o):o===null||A(o)||j(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ta(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||A(o)||j(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||A(e)||j(e)?t(e):r(e)}function a(e){return k(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):k(t)?(e.consume(t),o):n(t)}}function Ea(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ue(e)?n(e):t(e)}}function Da(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||A(e)}function Oa(e){return!k(e)}function ka(e){return!(e===47||Aa(e))}function Aa(e){return e===43||e===45||e===46||e===95||Ue(e)}function ja(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Ma(e){return Qe([_a(),qe(),Ge(e),Je(),ve()])}var Na={};function Pa(e){let t=this,n=e||Na,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Ma(n)),a.push(ca()),o.push(la(n))}function Fa(){let e=o(),[t,n]=(0,Y.useState)();return(0,Y.useEffect)(()=>{let t=!0,r,i=()=>{w(e,`project/items`,{}).then(e=>{t&&n({items:e.items,revision:e.revision})},()=>void 0)};i();let a=e.on(`project/changed`,()=>{clearTimeout(r),r=setTimeout(i,300)});return()=>{t=!1,clearTimeout(r),a()}},[e]),t}function Ia(e,t){let n=t.replace(/^\.\//u,``).replace(/\/+$/u,``),r=e?.items.find(e=>e.kind!==void 0&&e.entry===n);if(r)return{type:`item`,item:r};let i=et(n);return/^(image|video|audio)\//u.test(i)?{type:`media`,path:n,mime:i}:{type:`file`,path:n}}var La=new Map;function Ra(e,t,n){let[r,i]=(0,Y.useState)(),a=`${t??``}@${String(n??-1)}`;if((0,Y.useEffect)(()=>{if(t===void 0||n===void 0)return;let r=!0,o=La.get(a);return o||(o=w(e,`items/preview`,{item:t}).then(e=>e.preview,()=>void 0),La.set(a,o)),o.then(e=>{r&&i({key:a,preview:e})}),()=>{r=!1}},[e,t,n,a]),r!==void 0)return r.preview??`none`}var za=new Map;function Ba(e,t){let[n,r]=(0,Y.useState)();return(0,Y.useEffect)(()=>{if(t===void 0)return;let n=!0,i=za.get(t);return i||(i=e[`files/url`]({path:t}).then(e=>e.url,()=>void 0),za.set(t,i)),i.then(e=>{n&&r(e)}),()=>{n=!1}},[e,t]),n}var Va=new Map;function Ha(e,t){let[n,r]=(0,Y.useState)();return(0,Y.useEffect)(()=>{if(t===void 0||t===``)return;let n=!0,i=t.lastIndexOf(`/`),a=i<0?``:t.slice(0,i),o=Va.get(a);return o||(o=e[`files/list`]({dir:a}).then(e=>new Set([...e.files.map(e=>e.path),...e.dirs]),()=>void 0),Va.set(a,o),setTimeout(()=>Va.delete(a),2e3)),o.then(e=>{n&&r(e===void 0?void 0:e.has(t))}),()=>{n=!1}},[e,t]),n}var Ua=p({en:{loading:`Opening the canvas…`,couldNotOpen:e=>`The canvas could not be opened: ${e}`,unreadable:e=>`This file is not JSON Canvas, so it is shown and not changed: ${e}`,empty:`Double-click to add a note, or drop a file here.`,undo:`Undo`,redo:`Redo`,zoom:`Zoom`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,zoomFit:`Zoom to fit`,zoomActual:`Zoom to 100%`,zoomSelection:`Zoom to selection`,history:`History`,adding:`Add to the canvas`,selected:`Selection`,note:`Note`,noteHint:`Add a note in Markdown`,file:`File`,fileHint:`Add an item or a file of the project`,link:`Link`,linkHint:`Add a link to a page`,linkPlaceholder:`https://`,linkAdd:`Add`,group:`Group`,groupHint:`Put the selection in a group`,color:`Colour`,noColor:`No colour`,colors:{1:`Red`,2:`Orange`,3:`Yellow`,4:`Green`,5:`Cyan`,6:`Purple`},find:`Find an item or a file`,items:`Items`,media:`Media`,nothingFound:`Nothing matches`,open:`Open`,openHint:`Open it in its own editor`,openLinkHint:`Open the page in the browser`,delete:`Delete`,label:`Label`,missing:e=>`${e} is not in the project`,unknownType:e=>`A “${e}” node, kept as it is`,uploadFailed:e=>`The file could not be added: ${e}`,edits:{add:`Add`,move:`Move`,resize:`Resize`,type:`Typing`,delete:`Delete`,color:`Colour`,group:`Group`,connect:`Connect`,label:`Label`}},"zh-cn":{loading:`正在打开画布…`,couldNotOpen:e=>`画布无法打开:${e}`,unreadable:e=>`此文件不是 JSON Canvas,因此只显示、不修改:${e}`,empty:`双击添加便签,或把文件拖到这里。`,undo:`撤销`,redo:`重做`,zoom:`缩放`,zoomIn:`放大`,zoomOut:`缩小`,zoomFit:`缩放到合适大小`,zoomActual:`缩放到 100%`,zoomSelection:`缩放到所选内容`,history:`历史记录`,adding:`添加到画布`,selected:`所选内容`,note:`便签`,noteHint:`添加 Markdown 便签`,file:`文件`,fileHint:`添加项目中的作品或文件`,link:`链接`,linkHint:`添加网页链接`,linkPlaceholder:`https://`,linkAdd:`添加`,group:`分组`,groupHint:`把所选内容放进一个分组`,color:`颜色`,noColor:`无颜色`,colors:{1:`红色`,2:`橙色`,3:`黄色`,4:`绿色`,5:`青色`,6:`紫色`},find:`查找作品或文件`,items:`作品`,media:`媒体`,nothingFound:`没有匹配的内容`,open:`打开`,openHint:`在它自己的编辑器中打开`,openLinkHint:`在浏览器中打开网页`,delete:`删除`,label:`标签`,missing:e=>`${e} 不在项目中`,unknownType:e=>`“${e}”节点,按原样保留`,uploadFailed:e=>`无法添加文件:${e}`,edits:{add:`添加`,move:`移动`,resize:`调整大小`,type:`输入`,delete:`删除`,color:`颜色`,group:`分组`,connect:`连接`,label:`标签`}},"zh-tw":{loading:`正在開啟畫布…`,couldNotOpen:e=>`畫布無法開啟:${e}`,unreadable:e=>`此檔案不是 JSON Canvas,因此只顯示、不修改:${e}`,empty:`按兩下新增便條,或把檔案拖到這裡。`,undo:`復原`,redo:`重做`,zoom:`縮放`,zoomIn:`放大`,zoomOut:`縮小`,zoomFit:`縮放至適當大小`,zoomActual:`縮放至 100%`,zoomSelection:`縮放至所選內容`,history:`記錄`,adding:`加入畫布`,selected:`所選內容`,note:`便條`,noteHint:`新增 Markdown 便條`,file:`檔案`,fileHint:`新增專案中的作品或檔案`,link:`連結`,linkHint:`新增網頁連結`,linkPlaceholder:`https://`,linkAdd:`新增`,group:`群組`,groupHint:`把所選內容放進一個群組`,color:`顏色`,noColor:`無顏色`,colors:{1:`紅色`,2:`橙色`,3:`黃色`,4:`綠色`,5:`青色`,6:`紫色`},find:`尋找作品或檔案`,items:`作品`,media:`媒體`,nothingFound:`沒有相符的內容`,open:`開啟`,openHint:`在它自己的編輯器中開啟`,openLinkHint:`在瀏覽器中開啟網頁`,delete:`刪除`,label:`標籤`,missing:e=>`${e} 不在專案中`,unknownType:e=>`「${e}」節點,依原樣保留`,uploadFailed:e=>`無法新增檔案:${e}`,edits:{add:`新增`,move:`移動`,resize:`調整大小`,type:`輸入`,delete:`刪除`,color:`顏色`,group:`群組`,connect:`連接`,label:`標籤`}},ja:{loading:`キャンバスを開いています…`,couldNotOpen:e=>`キャンバスを開けませんでした:${e}`,unreadable:e=>`このファイルは JSON Canvas ではないため、表示のみで変更しません:${e}`,empty:`ダブルクリックでメモを追加するか、ここにファイルをドロップします。`,undo:`取り消す`,redo:`やり直す`,zoom:`ズーム`,zoomIn:`拡大`,zoomOut:`縮小`,zoomFit:`全体を表示`,zoomActual:`100% で表示`,zoomSelection:`選択範囲にズーム`,history:`履歴`,adding:`キャンバスに追加`,selected:`選択範囲`,note:`メモ`,noteHint:`Markdown のメモを追加`,file:`ファイル`,fileHint:`プロジェクトの作品やファイルを追加`,link:`リンク`,linkHint:`ページへのリンクを追加`,linkPlaceholder:`https://`,linkAdd:`追加`,group:`グループ`,groupHint:`選択したものをグループにまとめる`,color:`色`,noColor:`色なし`,colors:{1:`赤`,2:`オレンジ`,3:`黄`,4:`緑`,5:`シアン`,6:`紫`},find:`作品やファイルを検索`,items:`作品`,media:`メディア`,nothingFound:`一致するものはありません`,open:`開く`,openHint:`専用のエディタで開く`,openLinkHint:`ページをブラウザで開く`,delete:`削除`,label:`ラベル`,missing:e=>`${e} はプロジェクトにありません`,unknownType:e=>`「${e}」ノード(そのまま保持)`,uploadFailed:e=>`ファイルを追加できませんでした:${e}`,edits:{add:`追加`,move:`移動`,resize:`サイズ変更`,type:`入力`,delete:`削除`,color:`色`,group:`グループ`,connect:`接続`,label:`ラベル`}},ko:{loading:`캔버스를 여는 중…`,couldNotOpen:e=>`캔버스를 열 수 없습니다: ${e}`,unreadable:e=>`이 파일은 JSON Canvas가 아니므로 표시만 하고 변경하지 않습니다: ${e}`,empty:`두 번 클릭해 메모를 추가하거나 여기에 파일을 놓으세요.`,undo:`실행 취소`,redo:`다시 실행`,zoom:`확대/축소`,zoomIn:`확대`,zoomOut:`축소`,zoomFit:`화면에 맞추기`,zoomActual:`100%로 확대/축소`,zoomSelection:`선택 항목으로 확대/축소`,history:`기록`,adding:`캔버스에 추가`,selected:`선택 항목`,note:`메모`,noteHint:`Markdown 메모 추가`,file:`파일`,fileHint:`프로젝트의 작업물이나 파일 추가`,link:`링크`,linkHint:`페이지 링크 추가`,linkPlaceholder:`https://`,linkAdd:`추가`,group:`그룹`,groupHint:`선택한 항목을 그룹으로 묶기`,color:`색상`,noColor:`색상 없음`,colors:{1:`빨강`,2:`주황`,3:`노랑`,4:`초록`,5:`청록`,6:`보라`},find:`작업물이나 파일 찾기`,items:`작업물`,media:`미디어`,nothingFound:`일치하는 항목이 없습니다`,open:`열기`,openHint:`전용 편집기에서 열기`,openLinkHint:`브라우저에서 페이지 열기`,delete:`삭제`,label:`레이블`,missing:e=>`${e}이(가) 프로젝트에 없습니다`,unknownType:e=>`“${e}” 노드, 그대로 유지됨`,uploadFailed:e=>`파일을 추가할 수 없습니다: ${e}`,edits:{add:`추가`,move:`이동`,resize:`크기 조정`,type:`입력`,delete:`삭제`,color:`색상`,group:`그룹`,connect:`연결`,label:`레이블`}},es:{loading:`Abriendo el lienzo…`,couldNotOpen:e=>`No se pudo abrir el lienzo: ${e}`,unreadable:e=>`Este archivo no es JSON Canvas, así que se muestra y no se cambia: ${e}`,empty:`Haz doble clic para añadir una nota, o suelta aquí un archivo.`,undo:`Deshacer`,redo:`Rehacer`,zoom:`Zoom`,zoomIn:`Acercar`,zoomOut:`Alejar`,zoomFit:`Ajustar a la vista`,zoomActual:`Zoom al 100 %`,zoomSelection:`Zoom a la selección`,history:`Historial`,adding:`Añadir al lienzo`,selected:`Selección`,note:`Nota`,noteHint:`Añadir una nota en Markdown`,file:`Archivo`,fileHint:`Añadir un elemento o un archivo del proyecto`,link:`Enlace`,linkHint:`Añadir un enlace a una página`,linkPlaceholder:`https://`,linkAdd:`Añadir`,group:`Agrupar`,groupHint:`Poner la selección en un grupo`,color:`Color`,noColor:`Sin color`,colors:{1:`Rojo`,2:`Naranja`,3:`Amarillo`,4:`Verde`,5:`Cian`,6:`Morado`},find:`Buscar un elemento o un archivo`,items:`Elementos`,media:`Multimedia`,nothingFound:`No hay coincidencias`,open:`Abrir`,openHint:`Abrirlo en su propio editor`,openLinkHint:`Abrir la página en el navegador`,delete:`Eliminar`,label:`Etiqueta`,missing:e=>`${e} no está en el proyecto`,unknownType:e=>`Un nodo «${e}», conservado tal cual`,uploadFailed:e=>`No se pudo añadir el archivo: ${e}`,edits:{add:`Añadir`,move:`Mover`,resize:`Cambiar tamaño`,type:`Escritura`,delete:`Eliminar`,color:`Color`,group:`Agrupar`,connect:`Conectar`,label:`Etiqueta`}},fr:{loading:`Ouverture du canevas…`,couldNotOpen:e=>`Le canevas n’a pas pu être ouvert : ${e}`,unreadable:e=>`Ce fichier n’est pas au format JSON Canvas : il est affiché sans être modifié. ${e}`,empty:`Double-cliquez pour ajouter une note, ou déposez un fichier ici.`,undo:`Annuler`,redo:`Rétablir`,zoom:`Zoom`,zoomIn:`Zoom avant`,zoomOut:`Zoom arrière`,zoomFit:`Ajuster à la fenêtre`,zoomActual:`Zoom à 100 %`,zoomSelection:`Zoom sur la sélection`,history:`Historique`,adding:`Ajouter au canevas`,selected:`Sélection`,note:`Note`,noteHint:`Ajouter une note en Markdown`,file:`Fichier`,fileHint:`Ajouter un élément ou un fichier du projet`,link:`Lien`,linkHint:`Ajouter un lien vers une page`,linkPlaceholder:`https://`,linkAdd:`Ajouter`,group:`Grouper`,groupHint:`Mettre la sélection dans un groupe`,color:`Couleur`,noColor:`Sans couleur`,colors:{1:`Rouge`,2:`Orange`,3:`Jaune`,4:`Vert`,5:`Cyan`,6:`Violet`},find:`Chercher un élément ou un fichier`,items:`Éléments`,media:`Médias`,nothingFound:`Aucun résultat`,open:`Ouvrir`,openHint:`L’ouvrir dans son propre éditeur`,openLinkHint:`Ouvrir la page dans le navigateur`,delete:`Supprimer`,label:`Libellé`,missing:e=>`${e} n’est pas dans le projet`,unknownType:e=>`Un nœud « ${e} », conservé tel quel`,uploadFailed:e=>`Le fichier n’a pas pu être ajouté : ${e}`,edits:{add:`Ajout`,move:`Déplacement`,resize:`Redimensionnement`,type:`Saisie`,delete:`Suppression`,color:`Couleur`,group:`Groupe`,connect:`Liaison`,label:`Libellé`}},de:{loading:`Canvas wird geöffnet …`,couldNotOpen:e=>`Das Canvas konnte nicht geöffnet werden: ${e}`,unreadable:e=>`Diese Datei ist kein JSON Canvas und wird daher nur angezeigt, nicht geändert: ${e}`,empty:`Doppelklicken, um eine Notiz hinzuzufügen, oder eine Datei hier ablegen.`,undo:`Widerrufen`,redo:`Wiederholen`,zoom:`Zoom`,zoomIn:`Vergrößern`,zoomOut:`Verkleinern`,zoomFit:`Alles zeigen`,zoomActual:`Auf 100 % zoomen`,zoomSelection:`Auf Auswahl zoomen`,history:`Verlauf`,adding:`Zum Canvas hinzufügen`,selected:`Auswahl`,note:`Notiz`,noteHint:`Eine Notiz in Markdown hinzufügen`,file:`Datei`,fileHint:`Ein Werk oder eine Datei des Projekts hinzufügen`,link:`Link`,linkHint:`Einen Link zu einer Seite hinzufügen`,linkPlaceholder:`https://`,linkAdd:`Hinzufügen`,group:`Gruppieren`,groupHint:`Die Auswahl in eine Gruppe legen`,color:`Farbe`,noColor:`Keine Farbe`,colors:{1:`Rot`,2:`Orange`,3:`Gelb`,4:`Grün`,5:`Cyan`,6:`Lila`},find:`Ein Werk oder eine Datei suchen`,items:`Werke`,media:`Medien`,nothingFound:`Keine Treffer`,open:`Öffnen`,openHint:`Im eigenen Editor öffnen`,openLinkHint:`Seite im Browser öffnen`,delete:`Löschen`,label:`Beschriftung`,missing:e=>`${e} ist nicht im Projekt`,unknownType:e=>`Ein „${e}“-Knoten, unverändert behalten`,uploadFailed:e=>`Die Datei konnte nicht hinzugefügt werden: ${e}`,edits:{add:`Hinzufügen`,move:`Verschieben`,resize:`Größe ändern`,type:`Eingabe`,delete:`Löschen`,color:`Farbe`,group:`Gruppieren`,connect:`Verbinden`,label:`Beschriftung`}},pt:{loading:`Abrindo a tela…`,couldNotOpen:e=>`Não foi possível abrir a tela: ${e}`,unreadable:e=>`Este arquivo não é JSON Canvas, por isso é mostrado e não alterado: ${e}`,empty:`Clique duas vezes para adicionar uma nota, ou solte um arquivo aqui.`,undo:`Desfazer`,redo:`Refazer`,zoom:`Zoom`,zoomIn:`Ampliar`,zoomOut:`Reduzir`,zoomFit:`Ajustar à tela`,zoomActual:`Zoom em 100%`,zoomSelection:`Zoom na seleção`,history:`Histórico`,adding:`Adicionar à tela`,selected:`Seleção`,note:`Nota`,noteHint:`Adicionar uma nota em Markdown`,file:`Arquivo`,fileHint:`Adicionar um item ou um arquivo do projeto`,link:`Link`,linkHint:`Adicionar um link para uma página`,linkPlaceholder:`https://`,linkAdd:`Adicionar`,group:`Agrupar`,groupHint:`Colocar a seleção em um grupo`,color:`Cor`,noColor:`Sem cor`,colors:{1:`Vermelho`,2:`Laranja`,3:`Amarelo`,4:`Verde`,5:`Ciano`,6:`Roxo`},find:`Procurar um item ou um arquivo`,items:`Itens`,media:`Mídia`,nothingFound:`Nada corresponde`,open:`Abrir`,openHint:`Abrir no seu próprio editor`,openLinkHint:`Abrir a página no navegador`,delete:`Excluir`,label:`Rótulo`,missing:e=>`${e} não está no projeto`,unknownType:e=>`Um nó “${e}”, mantido como está`,uploadFailed:e=>`Não foi possível adicionar o arquivo: ${e}`,edits:{add:`Adicionar`,move:`Mover`,resize:`Redimensionar`,type:`Digitação`,delete:`Excluir`,color:`Cor`,group:`Agrupar`,connect:`Conectar`,label:`Rótulo`}}});function Wa(){return Ua.of(s()?.locale)}var Ga={1:`#cf5f5a`,2:`#d98a45`,3:`#c9a63a`,4:`#579f67`,5:`#459fb2`,6:`#8f78bd`},Ka=e=>e===void 0?void 0:Ga[e]??(/^#[0-9a-f]{3,8}$/iu.test(e)?e:void 0);function qa({target:e,className:t}){return e.type===`item`?(0,J.jsx)(we,{name:e.item.kindInfo?.icon,className:t}):e.type===`media`?e.mime.startsWith(`audio/`)?(0,J.jsx)(v,{className:t,"aria-hidden":!0}):(0,J.jsx)(D,{className:t,"aria-hidden":!0}):(0,J.jsx)(T,{className:t,"aria-hidden":!0})}var Ja=e=>e.slice(e.lastIndexOf(`/`)+1);function Ya(e){return e.type===`item`?e.item.title??Ja(e.item.id):Ja(e.path)}function Xa({text:e}){return(0,J.jsx)(`div`,{className:`text-ink size-full overflow-hidden px-4 py-3 text-base leading-relaxed [&_a]:text-pencil-text [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_code]:font-mono [&_code]:text-sm [&_h1]:mb-2 [&_h1]:text-2xl [&_h1]:font-semibold [&_h2]:mb-2 [&_h2]:text-xl [&_h2]:font-semibold [&_h3]:mb-1 [&_h3]:font-semibold [&_li]:mb-0.5 [&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p]:mb-2 [&_strong]:font-semibold [&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-5`,"data-testid":`canvas-text`,children:(0,J.jsx)(Ii,{remarkPlugins:[Pa],children:e})})}function Za({preview:e}){switch(e.type){case`picture`:return(0,J.jsx)(`img`,{src:`data:${e.image.mime};base64,${e.image.data}`,alt:``,draggable:!1,className:`pointer-events-none size-full object-contain select-none`,"data-testid":`canvas-preview-picture`});case`text`:return(0,J.jsx)(`div`,{className:`text-ink size-full overflow-hidden px-5 py-4 text-base leading-relaxed`,"data-testid":`canvas-preview-text`,children:e.lines.map((e,t)=>(0,J.jsx)(`p`,{className:t===0?`mb-2 font-semibold`:`mb-1`,children:e},t))});case`table`:return(0,J.jsx)(`div`,{className:`size-full overflow-hidden p-2 text-xs`,"data-testid":`canvas-preview-table`,children:(0,J.jsxs)(`table`,{className:`w-full border-collapse`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsx)(`tr`,{children:e.columns.map((e,t)=>(0,J.jsx)(`th`,{className:`border-rule truncate border px-1 text-left font-semibold`,children:e},t))})}),(0,J.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,J.jsx)(`tr`,{children:e.map((e,t)=>(0,J.jsx)(`td`,{className:`border-rule truncate border px-1`,children:e},t))},t))})]})})}}function Qa({icon:e,words:t,className:n}){return(0,J.jsxs)(`div`,{className:f(`text-lead flex size-full flex-col items-center justify-center gap-2 p-3 text-center text-xs [&_svg]:size-6`,n),children:[e,(0,J.jsx)(`span`,{className:`max-w-full truncate`,children:t})]})}function $a({target:e,project:t}){let n=Ra(o(),e.item.id,t?.revision);return n===void 0||n===`none`?(0,J.jsx)(Qa,{icon:(0,J.jsx)(qa,{target:e}),words:e.item.id}):(0,J.jsxs)(`div`,{className:`relative size-full`,children:[(0,J.jsx)(Za,{preview:n}),n.type===`picture`&&n.duration!==void 0?(0,J.jsx)(`span`,{className:`bg-ink/70 text-paper absolute right-2 bottom-2 rounded-xs px-1 text-xs tabular-nums`,children:`${String(Math.floor(n.duration/60))}:${String(Math.round(n.duration%60)).padStart(2,`0`)}`}):null]})}function eo({target:e,active:t}){let n=Ba(o(),e.path),r=a(e.mime),i=(0,J.jsx)(Qa,{icon:(0,J.jsx)(qa,{target:e}),words:e.path});return!r||n===void 0?i:(0,J.jsx)(Y.Suspense,{fallback:i,children:(0,J.jsx)(r,{url:n,path:e.path,type:e.mime,active:t})})}function to({node:e,project:t,active:n}){let r=Wa(),i=o(),a=e.file??``,s=Ia(t,a),c=Ha(i,s.type===`item`?void 0:s.path);return s.type===`item`?(0,J.jsx)($a,{target:s,project:t}):c===!1||a===``?(0,J.jsx)(Qa,{icon:(0,J.jsx)(fe,{"aria-hidden":!0}),words:r.missing(a),className:`text-problem-text`}):s.type===`media`?(0,J.jsx)(eo,{target:s,active:n}):(0,J.jsx)(Qa,{icon:(0,J.jsx)(T,{"aria-hidden":!0}),words:a})}function no({node:e,project:t}){let n=s()?.locale??`en`,r=Ia(t,e.file??``),i=r.type===`item`&&r.item.kindInfo?m(r.item.kindInfo,n):void 0;return(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,title:e.file,children:[(0,J.jsx)(qa,{target:r,className:`size-3.5 flex-none`}),(0,J.jsx)(`span`,{className:`truncate`,children:Ya(r)}),i===void 0?null:(0,J.jsx)(`span`,{className:`text-lead-soft flex-none`,children:i})]})}function ro({url:e}){let t=e,n=``;try{let r=new URL(e);t=r.host,n=`${r.pathname===`/`?``:r.pathname}${r.search}`}catch{}return(0,J.jsxs)(`div`,{className:`flex size-full flex-col justify-center gap-1 overflow-hidden px-4 py-3`,"data-testid":`canvas-link`,children:[(0,J.jsxs)(`span`,{className:`text-ink flex min-w-0 items-center gap-2 font-semibold`,children:[(0,J.jsx)(De,{className:`text-lead size-4 flex-none`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`truncate`,children:t})]}),n===``?null:(0,J.jsx)(`span`,{className:`text-lead truncate text-xs`,children:n})]})}function io({type:e}){let t=Wa();return(0,J.jsx)(Qa,{icon:(0,J.jsx)(T,{"aria-hidden":!0}),words:t.unknownType(e)})}var ao=typeof navigator<`u`&&navigator.userAgent.includes(`Mac`)?`⌘`:`Ctrl+`,Q=(e,t)=>t===void 0?e:`${e} (${t})`,oo=`application/x-allyhub-canvas-note`,so=`bg-sheet border-rule shadow-overlay pointer-events-auto flex items-center gap-0.5 rounded-lg border p-1`,co=/\.(?:png|jpe?g|webp|avif|gif|svg|mp4|webm|mov|mp3|wav|m4a|ogg|aac|flac)$/iu;async function lo(e,t,n=3){let r=await e(t).catch(()=>({files:[],dirs:[]})),i=r.files.map(e=>e.path).filter(e=>co.test(e));if(n===0)return i;let a=await Promise.all(r.dirs.filter(e=>!e.split(`/`).some(e=>e.startsWith(`.`)||e===`node_modules`)).map(t=>lo(e,t,n-1)));return[...i,...a.flat()]}function uo(e){let t=Wa(),n=o(),r=s()?.locale??`en`,[i,a]=(0,Y.useState)(``),[c,l]=(0,Y.useState)([]);(0,Y.useEffect)(()=>{let e=!0;return lo(e=>n[`files/list`]({dir:e}),``).then(t=>{e&&l([...new Set(t)].sort())}),()=>{e=!1}},[n]);let u=i.trim().toLowerCase(),d=(0,Y.useMemo)(()=>(e.project?.items??[]).filter(t=>t.entry!==e.self&&(u===``||t.id.toLowerCase().includes(u)||(t.title??``).toLowerCase().includes(u))),[e.project,e.self,u]),f=c.filter(e=>u===``||e.toLowerCase().includes(u));return(0,J.jsxs)(`div`,{className:`flex w-80 flex-col gap-2`,"data-testid":`canvas-picker`,children:[(0,J.jsx)(Ee,{autoFocus:!0,value:i,placeholder:t.find,"aria-label":t.find,onChange:e=>{a(e.target.value)}}),(0,J.jsxs)(`div`,{className:`flex h-80 flex-col overflow-y-auto`,children:[d.length>0&&(0,J.jsx)(`p`,{className:`text-lead px-2 pt-1 text-xs font-semibold`,children:t.items}),d.map(t=>(0,J.jsx)(O,{size:`dense`,"data-testid":`canvas-pick`,"data-path":t.entry,onClick:()=>{e.onPick(t.entry)},meta:t.kindInfo?(0,J.jsx)(`span`,{className:`text-lead-soft text-xs`,children:m(t.kindInfo,r)}):void 0,children:t.title??t.id},t.id)),f.length>0&&(0,J.jsx)(`p`,{className:`text-lead px-2 pt-2 text-xs font-semibold`,children:t.media}),f.map(t=>(0,J.jsx)(O,{size:`dense`,"data-testid":`canvas-pick`,"data-path":t,onClick:()=>{e.onPick(t)},children:t},t)),d.length===0&&f.length===0&&(0,J.jsx)(`p`,{className:`text-lead px-2 py-1 text-xs`,children:t.nothingFound})]})]})}function fo(e){let t=Wa(),[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(``),c=()=>{let t=o.trim();t!==``&&(a(!1),s(``),e.onLink(/^[a-z][a-z0-9+.-]*:/iu.test(t)?t:`https://${t}`))};return(0,J.jsxs)(`div`,{role:`toolbar`,"aria-label":t.adding,"data-testid":`canvas-add-bar`,className:f(so,`absolute bottom-3 left-1/2 -translate-x-1/2`),children:[(0,J.jsx)(E,{icon:!0,draggable:!0,"aria-label":t.note,title:t.noteHint,"data-testid":`canvas-add-note`,onClick:e.onNote,onDragStart:e=>{e.dataTransfer.setData(oo,`text`),e.dataTransfer.effectAllowed=`copy`},children:(0,J.jsx)(Se,{})}),(0,J.jsxs)(y,{open:n,onOpenChange:r,children:[(0,J.jsx)(b,{asChild:!0,children:(0,J.jsx)(E,{icon:!0,"aria-label":t.file,title:t.fileHint,"data-testid":`canvas-add-file`,children:(0,J.jsx)(rt,{})})}),(0,J.jsx)(ne,{side:`top`,align:`center`,className:`w-auto p-2`,children:(0,J.jsx)(uo,{project:e.project,self:e.self,onPick:t=>{r(!1),e.onFile(t)}})})]}),(0,J.jsxs)(y,{open:i,onOpenChange:a,children:[(0,J.jsx)(b,{asChild:!0,children:(0,J.jsx)(E,{icon:!0,"aria-label":t.link,title:t.linkHint,"data-testid":`canvas-add-link`,children:(0,J.jsx)(me,{})})}),(0,J.jsxs)(ne,{side:`top`,align:`center`,className:`flex w-80 gap-2 p-2`,children:[(0,J.jsx)(Ee,{autoFocus:!0,value:o,placeholder:t.linkPlaceholder,"aria-label":t.link,"data-testid":`canvas-link-url`,onChange:e=>{s(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&c()}}),(0,J.jsx)(E,{"data-testid":`canvas-link-add`,disabled:o.trim()===``,onClick:c,children:t.linkAdd})]})]}),(0,J.jsx)(E,{icon:!0,"aria-label":t.group,title:Q(t.groupHint,`${ao}G`),disabled:!e.groupable,"data-testid":`canvas-group`,onClick:e.onGroup,children:(0,J.jsx)(x,{})})]})}function po(e){let t=Wa();return(0,J.jsxs)(`div`,{className:f(so,`absolute top-3 right-3 flex-col`),"data-testid":`canvas-view-controls`,children:[(0,J.jsxs)(`div`,{role:`toolbar`,"aria-label":t.zoom,"aria-orientation":`vertical`,className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(E,{icon:!0,"aria-label":t.zoomIn,title:Q(t.zoomIn,`${ao}+`),"data-testid":`canvas-zoom-in`,onClick:()=>{e.onZoom(`in`)},children:(0,J.jsx)(Te,{})}),(0,J.jsx)(E,{icon:!0,"aria-label":t.zoomOut,title:Q(t.zoomOut,`${ao}−`),"data-testid":`canvas-zoom-out`,onClick:()=>{e.onZoom(`out`)},children:(0,J.jsx)(ye,{})}),(0,J.jsx)(E,{icon:!0,"aria-label":t.zoomFit,title:Q(t.zoomFit,`⇧1`),"data-testid":`canvas-zoom-fit`,onClick:()=>{e.onZoom(`fit`)},children:(0,J.jsx)(nt,{})}),(0,J.jsx)(E,{icon:!0,"aria-label":t.zoomActual,title:Q(t.zoomActual,`⇧0`),"data-testid":`canvas-zoom-actual`,className:`text-[11px] tabular-nums`,onClick:()=>{e.onZoom(`actual`)},children:`1:1`})]}),e.history?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`bg-rule my-0.5 h-px w-5`,"aria-hidden":!0}),(0,J.jsxs)(`div`,{role:`toolbar`,"aria-label":t.history,"aria-orientation":`vertical`,className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(E,{icon:!0,"aria-label":t.undo,title:Q(t.undo,`${ao}Z`),"data-testid":`canvas-undo`,disabled:!e.history.canUndo,onClick:e.history.onUndo,children:(0,J.jsx)(xe,{})}),(0,J.jsx)(E,{icon:!0,"aria-label":t.redo,title:Q(t.redo,`⇧${ao}Z`),"data-testid":`canvas-redo`,disabled:!e.history.canRedo,onClick:e.history.onRedo,children:(0,J.jsx)(be,{})})]})]}):null]})}var mo=8,ho=20,go=8;function _o(e){let t=Wa(),n=e.markUp,r=(0,Y.useRef)(null),[i,a]=(0,Y.useState)({width:0,height:0});(0,Y.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{a({width:e.offsetWidth,height:e.offsetHeight})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let o=e.box.left+e.box.width/2,s=Math.min(Math.max(go,o-i.width/2),Math.max(go,e.view.width-go-i.width)),c=e.box.top-Math.max(e.above,ho)-mo-i.height,l=e.box.top+e.box.height+mo,u=c>=go?c:l+i.height<=e.view.height-go?l:go,d=e.color===void 0?void 0:Ga[e.color];return(0,J.jsxs)(`div`,{ref:r,role:`toolbar`,"aria-label":t.selected,"data-testid":`canvas-selection-bar`,"data-note-chrome":``,className:f(so,`absolute`),style:{left:s,top:u,...i.width===0?{opacity:0,pointerEvents:`none`}:{}},children:[e.onColor?(0,J.jsxs)(y,{children:[(0,J.jsx)(b,{asChild:!0,children:(0,J.jsx)(E,{icon:!0,"aria-label":t.color,title:t.color,"data-testid":`canvas-color`,children:(0,J.jsx)(pe,{style:d?{color:d}:void 0})})}),(0,J.jsxs)(ne,{side:`top`,align:`center`,className:`flex w-auto items-center gap-2 p-2`,role:`radiogroup`,"aria-label":t.color,children:[(0,J.jsx)(C,{color:`linear-gradient(135deg, transparent 45%, var(--color-lead) 45%, var(--color-lead) 55%, transparent 55%)`,label:t.noColor,checked:e.color===void 0,"data-testid":`canvas-color-none`,onClick:()=>{e.onColor?.(void 0)}}),at.map(n=>(0,J.jsx)(C,{color:Ga[n]??``,label:t.colors[n],checked:e.color===n,"data-testid":`canvas-color-${n}`,onClick:()=>{e.onColor?.(n)}},n))]})]}):null,e.onDelete?(0,J.jsx)(E,{icon:!0,"aria-label":t.delete,title:Q(t.delete,`⌫`),"data-testid":`canvas-delete`,onClick:e.onDelete,children:(0,J.jsx)(Ce,{})}):null,e.open?(0,J.jsx)(E,{icon:!0,"aria-label":t.open,title:e.open.link?t.openLinkHint:t.openHint,"data-testid":`canvas-open`,onClick:e.open.run,children:(0,J.jsx)(it,{})}):null,(0,J.jsx)(E,{icon:!0,"aria-label":t.zoomSelection,title:Q(t.zoomSelection,`⇧2`),"data-testid":`canvas-zoom-selection`,onClick:e.onZoomTo,children:(0,J.jsx)(tt,{})}),n?(0,J.jsxs)(E,{title:n.hint,"data-testid":`mark-up-selected`,className:`text-ink`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();n.begin({x:t.x,y:t.y,width:t.width,height:t.height},!0)},children:[(0,J.jsx)(ee,{"aria-hidden":!0}),n.label]}):null]})}function vo(e,t){let n=e.split(`
|
|
16
|
+
`)[t-1]?.trim().replace(/,$/u,``);if(n?.startsWith(`{`)===!0)try{let e=JSON.parse(n);return typeof e.fromNode==`string`?e.fromNode:typeof e.id==`string`?e.id:void 0}catch{return}}function yo(e){let t=e.nodes.find(e=>e.after!==void 0)??e.nodes[0];if(t)return t.id;let n=e.edges[0],r=n?.after??n?.before;return typeof r?.fromNode==`string`?r.fromNode:void 0}var bo=class e{path;session;canvas;unreadable;revision=0;landed;snapshot;listeners=new Set;amending;stops=[];constructor(e,t){this.path=e,this.session=t;let n=dt(t.text);this.canvas=n.readable?n.canvas:P,this.unreadable=n.readable?void 0:n.problems.map(e=>e.message).join(` `),this.snapshot=this.make(),t.attach({save:e=>{if(this.unreadable!==void 0)return;let t=mt(this.canvas);return t===e?void 0:t},take:(e,t,n)=>{let r=dt(e);if(!r.readable)this.canvas=P,this.unreadable=r.problems.map(e=>e.message).join(` `);else{let e=dt(t),i=n?.kind===`agent`&&e.readable?yo(xt(e.canvas,r.canvas)):void 0;i!==void 0&&(this.landed={id:i,at:Date.now()}),this.canvas=this.unreadable!==void 0||!e.readable?r.canvas:yt(e.canvas,this.canvas,r.canvas),this.unreadable=void 0}this.emit()}}),this.stops.push(t.onState(()=>{this.emit()}),t.onUndo(()=>{this.emit()}))}static async open(t,n){return new e(n,await h.open(t,n))}make(){return{canvas:this.canvas,state:this.session.state,canUndo:this.session.canUndo,canRedo:this.session.canRedo,unreadable:this.unreadable,revision:this.revision,landed:this.landed}}emit(){this.revision+=1,this.snapshot=this.make();for(let e of this.listeners)e()}get(){return this.snapshot}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get text(){return this.session.text}edit(e,t,n){if(this.unreadable!==void 0)return;let r=this.canvas,i=t(r);if(i===r)return;if(n!==void 0&&this.amending?.key===n&&this.session.canUndo){this.session.undo(),this.canvas=i,this.push(this.amending.label,xt(this.amending.from,i));return}let a=xt(r,i);St(a)||(this.canvas=i,this.amending=n===void 0?void 0:{key:n,from:r,label:e},this.push(e,a))}settle(){this.amending=void 0}push(e,t){this.session.pushEdit({label:e,undo:()=>{this.canvas=bt(this.canvas,t,`before`),this.emit()},redo:()=>{this.canvas=bt(this.canvas,t,`after`),this.emit()}}),this.emit()}undo(){this.amending=void 0,this.session.undo()}redo(){this.amending=void 0,this.session.redo()}flush(){return this.session.flush()}async close(){for(let e of this.stops.splice(0))e();await this.session.close()}},xo=.1,So=e=>Math.min(4,Math.max(xo,e)),Co=(e,t)=>({x:(t.x-e.x)*e.zoom,y:(t.y-e.y)*e.zoom}),wo=(e,t)=>({x:t.x/e.zoom+e.x,y:t.y/e.zoom+e.y});function To(e,t,n){let r=So(n),i=wo(e,t);return{x:i.x-t.x/r,y:i.y-t.y/r,zoom:r}}var $=e=>({left:e.x,top:e.y,width:e.width,height:e.height});function Eo(e,t,n=48){if(e.length===0||t.width<=0||t.height<=0)return{x:-t.width/2,y:-t.height/2,zoom:1};let r=Math.min(...e.map(e=>e.left)),i=Math.min(...e.map(e=>e.top)),a=Math.max(...e.map(e=>e.left+e.width)),o=Math.max(...e.map(e=>e.top+e.height)),s=So(Math.min((t.width-2*n)/Math.max(1,a-r),(t.height-2*n)/Math.max(1,o-i),1));return{x:(r+a)/2-t.width/2/s,y:(i+o)/2-t.height/2/s,zoom:s}}function Do(e,t){switch(t){case`top`:return{x:e.left+e.width/2,y:e.top};case`bottom`:return{x:e.left+e.width/2,y:e.top+e.height};case`left`:return{x:e.left,y:e.top+e.height/2};case`right`:return{x:e.left+e.width,y:e.top+e.height/2}}}function Oo(e,t){let n=[[`top`,Math.abs(t.y-e.top)],[`bottom`,Math.abs(t.y-(e.top+e.height))],[`left`,Math.abs(t.x-e.left)],[`right`,Math.abs(t.x-(e.left+e.width))]];return n.sort((e,t)=>e[1]-t[1]),n[0]?.[0]??`right`}function ko(e,t){let n=t.left+t.width/2-(e.left+e.width/2),r=t.top+t.height/2-(e.top+e.height/2);return Math.abs(n)*e.height>=Math.abs(r)*e.width?n>=0?`right`:`left`:r>=0?`bottom`:`top`}var Ao={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function jo(e,t,n,r){let i=Math.max(40,Math.hypot(n.x-e.x,n.y-e.y)/3),a=Ao[t],o={x:e.x+a.x*i,y:e.y+a.y*i},s=r?Ao[r]:{x:0,y:0},c={x:n.x+s.x*i,y:n.y+s.y*i},l=t=>{let r=1-t;return{x:r*r*r*e.x+3*r*r*t*o.x+3*r*t*t*c.x+t*t*t*n.x,y:r*r*r*e.y+3*r*r*t*o.y+3*r*t*t*c.y+t*t*t*n.y}},u=e=>String(Math.round(e*10)/10),d=r?{x:-s.x,y:-s.y}:(()=>{let e=l(.95),t=Math.hypot(n.x-e.x,n.y-e.y)||1;return{x:(n.x-e.x)/t,y:(n.y-e.y)/t}})();return{d:`M ${u(e.x)} ${u(e.y)} C ${u(o.x)} ${u(o.y)} ${u(c.x)} ${u(c.y)} ${u(n.x)} ${u(n.y)}`,mid:l(.5),end:n,endDir:d}}function Mo(e,t,n){let r={x:e.x-t.x*n,y:e.y-t.y*n},i={x:-t.y*n*.5,y:t.x*n*.5};return[e,{x:r.x+i.x,y:r.y+i.y},{x:r.x-i.x,y:r.y-i.y}].map(e=>`${String(e.x)},${String(e.y)}`).join(` `)}function No(e,t){let n=e.filter(e=>t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height);return[...n].reverse().find(e=>e.type!==`group`)??n.at(-1)}function Po(e,t,n,r=48){let i=r/t.zoom,a=(e,n,r,a)=>{let o=a/t.zoom;return n+2*i>o||e-i<r?e-i:e+n+i>r+o?e+n+i-o:r},o=a(e.left,e.width,t.x,n.width),s=a(e.top,e.height,t.y,n.height);return o===t.x&&s===t.y?void 0:{...t,x:o,y:s}}function Fo(e,t,n,r,i){let a=e=>({x:n.x+(e.x-t.x)*t.zoom,y:n.y+(e.y-t.y)*t.zoom,width:e.width*t.zoom,height:e.height*t.zoom});return[...e].reverse().filter(e=>u(r,a(e))).map(e=>Io(e,i))}function Io(e,t){let n=Ct(t.text,e.id),r={path:t.file,...n===void 0?{}:{line:n}};switch(e.type){case`text`:return{name:`the note ${e.id} on the canvas`,source:r,...e.text===void 0?{}:{text:e.text}};case`file`:{let n=Ia(t.project,e.file??``),i=n.type===`item`?`the ${n.item.kindInfo?.noun??n.item.kind??`item`} ${n.item.id} (${n.item.entry})`:`the file ${n.path}`;return{name:`node ${e.id}, showing ${i}`,source:r}}case`link`:return{name:`node ${e.id}, a link to ${e.url??``}`,source:r};case`group`:return{name:`the group ${e.label===void 0?e.id:`"${e.label}"`}`,source:r};default:return{name:`node ${e.id}, of type ${e.type}`,source:r}}}function Lo(e,t,n,r){return{element:Io(e,r),outline:l({x:n.x+(e.x-t.x)*t.zoom,y:n.y+(e.y-t.y)*t.zoom,width:e.width*t.zoom,height:e.height*t.zoom})}}function Ro(e,t,n,r){let i=wo(t,{x:r.x-n.x,y:r.y-n.y}),a=[...e].reverse().find(e=>i.x>=e.x&&i.x<=e.x+e.width&&i.y>=e.y&&i.y<=e.y+e.height);return a?`on the canvas, over node ${a.id}`:`on the canvas at ${String(Math.round(i.x))}, ${String(Math.round(i.y))}`}var zo=3e4,Bo=3,Vo=6,Ho=40,Uo=24,Wo=6,Go=14,Ko=10;function qo(e,t){let n=1/Math.max(t,.5);if(e.type===`file`)return Math.max(16*n,14);if(e.type===`group`)return 20*n+4}var Jo={text:{width:260,height:140},file:{width:480,height:300},link:{width:320,height:96}},Yo=24,Xo=typeof navigator<`u`&&navigator.userAgent.includes(`Mac`),Zo=Xo?`⌘G`:`Ctrl+G`,Qo=e=>typeof e==`object`&&!!e&&typeof e.x==`number`&&typeof e.y==`number`&&typeof e.zoom==`number`&&e.zoom>0,$o={nodes:new Set,edges:new Set},es=(e,t,n)=>({...e,nodes:e.nodes.map(e=>typeof e.id==`string`&&t.has(e.id)?n(e):e)}),ts=(e,t,n)=>({...e,edges:e.edges.map(e=>typeof e.id==`string`&&t.has(e.id)?n(e):e)}),ns=e=>{let t=``,n=new Uint8Array(e);for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)};function rs({doc:e,path:t}){let n=Wa(),a=o(),c=s(),l=Fa(),u=(0,Y.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),p=c?.mode!==`edit`||u.unreadable!==void 0,m=(0,Y.useMemo)(()=>ft(u.canvas),[u.canvas]),h=(0,Y.useMemo)(()=>pt(u.canvas),[u.canvas]),g=(0,Y.useMemo)(()=>new Map(m.map(e=>[e.id,e])),[m]),_=(0,Y.useRef)(null),[v,ee]=(0,Y.useState)({width:0,height:0}),ne=Qo(c?.place)?c.place:void 0,[y,b]=(0,Y.useState)(ne),fe=(0,Y.useMemo)(()=>v.width===0?{x:0,y:0,zoom:1}:Eo(m.map($),v),[m,v]),x=y??fe,pe=(0,Y.useRef)(x);(0,Y.useEffect)(()=>{pe.current=x});let{agent:S,following:me}=r(),he=de(),ge=(()=>{if(S?.doing===void 0)return;let n=u.landed,r=n&&n.at>=S.at-zo,i=S.source?.path===t;if(r&&i)return n.id;let a=i?S.source?.from:void 0,o=a===void 0?void 0:vo(e.text,a);return o!==void 0&&g.has(o)?o:r?n.id:void 0})(),_e=ge===void 0?void 0:g.get(ge),ve=me?_e:void 0,[ye,be]=(0,Y.useState)();if(ve?.id!==ye&&(be(ve?.id),ve&&v.width>0)){let e=Po($(ve),x,v);e&&b(e)}let xe=()=>{y===void 0&&b(x)},[Se,Ce]=(0,Y.useState)($o),C=(0,Y.useMemo)(()=>{let e=[...Se.nodes].filter(e=>g.has(e)),t=[...Se.edges].filter(e=>h.some(t=>t.id===e));return e.length===Se.nodes.size&&t.length===Se.edges.size?Se:{nodes:new Set(e),edges:new Set(t)}},[Se,g,h]),[we,Te]=(0,Y.useState)(),[w,Ee]=(0,Y.useState)({}),De=(0,Y.useRef)({}),T=e=>{De.current=e,Ee(e)},[E,D]=(0,Y.useState)(),O=(0,Y.useRef)(void 0),[k,A]=(0,Y.useState)(),Fe=(0,Y.useRef)(!1);(0,Y.useLayoutEffect)(()=>{let e=_.current;if(!e)return;let t=new ResizeObserver(()=>{ee({width:e.clientWidth,height:e.clientHeight})});return t.observe(e),()=>{t.disconnect()}},[]),(0,Y.useEffect)(()=>{if(y===void 0)return;let e=setTimeout(()=>{a[`editor/place`]({place:{x:Math.round(y.x),y:Math.round(y.y),zoom:Math.round(y.zoom*1e3)/1e3}}).catch(()=>void 0)},400);return()=>{clearTimeout(e)}},[a,y]);let Ie=()=>{let e=_.current?.getBoundingClientRect();return{x:e?.left??0,y:e?.top??0}},j=e=>{let t=Ie();return wo(x,{x:e.clientX-t.x,y:e.clientY-t.y})},Le=()=>wo(x,{x:v.width/2,y:v.height/2});(0,Y.useEffect)(()=>{let e=_.current;if(!e)return;let t=t=>{if(t.target?.closest(`[data-canvas-scrolls]`))return;t.preventDefault();let n=e.getBoundingClientRect(),r={x:t.clientX-n.left,y:t.clientY-n.top};b(e=>{let n=e??pe.current;if(t.ctrlKey||t.metaKey)return To(n,r,n.zoom*Math.exp(-t.deltaY*.01));let i=t.shiftKey&&t.deltaX===0?t.deltaY:t.deltaX,a=t.shiftKey&&t.deltaX===0?0:t.deltaY;return{...n,x:n.x+i/n.zoom,y:n.y+a/n.zoom}})};return e.addEventListener(`wheel`,t,{passive:!1}),()=>{e.removeEventListener(`wheel`,t)}},[]);let Re=(0,Y.useCallback)(e=>{if(e===`fit`||typeof e!=`string`){let t=e===`fit`?m.map($):e;t.length>0&&b(Eo(t,v))}else b(t=>{let n=t??pe.current,r=e===`actual`?1:e===`in`?n.zoom*1.25:n.zoom/1.25;return To(n,{x:v.width/2,y:v.height/2},So(r))})},[m,v]),ze=e=>{let t=new Map;for(let n of e){let e=g.get(n);if(e&&(t.set(n,$(e)),e.type===`group`))for(let n of m)n.id!==e.id&&n.x>=e.x&&n.y>=e.y&&n.x+n.width<=e.x+e.width&&n.y+n.height<=e.y+e.height&&t.set(n.id,$(n))}return t},M=e=>{Ce(e)},Be=(e,t,n,r)=>{let i={left:e.x-t/2,top:e.y-n/2,width:t,height:n};if(!r)return i;let a=e=>m.filter(t=>t.type!==`group`&&t.x<e.left+e.width&&t.x+t.width>e.left&&t.y<e.top+e.height&&t.y+t.height>e.top);for(let e=0;e<50;e++){let e=a(i);if(e.length===0)break;i={...i,left:Math.max(...e.map(e=>e.x+e.width))+Uo}}let o=(i.left+i.width-x.x)*x.zoom,s=(i.top+i.height-x.y)*x.zoom;return(o>v.width||s>v.height||i.left<x.x||i.top<x.y)&&b({...x,x:i.left+i.width/2-v.width/2/x.zoom,y:i.top+i.height/2-v.height/2/x.zoom}),i},Ve=(t,r,i=!1)=>{xe();let a=ht(u.canvas),o=typeof t.width==`number`?t.width:260,s=typeof t.height==`number`?t.height:140,c=Be(r??Le(),o,s,r===void 0),l={id:a,...t,x:R(c.left),y:R(c.top),width:R(o),height:R(s)},d={id:a,type:l.type,...Object.fromEntries(Object.entries(l).filter(([e])=>![`id`,`type`,`x`,`y`,`width`,`height`].includes(e))),x:l.x,y:l.y,width:l.width,height:l.height};return e.edit(n.edits.add,e=>({...e,nodes:[...e.nodes,d]})),M({nodes:new Set([a]),edges:new Set}),i&&t.type===`text`&&D({type:`text`,id:a,text:``}),a},He=e=>Ve({type:`text`,text:``,...Jo.text},e,!0),Ue=(e,t)=>Ve({type:`file`,file:e,...Jo.file},t),We=(e,t)=>Ve({type:`link`,url:e,...Jo.link},t),Ge=()=>{if(C.nodes.size===0&&C.edges.size===0)return;let t=C.nodes;e.edit(n.edits.delete,e=>({...e,nodes:e.nodes.filter(e=>!(typeof e.id==`string`&&t.has(e.id))),edges:e.edges.filter(e=>!(typeof e.id==`string`&&C.edges.has(e.id))&&!t.has(String(e.fromNode))&&!t.has(String(e.toNode)))})),M($o)},Ke=()=>{let t=m.filter(e=>C.nodes.has(e.id));if(t.length===0)return;let r=ke(t.map($)),i=ht(u.canvas),a=t.some(e=>e.type===`file`)?48:Uo,o={id:i,type:`group`,x:R(r.left-Uo),y:R(r.top-a),width:R(r.width+48),height:R(r.height+Uo+a)};e.edit(n.edits.group,e=>{let t=e.nodes.findIndex(e=>typeof e.id==`string`&&C.nodes.has(e.id)),n=[...e.nodes];return n.splice(t<0?0:t,0,o),{...e,nodes:n}}),M({nodes:new Set([i]),edges:new Set}),D({type:`group`,id:i,text:``})},qe=t=>{e.edit(n.edits.color,e=>ts(es(e,C.nodes,e=>z(e,{color:t})),C.edges,e=>z(e,{color:t})))},Je=()=>{let e=[...m.filter(e=>C.nodes.has(e.id)).map(e=>e.color),...h.filter(e=>C.edges.has(e.id)).map(e=>e.color)],t=e[0];return e.length>0&&e.every(e=>e===t)?t:void 0},Ye=()=>[...m.filter(e=>C.nodes.has(e.id)).map(N),...h.filter(e=>C.edges.has(e.id)).flatMap(e=>{let t=ct(e);return t?[Me(t.start,t.end)]:[]})],Xe=(t=E)=>{if(!t)return;D(void 0);let r=t.text;t.type===`edge`?e.edit(n.edits.label,e=>ts(e,new Set([t.id]),e=>z(e,{label:r.trim()===``?void 0:r}))):t.type===`group`?e.edit(n.edits.label,e=>es(e,new Set([t.id]),e=>z(e,{label:r.trim()===``?void 0:r}))):e.edit(n.edits.type,e=>es(e,new Set([t.id]),e=>z(e,{text:r}))),_.current?.focus()},Ze=e=>{e.type===`file`&&e.file?a[`items/open`]({target:{type:`file`,path:e.file}}).catch(()=>void 0):e.type===`link`&&e.url&&/^https?:\/\//u.test(e.url)&&a[`items/open`]({target:{type:`browser`,url:e.url}}).catch(()=>void 0)},Qe=e=>{xe(),E&&Xe();let t=e.target;if(t.closest(`[data-canvas-own]`))return;_.current?.focus();let n=j(e);if(e.button===1||e.button===0&&Fe.current){O.current={type:`pan`,start:{x:e.clientX,y:e.clientY},camera:x},A(`pan`),e.currentTarget.setPointerCapture(e.pointerId);return}if(e.button!==0)return;let r=t.closest(`[data-handle]`)?.dataset.handle,i=t.closest(`[data-connector]`),a=t.closest(`[data-edge]`),o=t.closest(`[data-node]`);if(!(p&&(r||i))){if(r){let e=[...C.nodes][0],t=e===void 0?void 0:g.get(e);if(!t)return;O.current={type:`resize`,id:t.id,handle:r,start:n,frame:$(t)}}else if(i){let e=i.dataset.connector??``,t=i.dataset.side??`right`;O.current={type:`connect`,from:e,side:t,start:n},T({connect:{from:e,side:t,to:n}})}else if(a){let t=a.dataset.edge??``,n=e.shiftKey||e.metaKey;M(n?{nodes:C.nodes,edges:new Set(C.edges.has(t)?[...C.edges].filter(e=>e!==t):[...C.edges,t])}:{nodes:new Set,edges:new Set([t])});return}else if(o){let t=o.dataset.node??``,r=e.shiftKey||e.metaKey,i=C;if(r?i={nodes:new Set(C.nodes.has(t)?[...C.nodes].filter(e=>e!==t):[...C.nodes,t]),edges:C.edges}:C.nodes.has(t)||(i={nodes:new Set([t]),edges:new Set}),M(i),p)return;O.current={type:`move`,start:n,frames:ze(i.nodes),dragged:!1}}else O.current={type:`marquee`,start:n,add:e.shiftKey},e.shiftKey||M($o);A(O.current.type),e.currentTarget.setPointerCapture(e.pointerId)}},$e=e=>{let t=O.current;if(!t){let t=e.target,n=j(e),r=24/x.zoom,i=t.closest(`[data-connector]`)?.dataset.connector??[...m].reverse().find(e=>e.type!==`group`&&n.x>=e.x-r&&n.x<=e.x+e.width+r&&n.y>=e.y-r&&n.y<=e.y+e.height+r)?.id??t.closest(`[data-node]`)?.dataset.node;i!==we&&Te(i);return}let n=j(e);if(t.type===`pan`){b({...t.camera,x:t.camera.x-(e.clientX-t.start.x)/t.camera.zoom,y:t.camera.y-(e.clientY-t.start.y)/t.camera.zoom});return}let r=Vo/x.zoom;if(t.type===`move`){let i=n.x-t.start.x,a=n.y-t.start.y;if(!t.dragged&&Math.hypot(i,a)*x.zoom<Bo)return;t.dragged=!0;let o=[...t.frames.values()],s=ke(o),c=m.filter(e=>!t.frames.has(e.id)).map($),l=e.metaKey||e.ctrlKey?{frame:{...s,left:s.left+i,top:s.top+a},guides:[]}:Oe({...s,left:s.left+i,top:s.top+a},c,void 0,r),u=l.frame.left-s.left,d=l.frame.top-s.top,f=new Map;for(let[e,n]of t.frames)f.set(e,{...n,left:n.left+u,top:n.top+d});T({frames:f,guides:l.guides})}else if(t.type===`resize`){let i=m.filter(e=>e.id!==t.id).map($),a=je(t.frame,t.handle,n.x-t.start.x,n.y-t.start.y,{keep:e.shiftKey,min:Ho,...e.metaKey||e.ctrlKey?{}:{snap:{others:i,surface:void 0,tol:r}}});T({frames:new Map([[t.id,a.frame]]),guides:a.guides})}else if(t.type===`connect`){let e=No(m.filter(e=>e.id!==t.from),n);T({connect:{from:t.from,side:t.side,to:n,...e?{over:{id:e.id,side:Oo($(e),n)}}:{}}})}else{let e=Me(t.start,n),r=m.filter(t=>t.x<e.left+e.width&&t.x+t.width>e.left&&t.y<e.top+e.height&&t.y+t.height>e.top&&(t.type!==`group`||t.x>=e.left&&t.y>=e.top&&t.x+t.width<=e.left+e.width&&t.y+t.height<=e.top+e.height));M({nodes:new Set([...t.add?C.nodes:[],...r.map(e=>e.id)]),edges:t.add?C.edges:new Set}),T({marquee:e})}},et=()=>{let t=O.current;O.current=void 0,A(void 0);let r=De.current;if(T({}),t){if(t.type===`move`&&t.dragged&&r.frames){let t=r.frames;e.edit(n.edits.move,e=>es(e,new Set(t.keys()),e=>{let n=t.get(String(e.id));return n?z(e,{x:R(n.left),y:R(n.top)}):e}))}else if(t.type===`resize`&&r.frames){let i=r.frames.get(t.id);i&&e.edit(n.edits.resize,e=>es(e,new Set([t.id]),e=>z(e,{x:R(i.left),y:R(i.top),width:R(i.width),height:R(i.height)})))}else if(t.type===`connect`&&r.connect?.over){let i=r.connect.over,a=ht(u.canvas);e.edit(n.edits.connect,e=>({...e,edges:[...e.edges,{id:a,fromNode:t.from,fromSide:t.side,toNode:i.id,toSide:i.side}]})),M({nodes:new Set,edges:new Set([a])})}}},tt=e=>{let t=document.elementFromPoint(e.clientX,e.clientY)??e.target;if(p){let e=t.closest(`[data-node]`)?.dataset.node,n=e===void 0?void 0:g.get(e);n&&Ze(n);return}if(t.closest(`[data-canvas-own]`))return;let n=t.closest(`[data-edge]`)?.dataset.edge;if(n!==void 0){let e=h.find(e=>e.id===n);D({type:`edge`,id:n,text:e?.label??``});return}if(t.closest(`[data-group-label]`)){let e=t.closest(`[data-node]`)?.dataset.node??``;D({type:`group`,id:e,text:g.get(e)?.label??``});return}let r=t.closest(`[data-node]`)?.dataset.node,i=r===void 0?void 0:g.get(r);i?i.type===`text`?D({type:`text`,id:i.id,text:i.text??``}):i.type===`group`?D({type:`group`,id:i.id,text:i.label??``}):Ze(i):He(j(e))},nt=t=>{if(t.target.closest(`textarea, input, [contenteditable]`))return;xe();let r=Xo?t.metaKey:t.ctrlKey;if(t.key===` `)Fe.current=!0,t.preventDefault();else if(r&&t.key.toLowerCase()===`z`)t.preventDefault(),t.shiftKey?e.redo():e.undo();else if(r&&t.key.toLowerCase()===`y`)t.preventDefault(),e.redo();else if(r&&t.key.toLowerCase()===`a`)t.preventDefault(),M({nodes:new Set(m.map(e=>e.id)),edges:new Set(h.map(e=>e.id))});else if(r&&t.key.toLowerCase()===`g`&&!p)t.preventDefault(),Ke();else if((t.key===`Delete`||t.key===`Backspace`)&&!p)t.preventDefault(),Ge();else if(t.key===`Escape`)M($o);else if(t.shiftKey&&(t.key===`!`||t.code===`Digit1`))Re(`fit`);else if(t.shiftKey&&(t.key===`@`||t.code===`Digit2`))Re(Ye());else if(t.shiftKey&&(t.key===`)`||t.code===`Digit0`))Re(`actual`);else if(r&&(t.key===`=`||t.key===`+`))t.preventDefault(),Re(`in`);else if(r&&t.key===`-`)t.preventDefault(),Re(`out`);else if(t.key===`Enter`&&C.nodes.size===1&&!p){let e=g.get([...C.nodes][0]??``);e?.type===`text`&&(t.preventDefault(),D({type:`text`,id:e.id,text:e.text??``}))}else if(t.key.startsWith(`Arrow`)&&C.nodes.size>0&&!p){t.preventDefault();let r=t.shiftKey?10:1,i=t.key===`ArrowLeft`?-r:t.key===`ArrowRight`?r:0,a=t.key===`ArrowUp`?-r:t.key===`ArrowDown`?r:0,o=ze(C.nodes);e.edit(n.edits.move,e=>es(e,new Set(o.keys()),e=>z(e,{x:R(Number(e.x)+i),y:R(Number(e.y)+a)})),`nudge`)}},rt=t=>{t.key===` `&&(Fe.current=!1),t.key.startsWith(`Arrow`)&&e.settle()},it=e=>{if(p)return;e.preventDefault();let n=j(e);if(e.dataTransfer.types.includes(`application/x-allyhub-canvas-note`)){He(n);return}let r=[...e.dataTransfer.files];if(r.length>0){(async()=>{let e=0;for(let i of r)try{let{path:r}=await a[`files/upload`]({dir:t.includes(`/`)?t.slice(0,t.lastIndexOf(`/`)):``,name:i.name,data:ns(await i.arrayBuffer())});Ue(r,{x:n.x+e*40,y:n.y+e*40}),e+=1}catch{}})();return}let i=(e.dataTransfer.getData(`text/uri-list`)||e.dataTransfer.getData(`text/plain`)).trim();i!==``&&(/^https?:\/\//u.test(i)?We(i,n):Ue(i.replace(/^\.\//u,``),n))},at=re();i({hold:()=>Promise.resolve({key:`${t}@${String(u.revision)}`,what:`The canvas ${t}, its nodes laid out with notes and edges`,source:{path:t}}),locate:n=>{let r=d(n)[0];return Promise.resolve({elements:Fo(m,x,Ie(),n,{file:t,text:e.text,project:l}),...r?{where:Ro(m,x,Ie(),r)}:{}})},pick:n=>{let r=Ie(),i=No(m,wo(x,{x:n.x-r.x,y:n.y-r.y}));return Promise.resolve(i?Lo(i,x,Ie(),{file:t,text:e.text,project:l}):void 0)},selected:()=>Promise.resolve(m.filter(e=>C.nodes.has(e.id)).map(n=>Lo(n,x,Ie(),{file:t,text:e.text,project:l})))});let N=e=>w.frames?.get(e.id)??$(e),P=C.nodes.size===1&&C.edges.size===0?g.get([...C.nodes][0]??``):void 0,F=x.zoom,I=m.filter(e=>e.type===`group`),st=m.filter(e=>e.type!==`group`),ct=e=>{let t=g.get(e.fromNode),n=g.get(e.toNode);if(!t||!n)return;let r=N(t),i=N(n),a=e.fromSide??ko(r,i),o=e.toSide??ko(i,r),s=Do(r,a),c=Do(i,o);return{...jo(s,a,c,o),start:s,startDir:jo(c,o,s,a).endDir}},lt=e=>{let t=N(e),r=C.nodes.has(e.id),i=Ka(e.color),a=e.type===`group`,o=a?(0,J.jsx)(`div`,{"data-group-label":``,className:`text-ink absolute bottom-full left-0 max-w-full truncate rounded-sm px-1.5 py-0.5 text-sm font-semibold`,style:{marginBottom:Wo/F,fontSize:14/Math.max(F,.5),background:i?`color-mix(in oklab, ${i} 22%, transparent)`:void 0},children:E?.type===`group`&&E.id===e.id?null:e.label??`\xA0`}):e.type===`file`?(0,J.jsx)(`div`,{className:`text-lead absolute bottom-full left-0 flex max-w-full text-xs`,style:{marginBottom:Wo/F,fontSize:12/Math.max(F,.5)},children:(0,J.jsx)(no,{node:e,project:l})}):null;return(0,J.jsxs)(`div`,{"data-node":e.id,"data-testid":`canvas-node`,"data-type":e.type,"data-selected":r?``:void 0,className:`group/node absolute`,style:{left:t.left,top:t.top,width:t.width,height:t.height},children:[o,(0,J.jsx)(`div`,{className:f(`size-full overflow-hidden rounded-md border`,a?`border-rule-strong`:`bg-sheet border-rule motion-safe:transition-shadow`,!a&&we===e.id&&`border-rule-strong shadow-overlay`,r&&`outline-pencil outline-2 outline-offset-2`),style:{...i?{borderColor:i}:{},...a?{background:i?`color-mix(in oklab, ${i} 8%, transparent)`:`color-mix(in oklab, var(--color-lead) 5%, transparent)`}:e.type===`text`&&i?{background:`color-mix(in oklab, ${i} 10%, var(--color-sheet))`}:{},borderWidth:Math.max(1,1/F)},children:e.type===`text`?E?.type===`text`&&E.id===e.id?(0,J.jsx)(`textarea`,{"data-canvas-own":``,"data-testid":`canvas-typing`,autoFocus:!0,value:E.text,"aria-label":n.note,className:`text-ink size-full resize-none bg-transparent px-4 py-3 text-base leading-relaxed outline-none`,onChange:e=>{D({...E,text:e.target.value})},onBlur:()=>{Xe()},onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&Xe()}}):(0,J.jsx)(Xa,{text:e.text??``}):e.type===`file`?(0,J.jsx)(to,{node:e,project:l,active:we===e.id}):e.type===`link`?(0,J.jsx)(ro,{url:e.url??``}):a?null:(0,J.jsx)(io,{type:e.type})}),a&&E?.type===`group`&&E.id===e.id?(0,J.jsx)(`input`,{"data-canvas-own":``,"data-testid":`canvas-typing`,autoFocus:!0,value:E.text,"aria-label":n.label,className:`bg-sheet text-ink border-pencil absolute bottom-full left-0 rounded-sm border px-1.5 py-0.5 text-sm font-semibold outline-none`,style:{marginBottom:Wo/F,fontSize:14/Math.max(F,.5)},onChange:e=>{D({...E,text:e.target.value})},onBlur:()=>{Xe()},onKeyDown:e=>{e.stopPropagation(),(e.key===`Escape`||e.key===`Enter`)&&Xe()}}):null]},e.id)},ut=p||k!==void 0?null:m.filter(e=>e.id===we||C.nodes.has(e.id)).flatMap(e=>{let t=N(e),n=Go/F,r=qo(e,F);return ot.map(i=>{let a=Do({left:t.left-n,top:t.top-n,width:t.width+2*n,height:t.height+2*n},i),o=i===`top`&&r!==void 0?{x:a.x,y:t.top-15/F-r}:a;return(0,J.jsx)(`span`,{"data-connector":e.id,"data-side":i,"data-testid":`canvas-connector`,className:`bg-sheet border-pencil absolute rounded-full border`,style:{left:o.x,top:o.y,width:Ko/F,height:Ko/F,marginLeft:-5/F,marginTop:-5/F,borderWidth:1.5/F,cursor:`crosshair`}},`${e.id} ${i}`)})}),L=(()=>{let e=w.connect;if(!e)return;let t=g.get(e.from);if(!t)return;let n=N(t),r=e.over?g.get(e.over.id):void 0;return jo(Do(n,e.side),e.side,r&&e.over?Do($(r),e.over.side):e.to,e.over?.side)})(),dt=h.map(e=>{let t=ct(e);if(!t)return null;let n=C.edges.has(e.id),r=Ka(e.color)??`var(--color-lead)`,i=(n?2.5:1.75)/F;return(0,J.jsxs)(`g`,{"data-edge":e.id,"data-testid":`canvas-edge`,children:[(0,J.jsx)(`path`,{d:t.d,stroke:`transparent`,strokeWidth:14/F,fill:`none`,pointerEvents:`stroke`}),(0,J.jsx)(`path`,{d:t.d,stroke:n?`var(--color-pencil)`:r,strokeWidth:i,fill:`none`,pointerEvents:`none`}),e.fromEnd===`arrow`?(0,J.jsx)(`polygon`,{points:Mo(t.start,t.startDir,10/Math.max(F,.4)),fill:n?`var(--color-pencil)`:r,pointerEvents:`none`}):null,e.toEnd===`arrow`?(0,J.jsx)(`polygon`,{points:Mo(t.end,t.endDir,10/Math.max(F,.4)),fill:n?`var(--color-pencil)`:r,pointerEvents:`none`}):null]},e.id)}),mt=h.map(e=>{let t=ct(e);if(!t)return null;let r=E?.type===`edge`&&E.id===e.id;return!r&&(e.label===void 0||e.label===``)?null:(0,J.jsx)(`div`,{"data-edge":e.id,className:`absolute -translate-x-1/2 -translate-y-1/2`,style:{left:t.mid.x,top:t.mid.y,fontSize:13/Math.max(F,.5)},children:r?(0,J.jsx)(`input`,{"data-canvas-own":``,"data-testid":`canvas-typing`,autoFocus:!0,value:E.text,"aria-label":n.label,className:`bg-sheet text-ink border-pencil w-40 rounded-sm border px-1.5 py-0.5 text-center outline-none`,onChange:e=>{D({...E,text:e.target.value})},onBlur:()=>{Xe()},onKeyDown:e=>{e.stopPropagation(),(e.key===`Escape`||e.key===`Enter`)&&Xe()}}):(0,J.jsx)(`span`,{"data-testid":`canvas-edge-label`,className:`bg-paper text-ink rounded-sm px-1.5 py-0.5 whitespace-nowrap`,children:e.label})},e.id)}),gt=P&&!p&&P.id!==E?.id?Ne.map(e=>{let t=N(P),[n,r]=Ae[e],i=9/F;return(0,J.jsx)(`span`,{"data-handle":e,"data-testid":`canvas-handle`,className:`bg-sheet border-pencil absolute border`,style:{left:t.left+n*t.width-i/2,top:t.top+r*t.height-i/2,width:i,height:i,borderWidth:1.5/F,cursor:`${e===`n`||e===`s`?`ns`:e===`e`||e===`w`?`ew`:e===`ne`||e===`sw`?`nesw`:`nwse`}-resize`}},e)}):null,_t=Yo*F,vt=P,yt=!p,B=()=>{_.current?.focus()},bt=(()=>{if(k!==void 0||E!==void 0)return;let e=Ye();if(e.length===0)return;let t=ke(e),n=Co(x,{x:t.left,y:t.top}),r={left:n.x,top:n.y,width:t.width*F,height:t.height*F};if(r.left>v.width||r.top>v.height||r.left+r.width<0||r.top+r.height<0)return;let i=Math.max(0,...m.filter(e=>C.nodes.has(e.id)&&e.y<=t.top).map(e=>qo(e,F)??0));return{box:r,above:i>0?i*F+Wo+Ko+4:0}})(),xt=P&&(P.type===`file`||P.type===`link`)?P:void 0;return(0,J.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col`,"data-testid":`canvas-editor`,"data-state":`ready`,children:[(0,J.jsx)(oe,{saved:{state:u.state}}),u.unreadable===void 0?null:(0,J.jsx)(`div`,{className:`bg-problem/10 text-problem-text shrink-0 px-3 py-1 text-xs`,"data-testid":`canvas-unreadable`,children:n.unreadable(u.unreadable)}),(0,J.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,J.jsxs)(se,{children:[(0,J.jsx)(te,{asChild:!0,children:(0,J.jsxs)(`div`,{ref:_,tabIndex:0,role:`application`,"aria-label":t,"data-testid":`canvas-surface`,"data-zoom":F,className:`bg-paper absolute inset-0 touch-none overflow-hidden outline-none select-none`,style:{backgroundImage:`radial-gradient(circle, var(--color-rule-strong) ${String(Math.max(.6,F))}px, transparent ${String(Math.max(.6,F)+.4)}px)`,backgroundSize:`${String(_t)}px ${String(_t)}px`,backgroundPosition:`${String(-x.x*F)}px ${String(-x.y*F)}px`,cursor:k===`pan`?`grabbing`:k===`move`?`move`:k===`connect`?`crosshair`:void 0},onPointerDown:Qe,onPointerMove:$e,onPointerUp:et,onPointerCancel:et,onPointerLeave:()=>{k===void 0&&Te(void 0)},onDoubleClick:tt,onKeyDown:nt,onKeyUp:rt,onDragOver:e=>{p||e.preventDefault()},onDrop:it,onContextMenu:e=>{let t=e.target.closest(`[data-node]`)?.dataset.node;t!==void 0&&!C.nodes.has(t)&&M({nodes:new Set([t]),edges:new Set})},children:[(0,J.jsxs)(`div`,{className:`absolute top-0 left-0`,"data-testid":`canvas-world`,style:{transform:`translate(${String(-x.x*F)}px, ${String(-x.y*F)}px) scale(${String(F)})`,transformOrigin:`0 0`},children:[I.map(lt),(0,J.jsx)(`svg`,{className:`pointer-events-none absolute top-0 left-0 overflow-visible`,width:1,height:1,children:(0,J.jsx)(`g`,{className:`pointer-events-auto`,children:dt})}),st.map(lt),L?(0,J.jsx)(`svg`,{className:`pointer-events-none absolute top-0 left-0 overflow-visible`,width:1,height:1,children:(0,J.jsx)(`path`,{d:L.d,stroke:`var(--color-pencil)`,strokeWidth:2/F,strokeDasharray:`${String(6/F)} ${String(4/F)}`,fill:`none`})}):null,mt,gt,ut,(w.guides??[]).map((e,t)=>(0,J.jsx)(`span`,{className:`bg-pencil pointer-events-none absolute`,style:e.axis===`x`?{left:e.at,top:x.y-1e4,width:1/F,height:2e4+v.height/F}:{top:e.at,left:x.x-1e4,height:1/F,width:2e4+v.width/F}},t)),w.marquee?(0,J.jsx)(`span`,{className:`border-pencil bg-pencil-wash pointer-events-none absolute border`,style:{left:w.marquee.left,top:w.marquee.top,width:w.marquee.width,height:w.marquee.height,borderWidth:1/F}}):null]}),S&&_e?(()=>{let e=$(_e);return(0,J.jsx)(Pe,{"data-testid":`canvas-agent`,label:he(S),style:{left:(e.left-x.x)*F,top:(e.top-x.y)*F,width:e.width*F,height:e.height*F}})})():null,m.length===0&&!p?(0,J.jsx)(`p`,{className:`text-lead pointer-events-none absolute inset-x-0 top-1/2 text-center text-sm`,"data-testid":`canvas-empty`,children:n.empty}):null]})}),(0,J.jsxs)(ue,{className:`w-52`,"data-testid":`canvas-menu`,children:[vt&&(vt.type===`file`||vt.type===`link`)?(0,J.jsx)(ie,{onSelect:()=>{Ze(vt)},children:n.open}):null,!p&&C.nodes.size>0?(0,J.jsxs)(ie,{onSelect:Ke,children:[n.group,(0,J.jsx)(le,{children:Zo})]}):null,!p&&C.nodes.size+C.edges.size>0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ae,{}),(0,J.jsxs)(ie,{variant:`destructive`,onSelect:Ge,children:[n.delete,(0,J.jsx)(le,{children:`⌫`})]})]}):null,!p&&C.nodes.size===0&&C.edges.size===0?(0,J.jsx)(ie,{onSelect:()=>{He()},children:n.note}):null,(0,J.jsx)(ce,{})]})]}),yt?(0,J.jsx)(fo,{onNote:()=>{He()},onFile:e=>{Ue(e),B()},onLink:e=>{We(e),B()},groupable:C.nodes.size>0,onGroup:Ke,project:l,self:t}):null,(0,J.jsx)(po,{onZoom:e=>{xe(),Re(e),B()},history:yt?{canUndo:u.canUndo,canRedo:u.canRedo,onUndo:()=>{e.undo(),B()},onRedo:()=>{e.redo(),B()}}:void 0}),bt?(0,J.jsx)(_o,{markUp:at,box:bt.box,above:bt.above,view:v,color:Je(),onColor:yt?qe:void 0,onDelete:yt?()=>{Ge(),B()}:void 0,open:xt?{link:xt.type===`link`,run:()=>{Ze(xt)}}:void 0,onZoomTo:()=>{xe(),Re(Ye()),B()}}):null]})]})}function is(){let e=Wa(),t=o(),n=s()?.item.entry,[r,i]=(0,Y.useState)(),[a,c]=(0,Y.useState)();return(0,Y.useEffect)(()=>{if(n===void 0)return;let e,r=!0;return bo.open(t,n).then(t=>{r?(e=t,i(t)):t.close()},e=>{r&&c(e instanceof Error?e.message:String(e))}),()=>{r=!1,e?.close()}},[t,n]),!r||n===void 0?(0,J.jsx)(`div`,{className:`text-lead flex size-full items-center justify-center text-sm`,"data-testid":`canvas-editor`,"data-state":a===void 0?`loading`:`error`,children:a===void 0?e.loading:e.couldNotOpen(a)}):(0,J.jsx)(rs,{doc:r,path:n})}export{bo as CanvasDocument,is as CanvasEditor,is as default,Ua as WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{_ as t,d as n,o as r,s as i,u as a,v as o}from"./react-Bk7NnOLX.js";import{Dt as s,Et as c,Ot as l,gt as u,yt as d}from"./button-BVQH7zxz.js";import{t as f}from"./jsx-runtime-DePvh3-m.js";import{t as p}from"./audio-lines-1s1eRs4Q.js";import{i as m}from"./dist-DWKEqAou.js";import{t as h}from"./file-exclamation-point-C_fX4fpI.js";import{q as g}from"./index-CglHrLRS.js";import{t as _}from"./surface-D9qJjJQL.js";var v=e(o(),1),y=f(),b=d({en:{loading:`Opening the file…`,couldNotOpen:e=>`The file could not be opened: ${e}`,page:(e,t)=>`Page ${String(e)} of ${String(t)}`},"zh-cn":{loading:`正在打开文件…`,couldNotOpen:e=>`无法打开文件:${e}`,page:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`},"zh-tw":{loading:`正在開啟檔案…`,couldNotOpen:e=>`無法開啟檔案:${e}`,page:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`},ja:{loading:`ファイルを開いています…`,couldNotOpen:e=>`ファイルを開けませんでした:${e}`,page:(e,t)=>`${String(t)} ページ中 ${String(e)} ページ`},ko:{loading:`파일을 여는 중…`,couldNotOpen:e=>`파일을 열 수 없습니다: ${e}`,page:(e,t)=>`${String(t)}페이지 중 ${String(e)}페이지`},es:{loading:`Abriendo el archivo…`,couldNotOpen:e=>`No se pudo abrir el archivo: ${e}`,page:(e,t)=>`Página ${String(e)} de ${String(t)}`},fr:{loading:`Ouverture du fichier…`,couldNotOpen:e=>`Impossible d’ouvrir le fichier : ${e}`,page:(e,t)=>`Page ${String(e)} sur ${String(t)}`},de:{loading:`Datei wird geöffnet …`,couldNotOpen:e=>`Die Datei konnte nicht geöffnet werden: ${e}`,page:(e,t)=>`Seite ${String(e)} von ${String(t)}`},pt:{loading:`Abrindo o arquivo…`,couldNotOpen:e=>`Não foi possível abrir o arquivo: ${e}`,page:(e,t)=>`Página ${String(e)} de ${String(t)}`}}),x={png:`picture`,jpg:`picture`,jpeg:`picture`,gif:`picture`,webp:`picture`,avif:`picture`,bmp:`picture`,ico:`picture`,svg:`picture`,mp4:`video`,m4v:`video`,mov:`video`,webm:`video`,mp3:`sound`,wav:`sound`,m4a:`sound`,aac:`sound`,ogg:`sound`,oga:`sound`,opus:`sound`,flac:`sound`,pdf:`pdf`},S=Object.keys(x);function C(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?void 0:x[t.slice(n+1).toLowerCase()]}var w=300,T=1200,E=16;async function D(e){let[t,n]=await Promise.all([g(()=>import(`./pdf-BHx8b9rl.js`),[],import.meta.url),g(()=>import(`./pdf.worker.min-DI4FfYVf.js`),[],import.meta.url)]);t.GlobalWorkerOptions.workerSrc=n.default;let r=t.getDocument({url:e});return{pdf:await r.promise,close:()=>r.destroy()}}var O=e=>{let t=e.getBoundingClientRect();return{x:t.x,y:t.y,width:t.width,height:t.height}};function k({pdf:e,number:t,width:n,drawing:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let r=!0;return e.getPage(t).then(e=>{if(!r)return;let t=e.getViewport({scale:1});o({width:n,height:n*t.height/t.width})}),()=>{r=!1}},[e,t,n]),(0,v.useEffect)(()=>{let e=i.current;if(!e||s)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c(!0)},{rootMargin:`800px 0px`});return t.observe(e),()=>{t.disconnect()}},[s,a]),(0,v.useEffect)(()=>{let n=i.current;if(!n||!s||!a)return;let o;return r((async()=>{let r=await e.getPage(t),i=window.devicePixelRatio||1,s=r.getViewport({scale:1}),c=r.getViewport({scale:a.width/s.width*i});n.width=Math.round(c.width),n.height=Math.round(c.height);let l=r.render({canvas:n,viewport:c});o=l,await l.promise.catch(()=>void 0)})()),()=>{o?.cancel()}},[e,t,s,a,r]),(0,y.jsx)(`canvas`,{ref:i,"data-page":t,"data-testid":`media-viewer-pdf-page`,className:`border-rule border bg-white`,style:{width:a?.width??n,height:a?.height??n*1.3}})}function A({path:e,url:t,version:r}){let a=b.of(i()?.locale),o=(0,v.useRef)(null),[s,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(0),g=(0,v.useRef)(new Set),_=(0,v.useCallback)(e=>{g.current.add(e),e.finally(()=>g.current.delete(e))},[]);(0,v.useEffect)(()=>{let e=!0,n;return D(t).then(t=>{e?(n=t.close,d(t.pdf)):t.close()},t=>{e&&p(t instanceof Error?t.message:String(t))}),()=>{e=!1,n?.()}},[t]),(0,v.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{h(Math.max(0,Math.min(e.clientWidth-32,960)))});return t.observe(e),()=>{t.disconnect()}},[]);let x=()=>[...o.current?.querySelectorAll(`canvas[data-page]`)??[]],S=e=>`page ${e.dataset.page??`?`}`;n({hold:async()=>(await Promise.all([...g.current]),{key:`${e}@${String(r)}`,what:`The PDF ${e}`,source:{path:e}}),locate:t=>{let n=x().filter(e=>l(t,O(e)));return Promise.resolve({elements:n.map(t=>({name:`${S(t)} of the PDF ${e}`,source:{path:e}})),...n.length===0?{}:{where:`on ${n.map(S).join(`, `)}`}})},pick:t=>{let n=x().find(e=>{let n=O(e);return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height});return Promise.resolve(n&&{element:{name:`${S(n)} of the PDF ${e}`,source:{path:e}},outline:c(O(n)),where:`on ${S(n)}`})}});let C=Math.min(s?.numPages??0,w),[A,j]=(0,v.useState)(),M=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>()=>{clearTimeout(M.current)},[]),(0,y.jsxs)(`div`,{ref:o,onScroll:()=>{let e=o.current;if(!e)return;let t=e.getBoundingClientRect().top+e.clientHeight/2,n=1;for(let e of x())e.getBoundingClientRect().top<=t&&(n=Number(e.dataset.page));j({at:n,live:!0}),clearTimeout(M.current),M.current=setTimeout(()=>{j(e=>e&&{...e,live:!1})},T)},className:`size-full overflow-auto`,"data-testid":`media-viewer-pdf`,"data-state":f===void 0?s?`open`:`loading`:`error`,children:[(f!==void 0||!s)&&(0,y.jsx)(`p`,{className:`text-lead p-6 text-center text-sm`,children:f===void 0?a.loading:a.couldNotOpen(f)}),(0,y.jsx)(`div`,{className:`flex flex-col items-center`,style:{gap:E,padding:E},children:s&&m>0&&Array.from({length:C},(e,t)=>(0,y.jsx)(k,{pdf:s,number:t+1,width:m,drawing:_},t))}),A&&C>1&&(0,y.jsx)(`p`,{className:u(`bg-background text-lead shadow-overlay pointer-events-none absolute bottom-4 left-1/2 -translate-x-1/2 rounded-md px-2.5 py-1 text-xs tabular-nums motion-safe:transition-opacity`,A.live?`opacity-100`:`opacity-0`),"data-testid":`media-viewer-pdf-page-number`,"aria-live":`polite`,children:a.page(A.at,C)})]})}var j=()=>b.of(i()?.locale);function M(e){let t=r(),[n,i]=(0,v.useState)(0),[a,o]=(0,v.useState)({});return(0,v.useEffect)(()=>{let n=!0,r,a=t.on(`files/changed`,t=>{t.watch===r&&t.changes.some(t=>t.path===e)&&i(e=>e+1)});return t[`files/watch`]({paths:[e]}).then(e=>{n?r=e.watch:t[`files/unwatch`]({watch:e.watch}).catch(()=>void 0)},()=>void 0),()=>{n=!1,a(),r!==void 0&&t[`files/unwatch`]({watch:r}).catch(()=>void 0)}},[t,e]),(0,v.useEffect)(()=>{let r=!0;return t[`files/url`]({path:e}).then(({url:e})=>{if(!r)return;let t=new URL(e,location.href);n>0&&t.searchParams.set(`v`,String(n)),o({url:t.href})},e=>{r&&o({failed:e instanceof Error?e.message:String(e)})}),()=>{r=!1}},[t,e,n]),{url:a.url,version:n,failed:a.failed}}function N(e,t){let n=e.getBoundingClientRect();if(t.width<=0||t.height<=0||n.width<=0)return;let r=Math.min(n.width/t.width,n.height/t.height),i=t.width*r,a=t.height*r;return{x:n.x+(n.width-i)/2,y:n.y+(n.height-a)/2,width:i,height:a}}var P=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height;function F({path:e,url:t,version:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(!1),d=()=>{let e=i.current;if(!e?.complete)return;let t={width:e.naturalWidth,height:e.naturalHeight},n=N(e,t);return n&&{box:n,...t}},f=()=>({name:`the picture ${e}`,source:{path:e}});return n({hold:()=>Promise.resolve({key:`${e}@${String(r)}`,what:`The picture ${e}`,source:{path:e}}),locate:t=>{let n=d();if(!n||!l(t,n.box))return Promise.resolve({elements:[]});let r=n.width/n.box.width,i=e=>({x:(e.x-n.box.x)*r,y:(e.y-n.box.y)*r});return Promise.resolve({elements:[{...f(),regions:[{in:`the picture`,file:e,width:n.width,height:n.height,...s(t,i),scale:r}]}]})},pick:e=>{let t=d();return Promise.resolve(t&&P(e,t.box)?{element:f(),outline:c(t.box)}:void 0)}}),(0,y.jsx)(`div`,{className:u(`size-full`,a?`overflow-auto`:`flex items-center justify-center p-6`),onDoubleClick:()=>{o(e=>!e)},"data-testid":`media-viewer-stage`,"data-size":a?`actual`:`fit`,children:(0,y.jsx)(`img`,{ref:i,src:t,alt:``,draggable:!1,className:u(`select-none`,a?`m-auto block max-w-none p-6`:`size-full object-contain`),"data-testid":`media-viewer-picture`})})}function I({path:e,url:r,version:i}){let o=(0,v.useRef)(null),s=(0,v.useRef)(!1),c=()=>(o.current?.currentTime??0).toFixed(2);return n({hold:()=>Promise.resolve({key:`${e}@${String(i)}`,what:`The video ${e}`,source:{path:e}}),locate:()=>Promise.resolve({elements:[]})}),a({element:()=>o.current,hold:()=>{let e=o.current;return s.current=e!==null&&!e.paused,e?.pause(),Promise.resolve()},release:()=>{s.current&&o.current?.play().catch(()=>void 0),s.current=!1},pictures:()=>{let e=o.current,n=e?t(e):void 0;return Promise.resolve(n?[n]:[])},locate:()=>Promise.resolve({elements:[{name:`the video ${e}`,source:{path:e}}],where:`on the video ${e} at ${c()} s`})}),(0,y.jsx)(`video`,{ref:o,src:r,controls:!0,playsInline:!0,preload:`metadata`,className:`size-full object-contain`,"data-testid":`media-viewer-video`})}function L({path:e,url:t,version:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(!1);return n({hold:()=>{let t=i.current;return a.current=t!==null&&!t.paused,t?.pause(),Promise.resolve({key:`${e}@${String(r)}`,what:`The sound ${e}`,source:{path:e}})},locate:()=>Promise.resolve({elements:[{name:`the sound ${e}`,source:{path:e}}],where:`at ${(i.current?.currentTime??0).toFixed(2)} s`}),release:()=>{a.current&&i.current?.play().catch(()=>void 0),a.current=!1}}),(0,y.jsxs)(_,{className:`flex w-full max-w-sm flex-col items-center gap-2 p-5 text-center`,children:[(0,y.jsx)(p,{className:`text-lead-soft size-5`,strokeWidth:1.5,"aria-hidden":!0}),(0,y.jsx)(`p`,{className:`text-ink font-serif text-sm font-semibold`,children:e.slice(e.lastIndexOf(`/`)+1)}),(0,y.jsx)(`audio`,{ref:i,src:t,controls:!0,preload:`metadata`,className:`mt-1 w-full`,"data-testid":`media-viewer-sound`})]})}var R={picture:F,video:I,sound:L,pdf:A};function z(){let e=j(),t=i()?.item.entry??``,n=C(t),{url:r,version:a,failed:o}=M(t),s=n===void 0?void 0:R[n];return(0,y.jsxs)(`div`,{className:`flex size-full flex-col`,"data-testid":`media-viewer`,children:[(0,y.jsx)(m,{}),(0,y.jsx)(`div`,{className:u(`bg-stone relative min-h-0 flex-1`,(n===`video`||n===`sound`)&&`flex items-center justify-center p-6`),children:r!==void 0&&s?(0,y.jsx)(s,{path:t,url:r,version:a},r):o===void 0?null:(0,y.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,y.jsx)(h,{className:`text-lead-soft size-5`,strokeWidth:1.5,"aria-hidden":!0}),(0,y.jsx)(`p`,{className:`text-ink font-serif text-sm font-semibold`,children:t.slice(t.lastIndexOf(`/`)+1)}),(0,y.jsx)(`p`,{className:`text-lead text-xs`,children:e.couldNotOpen(o)})]})})]})}export{S as MEDIA_EXTENSIONS,z as MediaViewer,z as default,b as WORDS,C as mediaOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{c as t,d as n,l as r,o as i,p as a,s as o,u as s,v as c}from"./react-Bk7NnOLX.js";import{Tt as l,bt as u,gt as d,t as f,vt as p,yt as m}from"./button-BVQH7zxz.js";import{A as h,B as g,I as _,P as v,Q as y,R as b,V as x,X as S,Y as C,at as w,et as T,f as E,h as D,j as O,m as k,o as ee,p as A,q as j,rt as M,tt as N,x as te}from"./snapshots-CTS2iez5.js";import{t as ne}from"./jsx-runtime-DePvh3-m.js";import{t as re}from"./createLucideIcon-REX213UO.js";import{n as P,t as ie}from"./progress-udl4pNsP.js";import{t as F}from"./switch-D5kPl2jO.js";import{i as ae,n as oe,r as se,t as ce}from"./hint-mQB8slJ2.js";import{A as I,D as L,O as R,f as le,j as z,k as B,nt as ue}from"./index-CglHrLRS.js";import{t as de}from"./surface-D9qJjJQL.js";var V={files:2e4,bytes:5368709120,redirects:2e3,headers:100},H={min:3,max:40},fe=new Set(`abuse.account.accounts.admin.administrator.allyhub.api.app.assets.auth.autoconfig.autodiscover.billing.blog.cdn.dashboard.dev.dns.docs.download.downloads.ftp.help.hostmaster.imap.login.mail.mta-sts.ns1.ns2.ops.pop.postmaster.preview.root.security.signin.smtp.staging.static.status.studio.support.test.webmaster.wpad.www`.split(`.`));function pe(e){if(e.length<H.min||e.length>H.max)return`length`;if(!/^[a-z0-9-]+$/u.test(e))return`characters`;if(e.startsWith(`-`)||e.endsWith(`-`))return`hyphenEnds`;if(e.includes(`--`))return`doubleHyphen`;if(fe.has(e))return`reserved`}var me={length:`An address is ${String(H.min)} to ${String(H.max)} characters.`,characters:`An address is lowercase letters, digits and hyphens.`,hyphenEnds:`An address neither starts nor ends with a hyphen.`,doubleHyphen:`An address does not have two hyphens in a row.`,reserved:`That address is reserved.`};function he(e){let t=pe(e);return t===void 0?void 0:me[t]}var ge=N().superRefine((e,t)=>{let n=he(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),_e=[200,301,302,303,307,308,404,410],ve=N().min(1).max(1024).regex(/^\/[^\s]*$/u,`A rule's path starts with /.`),ye=T({from:ve,to:N().min(1).max(2048).regex(/^(\/[^\s]*|https?:\/\/[^\s]+)$/u,`A rule goes to a path or an http(s) address.`),status:M(_e.map(e=>j(e))),force:x()}),be=new Set([`accept-ranges`,`connection`,`content-encoding`,`content-length`,`content-range`,`date`,`keep-alive`,`set-cookie`,`strict-transport-security`,`trailer`,`transfer-encoding`,`upgrade`,`x-content-type-options`]),xe=N().regex(/^[A-Za-z0-9-]+$/u).max(128).refine(e=>!be.has(e.toLowerCase()),`That header is the platform's.`),Se=T({for:ve,set:y(xe,N().max(2048))});T({format:j(1),files:y(k,A),redirects:g(ye).max(V.redirects),headers:g(Se).max(V.headers)});var Ce=[`upload`,`git`],we=T({kind:b(Ce),commit:N().min(1).max(64).optional(),digest:E.optional()}),U=S({id:N(),siteId:N(),source:S({...we.shape,kind:D(Ce)}),note:N().nullable(),files:C(),bytes:C(),createdBy:N(),createdAt:_(),live:x()}),W=S({id:N(),slug:N(),name:N(),url:w(),liveDeployment:N().nullable(),approved:x(),autoPublish:x(),indexing:x(),createdAt:_()});T({slug:ge,name:N().min(1).max(255)}),S({sites:g(W),domain:N(),hosting:x()});var Te=S({site:W,deployments:g(U)});T({manifest:E,source:we,note:N().max(500).optional()}),S({site:W,deployment:U}),T({deployment:N().min(1)}),S({site:W,live:x(),confirm:w().optional()}),T({autoPublish:x().optional(),indexing:x().optional()}),S({site:N(),organization:N(),deployment:N(),manifest:E,indexing:x()});var Ee=re(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),De=e=>e.state===`running`||e.state===`queued`;function G(e){if(e.state===`done`)return 1;if(!(e.total===void 0||e.total<=0))return Math.min(1,Math.max(0,e.completed/e.total))}var K=e(c(),1),q=ne(),J=T({item:h}),Oe=T({hosting:x(),detail:Te.optional(),elsewhere:x().optional(),changed:x().optional(),slug:N().optional(),domain:N().optional()}),Y={confirm:N().optional()},ke={"website/preview":v(J,T({url:N()}),`A website's address as its own dev server serves it, for a frame: its dependencies installed if it has none, then its website.json's dev command on a free port; it answers once the page does.`),"website/still":v(J.extend({width:C().int().positive().max(4096),height:C().int().positive().max(4096),scale:C().positive().max(4).default(1),hold:N().optional()}),T({image:T({mime:N(),data:N()})}),`A website's page as its own dev server serves it, drawn at a frame's size from its top: what Mark up lays over a website's frame where the window cannot read another origin's pixels.`),"website/hold":v(J.extend({width:C().int().positive().max(4096),height:C().int().positive().max(4096),scale:C().positive().max(4).default(1)}),T({hold:N()}),`A website's page opened at a frame's size and kept as it is while a person marks it: website/still and website/at draw and read it as it was, until website/release.`),"website/release":v(T({hold:N()}),T({}),`Lets a page held for notes go.`),"website/at":v(J.extend({width:C().int().positive().max(4096),height:C().int().positive().max(4096),points:g(T({x:C(),y:C()})).min(1).max(24),hold:N().optional()}),T({page:N(),elements:g(T({selector:N(),tag:N(),text:N()}))}),`What is at places of a website's page as its own dev server serves it, drawn at a frame's size from its top (as website/still draws it): what a person's mark on its frame is on.`),"website/status":v(J,Oe,`A website's hosted site, its versions, and whether what is here differs from what is live; where the server has no person's sign-in, not hosted.`),"website/publish":v(J.extend({slug:N().optional(),note:N().optional(),anew:x().optional()}),T({live:x(),url:N(),...Y}),"Builds a website, uploads it as a version and makes it live, for the person who pressed Publish. The first time, it waits for their yes in a browser (`confirm`, a page to open there)."),"website/live":v(J.extend({version:N().min(1)}),T({live:x(),...Y}),`Makes a version what the site serves, as the person asked.`),"website/settings":v(J.extend({autoPublish:x().optional(),indexing:x().optional()}),T({}),`Changes what the person controls of a site.`),"website/unpublish":v(J,T({}),`Takes a site offline; it keeps its address and versions.`),"website/remove":v(J,T({}),`Takes a site offline for good. Its address is never given to anyone else.`)},X=te(ke);function Z({className:e,...t}){return(0,q.jsx)(de,{className:d(`divide-y divide-rule`,e),...t})}function Q({icon:e,label:t,detail:n,children:r,className:i}){return(0,q.jsxs)(`div`,{"data-slot":`setting-row`,className:d(`flex items-center gap-4 px-4.5 py-4`,i),children:[e!==void 0&&(0,q.jsx)(`span`,{className:`-mr-1 flex-none`,children:e}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`text-sm`,children:t}),n!==void 0&&(0,q.jsx)(`div`,{className:`mt-0.5 text-xs text-lead`,children:n})]}),r]})}function Ae({label:e,detail:t,children:n}){return(0,q.jsxs)(`label`,{"data-slot":`setting-row`,className:`flex items-center gap-4 px-4.5 py-4 transition-colors has-[[role=checkbox]:not(:disabled),[role=switch]:not(:disabled)]:hover:bg-hover`,children:[(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:`block text-sm`,children:e}),t!==void 0&&(0,q.jsx)(`span`,{className:`mt-0.5 block text-xs text-lead`,children:t})]}),n]})}function je(e){let[n,r]=(0,K.useState)([]);return t(`jobs/changed`,({job:t,item:n})=>{n===e&&r(e=>[...e.filter(e=>e.id!==t.id),t])}),n}var Me=(e,t)=>e.findLast(e=>(t===void 0||e.what===t)&&De(e)),Ne=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function Pe(e,t,n=Date.now()){let r=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),i=e-n;for(let[e,t]of Ne)if(Math.abs(i)>=t)return r.format(Math.round(i/t),e);return r.format(0,`minute`)}var $={content:`max-w-[min(28rem,calc(100%-2rem))]`,header:`text-left`,footer:`flex-row justify-end`},Fe=e=>e instanceof Error?e.message:String(e),Ie=(e,t)=>({message:Fe(e),...t!==void 0&&typeof e==`object`&&e&&e.code===O.conflict?{refused:t}:{}});function Le(e,t,n){let r=i(),[a,o]=(0,K.useState)(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(),[d,f]=(0,K.useState)(),p=(0,K.useCallback)(()=>X(r,`website/status`,{item:e}).then(e=>{o(e),e.detail?.site.liveDeployment!=null&&f(void 0)}),[r,e]);(0,K.useEffect)(()=>{let e=()=>{p().catch(()=>void 0)};e();let t=()=>{document.visibilityState===`visible`&&e()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,t)}},[r,p,t]);let m=(0,K.useCallback)((e,t)=>{c(!0),u(void 0),e().then(p).catch(e=>{u(Ie(e,t))}).finally(()=>{c(!1)})},[p]),h=(0,K.useCallback)(e=>{r[`items/open`]({target:{type:`browser`,url:e}}).catch(()=>void 0)},[r]),g=(0,K.useCallback)(e=>{e.confirm!==void 0&&(f(e.confirm),h(e.confirm))},[h]),_={item:e};return{status:a,publishing:Me(n,`publish`),busy:s,failure:l,confirm:d,stopWaiting:()=>{f(void 0)},openAgain:()=>{d!==void 0&&h(d)},publish:(e={})=>{m(()=>X(r,`website/publish`,{..._,...e}).then(g),e.slug)},goLive:e=>{m(()=>X(r,`website/live`,{..._,version:e}).then(g))},settings:e=>{m(()=>X(r,`website/settings`,{..._,...e}))},unpublish:()=>{m(()=>X(r,`website/unpublish`,_))},remove:()=>{m(()=>X(r,`website/remove`,_))}}}function Re({words:e,from:t=`center`,children:n}){return(0,q.jsx)(ce,{disableHoverableContent:!0,children:(0,q.jsxs)(se,{children:[(0,q.jsx)(oe,{asChild:!0,children:(0,q.jsx)(`span`,{className:`flex min-w-0`,children:n})}),(0,q.jsx)(ae,{side:`top`,align:t,sideOffset:6,collisionPadding:8,children:e})]})})}var ze=e=>new URL(e).host;function Be({hosting:e,said:t,settings:n,onSettings:r}){let i=t.w.hosting,{status:a,busy:o,failure:s,confirm:c,publishing:l}=e,[u,d]=(0,K.useState)(!1),[p,m]=(0,K.useState)(),h=a?.detail?.site,g=h?.liveDeployment!=null,_=p??a?.slug??``,v=_===``?void 0:pe(_),y=!o&&_!==``&&v===void 0,b=v===`length`?i.slug.length(H.min,H.max):v===void 0?s?.refused===_?i.unavailable(`${_}.${a?.domain??``}`):void 0:i.slug[v];return a?.hosting===!0?(0,q.jsxs)(`div`,{className:`flex h-10 flex-none items-center gap-2 border-b border-rule bg-sheet px-3`,children:[g&&(0,q.jsxs)(`a`,{href:h.url,target:`_blank`,rel:`noreferrer`,className:`flex min-w-0 items-center gap-1.5 truncate font-mono text-xs text-lead hover:text-ink`,children:[(0,q.jsx)(ue,{"aria-hidden":!0,className:`size-3.5 flex-none`}),ze(h.url)]}),(0,q.jsx)(`span`,{className:`flex-1`}),s!==void 0&&!u&&(0,q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-problem-text`,children:s.message}),a.elsewhere===!0&&(0,q.jsx)(`span`,{className:`text-xs whitespace-nowrap text-lead`,children:i.elsewhere}),g&&(0,q.jsx)(`span`,{className:`text-xs whitespace-nowrap text-lead`,children:a.changed===!0?i.unpublished:i.live}),(0,q.jsx)(Re,{words:n?i.preview:i.settings,from:`end`,children:(0,q.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":n?i.preview:i.settings,"aria-pressed":n,disabled:h===void 0,onClick:r,children:(0,q.jsx)(Ee,{"aria-hidden":!0})})}),(0,q.jsxs)(f,{size:`xs`,disabled:o,onClick:()=>{h===void 0?d(!0):e.publish()},children:[l!==void 0&&(0,q.jsx)(P,{value:G(l)}),o?i.publishing:g?i.update:i.publish]}),(0,q.jsx)(L,{open:u&&c===void 0&&h===void 0,onOpenChange:d,children:(0,q.jsxs)(R,{className:$.content,children:[(0,q.jsx)(I,{className:$.header,children:(0,q.jsx)(z,{className:`font-serif`,children:i.first})}),(0,q.jsxs)(`form`,{className:`contents`,onSubmit:t=>{t.preventDefault(),y&&e.publish({slug:_,...a.elsewhere===!0?{anew:!0}:{}})},children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(le,{"aria-label":i.address,"aria-invalid":b!==void 0,"aria-describedby":`site-address-why`,value:_,onChange:e=>{m(e.target.value.toLowerCase())},className:`font-mono`}),(0,q.jsxs)(`span`,{className:`font-mono text-sm text-lead`,children:[`.`,a.domain]})]}),(0,q.jsx)(`p`,{id:`site-address-why`,role:`status`,className:`min-h-5 text-sm text-problem-text`,children:b})]}),(0,q.jsx)(`p`,{className:`text-sm text-lead`,children:a.elsewhere===!0?i.elsewhereNote:i.firstNote}),s!==void 0&&s.refused===void 0&&(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-problem-text`,children:[i.buildFailed,(0,q.jsx)(f,{type:`button`,size:`xs`,variant:`ghost`,className:`text-lead`,onClick:()=>{navigator.clipboard.writeText(s.message).catch(()=>void 0)},children:t.w.copy})]}),(0,q.jsx)(B,{className:$.footer,children:(0,q.jsx)(f,{type:`submit`,disabled:!y,children:o?i.publishing:i.publish})})]})]})}),(0,q.jsx)(L,{open:c!==void 0&&!g,onOpenChange:t=>{t||e.stopWaiting()},children:(0,q.jsxs)(R,{className:$.content,children:[(0,q.jsx)(I,{className:$.header,children:(0,q.jsx)(z,{className:`font-serif`,children:i.askTitle})}),(0,q.jsx)(`p`,{className:`text-sm text-lead`,children:i.ask}),(0,q.jsxs)(B,{className:$.footer,children:[(0,q.jsx)(f,{variant:`outline`,onClick:e.stopWaiting,children:t.w.cancel}),(0,q.jsx)(f,{autoFocus:!0,onClick:e.openAgain,children:i.openAgain})]})]})})]}):null}function Ve({hosting:e,said:t}){let n=t.w.hosting,{tag:r}=t,[i,a]=(0,K.useState)(!1),{status:o,busy:s}=e,c=o?.detail;if(c===void 0)return null;let{site:l,deployments:u}=c,d=ze(l.url),p=u.find(e=>e.live)?.createdAt,m=e=>p!==void 0&&Date.parse(e)<Date.parse(p);return(0,q.jsxs)(`div`,{className:`absolute inset-0 overflow-y-auto bg-sheet`,children:[(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col gap-6 px-6 py-8`,children:[(0,q.jsxs)(Z,{children:[(0,q.jsx)(Q,{label:n.address,children:(0,q.jsx)(`a`,{href:l.url,target:`_blank`,rel:`noreferrer`,className:`font-mono text-sm hover:underline`,children:d})}),(0,q.jsx)(Ae,{label:n.agent,children:(0,q.jsx)(F,{checked:l.autoPublish,disabled:s,onCheckedChange:t=>{e.settings({autoPublish:t})}})}),(0,q.jsx)(Ae,{label:n.search,children:(0,q.jsx)(F,{checked:l.indexing,disabled:s,onCheckedChange:t=>{e.settings({indexing:t})}})})]}),(0,q.jsxs)(`section`,{children:[(0,q.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:n.versions}),(0,q.jsx)(Z,{children:u.map(t=>(0,q.jsx)(Q,{label:t.note??Pe(Date.parse(t.createdAt),r),detail:t.note===null?void 0:Pe(Date.parse(t.createdAt),r),children:t.live?(0,q.jsx)(`span`,{className:`text-xs text-lead`,children:n.live}):(0,q.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:()=>{e.goLive(t.id)},children:m(t.createdAt)?n.rollBack:n.makeLive})},t.id))})]}),(0,q.jsxs)(Z,{children:[l.liveDeployment!==null&&(0,q.jsx)(Q,{label:n.unpublishNote,children:(0,q.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:e.unpublish,children:n.unpublish})}),(0,q.jsx)(Q,{label:n.removeNote(d),children:(0,q.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:()=>{a(!0)},children:n.remove})})]})]}),(0,q.jsx)(L,{open:i,onOpenChange:a,children:(0,q.jsxs)(R,{className:$.content,children:[(0,q.jsx)(I,{className:$.header,children:(0,q.jsx)(z,{className:`font-serif`,children:n.remove})}),(0,q.jsx)(`p`,{className:`text-sm text-lead`,children:n.removeNote(d)}),(0,q.jsxs)(B,{className:$.footer,children:[(0,q.jsx)(f,{variant:`outline`,onClick:()=>{a(!1)},children:t.w.cancel}),(0,q.jsx)(f,{variant:`destructive`,onClick:()=>{a(!1),e.remove()},children:n.remove})]})]})})]})}var He=m({en:{starting:`Starting the website…`,startingJob:e=>`Starting ${e}`,failed:`The website did not start`,copy:`Copy details`,retry:`Retry`,cancel:`Cancel`,asleep:`A website's preview needs the agent awake.`,edit:`Edit`,hosting:{buildFailed:`The website could not be built.`,publish:`Publish`,update:`Update`,settings:`Website settings`,preview:`Preview`,unpublished:`Unpublished changes`,address:`Address`,first:`Publish this website`,firstNote:`Anyone with the address can see it.`,publishing:`Publishing…`,askTitle:`Confirm in your browser`,ask:`A site's first publish is confirmed in your browser.`,openAgain:`Open again`,versions:`Versions`,live:`Live`,rollBack:`Roll back`,makeLive:`Make live`,elsewhere:`Published by another team`,elsewhereNote:`This folder names another team’s site. Publishing makes a new one of yours; theirs stays as it is. Anyone with the address can see it.`,slug:{length:(e,t)=>`An address is ${String(e)} to ${String(t)} characters.`,characters:`Use lowercase letters, digits and hyphens.`,hyphenEnds:`An address can’t start or end with a hyphen.`,doubleHyphen:`An address can’t have two hyphens in a row.`,reserved:`That address is reserved.`},unavailable:e=>`${e} is not available.`,agent:`Let the agent update the live site`,search:`Show in search engines`,unpublish:`Unpublish`,unpublishNote:`Takes the site offline within a minute. It keeps its address and versions.`,remove:`Delete site`,removeNote:e=>`${e} goes offline for good, and its address can never be used again.`}},"zh-cn":{starting:`正在启动网站…`,startingJob:e=>`正在启动 ${e}`,failed:`网站没有启动`,copy:`复制详情`,retry:`重试`,cancel:`取消`,asleep:`网站预览需要 Agent 处于唤醒状态。`,edit:`编辑`,hosting:{buildFailed:`网站没能构建成功。`,publish:`发布`,update:`更新`,settings:`网站设置`,preview:`预览`,unpublished:`有未发布的更改`,address:`地址`,first:`发布这个网站`,firstNote:`知道地址的人都能看到。`,publishing:`正在发布…`,askTitle:`请在浏览器中确认`,ask:`网站第一次发布需要在浏览器中确认。`,openAgain:`再次打开`,versions:`版本`,live:`线上`,rollBack:`回滚`,makeLive:`设为上线`,elsewhere:`由其他团队发布`,elsewhereNote:`这个文件夹指向另一个团队的网站。发布会为你新建一个网站,他们的保持不变。知道地址的人都能看到。`,slug:{length:(e,t)=>`地址为 ${String(e)} 到 ${String(t)} 个字符。`,characters:`只能用小写字母、数字和连字符。`,hyphenEnds:`地址不能以连字符开头或结尾。`,doubleHyphen:`地址里不能有两个连续的连字符。`,reserved:`这个地址是保留的。`},unavailable:e=>`${e} 不可用。`,agent:`允许 agent 更新线上网站`,search:`在搜索引擎中显示`,unpublish:`取消发布`,unpublishNote:`一分钟内让网站下线,地址和版本都会保留。`,remove:`删除网站`,removeNote:e=>`${e} 将永久下线,这个地址也不能再使用。`}},"zh-tw":{starting:`正在啟動網站…`,startingJob:e=>`正在啟動 ${e}`,failed:`網站沒有啟動`,copy:`複製詳情`,retry:`重試`,cancel:`取消`,asleep:`網站預覽需要 Agent 處於喚醒狀態。`,edit:`編輯`,hosting:{buildFailed:`網站無法建置。`,publish:`發布`,update:`更新`,settings:`網站設定`,preview:`預覽`,unpublished:`有未發布的變更`,address:`網址`,first:`發布這個網站`,firstNote:`知道網址的人都能看到。`,publishing:`正在發布…`,askTitle:`請在瀏覽器中確認`,ask:`網站第一次發布需要在瀏覽器中確認。`,openAgain:`再次開啟`,versions:`版本`,live:`線上`,rollBack:`復原`,makeLive:`設為上線`,elsewhere:`由其他團隊發布`,elsewhereNote:`這個資料夾指向另一個團隊的網站。發布會為你新建一個網站,他們的保持不變。知道網址的人都能看到。`,slug:{length:(e,t)=>`網址為 ${String(e)} 到 ${String(t)} 個字元。`,characters:`只能用小寫字母、數字和連字號。`,hyphenEnds:`網址不能以連字號開頭或結尾。`,doubleHyphen:`網址裡不能有兩個連續的連字號。`,reserved:`這個網址是保留的。`},unavailable:e=>`${e} 無法使用。`,agent:`允許 agent 更新線上網站`,search:`在搜尋引擎中顯示`,unpublish:`取消發布`,unpublishNote:`一分鐘內讓網站下線,網址和版本都會保留。`,remove:`刪除網站`,removeNote:e=>`${e} 將永久下線,這個網址也不能再使用。`}},ja:{starting:`ウェブサイトを起動しています…`,startingJob:e=>`${e} を起動しています`,failed:`ウェブサイトを起動できませんでした`,copy:`詳細をコピー`,retry:`再試行`,cancel:`キャンセル`,asleep:`ウェブサイトのプレビューにはエージェントが起きている必要があります。`,edit:`編集`,hosting:{buildFailed:`Web サイトをビルドできませんでした。`,publish:`公開`,update:`更新`,settings:`ウェブサイトの設定`,preview:`プレビュー`,unpublished:`未公開の変更`,address:`アドレス`,first:`このウェブサイトを公開`,firstNote:`アドレスを知っている人は誰でも見られます。`,publishing:`公開しています…`,askTitle:`ブラウザで確認してください`,ask:`サイトの最初の公開はブラウザで確認します。`,openAgain:`もう一度開く`,versions:`バージョン`,live:`公開中`,rollBack:`戻す`,makeLive:`公開する`,elsewhere:`別のチームが公開`,elsewhereNote:`このフォルダーは別のチームのサイトを指しています。公開するとあなたの新しいサイトができ、相手のサイトはそのままです。アドレスを知っている人は誰でも見られます。`,slug:{length:(e,t)=>`アドレスは ${String(e)}〜${String(t)} 文字です。`,characters:`小文字、数字、ハイフンだけが使えます。`,hyphenEnds:`アドレスの最初と最後にハイフンは使えません。`,doubleHyphen:`ハイフンを2つ続けては使えません。`,reserved:`このアドレスは予約されています。`},unavailable:e=>`${e} は使えません。`,agent:`公開中のサイトをエージェントに更新させる`,search:`検索エンジンに表示`,unpublish:`非公開にする`,unpublishNote:`1 分以内にサイトを非公開にします。アドレスとバージョンは残ります。`,remove:`サイトを削除`,removeNote:e=>`${e} は完全にオフラインになり、このアドレスは二度と使えません。`}},ko:{starting:`웹사이트를 시작하는 중…`,startingJob:e=>`${e} 시작하는 중`,failed:`웹사이트가 시작되지 않았습니다`,copy:`세부 정보 복사`,retry:`다시 시도`,cancel:`취소`,asleep:`웹사이트 미리보기는 에이전트가 깨어 있어야 합니다.`,edit:`편집`,hosting:{buildFailed:`웹사이트를 빌드하지 못했습니다.`,publish:`게시`,update:`업데이트`,settings:`웹사이트 설정`,preview:`미리 보기`,unpublished:`게시되지 않은 변경 사항`,address:`주소`,first:`이 웹사이트 게시`,firstNote:`주소를 아는 사람은 누구나 볼 수 있습니다.`,publishing:`게시 중…`,askTitle:`브라우저에서 확인하세요`,ask:`사이트의 첫 게시는 브라우저에서 확인합니다.`,openAgain:`다시 열기`,versions:`버전`,live:`게시 중`,rollBack:`되돌리기`,makeLive:`게시하기`,elsewhere:`다른 팀이 게시함`,elsewhereNote:`이 폴더는 다른 팀의 사이트를 가리킵니다. 게시하면 내 사이트가 새로 만들어지고, 그 팀의 사이트는 그대로 남습니다. 주소를 아는 사람은 누구나 볼 수 있습니다.`,slug:{length:(e,t)=>`주소는 ${String(e)}~${String(t)}자입니다.`,characters:`소문자, 숫자, 하이픈만 쓸 수 있습니다.`,hyphenEnds:`주소는 하이픈으로 시작하거나 끝날 수 없습니다.`,doubleHyphen:`하이픈을 두 개 연달아 쓸 수 없습니다.`,reserved:`예약된 주소입니다.`},unavailable:e=>`${e}은(는) 사용할 수 없습니다.`,agent:`에이전트가 게시된 사이트를 업데이트하도록 허용`,search:`검색 엔진에 표시`,unpublish:`게시 취소`,unpublishNote:`1분 안에 사이트를 내립니다. 주소와 버전은 그대로 남습니다.`,remove:`사이트 삭제`,removeNote:e=>`${e} 영구히 오프라인이 되며, 이 주소는 다시 사용할 수 없습니다.`}},es:{starting:`Iniciando el sitio web…`,startingJob:e=>`Iniciando ${e}`,failed:`El sitio web no se inició`,copy:`Copiar detalles`,retry:`Reintentar`,cancel:`Cancelar`,asleep:`La vista previa de un sitio web necesita al agente despierto.`,edit:`Editar`,hosting:{buildFailed:`No se pudo crear el sitio web.`,publish:`Publicar`,update:`Actualizar`,settings:`Ajustes del sitio web`,preview:`Vista previa`,unpublished:`Cambios sin publicar`,address:`Dirección`,first:`Publicar este sitio web`,firstNote:`Cualquiera con la dirección puede verlo.`,publishing:`Publicando…`,askTitle:`Confirma en tu navegador`,ask:`La primera publicación de un sitio se confirma en tu navegador.`,openAgain:`Abrir de nuevo`,versions:`Versiones`,live:`En línea`,rollBack:`Restaurar`,makeLive:`Poner en línea`,elsewhere:`Publicado por otro equipo`,elsewhereNote:`Esta carpeta es del sitio de otro equipo. Al publicar se crea uno nuevo tuyo; el suyo queda como está. Cualquiera con la dirección puede verlo.`,slug:{length:(e,t)=>`Una dirección tiene de ${String(e)} a ${String(t)} caracteres.`,characters:`Usa minúsculas, números y guiones.`,hyphenEnds:`Una dirección no empieza ni termina con guion.`,doubleHyphen:`Una dirección no lleva dos guiones seguidos.`,reserved:`Esa dirección está reservada.`},unavailable:e=>`${e} no está disponible.`,agent:`Dejar que el agente actualice el sitio publicado`,search:`Mostrar en buscadores`,unpublish:`Retirar`,unpublishNote:`Desconecta el sitio en menos de un minuto. Conserva su dirección y sus versiones.`,remove:`Eliminar sitio`,removeNote:e=>`${e} deja de estar en línea para siempre, y la dirección no podrá volver a usarse.`}},fr:{starting:`Démarrage du site web…`,startingJob:e=>`Démarrage de ${e}`,failed:`Le site web n’a pas démarré`,copy:`Copier les détails`,retry:`Réessayer`,cancel:`Annuler`,asleep:`L'aperçu d'un site web nécessite que l'agent soit éveillé.`,edit:`Modifier`,hosting:{buildFailed:`Le site n’a pas pu être construit.`,publish:`Publier`,update:`Mettre à jour`,settings:`Réglages du site web`,preview:`Aperçu`,unpublished:`Modifications non publiées`,address:`Adresse`,first:`Publier ce site web`,firstNote:`Toute personne ayant l'adresse peut le voir.`,publishing:`Publication…`,askTitle:`Confirmez dans votre navigateur`,ask:`La première publication d'un site se confirme dans votre navigateur.`,openAgain:`Rouvrir`,versions:`Versions`,live:`En ligne`,rollBack:`Restaurer`,makeLive:`Mettre en ligne`,elsewhere:`Publié par une autre équipe`,elsewhereNote:`Ce dossier désigne le site d’une autre équipe. Publier en crée un nouveau à vous ; le leur reste tel quel. Toute personne ayant l’adresse peut le voir.`,slug:{length:(e,t)=>`Une adresse compte de ${String(e)} à ${String(t)} caractères.`,characters:`Utilisez des minuscules, des chiffres et des tirets.`,hyphenEnds:`Une adresse ne commence ni ne finit par un tiret.`,doubleHyphen:`Une adresse n’a pas deux tirets d’affilée.`,reserved:`Cette adresse est réservée.`},unavailable:e=>`${e} n’est pas disponible.`,agent:`Laisser l'agent mettre à jour le site en ligne`,search:`Afficher dans les moteurs de recherche`,unpublish:`Dépublier`,unpublishNote:`Met le site hors ligne en moins d’une minute. Il garde son adresse et ses versions.`,remove:`Supprimer le site`,removeNote:e=>`${e} est mis hors ligne définitivement, et l'adresse ne pourra plus jamais servir.`}},de:{starting:`Website wird gestartet…`,startingJob:e=>`${e} wird gestartet`,failed:`Die Website wurde nicht gestartet`,copy:`Details kopieren`,retry:`Erneut versuchen`,cancel:`Abbrechen`,asleep:`Die Vorschau einer Website braucht einen wachen Agenten.`,edit:`Bearbeiten`,hosting:{buildFailed:`Die Website konnte nicht erstellt werden.`,publish:`Veröffentlichen`,update:`Aktualisieren`,settings:`Website-Einstellungen`,preview:`Vorschau`,unpublished:`Unveröffentlichte Änderungen`,address:`Adresse`,first:`Diese Website veröffentlichen`,firstNote:`Jeder mit der Adresse kann sie sehen.`,publishing:`Wird veröffentlicht…`,askTitle:`Im Browser bestätigen`,ask:`Die erste Veröffentlichung einer Website wird im Browser bestätigt.`,openAgain:`Erneut öffnen`,versions:`Versionen`,live:`Live`,rollBack:`Zurücksetzen`,makeLive:`Live schalten`,elsewhere:`Von einem anderen Team veröffentlicht`,elsewhereNote:`Dieser Ordner gehört zur Website eines anderen Teams. Beim Veröffentlichen entsteht eine neue von dir; ihre bleibt, wie sie ist. Jeder mit der Adresse kann sie sehen.`,slug:{length:(e,t)=>`Eine Adresse hat ${String(e)} bis ${String(t)} Zeichen.`,characters:`Nur Kleinbuchstaben, Ziffern und Bindestriche.`,hyphenEnds:`Eine Adresse beginnt und endet nicht mit einem Bindestrich.`,doubleHyphen:`Eine Adresse hat keine zwei Bindestriche hintereinander.`,reserved:`Diese Adresse ist reserviert.`},unavailable:e=>`${e} ist nicht verfügbar.`,agent:`Den Agenten die Live-Website aktualisieren lassen`,search:`In Suchmaschinen anzeigen`,unpublish:`Offline nehmen`,unpublishNote:`Nimmt die Website innerhalb einer Minute offline. Adresse und Versionen bleiben.`,remove:`Website löschen`,removeNote:e=>`${e} geht endgültig offline, und die Adresse kann nie wieder verwendet werden.`}},pt:{starting:`Iniciando o site…`,startingJob:e=>`Iniciando ${e}`,failed:`O site não foi iniciado`,copy:`Copiar detalhes`,retry:`Tentar de novo`,cancel:`Cancelar`,asleep:`A prévia de um site precisa do agente acordado.`,edit:`Editar`,hosting:{buildFailed:`Não foi possível montar o site.`,publish:`Publicar`,update:`Atualizar`,settings:`Configurações do site`,preview:`Pré-visualização`,unpublished:`Alterações não publicadas`,address:`Endereço`,first:`Publicar este site`,firstNote:`Qualquer pessoa com o endereço pode vê-lo.`,publishing:`Publicando…`,askTitle:`Confirme no navegador`,ask:`A primeira publicação de um site é confirmada no navegador.`,openAgain:`Abrir de novo`,versions:`Versões`,live:`No ar`,rollBack:`Restaurar`,makeLive:`Pôr no ar`,elsewhere:`Publicado por outra equipe`,elsewhereNote:`Esta pasta aponta para o site de outra equipe. Publicar cria um novo seu; o deles continua como está. Qualquer pessoa com o endereço pode vê-lo.`,slug:{length:(e,t)=>`Um endereço tem de ${String(e)} a ${String(t)} caracteres.`,characters:`Use letras minúsculas, números e hifens.`,hyphenEnds:`Um endereço não começa nem termina com hífen.`,doubleHyphen:`Um endereço não tem dois hifens seguidos.`,reserved:`Esse endereço é reservado.`},unavailable:e=>`${e} não está disponível.`,agent:`Deixar o agente atualizar o site no ar`,search:`Mostrar em buscadores`,unpublish:`Tirar do ar`,unpublishNote:`Deixa o site offline em até um minuto. Ele mantém o endereço e as versões.`,remove:`Excluir site`,removeNote:e=>`${e} sai do ar para sempre, e o endereço nunca mais poderá ser usado.`}}});function Ue({className:e}){let t=o();if(t===void 0)return null;let n=u(t.locale),{id:r,entry:i}=t.item;return(0,q.jsx)(Ke,{id:r,entry:i,said:{w:He.of(n),tag:p[n]},className:e},r)}function We(e){let[t,n]=(0,K.useState)(0);return r(e,()=>{n(e=>e+1)}),t}function Ge(e){try{let t=JSON.parse(e).dev;return typeof t!=`string`||t.trim()===``}catch{return!1}}function Ke({id:e,entry:r,said:o,className:c}){let u=i(),{w:p}=o,m=e.slice(e.lastIndexOf(`/`)+1),[h,g]=(0,K.useState)({at:`starting`}),[_,v]=(0,K.useState)(0),[y,b]=(0,K.useState)(!1),x=We(e),S=je(r),C=Le(e,x,S),w=h.at===`failed`?x:void 0,T=a(),E=h.at===`asleep`?T:void 0;(0,K.useEffect)(()=>{let t=!0;return X(u,`website/preview`,{item:e}).then(({url:e})=>{t&&g({at:`ready`,url:e})},e=>{t&&g(ee(e)?{at:`asleep`}:{at:`failed`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[u,e,_,w,E]);let[D,O]=(0,K.useState)(!1);(0,K.useEffect)(()=>{let e=!0;return u[`files/read`]({path:r}).then(({text:t})=>{e&&O(Ge(t))},()=>void 0),()=>{e=!1}},[u,r,x]);let k=h.at===`failed`;t(`jobs/changed`,({job:e,item:t})=>{k&&t===r&&e.what===`start`&&e.state===`running`&&(g({at:`starting`}),v(e=>e+1))});let A=(0,K.useRef)(null);n({hold:()=>Promise.resolve({key:`website@${e}@${crypto.randomUUID()}`,what:m,source:{path:r}}),locate:()=>Promise.resolve({elements:[]})});let j=()=>{let e=A.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0},M=(0,K.useRef)(void 0),N=()=>M.current??Promise.resolve(void 0);return s({element:()=>A.current,hold:()=>{let t=j();return M.current=t?X(u,`website/hold`,{item:e,width:Math.round(t.width),height:Math.round(t.height),scale:Math.min(4,Math.max(1,window.devicePixelRatio))}).then(e=>e.hold,()=>void 0):Promise.resolve(void 0),M.current.then(()=>void 0)},release:()=>{let e=M.current;M.current=void 0,e?.then(e=>e===void 0?void 0:X(u,`website/release`,{hold:e}).catch(()=>void 0))},pictures:async()=>{let t=j();if(!t)return[];let n=await N(),{image:r}=await X(u,`website/still`,{item:e,width:Math.round(t.width),height:Math.round(t.height),scale:Math.min(4,Math.max(1,window.devicePixelRatio)),...n===void 0?{}:{hold:n}});return[{...r,rect:t}]},locate:async t=>{let n=j(),i=n?l(t).map(e=>({x:e.x-n.x,y:e.y-n.y})).filter(e=>e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height):[],a=await N(),o=n&&i.length>0?await X(u,`website/at`,{item:e,width:Math.round(n.width),height:Math.round(n.height),points:i,...a===void 0?{}:{hold:a}}).catch(()=>void 0):void 0,s=o?.page??``;return{elements:o&&o.elements.length>0?o.elements.map(e=>({name:`the element ${e.selector} of the page ${s}`,source:{path:r},...e.text===``?{}:{text:e.text}})):[{name:`the page of the website ${m}`,source:{path:r}}],where:`on the website ${m}${s===``?``:` at ${s}`}, as its dev server serves it`}}}),h.at===`asleep`?(0,q.jsxs)(`div`,{className:d(`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,c),children:[(0,q.jsx)(`p`,{className:`text-sm text-lead`,children:p.asleep}),(0,q.jsx)(f,{size:`xs`,onClick:()=>{u[`edit/request`]({}).catch(()=>void 0)},children:p.edit})]}):(0,q.jsxs)(`div`,{className:d(`absolute inset-0 flex flex-col`,c),children:[(0,q.jsx)(Be,{hosting:C,said:o,settings:y,onSettings:()=>{b(e=>!e)}}),(0,q.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[h.at===`ready`&&(0,q.jsx)(`iframe`,{ref:A,title:m,src:h.url,"data-testid":`site`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`,className:`absolute inset-0 size-full border-0 bg-page`},D?x:void 0),h.at===`starting`&&(0,q.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-lead`,children:(0,q.jsx)(qe,{job:Me(S,`start`),name:m,w:p})}),h.at===`failed`&&(0,q.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,children:[(0,q.jsx)(`p`,{className:`text-sm text-ink`,children:p.failed}),(0,q.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,q.jsx)(f,{size:`xs`,variant:`ghost`,className:`text-lead`,onClick:()=>{navigator.clipboard.writeText(h.message).catch(()=>void 0)},children:p.copy}),(0,q.jsx)(f,{size:`xs`,onClick:()=>{g({at:`starting`}),v(e=>e+1)},children:p.retry})]})]}),y&&C.status?.detail!==void 0&&(0,q.jsx)(Ve,{hosting:C,said:o})]})]})}function qe({job:e,name:t,w:n}){if(e===void 0)return(0,q.jsx)(`span`,{className:`animate-pulse`,children:n.starting});let r=G(e);return(0,q.jsxs)(`span`,{role:`status`,className:`flex flex-col items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r===void 0&&(0,q.jsx)(P,{className:`text-ink`}),n.startingJob(e.name??t)]}),r!==void 0&&(0,q.jsx)(ie,{value:r*100,className:`h-1 w-48`})]})}export{He as WORDS,Ue as default};
|