allyhub 0.20.0 → 0.21.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.
Files changed (287) hide show
  1. package/dist/commands/cloud-tools.js +5 -5
  2. package/dist/commands/frames.js +8 -8
  3. package/dist/commands.json +1 -1
  4. package/dist/help.js +3 -3
  5. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  6. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  7. package/dist/node_modules/@allyhub/blocks/dist/elements.js +1 -1
  8. package/dist/node_modules/@allyhub/blocks/dist/layout.js +1 -1
  9. package/dist/node_modules/@allyhub/blocks/dist/palette.js +1 -1
  10. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +1 -1
  11. package/dist/node_modules/@allyhub/blocks/package.json +1 -1
  12. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  13. package/dist/node_modules/@allyhub/build/package.json +1 -1
  14. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  15. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  16. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  17. package/dist/node_modules/@allyhub/check/package.json +1 -1
  18. package/dist/node_modules/@allyhub/cloud/dist/call.js +2 -2
  19. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  20. package/dist/node_modules/@allyhub/components/package.json +1 -1
  21. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  22. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  23. package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
  24. package/dist/node_modules/@allyhub/doc/dist/blocks.js +1 -1
  25. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -5
  26. package/dist/node_modules/@allyhub/doc/dist/shapes.js +2 -2
  27. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  28. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +1 -1
  29. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  30. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  31. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  32. package/dist/node_modules/@allyhub/export/package.json +1 -1
  33. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  34. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  35. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +9 -1
  36. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +1 -1
  37. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  38. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  39. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  40. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  41. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  42. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
  43. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  44. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  45. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  46. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  47. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  48. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  49. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  50. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  51. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  52. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
  53. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  54. package/dist/node_modules/@allyhub/media/package.json +1 -1
  55. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  56. package/dist/node_modules/@allyhub/model/package.json +1 -1
  57. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  58. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  59. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  60. package/dist/node_modules/@allyhub/project/package.json +1 -1
  61. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  62. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  63. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  64. package/dist/node_modules/@allyhub/render/package.json +1 -1
  65. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  66. package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
  67. package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
  68. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
  69. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  70. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  71. package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
  72. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
  73. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
  74. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  75. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  76. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  77. package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
  78. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
  79. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
  80. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  81. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  82. package/dist/node_modules/@allyhub/scaffold/dist/index.js +5 -5
  83. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  84. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  85. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  87. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/theme.js +1 -1
  90. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  92. package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
  93. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  94. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  95. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
  96. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  97. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  98. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  99. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +1 -1
  100. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  101. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  102. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  103. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  104. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  105. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +2 -2
  106. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  107. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  108. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  109. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  110. package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
  111. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  112. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  113. package/dist/node_modules/@allyhub/website/package.json +1 -1
  114. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  115. package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
  116. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  117. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  118. package/dist/package.json +15 -14
  119. package/dist/works.js +1 -1
  120. package/editor-web/assets/{abnfDiagram-WEYOIA3C-BkVJMd53.js → abnfDiagram-WEYOIA3C-B4tvwU6C.js} +1 -1
  121. package/editor-web/assets/{architecture-WOLXFQ4H-C6rnaynZ.js → architecture-WOLXFQ4H-V2fA0vY2.js} +1 -1
  122. package/editor-web/assets/{architectureDiagram-ZHVYKT53-D3vrh8LK.js → architectureDiagram-ZHVYKT53-B6B7XN0M.js} +1 -1
  123. package/editor-web/assets/article-DW4eD_8K.js +3 -0
  124. package/editor-web/assets/article-Dm2dIEwc.js +7 -0
  125. package/editor-web/assets/bar-button-CJmpgNg4.js +1 -0
  126. package/editor-web/assets/{blockDiagram-RJAE7QA3-BKngt8H7.js → blockDiagram-RJAE7QA3-BizcUGOM.js} +1 -1
  127. package/editor-web/assets/{c4Diagram-XDPPPE54-j7sUELqF.js → c4Diagram-XDPPPE54-CBHS0dQ0.js} +1 -1
  128. package/editor-web/assets/channel-dyUtlVPg.js +1 -0
  129. package/editor-web/assets/chip-BdQRH3FL.js +1 -0
  130. package/editor-web/assets/{chunk-2E7WHVMD-BXa-uRSi.js → chunk-2E7WHVMD-CMPBck_Q.js} +1 -1
  131. package/editor-web/assets/{chunk-4EMNKR2T-B3ntcsZN.js → chunk-4EMNKR2T-Df22Adpt.js} +1 -1
  132. package/editor-web/assets/{chunk-55XCU76K-AMvnFwUg.js → chunk-55XCU76K-CYrZ6_Q7.js} +1 -1
  133. package/editor-web/assets/{chunk-7S6XSTFO-BA6esfFu.js → chunk-7S6XSTFO-BfdG9NNW.js} +1 -1
  134. package/editor-web/assets/{chunk-AQDTSKZB-BT_vANXs.js → chunk-AQDTSKZB-BCzZMoTJ.js} +1 -1
  135. package/editor-web/assets/{chunk-DSNLSHJZ-DoUgmzGB.js → chunk-DSNLSHJZ-DT0xT8Wf.js} +1 -1
  136. package/editor-web/assets/{chunk-HAGFOTED-DtnIrCZb.js → chunk-HAGFOTED-Bg3-EotU.js} +1 -1
  137. package/editor-web/assets/{chunk-HNE4Q36P-BlPwQx3_.js → chunk-HNE4Q36P-BrSym24V.js} +1 -1
  138. package/editor-web/assets/{chunk-NQOKRVIF-D2r7jp2r.js → chunk-NQOKRVIF-CMxgkJWF.js} +1 -1
  139. package/editor-web/assets/{chunk-UHW7PFBP-Cmc0_F5o.js → chunk-UHW7PFBP-DWEwoyPy.js} +1 -1
  140. package/editor-web/assets/{chunk-VQ5W62QI-nJSMqAr0.js → chunk-VQ5W62QI-eTFh5_T9.js} +1 -1
  141. package/editor-web/assets/{chunk-WQQL4CDK-Btq2nbF6.js → chunk-WQQL4CDK-4PTupr9T.js} +1 -1
  142. package/editor-web/assets/{chunk-YZO67HFG-DTbcCoGt.js → chunk-YZO67HFG-D5XAAFWm.js} +1 -1
  143. package/editor-web/assets/{chunk-ZAUX2LTX-DVwkg-2N.js → chunk-ZAUX2LTX-CPsdaisO.js} +1 -1
  144. package/editor-web/assets/{chunk-ZCHMQSOR-BV39jOOE.js → chunk-ZCHMQSOR-ClnuUyfy.js} +1 -1
  145. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Cj74-fhM.js → classDiagram-v2-4MYWR3UA-CM21waNF.js} +1 -1
  146. package/editor-web/assets/collaborator-CbTacvkB.js +1 -0
  147. package/editor-web/assets/color-picker-BmKFn2ww.js +1 -0
  148. package/editor-web/assets/{cynefin-EF2NZ3EQ-C0CkiipV.js → cynefin-EF2NZ3EQ-CJUHTgee.js} +1 -1
  149. package/editor-web/assets/{cynefinDiagram-WF24UDRP-hdsnJ4cI.js → cynefinDiagram-WF24UDRP-C9RIfuIV.js} +1 -1
  150. package/editor-web/assets/{dagre-NK4GIZVX-CC7WSgaK.js → dagre-NK4GIZVX-g-01KdpO.js} +1 -1
  151. package/editor-web/assets/deck-C0VxrlzX.js +1 -0
  152. package/editor-web/assets/{diagram-CBK3MWTC-DmaVm13J.js → diagram-CBK3MWTC-CbOjWUu-.js} +1 -1
  153. package/editor-web/assets/{diagram-I5XIIV2D-De8jqp7b.js → diagram-I5XIIV2D-C6psNS8J.js} +1 -1
  154. package/editor-web/assets/{diagram-ODIL2UCW-B5pBTulX.js → diagram-ODIL2UCW-C9PUE46P.js} +1 -1
  155. package/editor-web/assets/{diagram-PFBEJUXE-BYsXg5_w.js → diagram-PFBEJUXE-vJ_pnB33.js} +1 -1
  156. package/editor-web/assets/{diagram-RJA3I4VV-DZ8f6bYe.js → diagram-RJA3I4VV-FwYlEfJ-.js} +1 -1
  157. package/editor-web/assets/{diagram-TYUNFSNR-qXHUsauD.js → diagram-TYUNFSNR-FKpIxeUc.js} +1 -1
  158. package/editor-web/assets/{dist-DAhe-kFC.js → dist-B8_6sJ_V.js} +1 -1
  159. package/editor-web/assets/dist-BI_BaYhO.js +19 -0
  160. package/editor-web/assets/dist-BaWFMuvr.js +1 -0
  161. package/editor-web/assets/dist-BdmMT8fP.js +5 -0
  162. package/editor-web/assets/dist-BgKyM9U6.js +3 -0
  163. package/editor-web/assets/dist-BqijryYd.js +1 -0
  164. package/editor-web/assets/dist-ByguWp3a.js +16 -0
  165. package/editor-web/assets/{dist-9kuRjUTN.js → dist-CB-_0-X4.js} +6 -6
  166. package/editor-web/assets/dist-CCP24Lel.js +19 -0
  167. package/editor-web/assets/{dist-B3rd02Cg.js → dist-Cg0Z26Kv.js} +6 -6
  168. package/editor-web/assets/dist-CtYjYJdv.js +1 -0
  169. package/editor-web/assets/dist-D07Kj8GR.js +1 -0
  170. package/editor-web/assets/dist-D2rGVz9C.js +1 -0
  171. package/editor-web/assets/dist-D3DwRF1k.js +547 -0
  172. package/editor-web/assets/dist-DCI21ljp.js +6 -0
  173. package/editor-web/assets/dist-DH8oJJw9.js +35 -0
  174. package/editor-web/assets/dist-DJvfQvM7.js +24 -0
  175. package/editor-web/assets/dist-DmCDcb2_.js +4 -0
  176. package/editor-web/assets/dist-H0z_DXDz.js +19 -0
  177. package/editor-web/assets/{dist-DA72-4WB.js → dist-QLXI7XGS.js} +1 -1
  178. package/editor-web/assets/{docx-draw-L54blreB.js → docx-draw-Dxb67W2d.js} +1 -1
  179. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-B7-IfVI-.js → ebnfDiagram-V4P3TTPT-DBymUM-F.js} +1 -1
  180. package/editor-web/assets/{elk-QONTBCTQ-Gj_WaeBn.js → elk-QONTBCTQ-BNYR3OlS.js} +1 -1
  181. package/editor-web/assets/{erDiagram-KYQIGQAA-BDF6Qoqx.js → erDiagram-KYQIGQAA-cTNyOqW6.js} +1 -1
  182. package/editor-web/assets/esm-Cl3GKSDd.js +21 -0
  183. package/editor-web/assets/{eventmodeling-K75KTNOO-elxVXXEe.js → eventmodeling-K75KTNOO-C6FUZeXP.js} +1 -1
  184. package/editor-web/assets/eye-DwfE1USj.js +1 -0
  185. package/editor-web/assets/flowDiagram-IUGLLWBU-ukTovy07.js +1 -0
  186. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CEogW3jW.js → ganttDiagram-R7GPNTJY-LD9mqQ1x.js} +1 -1
  187. package/editor-web/assets/{gitGraph-VSP46ZUC-Bh9cRWFa.js → gitGraph-VSP46ZUC-CtCBcQFl.js} +1 -1
  188. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BQAvdM_V.js → gitGraphDiagram-PDYL7XHY-DYQpOozz.js} +1 -1
  189. package/editor-web/assets/hint-F4fIBnVU.js +1 -0
  190. package/editor-web/assets/index-Cah2zchD.css +2 -0
  191. package/editor-web/assets/index-omhSywJb.js +28 -0
  192. package/editor-web/assets/{info-OHQRW6UA-CdPrqere.js → info-OHQRW6UA-IXInKPRO.js} +1 -1
  193. package/editor-web/assets/{infoDiagram-MVDRKAX5-uwIMeP44.js → infoDiagram-MVDRKAX5-Ds7Cei7T.js} +1 -1
  194. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-rtfvqK7E.js → ishikawaDiagram-HPEHV2GE-DWs3qtAX.js} +1 -1
  195. package/editor-web/assets/{journeyDiagram-BOSHW7O7-mmhfIyVG.js → journeyDiagram-BOSHW7O7-BkNKVYBA.js} +1 -1
  196. package/editor-web/assets/{kanban-definition-FNSA4HC5-Fe7jBsi-.js → kanban-definition-FNSA4HC5-D3dMswnI.js} +1 -1
  197. package/editor-web/assets/{mermaid-parser.core-BxOSjBH9.js → mermaid-parser.core-D_W_0X0N.js} +3 -3
  198. package/editor-web/assets/{mermaid.core-BOln9YdH.js → mermaid.core-Bkirj-s5.js} +4 -4
  199. package/editor-web/assets/{mindmap-definition-6OY57UG3-M3Q1LOtO.js → mindmap-definition-6OY57UG3-CMKkAAvI.js} +1 -1
  200. package/editor-web/assets/{packet-JDAUHWVQ-Dbb0TUG6.js → packet-JDAUHWVQ-CzCkgCfg.js} +1 -1
  201. package/editor-web/assets/palette-DchDLJj6.js +1 -0
  202. package/editor-web/assets/panes-BexRuZd2.js +3 -0
  203. package/editor-web/assets/{pegDiagram-ECIUJNBX-BZMRpSFC.js → pegDiagram-ECIUJNBX-C8qHkx7M.js} +1 -1
  204. package/editor-web/assets/{pie-XZMESJXO-Ctm9XdKp.js → pie-XZMESJXO-BJqgxMrD.js} +1 -1
  205. package/editor-web/assets/{pieDiagram-GNMPY74T-cGbs5ZTl.js → pieDiagram-GNMPY74T-DyNntV5y.js} +1 -1
  206. package/editor-web/assets/progress-D1Uv3d1b.js +6 -0
  207. package/editor-web/assets/{quadrantDiagram-D57K4MC3-BUe_zsxT.js → quadrantDiagram-D57K4MC3-BHa-69ir.js} +1 -1
  208. package/editor-web/assets/{radar-ABXABTNO-CCmKtqLs.js → radar-ABXABTNO-BeRPjBBR.js} +1 -1
  209. package/editor-web/assets/{railroad-I3PHUGI6-k-yhjhjA.js → railroad-I3PHUGI6-BaRQqRsK.js} +1 -1
  210. package/editor-web/assets/{railroad-abnf-LNEFI6M7-B-PvntB3.js → railroad-abnf-LNEFI6M7-BZfwomxZ.js} +1 -1
  211. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Ds2rua1h.js → railroad-ebnf-DWYD2UWJ-DbgqpEF5.js} +1 -1
  212. package/editor-web/assets/{railroad-peg-JR7BVNR7-jNZ2wEp2.js → railroad-peg-JR7BVNR7-BYOf3PsQ.js} +1 -1
  213. package/editor-web/assets/{railroadDiagram-Y72NRBL7-CTqSQ15w.js → railroadDiagram-Y72NRBL7-B5OAzOsD.js} +1 -1
  214. package/editor-web/assets/{requirementDiagram-EQYSW5RA-CUblhR5M.js → requirementDiagram-EQYSW5RA-wqYNoqO0.js} +1 -1
  215. package/editor-web/assets/ribbon-tabs-B3IC9WOt.js +1 -0
  216. package/editor-web/assets/row-DqS4-5b1.js +1 -0
  217. package/editor-web/assets/{sankeyDiagram-SY24JHO5-nSz6zDX3.js → sankeyDiagram-SY24JHO5-Crf6GRsa.js} +1 -1
  218. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DxTpOYuo.js → sequenceDiagram-BLEHNHQU-DUcHz4_d.js} +1 -1
  219. package/editor-web/assets/{session-BhClkDyr.js → session--OJYv_B7.js} +1 -1
  220. package/editor-web/assets/{snapshots-DwGHDN3t.js → snapshots-DYooVfOx.js} +1 -1
  221. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C3e14iHY.js → stateDiagram-v2-A6IESKWZ-DbeLdnpS.js} +1 -1
  222. package/editor-web/assets/surface-BUoi7cmR.js +1 -0
  223. package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
  224. package/editor-web/assets/{swimlanes-B3ENRKFQ-DPPdzNzu.js → swimlanes-B3ENRKFQ-BDi6AeJI.js} +1 -1
  225. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-2wwOmxbv.js +8 -0
  226. package/editor-web/assets/switch-b6GCy_ix.js +1 -0
  227. package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
  228. package/editor-web/assets/tablet-C6oePHEW.js +1 -0
  229. package/editor-web/assets/textarea-Bu6uPEqT.js +1 -0
  230. package/editor-web/assets/{timeline-definition-JXYKGLGB-DRTJ1_Er.js → timeline-definition-JXYKGLGB-B0awa2hh.js} +1 -1
  231. package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
  232. package/editor-web/assets/{treeView-D4JQ5SDB-BYJ_m-i5.js → treeView-D4JQ5SDB-C91G0IGm.js} +1 -1
  233. package/editor-web/assets/{treemap-SAJKECNS-BcU6I6Rg.js → treemap-SAJKECNS-CiOWiwl2.js} +1 -1
  234. package/editor-web/assets/updating-D0GEtwnJ.js +1 -0
  235. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-YV92pS4o.js → usecaseDiagram-WPOLBNNX-DMYM1MRe.js} +1 -1
  236. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-oAvfHZtf.js → vennDiagram-Q3Y3IDCW-DQIJ5vvN.js} +1 -1
  237. package/editor-web/assets/{video-SJvDRCJK.js → video-mMOFXHYK.js} +1 -1
  238. package/editor-web/assets/{wardley-7MLQ67FV-BLNiqxtt.js → wardley-7MLQ67FV-C3H9HG8r.js} +1 -1
  239. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-SppgC6xW.js → wardleyDiagram-IVAIDKWA-DgsjqY1Y.js} +1 -1
  240. package/editor-web/assets/{words-BUlNNuH2.js → words-B2jQwWpp.js} +1 -1
  241. package/editor-web/assets/{words-zMedmPWc.js → words-DgMuEmDO.js} +1 -1
  242. package/editor-web/assets/workbook-NtMEyLgf.js +41 -0
  243. package/editor-web/assets/x-BAJilkKD.js +41 -0
  244. package/editor-web/assets/{xychartDiagram-4URNHDU4-BHMn_jwJ.js → xychartDiagram-4URNHDU4-DzsGI527.js} +1 -1
  245. package/editor-web/index.html +5 -6
  246. package/package.json +5 -2
  247. package/editor-web/assets/article-DHf6mOY_.js +0 -7
  248. package/editor-web/assets/article-Dns1-Xh-.js +0 -3
  249. package/editor-web/assets/bar-button-CKPfx2AB.js +0 -1
  250. package/editor-web/assets/channel-CVWSV3su.js +0 -1
  251. package/editor-web/assets/chip-Bn_9JRRG.js +0 -1
  252. package/editor-web/assets/collaborator-XiHOxwGM.js +0 -1
  253. package/editor-web/assets/deck-DQpNIS2p.js +0 -1
  254. package/editor-web/assets/dist--z0ZHp4T.js +0 -16
  255. package/editor-web/assets/dist-B5GOGGEe.js +0 -1
  256. package/editor-web/assets/dist-Bx6q9kCu.js +0 -1
  257. package/editor-web/assets/dist-C4hHtrJr.js +0 -1
  258. package/editor-web/assets/dist-CCXJewsi.js +0 -19
  259. package/editor-web/assets/dist-CfK2BLl8.js +0 -4
  260. package/editor-web/assets/dist-Cmux3oJ_.js +0 -1
  261. package/editor-web/assets/dist-Cspf85KV.js +0 -6
  262. package/editor-web/assets/dist-DOrGo1GD.js +0 -19
  263. package/editor-web/assets/dist-DjiCHlSu.js +0 -35
  264. package/editor-web/assets/dist-Do4a40Wn.js +0 -19
  265. package/editor-web/assets/dist-FKEWS3Co.js +0 -547
  266. package/editor-web/assets/dist-QKd2i6kG.js +0 -5
  267. package/editor-web/assets/dist-SGnOfLhx.js +0 -24
  268. package/editor-web/assets/dist-VmVB7tl4.js +0 -3
  269. package/editor-web/assets/esm-PQD5Pn8a.js +0 -21
  270. package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +0 -1
  271. package/editor-web/assets/hint-CbwoSBMw.js +0 -1
  272. package/editor-web/assets/index-CXisi0Cj.css +0 -2
  273. package/editor-web/assets/index-wMlfx8aT.js +0 -28
  274. package/editor-web/assets/layout-SWqqA0yV.js +0 -1
  275. package/editor-web/assets/progress-DZQTiRLv.js +0 -6
  276. package/editor-web/assets/ribbon-DajdQ_Ya.js +0 -1
  277. package/editor-web/assets/row-Bei9HNEe.js +0 -1
  278. package/editor-web/assets/split-DBAbwPZ5.js +0 -3
  279. package/editor-web/assets/surface-CIF0Ae0z.js +0 -1
  280. package/editor-web/assets/swatch-BUzr_XmH.js +0 -1
  281. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +0 -8
  282. package/editor-web/assets/switch-DrZxoPQS.js +0 -1
  283. package/editor-web/assets/syntax-emXV4DnN.js +0 -1
  284. package/editor-web/assets/tabs-BwU2E7bU.js +0 -1
  285. package/editor-web/assets/textarea-BX_ax3X8.js +0 -1
  286. package/editor-web/assets/type-CvZ0HZsV.js +0 -41
  287. package/editor-web/assets/workbook-BZKYx4WB.js +0 -41
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t,c as n,d as r,f as i,l as a,m as o,s,u as c}from"./react-Byupo4pA.js";import{Et as l,bt as u,ht as d,n as f,vt as p,yt as m}from"./x-BAJilkKD.js";import{C as h,D as g,S as _,T as v,_ as y,a as b,b as x,h as S,l as C,s as w,v as T}from"./schemas-DlRAoVtq.js";import{t as E}from"./iso-UwGLGD3F.js";import{F as D,M as O,f as k,h as A,j,m as M,o as ee,p as N,x as te}from"./snapshots-DYooVfOx.js";import{t as ne}from"./jsx-runtime-DePvh3-m.js";import{n as re,t as ie}from"./progress-D1Uv3d1b.js";import{t as ae}from"./switch-b6GCy_ix.js";import{i as oe,n as se,r as ce,t as le}from"./hint-F4fIBnVU.js";import{t as ue}from"./createLucideIcon-euu7Wcd9.js";import{a as de,b as fe,c as P,l as F,o as I,s as L,u as R}from"./index-omhSywJb.js";import{t as pe}from"./updating-D0GEtwnJ.js";import{t as me}from"./surface-BUoi7cmR.js";var z={files:2e4,bytes:5368709120,redirects:2e3,headers:100},B={min:3,max:40},he=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 V(e){if(e.length<B.min||e.length>B.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(he.has(e))return`reserved`}var ge={length:`An address is ${String(B.min)} to ${String(B.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 _e(e){let t=V(e);return t===void 0?void 0:ge[t]}var ve=h().superRefine((e,t)=>{let n=_e(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),ye=[200,301,302,303,307,308,404,410],H=h().min(1).max(1024).regex(/^\/[^\s]*$/u,`A rule's path starts with /.`),be=_({from:H,to:h().min(1).max(2048).regex(/^(\/[^\s]*|https?:\/\/[^\s]+)$/u,`A rule goes to a path or an http(s) address.`),status:v(ye.map(e=>S(e))),force:C()}),xe=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`]),Se=h().regex(/^[A-Za-z0-9-]+$/u).max(128).refine(e=>!xe.has(e.toLowerCase()),`That header is the platform's.`),Ce=_({for:H,set:x(Se,h().max(2048))});_({format:S(1),files:x(M,N),redirects:w(be).max(z.redirects),headers:w(Ce).max(z.headers)});var U=[`upload`,`git`],W=_({kind:b(U),commit:h().min(1).max(64).optional(),digest:k.optional()}),we=T({id:h(),siteId:h(),source:T({...W.shape,kind:A(U)}),note:h().nullable(),files:y(),bytes:y(),createdBy:h(),createdAt:E(),live:C()}),G=T({id:h(),slug:h(),name:h(),url:g(),liveDeployment:h().nullable(),approved:C(),autoPublish:C(),indexing:C(),createdAt:E()});_({slug:ve,name:h().min(1).max(255)}),T({sites:w(G),domain:h(),hosting:C()});var Te=T({site:G,deployments:w(we)});_({manifest:k,source:W,note:h().max(500).optional()}),T({site:G,deployment:we}),T({site:G,live:C(),confirm:g().optional()}),_({autoPublish:C().optional(),indexing:C().optional()});var Ee=ue(`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 Oe(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(t(),1),q=ne(),J=_({item:j}),ke=_({hosting:C(),detail:Te.optional(),elsewhere:C().optional(),changed:C().optional(),slug:h().optional(),domain:h().optional()}),Ae={confirm:h().optional()},je={"website/preview":D(J,_({url:h()}),`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":D(J.extend({width:y().int().positive().max(4096),height:y().int().positive().max(4096),scale:y().positive().max(4).default(1),hold:h().optional()}),_({image:_({mime:h(),data:h()})}),`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":D(J.extend({width:y().int().positive().max(4096),height:y().int().positive().max(4096),scale:y().positive().max(4).default(1)}),_({hold:h()}),`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":D(_({hold:h()}),_({}),`Lets a page held for notes go.`),"website/at":D(J.extend({width:y().int().positive().max(4096),height:y().int().positive().max(4096),points:w(_({x:y(),y:y()})).min(1).max(24),hold:h().optional()}),_({page:h(),elements:w(_({selector:h(),tag:h(),text:h()}))}),`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":D(J,ke,`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":D(J.extend({slug:h().optional(),note:h().optional(),anew:C().optional()}),_({live:C(),url:h(),...Ae}),"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":D(J.extend({version:h().min(1)}),_({live:C(),...Ae}),`Makes a version what the site serves, as the person asked.`),"website/settings":D(J.extend({autoPublish:C().optional(),indexing:C().optional()}),_({}),`Changes what the person controls of a site.`),"website/unpublish":D(J,_({}),`Takes a site offline; it keeps its address and versions.`),"website/remove":D(J,_({}),`Takes a site offline for good. Its address is never given to anyone else.`)},Y=te(je);function X({className:e,...t}){return(0,q.jsx)(me,{className:d(`divide-y divide-rule`,e),...t})}function Z({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 Me({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 Ne(e){let[t,n]=(0,K.useState)([]);return a(`jobs/changed`,({job:t,item:r})=>{r===e&&n(e=>[...e.filter(e=>e.id!==t.id),t])}),t}var Pe=(e,t)=>e.findLast(e=>(t===void 0||e.what===t)&&De(e)),Fe=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function Ie(e,t,n=Date.now()){let r=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),i=e-n;for(let[e,t]of Fe)if(Math.abs(i)>=t)return r.format(Math.round(i/t),e);return r.format(0,`minute`)}var Q={content:`max-w-[min(28rem,calc(100%-2rem))]`,header:`text-left`,footer:`flex-row justify-end`},Le=e=>e instanceof Error?e.message:String(e),Re=(e,t)=>({message:Le(e),...t!==void 0&&typeof e==`object`&&e&&e.code===O.conflict?{refused:t}:{}});function ze(e,t,n){let r=s(),[i,a]=(0,K.useState)(),[o,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(),[d,f]=(0,K.useState)(),p=(0,K.useCallback)(()=>Y(r,`website/status`,{item:e}).then(e=>{a(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(Re(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:i,publishing:Pe(n,`publish`),busy:o,failure:l,confirm:d,stopWaiting:()=>{f(void 0)},openAgain:()=>{d!==void 0&&h(d)},publish:(e={})=>{m(()=>Y(r,`website/publish`,{..._,...e}).then(g),e.slug)},goLive:e=>{m(()=>Y(r,`website/live`,{..._,version:e}).then(g))},settings:e=>{m(()=>Y(r,`website/settings`,{..._,...e}))},unpublish:()=>{m(()=>Y(r,`website/unpublish`,_))},remove:()=>{m(()=>Y(r,`website/remove`,_))}}}function Be({words:e,from:t=`center`,children:n}){return(0,q.jsx)(le,{disableHoverableContent:!0,children:(0,q.jsxs)(ce,{children:[(0,q.jsx)(se,{asChild:!0,children:(0,q.jsx)(`span`,{className:`flex min-w-0`,children:n})}),(0,q.jsx)(oe,{side:`top`,align:t,sideOffset:6,collisionPadding:8,children:e})]})})}var Ve=e=>new URL(e).host;function He({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:V(_),y=!o&&_!==``&&v===void 0,b=v===`length`?i.slug.length(B.min,B.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)(fe,{"aria-hidden":!0,className:`size-3.5 flex-none`}),Ve(h.url)]}),(0,q.jsx)(`span`,{className:`flex-1`}),s!==void 0&&s.refused===void 0&&!u&&(0,q.jsx)(`span`,{className:`text-xs whitespace-nowrap text-problem-text`,children:i.notPublished}),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)(Be,{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)(re,{value:Oe(l)}),o?i.publishing:g?i.update:i.publish]}),(0,q.jsx)(I,{open:u&&c===void 0&&h===void 0,onOpenChange:d,children:(0,q.jsxs)(L,{className:Q.content,children:[(0,q.jsx)(F,{className:Q.header,children:(0,q.jsx)(R,{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)(de,{"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.jsx)(`p`,{className:`text-sm text-problem-text`,children:i.notPublished}),(0,q.jsx)(P,{className:Q.footer,children:(0,q.jsx)(f,{type:`submit`,disabled:!y,children:o?i.publishing:i.publish})})]})]})}),(0,q.jsx)(I,{open:c!==void 0&&!g,onOpenChange:t=>{t||e.stopWaiting()},children:(0,q.jsxs)(L,{className:Q.content,children:[(0,q.jsx)(F,{className:Q.header,children:(0,q.jsx)(R,{className:`font-serif`,children:i.askTitle})}),(0,q.jsx)(`p`,{className:`text-sm text-lead`,children:i.ask}),(0,q.jsxs)(P,{className:Q.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 Ue({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=Ve(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)(X,{children:[(0,q.jsx)(Z,{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)(Me,{label:n.agent,children:(0,q.jsx)(ae,{checked:l.autoPublish,disabled:s,onCheckedChange:t=>{e.settings({autoPublish:t})}})}),(0,q.jsx)(Me,{label:n.search,children:(0,q.jsx)(ae,{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)(X,{children:u.map(t=>(0,q.jsx)(Z,{label:t.note??Ie(Date.parse(t.createdAt),r),detail:t.note===null?void 0:Ie(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)(X,{children:[l.liveDeployment!==null&&(0,q.jsx)(Z,{label:n.unpublishNote,children:(0,q.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:e.unpublish,children:n.unpublish})}),(0,q.jsx)(Z,{label:n.removeNote(d),children:(0,q.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:()=>{a(!0)},children:n.remove})})]})]}),(0,q.jsx)(I,{open:i,onOpenChange:a,children:(0,q.jsxs)(L,{className:Q.content,children:[(0,q.jsx)(F,{className:Q.header,children:(0,q.jsx)(R,{className:`font-serif`,children:n.remove})}),(0,q.jsx)(`p`,{className:`text-sm text-lead`,children:n.removeNote(d)}),(0,q.jsxs)(P,{className:Q.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 $=m({en:{starting:`Starting the website…`,startingJob:e=>`Starting ${e}`,cancel:`Cancel`,asleep:`A website's preview needs the agent awake.`,edit:`Edit`,hosting:{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…`,notPublished:`It was not published. Try again.`,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}`,cancel:`取消`,asleep:`网站预览需要 Agent 处于唤醒状态。`,edit:`编辑`,hosting:{publish:`发布`,update:`更新`,settings:`网站设置`,preview:`预览`,unpublished:`有未发布的更改`,address:`地址`,first:`发布这个网站`,firstNote:`知道地址的人都能看到。`,publishing:`正在发布…`,notPublished:`没有发布成功,请再试一次。`,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}`,cancel:`取消`,asleep:`網站預覽需要 Agent 處於喚醒狀態。`,edit:`編輯`,hosting:{publish:`發布`,update:`更新`,settings:`網站設定`,preview:`預覽`,unpublished:`有未發布的變更`,address:`網址`,first:`發布這個網站`,firstNote:`知道網址的人都能看到。`,publishing:`正在發布…`,notPublished:`沒有發布成功,請再試一次。`,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} を起動しています`,cancel:`キャンセル`,asleep:`ウェブサイトのプレビューにはエージェントが起きている必要があります。`,edit:`編集`,hosting:{publish:`公開`,update:`更新`,settings:`ウェブサイトの設定`,preview:`プレビュー`,unpublished:`未公開の変更`,address:`アドレス`,first:`このウェブサイトを公開`,firstNote:`アドレスを知っている人は誰でも見られます。`,publishing:`公開しています…`,notPublished:`公開できませんでした。もう一度お試しください。`,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} 시작하는 중`,cancel:`취소`,asleep:`웹사이트 미리보기는 에이전트가 깨어 있어야 합니다.`,edit:`편집`,hosting:{publish:`게시`,update:`업데이트`,settings:`웹사이트 설정`,preview:`미리 보기`,unpublished:`게시되지 않은 변경 사항`,address:`주소`,first:`이 웹사이트 게시`,firstNote:`주소를 아는 사람은 누구나 볼 수 있습니다.`,publishing:`게시 중…`,notPublished:`게시되지 않았습니다. 다시 시도해 주세요.`,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}`,cancel:`Cancelar`,asleep:`La vista previa de un sitio web necesita al agente despierto.`,edit:`Editar`,hosting:{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…`,notPublished:`No se publicó. Inténtalo de nuevo.`,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}`,cancel:`Annuler`,asleep:`L'aperçu d'un site web nécessite que l'agent soit éveillé.`,edit:`Modifier`,hosting:{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…`,notPublished:`Ce n’a pas été publié. Réessayez.`,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`,cancel:`Abbrechen`,asleep:`Die Vorschau einer Website braucht einen wachen Agenten.`,edit:`Bearbeiten`,hosting:{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…`,notPublished:`Es wurde nicht veröffentlicht. Versuche es noch einmal.`,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}`,cancel:`Cancelar`,asleep:`A prévia de um site precisa do agente acordado.`,edit:`Editar`,hosting:{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…`,notPublished:`Não foi publicado. Tente de novo.`,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 We({className:e}){let t=n();if(t===void 0)return null;let r=u(t.locale),{id:i,entry:a}=t.item;return(0,q.jsx)(qe,{id:i,entry:a,said:{w:$.of(r),tag:p[r]},className:e},i)}function Ge(e){let[t,n]=(0,K.useState)(0);return c(e,()=>{n(e=>e+1)}),t}function Ke(e){try{let t=JSON.parse(e).dev;return typeof t!=`string`||t.trim()===``}catch{return!1}}function qe({id:e,entry:t,said:n,className:c}){let u=s(),{w:p}=n,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=Ge(e),S=Ne(t),C=ze(e,x,S),w=h.at===`failed`?x:void 0,T=o(),E=h.at===`asleep`?T:void 0;(0,K.useEffect)(()=>{let t=!0;return Y(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:t}).then(({text:t})=>{e&&O(Ke(t))},()=>void 0),()=>{e=!1}},[u,t,x]);let k=h.at===`failed`;a(`jobs/changed`,({job:e,item:n})=>{k&&n===t&&e.what===`start`&&e.state===`running`&&(g({at:`starting`}),v(e=>e+1))});let A=(0,K.useRef)(null);i({hold:()=>Promise.resolve({key:`website@${e}@${crypto.randomUUID()}`,what:m,source:{path:t}}),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 r({element:()=>A.current,hold:()=>{let t=j();return M.current=t?Y(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:Y(u,`website/release`,{hold:e}).catch(()=>void 0))},pictures:async()=>{let t=j();if(!t)return[];let n=await N(),{image:r}=await Y(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 n=>{let r=j(),i=r?l(n).map(e=>({x:e.x-r.x,y:e.y-r.y})).filter(e=>e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height):[],a=await N(),o=r&&i.length>0?await Y(u,`website/at`,{item:e,width:Math.round(r.width),height:Math.round(r.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:t},...e.text===``?{}:{text:e.text}})):[{name:`the page of the website ${m}`,source:{path:t}}],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)(He,{hosting:C,said:n,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)(Je,{job:Pe(S,`start`),name:m,w:p})}),h.at===`failed`&&(0,q.jsx)(pe,{className:`absolute inset-0 flex items-center justify-center`}),y&&C.status?.detail!==void 0&&(0,q.jsx)(Ue,{hosting:C,said:n})]})]})}function Je({job:e,name:t,w:n}){if(e===void 0)return(0,q.jsx)(`span`,{className:`animate-pulse`,children:n.starting});let r=Oe(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)(re,{className:`text-ink`}),n.startingJob(e.name??t)]}),r!==void 0&&(0,q.jsx)(ie,{value:r*100,className:`h-1 w-48`})]})}export{$ as WORDS,We as default};
@@ -0,0 +1,5 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{Et as s,ht as c,kt as l,n as u,t as d}from"./x-BAJilkKD.js";import{C as f,S as p,_ as m,a as ee,l as h,s as g}from"./schemas-DlRAoVtq.js";import{t as _}from"./session--OJYv_B7.js";import{t as v}from"./jsx-runtime-DePvh3-m.js";import{C as y,_ as b,d as x,f as S,g as C,h as w,u as T}from"./bar-button-CJmpgNg4.js";import{C as te,E as ne,S as re,b as ie,i as ae}from"./dist-DCI21ljp.js";import{t as E}from"./createLucideIcon-euu7Wcd9.js";import{t as oe}from"./arrow-down-D-QZrqcz.js";import{t as se}from"./arrow-up-B1zjKUHX.js";import{t as ce}from"./chart-no-axes-column-Dyy25XZ_.js";import{a as le,d as ue,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as D}from"./panes-BexRuZd2.js";import{n as ve,t as ye}from"./undo-2-DCbMWoug.js";import{h as be}from"./index-omhSywJb.js";import{n as xe,r as Se,t as O}from"./updating-D0GEtwnJ.js";import{t as k}from"./collaborator-CbTacvkB.js";import{c as Ce,d as A,i as j,n as M,p as N,s as P}from"./browser-DEGNhKTV.js";import{S as F,b as we,d as Te,f as Ee,i as De,l as Oe,m as ke,n as I,p as Ae,t as L,u as je,v as Me,y as R}from"./words-B2jQwWpp.js";var z=E(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),B=E(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),V=[`following`,`mentionedUsers`,`subscribers`,`verified`],H=f().regex(/^[0-9]{1,19}$/u,`a post's id: 1 to 19 digits`),U=p({file:f().min(1),alt:f().optional()},{error:e=>e.code===`invalid_type`?`a medium is { file: ./picture.png, alt: … }: its file, from this file's folder, and its alt text`:void 0}),W=p({options:g(f()),duration_minutes:m().int()},{error:e=>e.code===`invalid_type`?`a poll is { options: [ … ], duration_minutes: … }`:void 0}),Ne=p({text:f().default(``).transform(e=>e.replace(/\n+$/u,``)),media:g(U).optional(),poll:W.optional(),made_with_ai:h().optional(),paid_partnership:h().optional(),reply:p({in_reply_to_tweet_id:H}).optional(),quote_tweet_id:H.optional()},{error:e=>e.code===`invalid_type`?`a post is { text: …, media: [ … ], poll: … }`:void 0}),Pe=p({reply_settings:ee(V).optional(),posts:g(Ne,{error:`posts is the list of its posts: posts: [ { text: … }, … ]`}).min(1,`posts holds at least one post`)},{error:e=>e.code===`invalid_type`?`an x-post's file is { posts: [ { text: … }, … ] }, with reply_settings beside posts`:void 0});function Fe(e,t){let n=e;for(let e of t)if(A(n)){let t=n.items.find(t=>t.key?.value===e);if(!t)return n;n=t.value??t.key}else if(N(n)&&typeof e==`number`){let t=n.items[e];if(!t)return n;n=t}else return n;return n}function G(e){let t=new j,n=M(e,{lineCounter:t,prettyErrors:!1}),r=e=>{let r=Fe(n.contents,e)?.range?.[0];return r===void 0?void 0:t.linePos(r).line};if(n.errors.length>0)return{errors:n.errors.map(e=>({path:[],message:e.message})),line:e=>e.length===0&&n.errors[0]?.linePos?.[0]?n.errors[0].linePos[0].line:r(e)};let i=Pe.safeParse(n.toJS());return i.success?{value:i.data,errors:[],line:r}:{errors:i.error.issues.map(e=>({path:e.path.filter(e=>typeof e==`string`||typeof e==`number`),message:e.message})),line:r}}function K(e,t){let n=e.createNode(t);return t.includes(`
2
+ `)&&(n.type=Ce.BLOCK_LITERAL),n}var q=e=>JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))):t),J=(e,t)=>q(e)===q(t);function Ie(e){return{text:e.text,media:e.media===void 0||e.media.length===0?void 0:e.media,poll:e.poll}}function Le(e,t){let n=M(e),r=G(e).value;if(r!==void 0&&J(r,t))return e;A(n.contents)||(n.contents=new P),t.reply_settings===void 0?n.deleteIn([`reply_settings`]):n.getIn([`reply_settings`])!==t.reply_settings&&n.setIn([`reply_settings`],t.reply_settings);let i=n.getIn([`posts`]),a=N(i)?i:void 0,o=(a?.items??[]).map(e=>A(e)?e:void 0),s=(r?.posts??[]).map(e=>q(e)),c=new Set,l=t.posts.map(()=>void 0);t.posts.forEach((e,t)=>{let n=s.findIndex((t,n)=>!c.has(n)&&o[n]&&t===q(e));n>=0&&(c.add(n),l[t]=n)}),t.posts.forEach((e,t)=>{l[t]===void 0&&o[t]&&!c.has(t)&&(c.add(t),l[t]=t)});let u=t.posts.map((e,t)=>{let r=l[t],i=r===void 0?void 0:o[r],a=Ie(e);if(!i){let t=n.createNode({});t.set(`text`,K(n,e.text));for(let e of[`media`,`poll`])a[e]!==void 0&&t.set(e,n.createNode(a[e]));return t}let s=i.get(`text`);(typeof s!=`string`||s.replace(/\n+$/u,``)!==e.text)&&i.set(`text`,K(n,e.text));for(let e of[`media`,`poll`]){let t=a[e],r=i.get(e,!0);t===void 0?r!==void 0&&i.delete(e):J(r?.toJSON?.(),t)||i.set(e,n.createNode(t))}return i});return a?a.items=u:n.setIn([`posts`],n.createNode(u)),n.toString({flowCollectionPadding:!1,lineWidth:0})}function Re(e,t,n){let r=(e,t,n)=>J(t,e)?n:t,i=t.posts.length===e.posts.length?n.posts.length:n.posts.length===e.posts.length?t.posts.length:n.posts.length,a=[];for(let o=0;o<i;o++){let i=e.posts[o],s=t.posts[o],c=n.posts[o],l=c??s;if(l===void 0)continue;if(s===void 0||c===void 0||i===void 0){a.push(l);continue}let u={...c,text:r(i.text,s.text,c.text)};delete u.media,delete u.poll,a.push({...u,...Y(`media`,r(i.media,s.media,c.media)),...Y(`poll`,r(i.poll,s.poll,c.poll))})}let o={...n,posts:a};return delete o.reply_settings,{...o,...Y(`reply_settings`,r(e.reply_settings,t.reply_settings,n.reply_settings))}}function Y(e,t){return t===void 0?{}:{[e]:t}}var X=e(n(),1),Z=v();function ze(e){let t=e?.part??e?.board;if(typeof t!=`string`)return;let n=/^post-(\d+)$/u.exec(t)?.[1];return n===void 0?void 0:Number(n)-1}var Be=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ve(e,t){let n=e?.posts??[],r=t.posts;for(let e=0;e<r.length;e++)if(!Be(n[e],r[e]))return e;if(n.length>r.length&&r.length>0)return r.length-1}function He(e,t){let n=G(e),r=n.value?.posts.length??0,i=e.split(`
3
+ `).length;for(let e=0;e<r;e++){let a=n.line([`posts`,e]);if(a===void 0)continue;let o=e+1<r?n.line([`posts`,e+1]):void 0,s=o===void 0?i:o-1;if(a<=t.to&&t.from<=s)return e}}function Ue(e,t){if(e.from!==void 0&&e.path===t.path)return He(t.text,{from:e.from,to:e.to??e.from})}var We=class e{session;file;unreadable=!1;landed;snapshot;listeners=new Set;amending;stops=[];constructor(e){this.session=e,this.read(e.text),this.snapshot=this.make(),e.attach({save:e=>{if(this.file===void 0||this.unreadable)return;let t=Le(e,this.file);return t===e?void 0:t},take:(e,t,n)=>{let r=G(e),i=G(t).value,a=n?.kind===`agent`&&r.value?Ve(i,r.value):void 0;a!==void 0&&(this.landed={post:a,at:Date.now()}),r.value?(this.file=this.file===void 0||i===void 0?r.value:Re(i,this.file,r.value),this.unreadable=!1):(this.file=void 0,this.unreadable=!0),this.emit()}}),this.stops.push(e.onState(()=>{this.emit()}),e.onUndo(()=>{this.emit()}))}read(e){let t=G(e);this.file=t.value,this.unreadable=t.value===void 0}static async open(t,n){return new e(await _.open(t,n))}make(){return{file:this.file,state:this.session.state,canUndo:this.session.canUndo,canRedo:this.session.canRedo,unreadable:this.unreadable,landed:this.landed}}emit(){this.snapshot=this.make();for(let e of this.listeners)e()}get text(){return this.session.text}get(){return this.snapshot}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}edit(e,t,n){let r=this.file;if(r===void 0||this.unreadable)return;let i=t(r);if(i!==r){if(n!==void 0&&this.amending?.key===n&&this.session.canUndo){let e=this.amending.from;this.session.undo(),this.push(this.amending.label,e,i)}else this.amending=n===void 0?void 0:{key:n,from:r,label:e},this.push(e,r,i)}}settle(){this.amending=void 0}push(e,t,n){this.file=n,this.session.pushEdit({label:e,undo:()=>{this.file=t,this.emit()},redo:()=>{this.file=n,this.emit()}}),this.emit()}undo(){this.amending=void 0,this.session.undo()}redo(){this.amending=void 0,this.session.redo()}async close(){for(let e of this.stops.splice(0))e();await this.session.close()}},Q=(e,t,n)=>({...e,posts:e.posts.map((e,r)=>r===t?n(e):e)});function Ge(e,t){let n={...e};return t===void 0||t.length===0?delete n.media:n.media=t,n}function Ke(e){let t={...e};return delete t.poll,t}function qe({text:e}){let t=L(),{weighted:n}=we(e),r=F.length.most,i=r-n,a=i<0&&n<=F.length.premium,o=n>F.length.premium,s=Math.min(1,n/r),l=2*Math.PI*9;return(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs tabular-nums`,"aria-label":i>=0?t.left(i):t.over(-i),"data-testid":`x-count`,children:[i<=20?(0,Z.jsx)(`span`,{className:c(o?`text-destructive`:a?`text-warning`:`text-muted-foreground`),children:a?n:i}):null,(0,Z.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 22 22`,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`11`,cy:`11`,r:9,fill:`none`,stroke:`var(--ak-x-line)`,strokeWidth:`2`}),(0,Z.jsx)(`circle`,{cx:`11`,cy:`11`,r:9,fill:`none`,stroke:o?`#f4212e`:a||i<=20?`#ffd400`:`var(--ak-x-link)`,strokeWidth:`2`,strokeDasharray:`${String(s*l)} ${String(l)}`,transform:`rotate(-90 11 11)`})]})]})}function Je(e){let t=L();return(0,Z.jsx)(D,{alt:e.alt??``,onAlt:e.onAlt,most:F.alt,trigger:(0,Z.jsx)(u,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,"aria-label":t.altText,children:t.alt})})}function Ye(e){let t=L();return(0,Z.jsx)(u,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media absolute top-2 right-2 rounded-full`,"aria-label":t.removeMedium,onClick:e.onRemove,children:(0,Z.jsx)(d,{})})}function Xe(e){let t=L(),{options:n,duration_minutes:r}=e.poll,i={days:Math.floor(r/1440),hours:Math.floor(r%1440/60),minutes:r%60},a=(t,n)=>{let r={...i,[t]:Math.max(0,Math.floor(n))};e.onChange({...e.poll,duration_minutes:r.days*1440+r.hours*60+r.minutes})};return(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 rounded-2xl border border-[var(--ak-x-line)] p-3`,"data-testid":`x-poll`,children:[n.map((r,i)=>{let a=R(r)-F.poll.option;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(`input`,{className:`aria-invalid:border-destructive h-10 flex-1 rounded-md border border-[var(--ak-x-line)] bg-transparent px-3 text-[15px] outline-none focus:border-[var(--ak-x-link)]`,value:r,"aria-invalid":a>0||void 0,maxLength:F.poll.option,placeholder:t.option(i+1),"aria-label":t.option(i+1),onChange:t=>{e.onChange({...e.poll,options:n.map((e,n)=>n===i?t.target.value:e)},`option-${String(i)}`)}}),a>0?(0,Z.jsx)(`span`,{className:`text-destructive text-sm`,children:t.over(a)}):null,n.length>F.poll.least?(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":t.removeOption,onClick:()=>{e.onChange({...e.poll,options:n.filter((e,t)=>t!==i)})},children:(0,Z.jsx)(d,{})}):null]},i)}),n.length<F.poll.most?(0,Z.jsxs)(u,{variant:`ghost`,size:`sm`,className:`self-start text-[var(--ak-x-link)]`,onClick:()=>{e.onChange({...e.poll,options:[...n,``]})},children:[(0,Z.jsx)(be,{}),t.addOption]}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 border-t border-[var(--ak-x-line)] pt-2 text-sm`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground mr-auto self-center`,children:t.pollLength}),[`days`,`hours`,`minutes`].map(e=>(0,Z.jsxs)(`label`,{className:`flex flex-col gap-0.5 text-xs`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:t[e]}),(0,Z.jsx)(`input`,{type:`number`,min:0,className:`h-8 w-16 rounded-md border border-[var(--ak-x-line)] bg-transparent px-2 text-sm`,value:i[e],onChange:t=>{a(e,Number(t.target.value))}})]},e)),(0,Z.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:e.onRemove,children:t.removePoll})]})]})}function Ze(e){let t=L(),n=t.replies[e.value??`everyone`];return(0,Z.jsxs)(T,{children:[(0,Z.jsx)(y,{asChild:!0,disabled:e.disabled,children:(0,Z.jsxs)(u,{variant:`ghost`,size:`sm`,className:`ak-x-c-replies -ml-2 gap-1 px-2 font-bold text-[var(--ak-x-link)]`,children:[(0,Z.jsx)(z,{}),n]})}),(0,Z.jsxs)(S,{align:`start`,className:`w-72`,children:[(0,Z.jsx)(w,{children:t.whoCanReply}),(0,Z.jsx)(C,{value:e.value??`everyone`,onValueChange:t=>{e.onChange(t===`everyone`?void 0:V.includes(t)?t:void 0)},children:[`everyone`,...V].map(e=>(0,Z.jsx)(b,{value:e,children:t.replies[e]},e))})]})]})}function Qe(e){let t=L(),n=e.post.made_with_ai===!0||e.post.paid_partnership===!0;return(0,Z.jsxs)(T,{children:[(0,Z.jsx)(y,{asChild:!0,children:(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-[var(--ak-x-link)]`,"aria-label":t.disclosure,title:t.disclosure,"aria-pressed":n,children:(0,Z.jsx)(B,{className:c(n&&`fill-current`)})})}),(0,Z.jsxs)(S,{align:`start`,className:`w-56`,children:[(0,Z.jsx)(w,{children:t.disclosure}),(0,Z.jsx)(x,{checked:e.post.made_with_ai===!0,onCheckedChange:t=>{e.onChange({made_with_ai:t})},children:t.madeWithAi}),(0,Z.jsx)(x,{checked:e.post.paid_partnership===!0,onCheckedChange:t=>{e.onChange({paid_partnership:t})},children:t.paidPartnership})]})]})}function $(e){return(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-[var(--ak-x-link)] disabled:text-[var(--ak-x-muted)]`,"aria-label":e.label,title:e.label,disabled:e.disabled,onClick:e.onClick,children:e.children})}var $e=3e4;function et({doc:e,dir:n,entry:o}){let c=L(),f=r(),p=a(),[m,ee]=he(),h=(0,X.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),[g,_]=(0,X.useState)(),[v,y]=(0,X.useState)(0),[b,x]=(0,X.useState)(),S=(0,X.useRef)([]);(0,X.useEffect)(()=>{if(b===void 0)return;let e=S.current[b.post];e!=null&&(e.focus(),e.setSelectionRange(b.at,b.at),y(b.post),x(void 0))},[b]);let{shown:C,updating:w}=Se(h.file),T=p||w,{agent:E,following:D}=t(),Ce=ne(),A=(()=>{if(E?.doing===void 0)return;let t=ze(E.place);if(t!==void 0)return t;let n=h.landed!==void 0&&h.landed.at>=E.at-$e;return n&&E.source?.path===o?h.landed?.post:(E.source?Ue(E.source,{path:o,text:e.text}):void 0)??(n?h.landed?.post:void 0)})(),j=A!==void 0&&A<(C?.posts.length??0)?A:void 0,M=(0,X.useRef)([]),N=(0,X.useRef)([]);(0,X.useEffect)(()=>{if(D&&j!==void 0)for(let e of[M.current[j],N.current[j]])e?.scrollIntoView({block:`nearest`})},[D,j,h.landed]);let P=me(n,(C?.posts??[]).flatMap(e=>(e.media??[]).map(e=>e.file)));i({hold:()=>Promise.resolve({key:`${o}@${String(e.text.length)}`,what:`The X post ${o}${(C?.posts.length??0)>1?`, a thread of ${String(C?.posts.length??0)} posts`:``}`,source:{path:o}}),locate:t=>{let n=C?.posts??[],r=G(e.text),i=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},a=e=>e!==void 0&&l(t,e),c=n.flatMap((e,t)=>{if(!a(i(M.current[t]))&&!a(i(N.current[t])))return[];let n=r.line([`posts`,t]);return[{name:`post ${String(t+1)} of the thread`,source:{path:o,...n===void 0?{}:{line:n}},...e.text===``?{}:{text:e.text}}]}),u=s(t)[0],d=e=>e!==void 0&&u!==void 0&&u.x>=e.x&&u.x<=e.x+e.width&&u.y>=e.y&&u.y<=e.y+e.height,f=n.findIndex((e,t)=>d(i(M.current[t]))),p=n.findIndex((e,t)=>d(i(N.current[t]))),m=f>=0?`in post ${String(f+1)}, where it is written`:p>=0?`in post ${String(p+1)}, as X's timeline will show it`:void 0;return Promise.resolve({elements:c,...m===void 0?{}:{where:m}})}});let we=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`z`&&(t.preventDefault(),t.shiftKey?e.redo():e.undo())},I=(t,n,r)=>{T||e.edit(t,n,r)},R=e=>(e.media??[]).map(e=>{let t=P.get(e.file),n=le(e.file),r=n?void 0:Me(e.file.split(`.`).pop()??``);return t===void 0?{kind:`made`,label:n?c.made:e.file}:{kind:r??`picture`,src:t,alt:e.alt,file:e.file}}),z=(0,Z.jsx)(ae,{start:(0,Z.jsxs)(Z.Fragment,{children:[T||m!==`edit`?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":c.undo,title:c.undo,disabled:!h.canUndo,onClick:()=>{e.undo()},children:(0,Z.jsx)(ye,{})}),(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":c.redo,title:c.redo,disabled:!h.canRedo,onClick:()=>{e.redo()},children:(0,Z.jsx)(ve,{})})]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsx)(_e,{pane:m,onPane:ee})]}),saved:{state:h.state},exports:{}}),B=f?.theme===`dark`;if(C===void 0)return(0,Z.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`x-post-editor`,children:[z,(0,Z.jsx)(O,{className:`flex min-h-0 flex-1 items-center justify-center`})]});let V=C.posts,H=Math.min(v,V.length-1),U=e=>{I(c.steps.add,t=>({...t,posts:[...t.posts.slice(0,e+1),{text:``},...t.posts.slice(e+1)]})),x({post:e+1,at:0})},W=e=>{let t=V[e],n=V[e-1];if(t===void 0||n===void 0)return!1;let r=e=>(e.media?.length??0)>0||e.poll!==void 0;if(r(t)&&r(n))return!1;let i=n.text===``||t.text===``?``:`
4
+
5
+ `;return I(c.steps.join,a=>({...a,posts:[...a.posts.slice(0,e-1),{...n,...r(t)?{...t.media?{media:t.media}:{},...t.poll?{poll:t.poll}:{}}:{},text:n.text+i+t.text},...a.posts.slice(e+1)]})),x({post:e-1,at:n.text.length+i.length}),!0},Ne=(0,Z.jsx)(`div`,{className:`ak-x ak-x-editing ak-x-composer`,"data-theme":B?`dark`:`light`,children:V.map((t,r)=>{let i=r===V.length-1,a=r===H,s=t.media??[],l=s.filter(e=>Me(e.file.split(`.`).pop()??``)===`picture`||le(e.file)).length,f=s.length>=F.pictures||s.length>l;return(0,Z.jsxs)(`div`,{ref:e=>{M.current[r]=e},className:`ak-x-c-post`,"data-here":a?``:void 0,"data-testid":`x-post`,onFocusCapture:()=>{y(r)},onPointerDown:()=>{y(r)},children:[(0,Z.jsxs)(`div`,{className:`ak-x-side`,children:[(0,Z.jsx)(`div`,{className:`ak-x-avatar`,"aria-hidden":`true`,children:je.name.slice(0,1)}),i?null:(0,Z.jsx)(`div`,{className:`ak-x-thread-line`})]}),(0,Z.jsxs)(`div`,{className:`ak-x-body`,children:[a&&r>0&&!T?(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`ak-x-c-remove`,"aria-label":c.remove,title:c.remove,onClick:()=>{I(c.steps.remove,e=>({...e,posts:e.posts.filter((e,t)=>t!==r)})),x({post:r-1,at:V[r-1]?.text.length??0})},children:(0,Z.jsx)(d,{})}):null,(0,Z.jsxs)(`div`,{className:`ak-x-field`,children:[(0,Z.jsx)(Ee,{text:t.text,whole:!0}),(0,Z.jsx)(`textarea`,{ref:e=>{S.current[r]=e},dir:`auto`,value:t.text,placeholder:r===0?c.whatsHappening:c.addAnother,"aria-label":r===0?c.whatsHappening:c.addAnother,readOnly:T,"data-testid":`x-text`,onChange:e=>{let t=e.target.value;I(c.steps.text,e=>Q(e,r,e=>({...e,text:t})),`text-${String(r)}`)},onBlur:()=>{e.settle()},onKeyDown:e=>{let t=e.currentTarget;if(e.key===`Backspace`&&r>0&&t.selectionStart===0&&t.selectionEnd===0&&!T){W(r)&&e.preventDefault();return}if(e.key!==`Enter`||!(e.metaKey||e.ctrlKey))return;e.preventDefault();let n=t.selectionStart;I(c.steps.split,e=>{let t=e.posts[r];if(!t)return e;let i=t.text.slice(0,n).replace(/\s+$/u,``),a=t.text.slice(n).replace(/^\s+/u,``);return{...e,posts:[...e.posts.slice(0,r),{...t,text:i},{text:a},...e.posts.slice(r+1)]}}),x({post:r+1,at:0})}})]}),(0,Z.jsx)(Oe,{media:R(t),onAlt:T?void 0:e=>(0,Z.jsx)(Je,{alt:s[e]?.alt,onAlt:t=>{I(c.steps.alt,n=>Q(n,r,n=>({...n,media:(n.media??[]).map((n,r)=>{if(r!==e)return n;let i={file:n.file};return t.trim()===``?i:{...i,alt:t}})})))}}),onMedium:T?void 0:e=>(0,Z.jsx)(Ye,{onRemove:()=>{I(c.steps.media,t=>Q(t,r,t=>Ge(t,(t.media??[]).filter((t,n)=>n!==e))))}})}),t.poll===void 0?null:T?(0,Z.jsx)(`div`,{className:`ak-x-poll`,children:t.poll.options.map((e,t)=>(0,Z.jsx)(`div`,{className:`ak-x-option`,dir:`auto`,children:e},t))}):(0,Z.jsx)(Xe,{poll:t.poll,onChange:(e,t)=>{I(c.steps.poll,t=>Q(t,r,t=>({...t,poll:e})),t===void 0?void 0:`${t}-${String(r)}`)},onRemove:()=>{I(c.steps.poll,e=>Q(e,r,e=>Ke(e)))}}),t.quote_tweet_id===void 0?null:(0,Z.jsx)(Ae,{id:t.quote_tweet_id}),a?(0,Z.jsx)(Ze,{value:C.reply_settings,disabled:T,onChange:e=>{I(c.whoCanReply,t=>{let n={...t};return e===void 0?delete n.reply_settings:n.reply_settings=e,n})}}):null,a&&!T?(0,Z.jsxs)(`div`,{className:`ak-x-c-tools`,children:[(0,Z.jsxs)(ie,{open:g===r,onOpenChange:e=>{_(e?r:void 0)},children:[(0,Z.jsx)(te,{asChild:!0,children:(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-[var(--ak-x-link)] disabled:text-[var(--ak-x-muted)]`,"aria-label":c.addMedia,title:c.addMedia,disabled:f||t.poll!==void 0,children:(0,Z.jsx)(ue,{})})}),(0,Z.jsx)(re,{className:`w-auto`,align:`start`,children:(0,Z.jsx)(de,{self:o,types:De,testId:`x-picker`,onPick:e=>{_(void 0),I(c.steps.media,t=>Q(t,r,t=>({...t,media:[...t.media??[],{file:ge(n,e)}]})))}})})]}),(0,Z.jsx)($,{label:c.addPoll,disabled:t.poll!==void 0||s.length>0,onClick:()=>{I(c.steps.poll,e=>Q(e,r,e=>({...e,poll:{options:[``,``],duration_minutes:1440}})))},children:(0,Z.jsx)(ce,{})}),(0,Z.jsx)(Qe,{post:t,onChange:e=>{I(c.disclosure,t=>Q(t,r,t=>{let n={...t,...e};return n.made_with_ai!==!0&&delete n.made_with_ai,n.paid_partnership!==!0&&delete n.paid_partnership,n}))}}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsx)($,{label:c.moveUp,disabled:r===0,onClick:()=>{I(c.steps.move,e=>{let t=[...e.posts],[n]=t.splice(r,1);return n&&t.splice(r-1,0,n),{...e,posts:t}}),y(r-1)},children:(0,Z.jsx)(se,{})}),(0,Z.jsx)($,{label:c.moveDown,disabled:i,onClick:()=>{I(c.steps.move,e=>{let t=[...e.posts],[n]=t.splice(r,1);return n&&t.splice(r+1,0,n),{...e,posts:t}}),y(r+1)},children:(0,Z.jsx)(oe,{})}),(0,Z.jsx)(qe,{text:t.text}),(0,Z.jsx)(`span`,{className:`bg-rule mx-1 h-6 w-px`,"aria-hidden":`true`}),(0,Z.jsx)(u,{variant:`outline`,size:`icon-xs`,className:`rounded-full border-[var(--ak-x-line)] text-[var(--ak-x-link)]`,"aria-label":c.addPost,title:c.addPost,onClick:()=>{U(r)},children:(0,Z.jsx)(be,{})})]}):null]}),E&&j===r?(0,Z.jsx)(k,{"data-testid":`x-agent-box`,label:Ce(E),className:`inset-x-1 inset-y-0`}):null]},r)})}),Pe=(0,Z.jsx)(`div`,{className:`ak-x`,"data-theme":B?`dark`:`light`,children:V.map((e,t)=>(0,Z.jsxs)(`div`,{ref:e=>{N.current[t]=e},className:`relative`,children:[(0,Z.jsx)(Te,{post:{text:e.text,media:R(e),poll:e.poll,quote:e.quote_tweet_id},joined:t<V.length-1,published:!0}),E&&j===t?(0,Z.jsx)(k,{"data-testid":`x-agent-shown`,className:`inset-0`}):null]},t))});return(0,Z.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`x-post-editor`,onKeyDown:we,children:[z,(0,Z.jsx)(ke.Provider,{value:fe,children:(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[w?(0,Z.jsx)(xe,{}):null,(0,Z.jsx)(pe,{pane:m,edit:Ne,preview:Pe,width:598,background:B?`#000000`:`#ffffff`,testId:`x-preview`})]})})]})}function tt(){let e=L(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,X.useState)(),[l,u]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return We.open(t,i).then(t=>{n?(e=t,c(t)):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,Z.jsx)(`div`,{className:`flex size-full`,"data-testid":`x-post-editor`,"data-state":`updating`,children:(0,Z.jsx)(O,{})}):!s||i===void 0?(0,Z.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`x-post-editor`,"data-state":`loading`,children:e.loading}):(0,Z.jsx)(et,{doc:s,dir:a,entry:i})}export{We as PostDocument,I as WORDS,tt as XPostEditor,tt as default};
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{ht as s,kt as c,n as l,t as u}from"./x-BAJilkKD.js";import{C as d,D as f,S as p,a as m,l as h,s as g}from"./schemas-DlRAoVtq.js";import{t as _}from"./session--OJYv_B7.js";import{t as ee}from"./jsx-runtime-DePvh3-m.js";import{A as te,C as ne,D as re,_ as ie,f as ae,g as oe,u as se}from"./bar-button-CJmpgNg4.js";import{C as v,E as ce,S as le,b as y,i as ue}from"./dist-DCI21ljp.js";import{t as b}from"./createLucideIcon-euu7Wcd9.js";import{t as de}from"./chart-no-axes-column-Dyy25XZ_.js";import{a as x,d as S,i as fe,l as pe,n as me,o as he,r as ge,s as _e,t as ve,u as C}from"./panes-BexRuZd2.js";import{t as ye}from"./link-CFOv3nz-.js";import{n as be,t as xe}from"./undo-2-DCbMWoug.js";import{b as Se,h as w}from"./index-omhSywJb.js";import{n as Ce,r as we,t as T}from"./updating-D0GEtwnJ.js";import{t as E}from"./collaborator-CbTacvkB.js";import{c as D,d as O,i as k,n as A,p as j,s as M}from"./browser-DEGNhKTV.js";import{_ as N,a as Te,b as Ee,c as De,f as Oe,g as P,h as F,i as ke,m as Ae,n as I,o as L,p as je,t as R,u as Me,v as z,y as B}from"./words-DgMuEmDO.js";var Ne=b(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),V=d().min(1),H=p({file:V,title:d().optional(),altText:d().optional()},{error:e=>e.code===`invalid_type`?`content.media is { file: ./demo.mp4, title: …, altText: … }`:void 0}),Pe=p({file:V,altText:d().optional()},{error:e=>e.code===`invalid_type`?`a picture of multiImage is { file: ./a.png, altText: … }`:void 0}),Fe=p({images:g(Pe)},{error:e=>e.code===`invalid_type`?`content.multiImage is { images: [ { file: ./a.png }, … ] }`:void 0}),Ie=p({question:d(),options:g(p({text:d()},{error:`a poll's option is { text: … }`})),settings:p({duration:m(N).optional()}).optional()},{error:e=>e.code===`invalid_type`?`content.poll is { question: …, options: [ { text: … }, … ], settings: { duration: SEVEN_DAYS } }`:void 0}),U=p({source:f({error:`an article's source is a web address`}),title:d().optional(),description:d().optional(),thumbnail:V.optional()},{error:e=>e.code===`invalid_type`?`content.article is { source: https://…, title: …, description: …, thumbnail: ./card.png }`:void 0}),W=p({media:H.optional(),multiImage:Fe.optional(),poll:Ie.optional(),article:U.optional()},{error:e=>e.code===`invalid_type`?`content is one of media, multiImage, poll or article`:void 0}).superRefine((e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==void 0);n.length>1&&t.addIssue({code:`custom`,message:`content holds one kind, and holds ${n.join(` and `)}: a post is pictures, a video, a document, a poll or a link, never two`})}),Le=p({commentary:d().default(``).transform(e=>e.replace(/\n+$/u,``)),visibility:m(Ee).optional(),content:W.optional(),isReshareDisabledByAuthor:h().optional()},{error:e=>e.code===`invalid_type`?`a linkedin-post's file is { commentary: …, content: … }, with visibility beside them`:void 0});function G(e,t){let n=e;for(let e of t)if(O(n)){let t=n.items.find(t=>t.key?.value===e);if(!t)return n;n=t.value??t.key}else if(j(n)&&typeof e==`number`){let t=n.items[e];if(!t)return n;n=t}else return n;return n}function K(e){let t=new k,n=A(e,{lineCounter:t,prettyErrors:!1}),r=e=>{let r=G(n.contents,e)?.range?.[0];return r===void 0?void 0:t.linePos(r).line};if(n.errors.length>0)return{errors:n.errors.map(e=>({path:[],message:e.message})),line:e=>e.length===0&&n.errors[0]?.linePos?.[0]?n.errors[0].linePos[0].line:r(e)};let i=Le.safeParse(n.toJS()??{});return i.success?{value:i.data,errors:[],line:r}:{errors:i.error.issues.map(e=>({path:e.path.filter(e=>typeof e==`string`||typeof e==`number`),message:e.message})),line:r}}function Re(e){let t=e.content;return t===void 0?[]:t.media?[{file:t.media.file,path:[`content`,`media`,`file`],role:`media`,altText:t.media.altText}]:t.multiImage?t.multiImage.images.map((e,t)=>({file:e.file,path:[`content`,`multiImage`,`images`,t,`file`],role:`picture`,altText:e.altText})):t.article?.thumbnail===void 0?[]:[{file:t.article.thumbnail,path:[`content`,`article`,`thumbnail`],role:`thumbnail`}]}function ze(e){let t=e.toLowerCase();for(let e of[`picture`,`video`,`document`])if(B[e].includes(t))return e}var Be=[`commentary`,`visibility`,`content`],Ve=e=>JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))):t),q=(e,t)=>Ve(e)===Ve(t);function He(e,t){let n=e.createNode(t);return t.includes(`
2
+ `)&&(n.type=D.BLOCK_LITERAL),n}function Ue(e,t){let n=K(e).value;if(n!==void 0&&q(n,t))return e;let r=A(e);O(r.contents)||(r.contents=new M);let i=r.contents;for(let e of Be){let n=t[e],a=i.get(e,!0);if(n===void 0||e===`commentary`&&n===``)a!==void 0&&i.delete(e);else if(e===`commentary`){let t=i.get(e);(typeof t!=`string`||t.replace(/\n+$/u,``)!==n)&&i.set(e,He(r,n))}else q(a?.toJSON?.(),n)||i.set(e,r.createNode(n))}if(i.items.length>1){let e=i.items.findIndex(e=>e.key?.value===`commentary`);if(e>0){let[t]=i.items.splice(e,1);t&&i.items.unshift(t)}}return r.toString({flowCollectionPadding:!1,lineWidth:0})}function We(e,t,n){let r=r=>q(t[r],e[r])?n[r]:t[r],i=r(`visibility`),a=r(`content`);return{...n.isReshareDisabledByAuthor===void 0?{}:{isReshareDisabledByAuthor:n.isReshareDisabledByAuthor},commentary:r(`commentary`),...i===void 0?{}:{visibility:i},...a===void 0?{}:{content:a}}}var J=e(n(),1),Y=ee(),Ge=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ke=class e{session;file;unreadable=!1;landed;snapshot;listeners=new Set;amending;stops=[];constructor(e){this.session=e,this.read(e.text),this.snapshot=this.make(),e.attach({save:e=>{if(this.file===void 0||this.unreadable)return;let t=Ue(e,this.file);return t===e?void 0:t},take:(e,t,n)=>{let r=K(e),i=K(t).value;n?.kind===`agent`&&r.value&&!Ge(i,r.value)&&(this.landed=Date.now()),r.value?(this.file=this.file===void 0||i===void 0?r.value:We(i,this.file,r.value),this.unreadable=!1):(this.file=void 0,this.unreadable=!0),this.emit()}}),this.stops.push(e.onState(()=>{this.emit()}),e.onUndo(()=>{this.emit()}))}read(e){let t=K(e);this.file=t.value,this.unreadable=t.value===void 0}static async open(t,n){return new e(await _.open(t,n))}make(){return{file:this.file,state:this.session.state,canUndo:this.session.canUndo,canRedo:this.session.canRedo,unreadable:this.unreadable,landed:this.landed}}emit(){this.snapshot=this.make();for(let e of this.listeners)e()}get text(){return this.session.text}get(){return this.snapshot}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}edit(e,t,n){let r=this.file;if(r===void 0||this.unreadable)return;let i=t(r);if(i!==r){if(n!==void 0&&this.amending?.key===n&&this.session.canUndo){let e=this.amending.from;this.session.undo(),this.push(this.amending.label,e,i)}else this.amending=n===void 0?void 0:{key:n,from:r,label:e},this.push(e,r,i)}}settle(){this.amending=void 0}push(e,t,n){this.file=n,this.session.pushEdit({label:e,undo:()=>{this.file=t,this.emit()},redo:()=>{this.file=n,this.emit()}}),this.emit()}undo(){this.amending=void 0,this.session.undo()}redo(){this.amending=void 0,this.session.redo()}async close(){for(let e of this.stops.splice(0))e();await this.session.close()}},qe=3e4;function X(e,t){let n={...e};return t===void 0?delete n.content:n.content=t,n}function Z(e){return x(e)?e.includes(`#`)?`picture`:void 0:ze(e.split(`.`).pop()??``)}function Je(e,t){if(Z(t)===`picture`){if(e?.multiImage)return{multiImage:{images:[...e.multiImage.images,{file:t}]}};if(e?.media&&Z(e.media.file)===`picture`)return{multiImage:{images:[{file:e.media.file,...e.media.altText===void 0?{}:{altText:e.media.altText}},{file:t}]}}}return{media:{file:t}}}function Ye({text:e}){let t=R(),{left:n}=P(e);return n>100?null:(0,Y.jsx)(`span`,{className:s(`text-sm tabular-nums`,n<0?`text-destructive font-semibold`:`text-muted-foreground`),"aria-label":n>=0?t.left(n):t.over(-n),"data-testid":`linkedin-count`,children:n})}function Q(e){return(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,disabled:e.disabled,onClick:e.onClick,children:e.children})}function Xe(e){let t=R();return(0,Y.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1`,children:[e.alt===void 0?null:(0,Y.jsx)(C,{alt:e.alt.value??``,onAlt:e.alt.onAlt,most:z.alt,trigger:(0,Y.jsx)(l,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,children:t.alt})}),(0,Y.jsx)(l,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media rounded-full`,"aria-label":t.remove,title:t.remove,onClick:e.onRemove,children:(0,Y.jsx)(u,{})})]})}function Ze(e){let t=R(),n=`aria-invalid:border-destructive h-10 w-full rounded-md border border-[var(--ak-li-border)] bg-transparent px-3 text-sm outline-none focus:border-[var(--ak-li-link)]`,r=F(e.poll.question)-z.poll.question;return(0,Y.jsxs)(`div`,{className:`mx-3 flex flex-col gap-2 rounded-lg border border-[var(--ak-li-border)] p-3`,"data-testid":`linkedin-poll`,children:[(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-[var(--ak-li-muted)]`,children:[t.question,(0,Y.jsx)(`input`,{className:n,value:e.poll.question,readOnly:e.locked,"aria-invalid":r>0||void 0,maxLength:z.poll.question,onChange:t=>{e.onChange({...e.poll,question:t.target.value},`question`)}})]}),e.poll.options.map((r,i)=>{let a=F(r.text)-z.poll.option;return(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-[var(--ak-li-muted)]`,children:[t.option(i+1),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`input`,{className:n,value:r.text,readOnly:e.locked,"aria-invalid":a>0||void 0,maxLength:z.poll.option,onChange:t=>{e.onChange({...e.poll,options:e.poll.options.map((e,n)=>n===i?{text:t.target.value}:e)},`option-${String(i)}`)}}),a>0?(0,Y.jsx)(`span`,{className:`text-destructive text-xs`,children:t.over(a)}):null,!e.locked&&e.poll.options.length>z.poll.least?(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":t.removeOption,title:t.removeOption,onClick:()=>{e.onChange({...e.poll,options:e.poll.options.filter((e,t)=>t!==i)})},children:(0,Y.jsx)(u,{})}):null]})]},i)}),!e.locked&&e.poll.options.length<z.poll.most?(0,Y.jsxs)(l,{variant:`outline`,size:`sm`,className:`self-start rounded-full`,onClick:()=>{e.onChange({...e.poll,options:[...e.poll.options,{text:``}]})},children:[(0,Y.jsx)(w,{}),t.addOption]}):null,(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-[var(--ak-li-border)] pt-2 text-sm`,children:[(0,Y.jsxs)(`label`,{className:`mr-auto flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[var(--ak-li-muted)]`,children:t.duration}),(0,Y.jsx)(`select`,{className:`h-8 rounded-md border border-[var(--ak-li-border)] bg-transparent px-2`,value:e.poll.settings?.duration??`SEVEN_DAYS`,disabled:e.locked,onChange:t=>{e.onChange({...e.poll,settings:{duration:t.target.value}})},children:N.map(e=>(0,Y.jsx)(`option`,{value:e,children:t.durations[e]},e))})]}),e.locked?null:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:e.onRemove,children:t.removePoll})]})]})}function Qe(e){let t=R(),n=(t,n)=>(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-[var(--ak-li-muted)]`,children:[n,(0,Y.jsx)(`input`,{className:`h-9 w-full rounded-md border border-[var(--ak-li-border)] bg-transparent px-3 text-sm text-[var(--ak-li-fg)] outline-none focus:border-[var(--ak-li-link)]`,value:e.article[t]??``,readOnly:e.locked,onChange:n=>{let r=n.target.value,{title:i,description:a,...o}={...e.article,[t]:r};e.onChange({...o,...i===void 0||i===``?{}:{title:i},...a===void 0||a===``?{}:{description:a}},t)}})]});return(0,Y.jsxs)(`div`,{className:`mx-3 mb-2 flex flex-col gap-2 rounded-lg border border-[var(--ak-li-border)] p-3`,"data-testid":`linkedin-link`,children:[n(`source`,t.link.source),n(`title`,t.link.title),n(`description`,t.link.description)]})}function $e({doc:e,dir:n,entry:o}){let s=R(),u=r(),d=a(),[f,p]=ge(),m=(0,J.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),[h,g]=(0,J.useState)(),[_,ee]=(0,J.useState)(!1),{shown:b,updating:C}=we(m.file),w=d||C,{agent:D,following:O}=t(),k=ce(),A=D?.doing!==void 0&&(D.source?.path===o||m.landed!==void 0&&m.landed>=D.at-qe),j=(0,J.useRef)(null),M=(0,J.useRef)(null);(0,J.useEffect)(()=>{O&&A&&(j.current?.scrollIntoView({block:`nearest`}),M.current?.scrollIntoView({block:`nearest`}))},[O,A,m.landed]);let N=he(n,b?Re(b).map(e=>e.file):[]);i({hold:()=>Promise.resolve({key:`${o}@${String(e.text.length)}`,what:`The LinkedIn post ${o}`,source:{path:o}}),locate:e=>{let t=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},n=t(j.current),r=t(M.current),i=n!==void 0&&c(e,n),a=r!==void 0&&c(e,r);if(!i&&!a)return Promise.resolve({elements:[]});let s=new Map;for(let n of[j.current,M.current])n?.querySelectorAll(`.ak-li-content img`).forEach((n,r)=>{let i=t(n);i!==void 0&&c(e,i)&&s.set(r,n.alt)});return Promise.resolve({elements:[{name:`the post`,source:{path:o},...b?.commentary?{text:b.commentary}:{}},...[...s].map(([e,t])=>({name:`picture ${String(e+1)} of the post`,source:{path:o},...t===``?{}:{text:t}}))],where:i?`where the post is written`:`as LinkedIn's feed will show it`})}});let Ee=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`z`&&(t.preventDefault(),t.shiftKey?e.redo():e.undo())},P=(t,n,r)=>{w||e.edit(t,n,r)},F=(0,Y.jsx)(ue,{start:(0,Y.jsxs)(Y.Fragment,{children:[w||f!==`edit`?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{label:s.undo,disabled:!m.canUndo,onClick:()=>{e.undo()},children:(0,Y.jsx)(xe,{})}),(0,Y.jsx)(Q,{label:s.redo,disabled:!m.canRedo,onClick:()=>{e.redo()},children:(0,Y.jsx)(be,{})})]}),(0,Y.jsx)(`span`,{className:`flex-1`}),(0,Y.jsx)(ve,{pane:f,onPane:p})]}),saved:{state:m.state},exports:{}}),I=u?.theme===`dark`;if(b===void 0)return(0,Y.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`linkedin-post-editor`,children:[F,(0,Y.jsx)(T,{className:`flex min-h-0 flex-1 items-center justify-center`})]});let B=b.content,V=(e,t)=>{let n=N.get(e),r=Z(e);return r===`document`?{kind:`document`,file:e,label:e.split(`/`).pop()}:n===void 0?{kind:`made`,label:x(e)?`${e} · ${s.made}`:e,file:e}:{kind:r??`picture`,src:n,alt:t,file:e}},H=B?.media?{type:`media`,medium:V(B.media.file,B.media.altText),title:B.media.title}:B?.multiImage?{type:`multiImage`,images:B.multiImage.images.map(e=>V(e.file,e.altText))}:B?.poll?{type:`poll`,question:B.poll.question,options:B.poll.options.map(e=>e.text),duration:B.poll.settings?.duration}:B?.article?{type:`article`,source:B.article.source,title:B.article.title,description:B.article.description,thumbnail:B.article.thumbnail===void 0?void 0:V(B.article.thumbnail)}:void 0,Pe=e=>{P(s.steps.media,t=>{let n=t.content;if(n?.multiImage){let r=n.multiImage.images.filter((t,n)=>n!==e),[i]=r;return X(t,r.length>1?{multiImage:{images:r}}:i?{media:i}:void 0)}if(n?.article){let e={...n.article};return delete e.thumbnail,X(t,{article:e})}return X(t,void 0)})},Fe=e=>{let t=(B?.multiImage?B.multiImage.images:B?.media&&Z(B.media.file)===`picture`?[B.media]:[])[e];if(t!==void 0)return{value:t.altText,onAlt:t=>{P(s.steps.alt,n=>{let r=e=>{let n={...e};return t.trim()===``?delete n.altText:n.altText=t,n},i=n.content;return i?.multiImage?X(n,{multiImage:{images:i.multiImage.images.map((t,n)=>n===e?r(t):t)}}):i?.media?X(n,{media:r(i.media)}):n})}}},Ie=B?.poll!==void 0||B?.article!==void 0||(B?.multiImage?.images.length??0)>=z.pictures.most||B?.media!==void 0&&Z(B.media.file)!==`picture`,U=(e,t)=>(0,Y.jsx)(le,{className:`w-auto`,align:`start`,children:(0,Y.jsx)(fe,{self:o,types:e,testId:`linkedin-picker`,onPick:e=>{g(void 0),t(_e(n,e))}})}),W=b.visibility??`PUBLIC`,Le=(0,Y.jsxs)(`div`,{ref:j,className:`ak-li ak-li-composer relative`,"data-theme":I?`dark`:`light`,"data-testid":`linkedin-composer`,children:[(0,Y.jsxs)(`div`,{className:`ak-li-c-head`,children:[(0,Y.jsx)(De,{visibility:W,avatar:64}),(0,Y.jsxs)(se,{children:[(0,Y.jsx)(ne,{asChild:!0,disabled:w,children:(0,Y.jsxs)(l,{variant:`secondary`,size:`sm`,className:`ak-li-pill`,"data-testid":`linkedin-visibility`,children:[W===`CONNECTIONS`?(0,Y.jsx)(Ne,{}):(0,Y.jsx)(Se,{}),s.postTo(W===`CONNECTIONS`?s.connections:s.anyone),(0,Y.jsx)(te,{})]})}),(0,Y.jsx)(ae,{align:`start`,children:(0,Y.jsxs)(oe,{value:W,onValueChange:e=>{P(s.steps.visibility,t=>{let n={...t};return e===`PUBLIC`?delete n.visibility:n.visibility=`CONNECTIONS`,n})},children:[(0,Y.jsx)(ie,{value:`PUBLIC`,children:s.anyone}),(0,Y.jsx)(ie,{value:`CONNECTIONS`,children:s.connections})]})})]})]}),(0,Y.jsxs)(`div`,{className:`ak-li-field`,children:[(0,Y.jsxs)(`div`,{className:`ak-li-field-words`,"aria-hidden":`true`,children:[(0,Y.jsx)(Ae,{text:b.commentary}),b.commentary.endsWith(`
3
+ `)?`​`:null]}),(0,Y.jsx)(`textarea`,{dir:`auto`,value:b.commentary,placeholder:s.share,"aria-label":s.share,readOnly:w,"data-testid":`linkedin-commentary`,onChange:e=>{let t=e.target.value;P(s.steps.text,e=>({...e,commentary:t}),`commentary`)},onBlur:()=>{e.settle()}})]}),B?.poll?(0,Y.jsx)(Ze,{poll:B.poll,locked:w,onChange:(e,t)=>{P(s.steps.poll,t=>X(t,{poll:e}),t===void 0?void 0:`poll-${t}`)},onRemove:()=>{P(s.steps.poll,e=>X(e,void 0))}}):(0,Y.jsxs)(Y.Fragment,{children:[B?.article?(0,Y.jsx)(Qe,{article:B.article,locked:w,onChange:(e,t)=>{P(s.steps.link,t=>X(t,{article:e}),`link-${t??``}`)}}):null,(0,Y.jsx)(Me,{content:H,onMedium:w?void 0:e=>(0,Y.jsx)(Xe,{alt:Fe(e),onRemove:()=>{Pe(e)}})}),B?.media&&Z(B.media.file)!==`picture`?(0,Y.jsx)(`input`,{className:`ak-li-doc-title-field`,value:B.media.title??``,placeholder:s.documentTitle,"aria-label":s.documentTitle,readOnly:w,onChange:e=>{let t=e.target.value;P(s.steps.title,e=>{let n=e.content?.media;if(!n)return e;let r={...n};return t===``?delete r.title:r.title=t,X(e,{media:r})},`title`)}}):null]}),w?null:(0,Y.jsxs)(`div`,{className:`ak-li-c-tools`,children:[(0,Y.jsxs)(y,{open:h===`media`,onOpenChange:e=>{g(e?`media`:void 0)},children:[(0,Y.jsx)(v,{asChild:!0,children:(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":B?.multiImage?s.addPicture:s.addMedia,title:B?.multiImage?s.addPicture:s.addMedia,disabled:Ie,children:(0,Y.jsx)(S,{})})}),U(B?.multiImage||B?.media?L:Te,e=>{P(s.steps.media,t=>X(t,Je(t.content,e)))})]}),(0,Y.jsxs)(y,{open:h===`document`,onOpenChange:e=>{g(e?`document`:void 0)},children:[(0,Y.jsx)(v,{asChild:!0,children:(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":s.addDocument,title:s.addDocument,disabled:B!==void 0,children:(0,Y.jsx)(re,{})})}),U(ke,e=>{P(s.steps.media,t=>X(t,{media:{file:e}}))})]}),(0,Y.jsx)(Q,{label:s.addPoll,disabled:B!==void 0,onClick:()=>{P(s.steps.poll,e=>X(e,{poll:{question:``,options:[{text:``},{text:``}]}}))},children:(0,Y.jsx)(de,{})}),(0,Y.jsx)(Q,{label:s.addLink,disabled:B!==void 0,onClick:()=>{P(s.steps.link,e=>X(e,{article:{source:`https://`}}))},children:(0,Y.jsx)(ye,{})}),B?.article&&B.article.thumbnail===void 0?(0,Y.jsxs)(y,{open:h===`thumbnail`,onOpenChange:e=>{g(e?`thumbnail`:void 0)},children:[(0,Y.jsx)(v,{asChild:!0,children:(0,Y.jsxs)(l,{variant:`ghost`,size:`sm`,children:[(0,Y.jsx)(S,{}),s.link.thumbnail]})}),U(L,e=>{P(s.steps.link,t=>t.content?.article?X(t,{article:{...t.content.article,thumbnail:e}}):t)})]}):null,(0,Y.jsx)(`span`,{className:`flex-1`}),(0,Y.jsx)(Ye,{text:b.commentary})]}),D&&A?(0,Y.jsx)(E,{"data-testid":`linkedin-agent-box`,label:k(D),className:`inset-1`}):null]}),G={commentary:b.commentary,visibility:W,content:H},K=(0,Y.jsxs)(`div`,{ref:M,className:`ak-li ak-li-previews relative`,"data-theme":I?`dark`:`light`,children:[(0,Y.jsx)(Oe,{post:G,lines:3,onFolded:ee}),_?(0,Y.jsx)(Oe,{post:G}):null,D&&A?(0,Y.jsx)(E,{"data-testid":`linkedin-agent-shown`,className:`inset-0`}):null]});return(0,Y.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`linkedin-post-editor`,onKeyDown:Ee,children:[F,(0,Y.jsx)(je.Provider,{value:pe,children:(0,Y.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[C?(0,Y.jsx)(Ce,{}):null,(0,Y.jsx)(me,{pane:f,edit:Le,preview:K,width:552,background:I?`#000000`:`#f4f2ee`,testId:`linkedin-preview`})]})})]})}function $(){let e=R(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,J.useState)(),[l,u]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return Ke.open(t,i).then(t=>{n?(e=t,c(t)):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,Y.jsx)(`div`,{className:`flex size-full`,"data-testid":`linkedin-post-editor`,"data-state":`updating`,children:(0,Y.jsx)(T,{})}):!s||i===void 0?(0,Y.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`linkedin-post-editor`,"data-state":`loading`,children:e.loading}):(0,Y.jsx)($e,{doc:s,dir:a,entry:i})}export{$ as LinkedInPostEditor,$ as default,Ke as PostDocument,I as WORDS};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t,c as n,d as r,f as i,m as a,o,s,u as c}from"./react-Byupo4pA.js";import{Dt as ee,Et as l,bt as u,ht as d,n as f,yt as p}from"./x-BAJilkKD.js";import{C as m,S as h,_ as g,s as _}from"./schemas-DlRAoVtq.js";import{F as v,j as y,o as te,x as b}from"./snapshots-DYooVfOx.js";import{t as x}from"./jsx-runtime-DePvh3-m.js";import{t as ne}from"./bar-button-CJmpgNg4.js";import{C as re,S as ie,b as ae,i as oe,v as se,y as ce}from"./dist-DCI21ljp.js";import{i as le,n as ue,r as S,t as de}from"./hint-F4fIBnVU.js";import{n as C,r as w,t as T}from"./tablet-C6oePHEW.js";import{t as fe}from"./palette-DchDLJj6.js";import{F as pe}from"./index-omhSywJb.js";import{t as me}from"./swatch-DCmD1gZl.js";var E=e(t(),1),D=x(),O=/^(#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|oklch|oklab|lab|lch)\([^)]*\))$/iu;function k(e){let t=new Map;for(let n of e.matchAll(/\[data-theme="([\w-]+)"\]\s*\{([^}]*)\}/gu)){let e=n[1]??``;if(e===``||t.has(e))continue;let r=[];for(let e of(n[2]??``).split(`;`)){let t=e.slice(e.indexOf(`:`)+1).trim();e.includes(`:`)&&O.test(t)&&r.push(t)}t.set(e,{name:e,colors:r})}return[...t.values()]}function A(e,t){let n=RegExp(`\\s${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s"'=<>\`]+))`,`iu`).exec(e);if(n)return{value:n[1]??n[2]??n[3]??``,at:n.index,length:n[0].length}}function j(e){let t=[];for(let n of e.matchAll(/<link\b[^>]*>/giu)){let e=n[0],r=A(e,`rel`)?.value.toLowerCase().split(/\s+/u)??[],i=A(e,`href`)?.value;r.includes(`stylesheet`)&&i&&t.push(i)}return t}var M=e=>/<html\b[^>]*>/iu.exec(e);function N(e){let t=M(e),n=t?A(t[0],`data-theme`)?.value:void 0;return n===void 0||n===``?void 0:n}function he(e,t){let n=M(e);if(!n)return;let r=n.index,i=A(n[0],`data-theme`),a=i?`${n[0].slice(0,i.at)} data-theme="${t}"${n[0].slice(i.at+i.length)}`:`<html data-theme="${t}"${n[0].slice(5)}`;return`${e.slice(0,r)}${a}${e.slice(r+n[0].length)}`}function P(e,t){if(/^[a-z][a-z0-9+.-]*:|^\/\//iu.test(t))return;let n=new URL(t,`file:///${e}`),r=decodeURIComponent(n.pathname).replace(/^\/+/u,``);return r===``?void 0:r}var F=h({item:y}),I={width:g().int().positive().max(4096),height:g().int().positive().max(4096)},L={scroll:h({x:g().min(0),y:g().min(0)}).optional()},R=h({selector:m(),tag:m(),text:m()}),z={"report/still":v(F.extend({...I,...L,scale:g().positive().max(4).default(1),hold:m().optional()}),h({image:h({mime:m(),data:m()})}),`A report's page drawn as the render draws it, at a frame's size, where its frame's page is scrolled: what Mark up lays over a report's frame, which the window cannot read.`),"report/hold":v(F.extend({...I,scale:g().positive().max(4).default(1)}),h({hold:m()}),`A report's page opened at a frame's size and kept as it is while a person marks it: report/still and report/at draw and read it as it was, until report/release.`),"report/release":v(h({hold:m()}),h({}),`Lets a page held for notes go.`),"report/at":v(F.extend({...I,...L,points:_(h({x:g(),y:g()})).min(1).max(24),hold:m().optional()}),h({elements:_(R)}),`What is at places of a report's page drawn at a frame's size, where its frame's page is scrolled (as report/still draws it): what a person's mark on its frame is on.`),"report/pick":v(F.extend({...I,...L,x:g(),y:g(),hold:m().optional()}),h({element:R.extend({box:h({x:g(),y:g(),width:g().positive(),height:g().positive()})}).optional()}),`The one element in front at a place of a report's page drawn at a frame's size, where its frame's page is scrolled (as report/still draws it), with its box: what Mark up's Select picks there.`)},B=b(z),V=p({en:{starting:`Opening the report…`,failed:`The report could not be shown`,copy:`Copy details`,retry:`Retry`,asleep:`A report's preview needs the agent awake.`,edit:`Edit`,width:`Width`,fit:`Fit the window`,tablet:`Tablet`,phone:`Phone`,theme:`Theme`,wide:(e,t)=>`${e}, ${String(t)} px`},"zh-cn":{starting:`正在打开报告…`,failed:`报告没能显示出来`,copy:`复制详情`,retry:`重试`,asleep:`报告预览需要 Agent 处于唤醒状态。`,edit:`编辑`,width:`宽度`,fit:`适应窗口`,tablet:`平板`,phone:`手机`,theme:`主题`,wide:(e,t)=>`${e}, ${String(t)} px`},"zh-tw":{starting:`正在開啟報告…`,failed:`報告沒能顯示出來`,copy:`複製詳情`,retry:`重試`,asleep:`報告預覽需要 Agent 處於喚醒狀態。`,edit:`編輯`,width:`寬度`,fit:`符合視窗`,tablet:`平板`,phone:`手機`,theme:`主題`,wide:(e,t)=>`${e}, ${String(t)} px`},ja:{starting:`レポートを開いています…`,failed:`レポートを表示できませんでした`,copy:`詳細をコピー`,retry:`再試行`,asleep:`レポートのプレビューにはエージェントの起動が必要です。`,edit:`編集`,width:`幅`,fit:`ウィンドウに合わせる`,tablet:`タブレット`,phone:`スマートフォン`,theme:`テーマ`,wide:(e,t)=>`${e}, ${String(t)} px`},ko:{starting:`리포트를 여는 중…`,failed:`리포트를 표시하지 못했습니다`,copy:`세부 정보 복사`,retry:`다시 시도`,asleep:`리포트 미리 보기는 에이전트가 깨어 있어야 합니다.`,edit:`편집`,width:`너비`,fit:`창에 맞추기`,tablet:`태블릿`,phone:`휴대폰`,theme:`테마`,wide:(e,t)=>`${e}, ${String(t)} px`},es:{starting:`Abriendo el informe…`,failed:`No se pudo mostrar el informe`,copy:`Copiar detalles`,retry:`Reintentar`,asleep:`La vista previa de un informe necesita al agente activo.`,edit:`Editar`,width:`Ancho`,fit:`Ajustar a la ventana`,tablet:`Tableta`,phone:`Teléfono`,theme:`Tema`,wide:(e,t)=>`${e}, ${String(t)} px`},fr:{starting:`Ouverture du rapport…`,failed:`Le rapport n’a pas pu s’afficher`,copy:`Copier les détails`,retry:`Réessayer`,asleep:`L’aperçu d’un rapport a besoin de l’agent éveillé.`,edit:`Modifier`,width:`Largeur`,fit:`Ajuster à la fenêtre`,tablet:`Tablette`,phone:`Téléphone`,theme:`Thème`,wide:(e,t)=>`${e}, ${String(t)} px`},de:{starting:`Bericht wird geöffnet…`,failed:`Der Bericht konnte nicht angezeigt werden`,copy:`Details kopieren`,retry:`Erneut versuchen`,asleep:`Die Vorschau eines Berichts braucht den wachen Agenten.`,edit:`Bearbeiten`,width:`Breite`,fit:`An Fenster anpassen`,tablet:`Tablet`,phone:`Smartphone`,theme:`Farbschema`,wide:(e,t)=>`${e}, ${String(t)} px`},pt:{starting:`Abrindo o relatório…`,failed:`Não foi possível mostrar o relatório`,copy:`Copiar detalhes`,retry:`Tentar novamente`,asleep:`A prévia de um relatório precisa do agente ativo.`,edit:`Editar`,width:`Largura`,fit:`Ajustar à janela`,tablet:`Tablet`,phone:`Celular`,theme:`Tema`,wide:(e,t)=>`${e}, ${String(t)} px`}}),H={tablet:768,phone:375},ge={fit:w,tablet:T,phone:C};function U({className:e}){let t=n();if(t===void 0)return null;let{id:r,entry:i}=t.item;return(0,D.jsx)(W,{id:r,entry:i,w:V.of(u(t.locale)),className:e},r)}function _e(e,t){let n=s(),[r,i]=(0,E.useState)({themes:[],current:void 0});return(0,E.useEffect)(()=>{let t=new AbortController;return(async()=>{let{text:r}=await n[`files/read`]({path:e}),a=new Map;for(let t of j(r)){let r=P(e,t);if(r===void 0)continue;let i=await n[`files/read`]({path:r}).then(e=>e.text,()=>``);for(let e of k(i))a.has(e.name)||a.set(e.name,e)}t.signal.aborted||i({themes:[...a.values()],current:N(r)})})().catch(()=>void 0),()=>{t.abort()}},[n,e,t]),r}var ve=e=>{let t=e.at(0)??`transparent`;return`linear-gradient(135deg, ${t} 50%, ${e.at(-1)??t} 50%)`};function ye(e){let[t,n]=(0,E.useState)({width:0,height:0});return(0,E.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(([e])=>{e&&n({width:e.contentRect.width,height:e.contentRect.height})});return r.observe(t),()=>{r.disconnect()}},[e]),t}function W({id:e,entry:t,w:n,className:u}){let p=s(),m=e.slice(e.lastIndexOf(`/`)+1),[h,g]=(0,E.useState)({at:`starting`}),[_,v]=(0,E.useState)(0),[y,b]=(0,E.useState)(`fit`),[x,C]=(0,E.useState)(0);c(e,()=>{C(e=>e+1)});let[w,T]=(0,E.useState)(0),{themes:O,current:k}=_e(t,x),A=a(),j=!A&&O.length>0,[M,N]=(0,E.useState)(),P=M!==void 0&&M.over===k?M.name:k,F=async e=>{N({name:e,over:k});for(let n=0;n<2;n++){let{text:r,version:i}=await p[`files/read`]({path:t}),a=he(r,e);if(a===void 0||a===r)return;try{await p[`files/write`]({path:t,text:a,over:i});return}catch(e){if(n===1)throw e}}},I=(0,E.useRef)(null),L=ye(I),R=(0,E.useRef)(null),z=o(R),V=h.at===`asleep`?A:void 0;(0,E.useEffect)(()=>{let t=!0;return pe(p,`items/page`,{item:e}).then(({url:e})=>{t&&g({at:`ready`,url:e})},e=>{t&&g(te(e)?{at:`asleep`}:{at:`failed`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[p,e,_,V]);let U=y!==`fit`,W=U?16:0,G=y===`fit`?Math.max(1,Math.round(L.width)):H[y],be=Math.max(1,L.width-2*W),K=L.width>0?Math.min(1,be/G):1,q=Math.max(1,Math.round((L.height-W)/K));i({hold:()=>Promise.resolve({key:`report@${e}@${crypto.randomUUID()}`,what:m,source:{path:t}}),locate:()=>Promise.resolve({elements:[]})});let J=()=>{let e=R.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0},Y=e=>({name:`the element ${e.selector} of the report`,source:{path:t},...e.text===``?{}:{text:e.text}}),X=()=>{let{y:e}=z.at();return`on the report ${m}, ${String(G)} px wide, ${e>0?`scrolled ${String(Math.round(e))} px down`:`from its top`}`},Z=(0,E.useRef)(void 0),Q=()=>Z.current??Promise.resolve(void 0),$=()=>Math.min(4,Math.max(1,window.devicePixelRatio*K));return r({element:()=>R.current,hold:()=>(Z.current=B(p,`report/hold`,{item:e,width:G,height:q,scale:$()}).then(e=>e.hold,()=>void 0),Z.current.then(()=>void 0)),release:()=>{let e=Z.current;Z.current=void 0,e?.then(e=>e===void 0?void 0:B(p,`report/release`,{hold:e}).catch(()=>void 0))},pictures:async()=>{let t=J();if(!t)return[];let n=await Q(),{image:r}=await B(p,`report/still`,{item:e,width:G,height:q,scale:$(),scroll:z.at(),...n===void 0?{}:{hold:n}});return[{...r,rect:t}]},locate:async n=>{let r=J(),i=r?l(n).map(e=>({x:(e.x-r.x)/K,y:(e.y-r.y)/K})).filter(e=>e.x>=0&&e.y>=0&&e.x<=G&&e.y<=q):[],a=await Q(),o=i.length>0?await B(p,`report/at`,{item:e,width:G,height:q,points:i,scroll:z.at(),...a===void 0?{}:{hold:a}}).catch(()=>void 0):void 0;return{elements:o&&o.elements.length>0?o.elements.map(Y):[{name:`the report ${m}`,source:{path:t}}],where:X()}},pick:async t=>{let n=J();if(!n)return;let r=(t.x-n.x)/K,i=(t.y-n.y)/K;if(r<0||i<0||r>G||i>q)return;let a=await Q(),{element:o}=await B(p,`report/pick`,{item:e,width:G,height:q,x:r,y:i,scroll:z.at(),...a===void 0?{}:{hold:a}});if(!o)return;let s=o.box,c=Math.max(0,s.x),l=Math.max(0,s.y),u=Math.min(G,s.x+s.width),d=Math.min(q,s.y+s.height);if(!(u<=c||d<=l))return{element:Y(o),outline:ee({x:n.x+c*K,y:n.y+l*K,width:(u-c)*K,height:(d-l)*K}),where:X()}}}),h.at===`asleep`?(0,D.jsxs)(`div`,{className:d(`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,u),children:[(0,D.jsx)(`p`,{className:`text-sm text-lead`,children:n.asleep}),(0,D.jsx)(f,{size:`xs`,onClick:()=>{p[`edit/request`]({}).catch(()=>void 0)},children:n.edit})]}):(0,D.jsxs)(`div`,{className:d(`absolute inset-0 flex flex-col`,u),children:[(0,D.jsx)(oe,{start:(0,D.jsxs)(de,{children:[j&&(0,D.jsxs)(ae,{children:[(0,D.jsx)(re,{asChild:!0,children:(0,D.jsxs)(ne,{"data-testid":`report-theme`,children:[(0,D.jsx)(fe,{}),n.theme]})}),(0,D.jsx)(ie,{align:`start`,className:`w-auto p-3`,children:(0,D.jsx)(`div`,{role:`radiogroup`,"aria-label":n.theme,className:`flex flex-wrap gap-1.5`,children:O.map(e=>(0,D.jsx)(me,{color:ve(e.colors),label:e.name,checked:e.name===P,onClick:()=>{F(e.name).catch(()=>{N(void 0)})}},e.name))})})]}),(0,D.jsx)(se,{type:`single`,size:`sm`,"aria-label":n.width,value:y,onValueChange:e=>{(e===`fit`||e in H)&&b(e)},children:[`fit`,`tablet`,`phone`].map(e=>{let t=ge[e],r=e===`fit`?n.fit:n.wide(n[e],H[e]);return(0,D.jsxs)(S,{children:[(0,D.jsx)(ue,{asChild:!0,children:(0,D.jsx)(ce,{value:e,"aria-label":r,children:(0,D.jsx)(t,{className:`size-4`})})}),(0,D.jsx)(le,{children:r})]},e)})})]})}),(0,D.jsxs)(`div`,{ref:I,className:`relative min-h-0 flex-1 overflow-hidden bg-stone`,children:[h.at===`ready`&&L.width>0&&(w===x?[x]:[w,x]).map(e=>{let t=e===w;return(0,D.jsx)(`iframe`,{ref:t?R:void 0,title:m,src:h.url,"data-testid":t?`report`:void 0,"aria-hidden":!t||void 0,tabIndex:t?void 0:-1,sandbox:`allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox`,className:d(`absolute border-0 bg-page`,U&&`shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_3px_rgb(0_0_0/0.12)]`),onLoad:t?void 0:t=>{z.to(t.currentTarget,z.at()),setTimeout(()=>{T(t=>e>t?e:t)},250)},style:{width:G,height:q,top:W,left:Math.max(0,(L.width-G*K)/2),transform:`scale(${String(K)})`,transformOrigin:`top left`,zIndex:+!!t}},e)}),h.at===`starting`&&(0,D.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-lead`,children:(0,D.jsx)(`span`,{className:`motion-safe:animate-pulse`,children:n.starting})}),h.at===`failed`&&(0,D.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,children:[(0,D.jsx)(`p`,{className:`text-sm text-ink`,children:n.failed}),(0,D.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,D.jsx)(f,{size:`xs`,variant:`ghost`,className:`text-lead`,onClick:()=>{navigator.clipboard.writeText(h.message).catch(()=>void 0)},children:n.copy}),(0,D.jsx)(f,{size:`xs`,onClick:()=>{g({at:`starting`}),v(e=>e+1)},children:n.retry})]})]})]})]})}export{V as WORDS,U as default};
@@ -0,0 +1,16 @@
1
+ import{i as e,n as t,t as n}from"./rolldown-runtime-COiEfhsA.js";import{a as r,b as i,c as a,f as o,p as s,s as c}from"./react-Byupo4pA.js";import{Dt as l,Et as u,ht as d,kt as f,yt as p}from"./x-BAJilkKD.js";import{E as m}from"./snapshots-DYooVfOx.js";import{t as h}from"./session--OJYv_B7.js";import{t as g}from"./jsx-runtime-DePvh3-m.js";import{t as _}from"./bar-button-CJmpgNg4.js";import{C as v,E as ee,O as y,S as b,_ 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}from"./dist-DCI21ljp.js";import{t as de}from"./createLucideIcon-euu7Wcd9.js";import{t as fe}from"./audio-lines-BFoW_IeO.js";import{t as pe}from"./group-DwM2yqU8.js";import{c as me,i as x,n as he,o as S,r as ge,t as _e}from"./syntax-Bqyhj0dw.js";import{t as ve}from"./minus-ngE8owxs.js";import{t as ye}from"./palette-DchDLJj6.js";import{n as be,t as xe}from"./undo-2-DCbMWoug.js";import{t as Se}from"./square-arrow-out-up-right-1NqFsNDe.js";import{t as Ce}from"./sticky-note-s4QfzaBB.js";import{t as we}from"./trash-2-SFReAxVM.js";import{F as Te,a as C,b as Ee,d as De,h as w,x as Oe,y as ke}from"./index-omhSywJb.js";import{n as Ae,r as je,t as T}from"./updating-D0GEtwnJ.js";import{c as Me,l as Ne,n as Pe,o as Fe,r as Ie,t as Le}from"./dist-D2a_y4AE.js";import{t as Re}from"./collaborator-CbTacvkB.js";import{t as E}from"./row-DqS4-5b1.js";import{t as D}from"./swatch-DCmD1gZl.js";import{A as O,F as k,L as ze,M as Be,R as A,S as Ve,_ as j,a as He,b as M,g as Ue,h as We,i as Ge,j as Ke,m as qe,n as Je,p as Ye,r as Xe,t as Ze,v as Qe,x as $e,y as et,z as tt}from"./syntax-C0iPON60.js";var nt={".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`},rt=e=>nt[/\.[^./]+$/u.exec(e)?.[0].toLowerCase()??``]??`application/octet-stream`,it=de(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),at=de(`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`}]]),ot=de(`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`}]]),st=de(`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`}]]),ct=[`1`,`2`,`3`,`4`,`5`,`6`],lt=[`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,ut=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,dt=(e,t)=>typeof t==`string`&&e.includes(t)?t:void 0;function ft(e){let t=I(e.id),n=I(e.type),r=ut(e.x),i=ut(e.y),a=ut(e.width),o=ut(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 pt(e){let t=I(e.id),n=I(e.fromNode),r=I(e.toNode);if(t&&n&&r)return{id:t,fromNode:n,fromSide:dt(lt,e.fromSide),fromEnd:dt(N,e.fromEnd)??`none`,toNode:r,toSide:dt(lt,e.toSide),toEnd:dt(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 mt(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(ft(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(pt(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 ht=e=>e.nodes.flatMap(e=>{let t=ft(e);return t?[t]:[]}),gt=e=>e.edges.flatMap(e=>{let t=pt(e);return t?[t]:[]});function _t(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 vt(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 yt=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function bt(e,t,n){if(yt(t,e))return n;if(yt(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=>!yt(t[n],e[n]));return z(n,Object.fromEntries(r.map(e=>[e,t[e]])))}function xt(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=bt(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=bt(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 St(e,t,n){let r=bt(e.top,t.top,n.top)??{};return{nodes:xt(e.nodes,t.nodes,n.nodes),edges:xt(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 Ct(e,t,n){return{...e,nodes:B(e.nodes,t.nodes,n),edges:B(e.edges,t.edges,n)}}function wt(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 Tt=e=>e.nodes.length===0&&e.edges.length===0;function Et(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 Dt(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ot=/[ \t\n\f\r]/g;function kt(e){return typeof e==`object`?e.type===`text`&&At(e.value):At(e)}function At(e){return e.replace(Ot,``)===``}var jt=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};jt.prototype.normal={},jt.prototype.property={},jt.prototype.space=void 0;function Mt(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new jt(n,r,t)}function Nt(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 Pt=t({boolean:()=>H,booleanish:()=>U,commaOrSpaceSeparated:()=>K,commaSeparated:()=>Lt,number:()=>W,overloadedBoolean:()=>It,spaceSeparated:()=>G}),Ft=0,H=Rt(),U=Rt(),It=Rt(),W=Rt(),G=Rt(),Lt=Rt(),K=Rt();function Rt(){return 2**++Ft}var zt=Object.keys(Pt),Bt=class extends V{constructor(e,t,n,r){let i=-1;if(super(e,t),Vt(this,`space`,r),typeof n==`number`)for(;++i<zt.length;){let e=zt[i];Vt(this,zt[i],(n&Pt[e])===Pt[e])}}};Bt.prototype.defined=!0;function Vt(e,t,n){n&&(e[t]=n)}function Ht(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Bt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Nt(r)]=r,n[Nt(a.attribute)]=r}return new jt(t,n,e.space)}var Ut=Ht({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 Wt(e,t){return t in e?e[t]:t}function Gt(e,t){return Wt(e,t.toLowerCase())}var Kt=Ht({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Lt,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|Lt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:H,defer:H,dir:null,dirName:null,disabled:H,download:It,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:It,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:Lt,part:G,prefix:null,property:null,results:W,security:null,unselectable:null},space:`html`,transform:Gt}),qt=Ht({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:Lt,g2:Lt,glyphName:Lt,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:Wt}),Jt=Ht({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()}}),Yt=Ht({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Gt}),Xt=Ht({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Zt={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`},Qt=/[A-Z]/g,$t=/-[a-z]/g,en=/^data[-\w.:]+$/i;function tn(e,t){let n=Nt(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`&&en.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace($t,rn);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!$t.test(e)){let n=e.replace(Qt,nn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Bt}return new i(r,t)}function nn(e){return`-`+e.toLowerCase()}function rn(e){return e.charAt(1).toUpperCase()}var an=Mt([Ut,Kt,Jt,Yt,Xt],`html`),on=Mt([Ut,qt,Jt,Yt,Xt],`svg`);function sn(e){return e.join(` `).trim()}var cn=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 y(){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 b(){var e=[];v(e);for(var t;t=y();)t!==!1&&(e.push(t),v(e));return e}return _(),b()}function d(e){return e?e.replace(l,``):``}t.exports=u})),ln=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(cn());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}})),un=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))}})),dn=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ln()),i=un();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})),fn=mn(`end`),pn=mn(`start`);function mn(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 hn(e){let t=pn(e),n=fn(e);if(t&&n)return{start:t,end:n}}var gn=e(dn(),1),_n={}.hasOwnProperty,vn=new Map,yn=/[A-Z]/g,bn=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),xn=new Set([`td`,`th`]),Sn=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Cn(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=Pn(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=Nn(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`?on:an,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wn(e,t,n){if(t.type===`element`)return Tn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return En(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return On(e,t,n);if(t.type===`mdxjsEsm`)return Dn(e,t);if(t.type===`root`)return kn(e,t,n);if(t.type===`text`)return An(e,t)}function Tn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=on,e.schema=i),e.ancestors.push(t);let a=Bn(e,t.tagName,!1),o=Fn(e,t),s=Ln(e,t);return bn.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!kt(e)})),jn(e,o,a,t),Mn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function En(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)}Vn(e,t.position)}function Dn(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vn(e,t.position)}function On(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=on,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Bn(e,t.name,!0),o=In(e,t),s=Ln(e,t);return jn(e,o,a,t),Mn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function kn(e,t,n){let r={};return Mn(r,Ln(e,t)),e.create(t,e.Fragment,r,n)}function An(e,t){return t.value}function jn(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Nn(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 Pn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=pn(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 Fn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&_n.call(t.properties,i)){let a=Rn(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&xn.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 In(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 Vn(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 Vn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Ln(e,t){let n=[],r=-1,i=e.passKeys?new Map:vn;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=wn(e,a,o);s!==void 0&&n.push(s)}return n}function Rn(e,t,n){let r=tn(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Dt(n):sn(n)),r.property===`style`){let t=typeof n==`object`?n:zn(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Hn(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Zt[r.property]||r.property:r.attribute,n]}}function zn(e,t){try{return(0,gn.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new x("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=Sn+`#cannot-parse-style-attribute`,r}}function Bn(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=S(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=S(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return _n.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vn(e)}function Vn(e,t){let n=new x("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=Sn+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Hn(e){let t={},n;for(n in e)_n.call(e,n)&&(t[Un(n)]=e[n]);return t}function Un(e){let t=e.replace(yn,Wn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Wn(e){return`-`+e.toLowerCase()}var Gn={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 Kn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ke(e.charCodeAt(n+1))&&Ke(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 qn(e){let t=this;t.parser=n;function n(n){return Ve(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Jn(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 Yn(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
6
+ `}]}function Xn(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 Zn(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qn(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $n(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Kn(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 er(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 tr(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nr(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 rr(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nr(e,t);let i={src:Kn(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 ir(e,t){let n={src:Kn(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 ar(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 or(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nr(e,t);let i={href:Kn(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 sr(e,t){let n={href:Kn(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 cr(e,t,n){let r=e.all(t),i=n?lr(n):ur(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 lr(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=ur(n[r])}return t}function ur(e){return e.spread??e.children.length>1}function dr(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 fr(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pr(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mr(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hr(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=pn(t.children[1]),o=fn(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 gr(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 _r(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var vr=9,yr=32;function br(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(xr(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(xr(t.slice(i),i>0,!1)),a.join(``)}function xr(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===vr||t===yr;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===vr||t===yr;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Sr(e,t){let n={type:`text`,value:br(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cr(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var wr={blockquote:Jn,break:Yn,code:Xn,delete:Zn,emphasis:Qn,footnoteReference:$n,heading:er,html:tr,imageReference:rr,image:ir,inlineCode:ar,linkReference:or,link:sr,listItem:cr,list:dr,paragraph:fr,root:pr,strong:mr,table:hr,tableCell:_r,tableRow:gr,text:Sr,thematicBreak:Cr,toml:Tr,yaml:Tr,definition:Tr,footnoteDefinition:Tr};function Tr(){}var{defineProperty:Er}=Object,Dr=typeof self==`object`?self:globalThis,Or=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Dr[e](t)},kr=(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__`?Er(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 Dr[e]==`function`?Or(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(Or(a,o),i)};return r},Ar=e=>kr(new Map,e)(0),jr=``,{toString:Mr}={},{keys:Nr,is:Pr}=Object,Fr=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Mr.call(e).slice(8,-1);switch(n){case`Array`:return[1,jr];case`Object`:return[2,jr];case`Date`:return[3,jr];case`RegExp`:return[4,jr];case`Map`:return[5,jr];case`Set`:return[6,jr];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Ir=([e,t])=>e===0&&(t===`function`||t===`symbol`),Lr=(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]=Fr(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Pr(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 Nr(o))(e||!Ir(Fr(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?jr: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||!(Ir(Fr(n))||Ir(Fr(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Ir(Fr(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Rr=(e,{json:t,lossy:n}={})=>{let r=[];return Lr(!(t||n),!!t,new Map,r)(e),r},zr=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Ar(Rr(e,t)):structuredClone(e):(e,t)=>Ar(Rr(e,t));function Br(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 Vr(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Hr(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Br,r=e.options.footnoteBackLabel||Vr,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=Kn(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:{...zr(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 Ur={}.hasOwnProperty,Wr={};function Gr(e,t){let n=t||Wr,r=new Map,i=new Map,a={all:s,applyData:qr,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...wr,...n.handlers},one:o,options:n,patch:Kr,wrap:Yr};return Qe(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(Ur.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=zr(n);return r.children=a.all(e),r}return zr(e)}return(a.options.unknownHandler||Jr)(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=Xr(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Xr(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Kr(e,t){e.position&&(t.position=hn(e))}function qr(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,zr(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Jr(e,t){let n=t.data||{},r=`value`in t&&!(Ur.call(n,`hProperties`)||Ur.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 Yr(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 Xr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Zr(e,t){let n=Gr(e,t),r=n.one(e,void 0),i=Hr(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 Qr(e,t){return e&&`run`in e?async function(n,r){let i=Zr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Zr(n,{file:r,...e||t})}}function $r(e){if(e)throw e}var ei=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 ti(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 ni(){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?ri(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 ri(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:ii,dirname:ai,extname:oi,join:si,sep:`/`};function ii(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ui(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 ai(e){if(ui(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 oi(e){ui(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 si(...e){let t=-1,n;for(;++t<e.length;)ui(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ci(n)}function ci(e){ui(e);let t=e.codePointAt(0)===47,n=li(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function li(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 ui(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var di={cwd:fi};function fi(){return`/`}function pi(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function mi(e){if(typeof e==`string`)e=new URL(e);else if(!pi(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 hi(e)}function hi(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 gi=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],_i=class{constructor(e){let t;t=e?pi(e)?{path:e}:typeof e==`string`||xi(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:di.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<gi.length;){let e=gi[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)gi.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?q.basename(this.path):void 0}set basename(e){yi(e,`basename`),vi(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){bi(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(vi(e,`extname`),bi(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){pi(e)&&(e=mi(e)),yi(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){yi(e,`stem`),vi(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 x(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 vi(e,t){if(e&&e.includes(q.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+q.sep+"`")}function yi(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function bi(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function xi(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Si=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ci=e(ei(),1),wi={}.hasOwnProperty,Ti=new class e extends Si{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=ni()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ci.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Oi(`data`,this.frozen),this.namespace[e]=t,this):wi.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Oi(`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=ji(e),n=this.parser||this.Parser;return Ei(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ei(`process`,this.parser||this.Parser),Di(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ji(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);Ni(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(),Ei(`processSync`,this.parser||this.Parser),Di(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ai(`processSync`,`process`,t),n;function r(e,r){t=!0,$r(e),n=r}}run(e,t,n){ki(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=ji(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),Ai(`runSync`,`run`,n),r;function i(e,t){$r(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ji(t),r=this.compiler||this.Compiler;return Di(`stringify`,r),ki(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Oi(`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,Ci.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];ti(o)&&ti(r)&&(r=(0,Ci.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ei(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Di(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Oi(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 ki(e){if(!ti(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ai(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ji(e){return Mi(e)?e:new _i(e)}function Mi(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Ni(e){return typeof e==`string`||Pi(e)}function Pi(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var J=g(),Y=e(i(),1),Fi=[],Ii={allowDangerousHtml:!0},Li=/^(https?|ircs?|mailto|xmpp)$/i,Ri=[{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 zi(e){let t=Bi(e),n=Vi(e);return Hi(t.runSync(t.parse(n),n),e)}function Bi(e){let t=e.rehypePlugins||Fi,n=e.remarkPlugins||Fi,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ii}:Ii;return Ti().use(qn).use(n).use(Qr,r).use(t)}function Vi(e){let t=e.children||``,n=new _i;return typeof t==`string`?n.value=t:``+t,n}function Hi(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Ui;for(let e of Ri)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Qe(e,l),Cn(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 Gn)if(Object.hasOwn(Gn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Gn[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 Ui(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||Li.test(e.slice(0,t))?e:``}function Wi(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 Gi(e,t,n){let r=$e((n||{}).ignore||[]),i=Ki(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 et}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 Ki(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([qi(e[0]),Ji(e[1])])}return t}function qi(e){return typeof e==`string`?new RegExp(j(e),`g`):e}function Ji(e){return typeof e==`function`?e:function(){return e}}var Yi=`phrasing`,Xi=[`autolink`,`link`,`image`,`label`];function Zi(){return{transforms:[aa],enter:{literalAutolink:$i,literalAutolinkEmail:ea,literalAutolinkHttp:ea,literalAutolinkWww:ea},exit:{literalAutolink:ia,literalAutolinkEmail:ra,literalAutolinkHttp:ta,literalAutolinkWww:na}}}function Qi(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Yi,notInConstruct:Xi},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Yi,notInConstruct:Xi},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Yi,notInConstruct:Xi}]}}function $i(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function ea(e){this.config.enter.autolinkProtocol.call(this,e)}function ta(e){this.config.exit.autolinkProtocol.call(this,e)}function na(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 ra(e){this.config.exit.autolinkEmail.call(this,e)}function ia(e){this.exit(e)}function aa(e){Gi(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,oa],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,sa]],{ignore:[`link`,`linkReference`]})}function oa(e,t,n,r,i){let a=``;if(!ua(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!ca(n)))return!1;let o=la(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 sa(e,t,n,r){return!ua(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function ca(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 la(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=Wi(e,`(`),a=Wi(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 ua(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||A(n)||ze(n))&&(!t||n!==47)}function da(){return[Zi(),We(),Ye(),Ge(),he()]}function fa(e){return{extensions:[Qi(),Ue(e),qe(),He(e),ge()]}}var pa={tokenize:Ta,partial:!0},ma={tokenize:Ea,partial:!0},ha={tokenize:Da,partial:!0},ga={tokenize:Oa,partial:!0},_a={tokenize:ka,partial:!0},va={name:`wwwAutolink`,tokenize:Ca,previous:Aa},ya={name:`protocolAutolink`,tokenize:wa,previous:ja},X={name:`emailAutolink`,tokenize:Sa,previous:Ma},Z={};function ba(){return{text:Z}}for(var xa=48;xa<123;)Z[xa]=X,xa++,xa===58?xa=65:xa===91&&(xa=97);Z[43]=X,Z[45]=X,Z[46]=X,Z[95]=X,Z[72]=[X,ya],Z[104]=[X,ya],Z[87]=[X,va],Z[119]=[X,va];function Sa(e,t,n){let r=this,i,a;return o;function o(t){return!Na(t)||!Ma.call(r,r.previous)||Pa(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Na(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(_a,u,l)(t):t===45||t===95||Ke(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&&O(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Ca(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Aa.call(r,r.previous)||Pa(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(pa,e.attempt(ma,e.attempt(ha,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function wa(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&ja.call(r,r.previous)&&!Pa(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(O(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||Be(t)||k(t)||A(t)||ze(t)?n(t):e.attempt(ma,e.attempt(ha,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Ta(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 Ea(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ga,c,s)(t):t===null||k(t)||A(t)||t!==45&&ze(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 Da(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(ga,t,a)(o):o===null||k(o)||A(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Oa(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||k(o)||A(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||k(e)||A(e)?t(e):r(e)}function a(e){return O(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):O(t)?(e.consume(t),o):n(t)}}function ka(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ke(e)?n(e):t(e)}}function Aa(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||k(e)}function ja(e){return!O(e)}function Ma(e){return!(e===47||Na(e))}function Na(e){return e===43||e===45||e===46||e===95||Ke(e)}function Pa(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 Fa(e){return tt([ba(),Xe(),Je(e),Ze(),_e()])}var Ia={};function La(e){let t=this,n=e||Ia,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Fa(n)),a.push(da()),o.push(fa(n))}function Ra(){let e=c(),[t,n]=(0,Y.useState)();return(0,Y.useEffect)(()=>{let t=!0,r,i=()=>{Te(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 za(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=rt(n);return/^(image|video|audio)\//u.test(i)?{type:`media`,path:n,mime:i}:{type:`file`,path:n}}var Ba=new Map;function Va(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=Ba.get(a);return o||(o=Te(e,`items/preview`,{item:t}).then(e=>e.preview,()=>void 0),Ba.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 Ha=new Map;function Ua(e,t){let[n,r]=(0,Y.useState)();return(0,Y.useEffect)(()=>{if(t===void 0)return;let n=!0,i=Ha.get(t);return i||(i=e[`files/url`]({path:t}).then(e=>e.url,()=>void 0),Ha.set(t,i)),i.then(e=>{n&&r(e)}),()=>{n=!1}},[e,t]),n}var Wa=new Map;function Ga(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=Wa.get(a);return o||(o=e[`files/list`]({dir:a}).then(e=>new Set([...e.files.map(e=>e.path),...e.dirs]),()=>void 0),Wa.set(a,o),setTimeout(()=>Wa.delete(a),2e3)),o.then(e=>{n&&r(e===void 0?void 0:e.has(t))}),()=>{n=!1}},[e,t]),n}var Ka=p({en:{loading:`Opening the canvas…`,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`,edits:{add:`Add`,move:`Move`,resize:`Resize`,type:`Typing`,delete:`Delete`,color:`Colour`,group:`Group`,connect:`Connect`,label:`Label`}},"zh-cn":{loading:`正在打开画布…`,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}”节点,按原样保留`,edits:{add:`添加`,move:`移动`,resize:`调整大小`,type:`输入`,delete:`删除`,color:`颜色`,group:`分组`,connect:`连接`,label:`标签`}},"zh-tw":{loading:`正在開啟畫布…`,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}」節點,依原樣保留`,edits:{add:`新增`,move:`移動`,resize:`調整大小`,type:`輸入`,delete:`刪除`,color:`顏色`,group:`群組`,connect:`連接`,label:`標籤`}},ja:{loading:`キャンバスを開いています…`,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}」ノード(そのまま保持)`,edits:{add:`追加`,move:`移動`,resize:`サイズ変更`,type:`入力`,delete:`削除`,color:`色`,group:`グループ`,connect:`接続`,label:`ラベル`}},ko:{loading:`캔버스를 여는 중…`,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}” 노드, 그대로 유지됨`,edits:{add:`추가`,move:`이동`,resize:`크기 조정`,type:`입력`,delete:`삭제`,color:`색상`,group:`그룹`,connect:`연결`,label:`레이블`}},es:{loading:`Abriendo el lienzo…`,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`,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…`,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`,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 …`,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`,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…`,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á`,edits:{add:`Adicionar`,move:`Mover`,resize:`Redimensionar`,type:`Digitação`,delete:`Excluir`,color:`Cor`,group:`Agrupar`,connect:`Conectar`,label:`Rótulo`}}});function qa(){return Ka.of(a()?.locale)}var Ja={1:`#cf5f5a`,2:`#d98a45`,3:`#c9a63a`,4:`#579f67`,5:`#459fb2`,6:`#8f78bd`},Ya=e=>e===void 0?void 0:Ja[e]??(/^#[0-9a-f]{3,8}$/iu.test(e)?e:void 0);function Xa({target:e,className:t}){return e.type===`item`?(0,J.jsx)(De,{name:e.item.kindInfo?.icon,className:t}):e.type===`media`?e.mime.startsWith(`audio/`)?(0,J.jsx)(fe,{className:t,"aria-hidden":!0}):(0,J.jsx)(ke,{className:t,"aria-hidden":!0}):(0,J.jsx)(Oe,{className:t,"aria-hidden":!0})}var Za=e=>e.slice(e.lastIndexOf(`/`)+1);function Qa(e){return e.type===`item`?e.item.title??Za(e.item.id):Za(e.path)}function $a({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)(zi,{remarkPlugins:[La],children:e})})}function eo({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 to({icon:e,words:t,className:n}){return(0,J.jsxs)(`div`,{className:d(`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 no({target:e,project:t}){let n=Va(c(),e.item.id,t?.revision);return n===void 0||n===`none`?(0,J.jsx)(to,{icon:(0,J.jsx)(Xa,{target:e}),words:e.item.id}):(0,J.jsxs)(`div`,{className:`relative size-full`,children:[(0,J.jsx)(eo,{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 ro({target:e,active:t}){let n=Ua(c(),e.path),r=s(e.mime),i=(0,J.jsx)(to,{icon:(0,J.jsx)(Xa,{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 io({node:e,project:t,active:n}){let r=qa(),i=c(),a=e.file??``,o=za(t,a),s=Ga(i,o.type===`item`?void 0:o.path);return o.type===`item`?(0,J.jsx)(no,{target:o,project:t}):s===!1||a===``?(0,J.jsx)(to,{icon:(0,J.jsx)(it,{"aria-hidden":!0}),words:r.missing(a),className:`text-problem-text`}):o.type===`media`?(0,J.jsx)(ro,{target:o,active:n}):(0,J.jsx)(to,{icon:(0,J.jsx)(Oe,{"aria-hidden":!0}),words:a})}function ao({node:e,project:t}){let n=a()?.locale??`en`,r=za(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)(Xa,{target:r,className:`size-3.5 flex-none`}),(0,J.jsx)(`span`,{className:`truncate`,children:Qa(r)}),i===void 0?null:(0,J.jsx)(`span`,{className:`text-lead-soft flex-none`,children:i})]})}function oo({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)(Ee,{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 so({type:e}){let t=qa();return(0,J.jsx)(to,{icon:(0,J.jsx)(Oe,{"aria-hidden":!0}),words:t.unknownType(e)})}var co=typeof navigator<`u`&&navigator.userAgent.includes(`Mac`)?`⌘`:`Ctrl+`,Q=(e,t)=>t===void 0?e:`${e} (${t})`,lo=`application/x-allyhub-canvas-note`,uo=`bg-sheet border-rule shadow-overlay pointer-events-auto flex items-center gap-0.5 rounded-lg border p-1`,fo=/\.(?:png|jpe?g|webp|avif|gif|svg|mp4|webm|mov|mp3|wav|m4a|ogg|aac|flac)$/iu;async function po(e,t,n=3){let r=await e(t).catch(()=>({files:[],dirs:[]})),i=r.files.map(e=>e.path).filter(e=>fo.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=>po(e,t,n-1)));return[...i,...a.flat()]}function mo(e){let t=qa(),n=c(),r=a()?.locale??`en`,[i,o]=(0,Y.useState)(``),[s,l]=(0,Y.useState)([]);(0,Y.useEffect)(()=>{let e=!0;return po(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=s.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)(C,{autoFocus:!0,value:i,placeholder:t.find,"aria-label":t.find,onChange:e=>{o(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)(E,{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)(E,{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 ho(e){let t=qa(),[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:d(uo,`absolute bottom-3 left-1/2 -translate-x-1/2`),children:[(0,J.jsx)(_,{icon:!0,draggable:!0,"aria-label":t.note,title:t.noteHint,"data-testid":`canvas-add-note`,onClick:e.onNote,onDragStart:e=>{e.dataTransfer.setData(lo,`text`),e.dataTransfer.effectAllowed=`copy`},children:(0,J.jsx)(Ce,{})}),(0,J.jsxs)(ne,{open:n,onOpenChange:r,children:[(0,J.jsx)(v,{asChild:!0,children:(0,J.jsx)(_,{icon:!0,"aria-label":t.file,title:t.fileHint,"data-testid":`canvas-add-file`,children:(0,J.jsx)(st,{})})}),(0,J.jsx)(b,{side:`top`,align:`center`,className:`w-auto p-2`,children:(0,J.jsx)(mo,{project:e.project,self:e.self,onPick:t=>{r(!1),e.onFile(t)}})})]}),(0,J.jsxs)(ne,{open:i,onOpenChange:a,children:[(0,J.jsx)(v,{asChild:!0,children:(0,J.jsx)(_,{icon:!0,"aria-label":t.link,title:t.linkHint,"data-testid":`canvas-add-link`,children:(0,J.jsx)(me,{})})}),(0,J.jsxs)(b,{side:`top`,align:`center`,className:`flex w-80 gap-2 p-2`,children:[(0,J.jsx)(C,{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)(_,{"data-testid":`canvas-link-add`,disabled:o.trim()===``,onClick:c,children:t.linkAdd})]})]}),(0,J.jsx)(_,{icon:!0,"aria-label":t.group,title:Q(t.groupHint,`${co}G`),disabled:!e.groupable,"data-testid":`canvas-group`,onClick:e.onGroup,children:(0,J.jsx)(pe,{})})]})}function go(e){let t=qa();return(0,J.jsxs)(`div`,{className:d(uo,`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)(_,{icon:!0,"aria-label":t.zoomIn,title:Q(t.zoomIn,`${co}+`),"data-testid":`canvas-zoom-in`,onClick:()=>{e.onZoom(`in`)},children:(0,J.jsx)(w,{})}),(0,J.jsx)(_,{icon:!0,"aria-label":t.zoomOut,title:Q(t.zoomOut,`${co}−`),"data-testid":`canvas-zoom-out`,onClick:()=>{e.onZoom(`out`)},children:(0,J.jsx)(ve,{})}),(0,J.jsx)(_,{icon:!0,"aria-label":t.zoomFit,title:Q(t.zoomFit,`⇧1`),"data-testid":`canvas-zoom-fit`,onClick:()=>{e.onZoom(`fit`)},children:(0,J.jsx)(ot,{})}),(0,J.jsx)(_,{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)(_,{icon:!0,"aria-label":t.undo,title:Q(t.undo,`${co}Z`),"data-testid":`canvas-undo`,disabled:!e.history.canUndo,onClick:e.history.onUndo,children:(0,J.jsx)(xe,{})}),(0,J.jsx)(_,{icon:!0,"aria-label":t.redo,title:Q(t.redo,`⇧${co}Z`),"data-testid":`canvas-redo`,disabled:!e.history.canRedo,onClick:e.history.onRedo,children:(0,J.jsx)(be,{})})]})]}):null]})}var _o=8,vo=20,yo=8;function bo(e){let t=qa(),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(yo,o-i.width/2),Math.max(yo,e.view.width-yo-i.width)),c=e.box.top-Math.max(e.above,vo)-_o-i.height,l=e.box.top+e.box.height+_o,u=c>=yo?c:l+i.height<=e.view.height-yo?l:yo,f=e.color===void 0?void 0:Ja[e.color];return(0,J.jsxs)(`div`,{ref:r,role:`toolbar`,"aria-label":t.selected,"data-testid":`canvas-selection-bar`,"data-note-chrome":``,className:d(uo,`absolute`),style:{left:s,top:u,...i.width===0?{opacity:0,pointerEvents:`none`}:{}},children:[e.onColor?(0,J.jsxs)(ne,{children:[(0,J.jsx)(v,{asChild:!0,children:(0,J.jsx)(_,{icon:!0,"aria-label":t.color,title:t.color,"data-testid":`canvas-color`,children:(0,J.jsx)(ye,{style:f?{color:f}:void 0})})}),(0,J.jsxs)(b,{side:`top`,align:`center`,className:`flex w-auto items-center gap-2 p-2`,role:`radiogroup`,"aria-label":t.color,children:[(0,J.jsx)(D,{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)}}),ct.map(n=>(0,J.jsx)(D,{color:Ja[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)(_,{icon:!0,"aria-label":t.delete,title:Q(t.delete,`⌫`),"data-testid":`canvas-delete`,onClick:e.onDelete,children:(0,J.jsx)(we,{})}):null,e.open?(0,J.jsx)(_,{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)(Se,{})}):null,(0,J.jsx)(_,{icon:!0,"aria-label":t.zoomSelection,title:Q(t.zoomSelection,`⇧2`),"data-testid":`canvas-zoom-selection`,onClick:e.onZoomTo,children:(0,J.jsx)(at,{})}),n?(0,J.jsxs)(_,{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)(y,{"aria-hidden":!0}),n.label]}):null]})}function xo(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 So(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 Co=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=mt(t.text);this.canvas=n.readable?n.canvas:P,this.unreadable=!n.readable,this.snapshot=this.make(),t.attach({save:e=>{if(this.unreadable)return;let t=_t(this.canvas);return t===e?void 0:t},take:(e,t,n)=>{let r=mt(e);if(!r.readable)this.canvas=P,this.unreadable=!0;else{let e=mt(t),i=n?.kind===`agent`&&e.readable?So(wt(e.canvas,r.canvas)):void 0;i!==void 0&&(this.landed={id:i,at:Date.now()}),this.canvas=this.unreadable||!e.readable?r.canvas:St(e.canvas,this.canvas,r.canvas),this.unreadable=!1}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)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,wt(this.amending.from,i));return}let a=wt(r,i);Tt(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=Ct(this.canvas,t,`before`),this.emit()},redo:()=>{this.canvas=Ct(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()}},wo=.1,To=e=>Math.min(4,Math.max(wo,e)),Eo=(e,t)=>({x:(t.x-e.x)*e.zoom,y:(t.y-e.y)*e.zoom}),Do=(e,t)=>({x:t.x/e.zoom+e.x,y:t.y/e.zoom+e.y});function Oo(e,t,n){let r=To(n),i=Do(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 ko(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=To(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 Ao(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 jo(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 Mo(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 No={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function Po(e,t,n,r){let i=Math.max(40,Math.hypot(n.x-e.x,n.y-e.y)/3),a=No[t],o={x:e.x+a.x*i,y:e.y+a.y*i},s=r?No[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 Fo(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 Io(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 Lo(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 Ro(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=>f(r,a(e))).map(e=>zo(e,i))}function zo(e,t){let n=Et(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=za(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 Bo(e,t,n,r){return{element:zo(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 Vo(e,t,n,r){let i=Do(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 Ho=3e4,Uo=3,Wo=6,Go=40,Ko=24,qo=6,Jo=14,Yo=10;function Xo(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 Zo={text:{width:260,height:140},file:{width:480,height:300},link:{width:320,height:96}},Qo=24,$o=typeof navigator<`u`&&navigator.userAgent.includes(`Mac`),es=$o?`⌘G`:`Ctrl+G`,ts=e=>typeof e==`object`&&!!e&&typeof e.x==`number`&&typeof e.y==`number`&&typeof e.zoom==`number`&&e.zoom>0,ns={nodes:new Set,edges:new Set},rs=(e,t,n)=>({...e,nodes:e.nodes.map(e=>typeof e.id==`string`&&t.has(e.id)?n(e):e)}),is=(e,t,n)=>({...e,edges:e.edges.map(e=>typeof e.id==`string`&&t.has(e.id)?n(e):e)}),as=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 os({doc:e,path:t,shown:n,updating:i}){let s=qa(),l=c(),f=a(),p=Ra(),m=(0,Y.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),h=f?.mode!==`edit`||i,g=(0,Y.useMemo)(()=>ht(n),[n]),_=(0,Y.useMemo)(()=>gt(n),[n]),v=(0,Y.useMemo)(()=>new Map(g.map(e=>[e.id,e])),[g]),y=(0,Y.useRef)(null),[b,ne]=(0,Y.useState)({width:0,height:0}),de=ts(f?.place)?f.place:void 0,[fe,pe]=(0,Y.useState)(de),me=(0,Y.useMemo)(()=>b.width===0?{x:0,y:0,zoom:1}:ko(g.map($),b),[g,b]),x=fe??me,he=(0,Y.useRef)(x);(0,Y.useEffect)(()=>{he.current=x});let{agent:S,following:ge}=r(),_e=ee(),ve=(()=>{if(S?.doing===void 0)return;let n=m.landed,r=n&&n.at>=S.at-Ho,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:xo(e.text,a);return o!==void 0&&v.has(o)?o:r?n.id:void 0})(),ye=ve===void 0?void 0:v.get(ve),be=ge?ye:void 0,[xe,Se]=(0,Y.useState)();if(be?.id!==xe&&(Se(be?.id),be&&b.width>0)){let e=Lo($(be),x,b);e&&pe(e)}let Ce=()=>{fe===void 0&&pe(x)},[we,Te]=(0,Y.useState)(ns),C=(0,Y.useMemo)(()=>{let e=[...we.nodes].filter(e=>v.has(e)),t=[...we.edges].filter(e=>_.some(t=>t.id===e));return e.length===we.nodes.size&&t.length===we.edges.size?we:{nodes:new Set(e),edges:new Set(t)}},[we,v,_]),[Ee,De]=(0,Y.useState)(),[w,Oe]=(0,Y.useState)({}),ke=(0,Y.useRef)({}),je=e=>{ke.current=e,Oe(e)},[T,E]=(0,Y.useState)(),D=(0,Y.useRef)(void 0),[O,k]=(0,Y.useState)(),ze=(0,Y.useRef)(!1);(0,Y.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=new ResizeObserver(()=>{ne({width:e.clientWidth,height:e.clientHeight})});return t.observe(e),()=>{t.disconnect()}},[]),(0,Y.useEffect)(()=>{if(fe===void 0)return;let e=setTimeout(()=>{l[`editor/place`]({place:{x:Math.round(fe.x),y:Math.round(fe.y),zoom:Math.round(fe.zoom*1e3)/1e3}}).catch(()=>void 0)},400);return()=>{clearTimeout(e)}},[l,fe]);let Be=()=>{let e=y.current?.getBoundingClientRect();return{x:e?.left??0,y:e?.top??0}},A=e=>{let t=Be();return Do(x,{x:e.clientX-t.x,y:e.clientY-t.y})},Ve=()=>Do(x,{x:b.width/2,y:b.height/2});(0,Y.useEffect)(()=>{let e=y.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};pe(e=>{let n=e??he.current;if(t.ctrlKey||t.metaKey)return Oo(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 j=(0,Y.useCallback)(e=>{if(e===`fit`||typeof e!=`string`){let t=e===`fit`?g.map($):e;t.length>0&&pe(ko(t,b))}else pe(t=>{let n=t??he.current,r=e===`actual`?1:e===`in`?n.zoom*1.25:n.zoom/1.25;return Oo(n,{x:b.width/2,y:b.height/2},To(r))})},[g,b]),He=e=>{let t=new Map;for(let n of e){let e=v.get(n);if(e&&(t.set(n,$(e)),e.type===`group`))for(let n of g)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=>{Te(e)},Ue=(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=>g.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))+Ko}}let o=(i.left+i.width-x.x)*x.zoom,s=(i.top+i.height-x.y)*x.zoom;return(o>b.width||s>b.height||i.left<x.x||i.top<x.y)&&pe({...x,x:i.left+i.width/2-b.width/2/x.zoom,y:i.top+i.height/2-b.height/2/x.zoom}),i},We=(t,n,r=!1)=>{Ce();let i=vt(m.canvas),a=typeof t.width==`number`?t.width:260,o=typeof t.height==`number`?t.height:140,c=Ue(n??Ve(),a,o,n===void 0),l={id:i,...t,x:R(c.left),y:R(c.top),width:R(a),height:R(o)},u={id:i,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(s.edits.add,e=>({...e,nodes:[...e.nodes,u]})),M({nodes:new Set([i]),edges:new Set}),r&&t.type===`text`&&E({type:`text`,id:i,text:``}),i},Ge=e=>We({type:`text`,text:``,...Zo.text},e,!0),Ke=(e,t)=>We({type:`file`,file:e,...Zo.file},t),qe=(e,t)=>We({type:`link`,url:e,...Zo.link},t),Je=()=>{if(C.nodes.size===0&&C.edges.size===0)return;let t=C.nodes;e.edit(s.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(ns)},Ye=()=>{let t=g.filter(e=>C.nodes.has(e.id));if(t.length===0)return;let n=Ne(t.map($)),r=vt(m.canvas),i=t.some(e=>e.type===`file`)?48:Ko,a={id:r,type:`group`,x:R(n.left-Ko),y:R(n.top-i),width:R(n.width+48),height:R(n.height+Ko+i)};e.edit(s.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,a),{...e,nodes:n}}),M({nodes:new Set([r]),edges:new Set}),E({type:`group`,id:r,text:``})},Xe=t=>{e.edit(s.edits.color,e=>is(rs(e,C.nodes,e=>z(e,{color:t})),C.edges,e=>z(e,{color:t})))},Ze=()=>{let e=[...g.filter(e=>C.nodes.has(e.id)).map(e=>e.color),..._.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},Qe=()=>[...g.filter(e=>C.nodes.has(e.id)).map(N),..._.filter(e=>C.edges.has(e.id)).flatMap(e=>{let t=dt(e);return t?[Ie(t.start,t.end)]:[]})],$e=(t=T)=>{if(!t)return;E(void 0);let n=t.text;t.type===`edge`?e.edit(s.edits.label,e=>is(e,new Set([t.id]),e=>z(e,{label:n.trim()===``?void 0:n}))):t.type===`group`?e.edit(s.edits.label,e=>rs(e,new Set([t.id]),e=>z(e,{label:n.trim()===``?void 0:n}))):e.edit(s.edits.type,e=>rs(e,new Set([t.id]),e=>z(e,{text:n}))),y.current?.focus()},et=e=>{e.type===`file`&&e.file?l[`items/open`]({target:{type:`file`,path:e.file}}).catch(()=>void 0):e.type===`link`&&e.url&&/^https?:\/\//u.test(e.url)&&l[`items/open`]({target:{type:`browser`,url:e.url}}).catch(()=>void 0)},tt=e=>{Ce(),T&&$e();let t=e.target;if(t.closest(`[data-canvas-own]`))return;y.current?.focus();let n=A(e);if(e.button===1||e.button===0&&ze.current){D.current={type:`pan`,start:{x:e.clientX,y:e.clientY},camera:x},k(`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(!(h&&(r||i))){if(r){let e=[...C.nodes][0],t=e===void 0?void 0:v.get(e);if(!t)return;D.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`;D.current={type:`connect`,from:e,side:t,start:n},je({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),h)return;D.current={type:`move`,start:n,frames:He(i.nodes),dragged:!1}}else D.current={type:`marquee`,start:n,add:e.shiftKey},e.shiftKey||M(ns);k(D.current.type),e.currentTarget.setPointerCapture(e.pointerId)}},nt=e=>{let t=D.current;if(!t){let t=e.target,n=A(e),r=24/x.zoom,i=t.closest(`[data-connector]`)?.dataset.connector??[...g].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!==Ee&&De(i);return}let n=A(e);if(t.type===`pan`){pe({...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=Wo/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<Uo)return;t.dragged=!0;let o=[...t.frames.values()],s=Ne(o),c=g.filter(e=>!t.frames.has(e.id)).map($),l=e.metaKey||e.ctrlKey?{frame:{...s,left:s.left+i,top:s.top+a},guides:[]}:Me({...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});je({frames:f,guides:l.guides})}else if(t.type===`resize`){let i=g.filter(e=>e.id!==t.id).map($),a=Fe(t.frame,t.handle,n.x-t.start.x,n.y-t.start.y,{keep:e.shiftKey,min:Go,...e.metaKey||e.ctrlKey?{}:{snap:{others:i,surface:void 0,tol:r}}});je({frames:new Map([[t.id,a.frame]]),guides:a.guides})}else if(t.type===`connect`){let e=Io(g.filter(e=>e.id!==t.from),n);je({connect:{from:t.from,side:t.side,to:n,...e?{over:{id:e.id,side:jo($(e),n)}}:{}}})}else{let e=Ie(t.start,n),r=g.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}),je({marquee:e})}},rt=()=>{let t=D.current;D.current=void 0,k(void 0);let n=ke.current;if(je({}),t){if(t.type===`move`&&t.dragged&&n.frames){let t=n.frames;e.edit(s.edits.move,e=>rs(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`&&n.frames){let r=n.frames.get(t.id);r&&e.edit(s.edits.resize,e=>rs(e,new Set([t.id]),e=>z(e,{x:R(r.left),y:R(r.top),width:R(r.width),height:R(r.height)})))}else if(t.type===`connect`&&n.connect?.over){let r=n.connect.over,i=vt(m.canvas);e.edit(s.edits.connect,e=>({...e,edges:[...e.edges,{id:i,fromNode:t.from,fromSide:t.side,toNode:r.id,toSide:r.side}]})),M({nodes:new Set,edges:new Set([i])})}}},it=e=>{let t=document.elementFromPoint(e.clientX,e.clientY)??e.target;if(h){let e=t.closest(`[data-node]`)?.dataset.node,n=e===void 0?void 0:v.get(e);n&&et(n);return}if(t.closest(`[data-canvas-own]`))return;let n=t.closest(`[data-edge]`)?.dataset.edge;if(n!==void 0){let e=_.find(e=>e.id===n);E({type:`edge`,id:n,text:e?.label??``});return}if(t.closest(`[data-group-label]`)){let e=t.closest(`[data-node]`)?.dataset.node??``;E({type:`group`,id:e,text:v.get(e)?.label??``});return}let r=t.closest(`[data-node]`)?.dataset.node,i=r===void 0?void 0:v.get(r);i?i.type===`text`?E({type:`text`,id:i.id,text:i.text??``}):i.type===`group`?E({type:`group`,id:i.id,text:i.label??``}):et(i):Ge(A(e))},at=t=>{if(t.target.closest(`textarea, input, [contenteditable]`))return;Ce();let n=$o?t.metaKey:t.ctrlKey;if(t.key===` `)ze.current=!0,t.preventDefault();else if(n&&t.key.toLowerCase()===`z`)t.preventDefault(),t.shiftKey?e.redo():e.undo();else if(n&&t.key.toLowerCase()===`y`)t.preventDefault(),e.redo();else if(n&&t.key.toLowerCase()===`a`)t.preventDefault(),M({nodes:new Set(g.map(e=>e.id)),edges:new Set(_.map(e=>e.id))});else if(n&&t.key.toLowerCase()===`g`&&!h)t.preventDefault(),Ye();else if((t.key===`Delete`||t.key===`Backspace`)&&!h)t.preventDefault(),Je();else if(t.key===`Escape`)M(ns);else if(t.shiftKey&&(t.key===`!`||t.code===`Digit1`))j(`fit`);else if(t.shiftKey&&(t.key===`@`||t.code===`Digit2`))j(Qe());else if(t.shiftKey&&(t.key===`)`||t.code===`Digit0`))j(`actual`);else if(n&&(t.key===`=`||t.key===`+`))t.preventDefault(),j(`in`);else if(n&&t.key===`-`)t.preventDefault(),j(`out`);else if(t.key===`Enter`&&C.nodes.size===1&&!h){let e=v.get([...C.nodes][0]??``);e?.type===`text`&&(t.preventDefault(),E({type:`text`,id:e.id,text:e.text??``}))}else if(t.key.startsWith(`Arrow`)&&C.nodes.size>0&&!h){t.preventDefault();let n=t.shiftKey?10:1,r=t.key===`ArrowLeft`?-n:t.key===`ArrowRight`?n:0,i=t.key===`ArrowUp`?-n:t.key===`ArrowDown`?n:0,a=He(C.nodes);e.edit(s.edits.move,e=>rs(e,new Set(a.keys()),e=>z(e,{x:R(Number(e.x)+r),y:R(Number(e.y)+i)})),`nudge`)}},ot=t=>{t.key===` `&&(ze.current=!1),t.key.startsWith(`Arrow`)&&e.settle()},st=e=>{if(h)return;e.preventDefault();let n=A(e);if(e.dataTransfer.types.includes(`application/x-allyhub-canvas-note`)){Ge(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 l[`files/upload`]({dir:t.includes(`/`)?t.slice(0,t.lastIndexOf(`/`)):``,name:i.name,data:as(await i.arrayBuffer())});Ke(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)?qe(i,n):Ke(i.replace(/^\.\//u,``),n))},ct=re();o({hold:()=>Promise.resolve({key:`${t}@${String(m.revision)}`,what:`The canvas ${t}, its nodes laid out with notes and edges`,source:{path:t}}),locate:n=>{let r=u(n)[0];return Promise.resolve({elements:Ro(g,x,Be(),n,{file:t,text:e.text,project:p}),...r?{where:Vo(g,x,Be(),r)}:{}})},pick:n=>{let r=Be(),i=Io(g,Do(x,{x:n.x-r.x,y:n.y-r.y}));return Promise.resolve(i?Bo(i,x,Be(),{file:t,text:e.text,project:p}):void 0)},selected:()=>Promise.resolve(g.filter(e=>C.nodes.has(e.id)).map(n=>Bo(n,x,Be(),{file:t,text:e.text,project:p})))});let N=e=>w.frames?.get(e.id)??$(e),P=C.nodes.size===1&&C.edges.size===0?v.get([...C.nodes][0]??``):void 0,F=x.zoom,I=g.filter(e=>e.type===`group`),ut=g.filter(e=>e.type!==`group`),dt=e=>{let t=v.get(e.fromNode),n=v.get(e.toNode);if(!t||!n)return;let r=N(t),i=N(n),a=e.fromSide??Mo(r,i),o=e.toSide??Mo(i,r),s=Ao(r,a),c=Ao(i,o);return{...Po(s,a,c,o),start:s,startDir:Po(c,o,s,a).endDir}},ft=e=>{let t=N(e),n=C.nodes.has(e.id),r=Ya(e.color),i=e.type===`group`,a=i?(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:qo/F,fontSize:14/Math.max(F,.5),background:r?`color-mix(in oklab, ${r} 22%, transparent)`:void 0},children:T?.type===`group`&&T.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:qo/F,fontSize:12/Math.max(F,.5)},children:(0,J.jsx)(ao,{node:e,project:p})}):null;return(0,J.jsxs)(`div`,{"data-node":e.id,"data-testid":`canvas-node`,"data-type":e.type,"data-selected":n?``:void 0,className:`group/node absolute`,style:{left:t.left,top:t.top,width:t.width,height:t.height},children:[a,(0,J.jsx)(`div`,{className:d(`size-full overflow-hidden rounded-md border`,i?`border-rule-strong`:`bg-sheet border-rule motion-safe:transition-shadow`,!i&&Ee===e.id&&`border-rule-strong shadow-overlay`,n&&`outline-pencil outline-2 outline-offset-2`),style:{...r?{borderColor:r}:{},...i?{background:r?`color-mix(in oklab, ${r} 8%, transparent)`:`color-mix(in oklab, var(--color-lead) 5%, transparent)`}:e.type===`text`&&r?{background:`color-mix(in oklab, ${r} 10%, var(--color-sheet))`}:{},borderWidth:Math.max(1,1/F)},children:e.type===`text`?T?.type===`text`&&T.id===e.id?(0,J.jsx)(`textarea`,{"data-canvas-own":``,"data-testid":`canvas-typing`,autoFocus:!0,value:T.text,"aria-label":s.note,className:`text-ink size-full resize-none bg-transparent px-4 py-3 text-base leading-relaxed outline-none`,onChange:e=>{E({...T,text:e.target.value})},onBlur:()=>{$e()},onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&$e()}}):(0,J.jsx)($a,{text:e.text??``}):e.type===`file`?(0,J.jsx)(io,{node:e,project:p,active:Ee===e.id}):e.type===`link`?(0,J.jsx)(oo,{url:e.url??``}):i?null:(0,J.jsx)(so,{type:e.type})}),i&&T?.type===`group`&&T.id===e.id?(0,J.jsx)(`input`,{"data-canvas-own":``,"data-testid":`canvas-typing`,autoFocus:!0,value:T.text,"aria-label":s.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:qo/F,fontSize:14/Math.max(F,.5)},onChange:e=>{E({...T,text:e.target.value})},onBlur:()=>{$e()},onKeyDown:e=>{e.stopPropagation(),(e.key===`Escape`||e.key===`Enter`)&&$e()}}):null]},e.id)},pt=h||O!==void 0?null:g.filter(e=>e.id===Ee||C.nodes.has(e.id)).flatMap(e=>{let t=N(e),n=Jo/F,r=Xo(e,F);return lt.map(i=>{let a=Ao({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:Yo/F,height:Yo/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=v.get(e.from);if(!t)return;let n=N(t),r=e.over?v.get(e.over.id):void 0;return Po(Ao(n,e.side),e.side,r&&e.over?Ao($(r),e.over.side):e.to,e.over?.side)})(),mt=_.map(e=>{let t=dt(e);if(!t)return null;let n=C.edges.has(e.id),r=Ya(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:Fo(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:Fo(t.end,t.endDir,10/Math.max(F,.4)),fill:n?`var(--color-pencil)`:r,pointerEvents:`none`}):null]},e.id)}),_t=_.map(e=>{let t=dt(e);if(!t)return null;let n=T?.type===`edge`&&T.id===e.id;return!n&&(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:n?(0,J.jsx)(`input`,{"data-canvas-own":``,"data-testid":`canvas-typing`,autoFocus:!0,value:T.text,"aria-label":s.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=>{E({...T,text:e.target.value})},onBlur:()=>{$e()},onKeyDown:e=>{e.stopPropagation(),(e.key===`Escape`||e.key===`Enter`)&&$e()}}):(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)}),yt=P&&!h&&P.id!==T?.id?Le.map(e=>{let t=N(P),[n,r]=Pe[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,bt=Qo*F,xt=P,St=!h,B=()=>{y.current?.focus()},Ct=(()=>{if(O!==void 0||T!==void 0)return;let e=Qe();if(e.length===0)return;let t=Ne(e),n=Eo(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>b.width||r.top>b.height||r.left+r.width<0||r.top+r.height<0)return;let i=Math.max(0,...g.filter(e=>C.nodes.has(e.id)&&e.y<=t.top).map(e=>Xo(e,F)??0));return{box:r,above:i>0?i*F+qo+Yo+4:0}})(),wt=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:m.state}}),(0,J.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[i?(0,J.jsx)(`div`,{className:`pointer-events-none absolute top-0 right-16 left-0 h-12`,children:(0,J.jsx)(Ae,{})}):null,(0,J.jsxs)(se,{children:[(0,J.jsx)(te,{asChild:!0,children:(0,J.jsxs)(`div`,{ref:y,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(bt)}px ${String(bt)}px`,backgroundPosition:`${String(-x.x*F)}px ${String(-x.y*F)}px`,cursor:O===`pan`?`grabbing`:O===`move`?`move`:O===`connect`?`crosshair`:void 0},onPointerDown:tt,onPointerMove:nt,onPointerUp:rt,onPointerCancel:rt,onPointerLeave:()=>{O===void 0&&De(void 0)},onDoubleClick:it,onKeyDown:at,onKeyUp:ot,onDragOver:e=>{h||e.preventDefault()},onDrop:st,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(ft),(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:mt})}),ut.map(ft),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,_t,yt,pt,(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+b.height/F}:{top:e.at,left:x.x-1e4,height:1/F,width:2e4+b.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&&ye?(()=>{let e=$(ye);return(0,J.jsx)(Re,{"data-testid":`canvas-agent`,label:_e(S),style:{left:(e.left-x.x)*F,top:(e.top-x.y)*F,width:e.width*F,height:e.height*F}})})():null,g.length===0&&!h?(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:s.empty}):null]})}),(0,J.jsxs)(ue,{className:`w-52`,"data-testid":`canvas-menu`,children:[xt&&(xt.type===`file`||xt.type===`link`)?(0,J.jsx)(ie,{onSelect:()=>{et(xt)},children:s.open}):null,!h&&C.nodes.size>0?(0,J.jsxs)(ie,{onSelect:Ye,children:[s.group,(0,J.jsx)(le,{children:es})]}):null,!h&&C.nodes.size+C.edges.size>0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ae,{}),(0,J.jsxs)(ie,{variant:`destructive`,onSelect:Je,children:[s.delete,(0,J.jsx)(le,{children:`⌫`})]})]}):null,!h&&C.nodes.size===0&&C.edges.size===0?(0,J.jsx)(ie,{onSelect:()=>{Ge()},children:s.note}):null,(0,J.jsx)(ce,{})]})]}),St?(0,J.jsx)(ho,{onNote:()=>{Ge()},onFile:e=>{Ke(e),B()},onLink:e=>{qe(e),B()},groupable:C.nodes.size>0,onGroup:Ye,project:p,self:t}):null,(0,J.jsx)(go,{onZoom:e=>{Ce(),j(e),B()},history:St?{canUndo:m.canUndo,canRedo:m.canRedo,onUndo:()=>{e.undo(),B()},onRedo:()=>{e.redo(),B()}}:void 0}),Ct?(0,J.jsx)(bo,{markUp:ct,box:Ct.box,above:Ct.above,view:b,color:Ze(),onColor:St?Xe:void 0,onDelete:St?()=>{Je(),B()}:void 0,open:wt?{link:wt.type===`link`,run:()=>{et(wt)}}:void 0,onZoomTo:()=>{Ce(),j(Qe()),B()}}):null]})]})}function ss({doc:e,path:t}){let n=(0,Y.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),{shown:r,updating:i}=je(n.unreadable?void 0:n.canvas);return r===void 0?(0,J.jsxs)(`div`,{className:`flex size-full flex-col`,"data-testid":`canvas-editor`,"data-state":`updating`,children:[(0,J.jsx)(oe,{saved:{state:n.state}}),(0,J.jsx)(T,{className:`flex min-h-0 flex-1 items-center justify-center`})]}):(0,J.jsx)(os,{doc:e,path:t,shown:r,updating:i})}function cs(){let e=qa(),t=c(),n=a()?.item.entry,[r,i]=(0,Y.useState)(),[o,s]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{if(n===void 0)return;let e,r=!0;return Co.open(t,n).then(t=>{r?(e=t,i(t)):t.close()},e=>{reportError(e),r&&s(!0)}),()=>{r=!1,e?.close()}},[t,n]),o?(0,J.jsx)(`div`,{className:`flex size-full`,"data-testid":`canvas-editor`,"data-state":`updating`,children:(0,J.jsx)(T,{})}):!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":`loading`,children:e.loading}):(0,J.jsx)(ss,{doc:r,path:n})}export{Co as CanvasDocument,cs as CanvasEditor,cs as default,Ka as WORDS};