@aiquants/markdown 12.3.0 → 13.1.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 (273) hide show
  1. package/README.md +551 -76
  2. package/dist/{abnfDiagram-VRR7QNED-B_QmXzWv.js → abnfDiagram-VRR7QNED-B3Q9attM.js} +9 -9
  3. package/dist/abnfDiagram-VRR7QNED-QW4YM2AY.cjs +1 -0
  4. package/dist/arc-BBLXr5EU.js +83 -0
  5. package/dist/arc-Cn8XXgbN.cjs +1 -0
  6. package/dist/{architectureDiagram-ZJ3FMSHR-CEb923Bc.js → architectureDiagram-ZJ3FMSHR-BaSp0hC2.js} +123 -123
  7. package/dist/architectureDiagram-ZJ3FMSHR-BfmjNYww.cjs +36 -0
  8. package/dist/{blockDiagram-677ZJIJ3-CmKMdhaS.js → blockDiagram-677ZJIJ3-DFcPQ19k.js} +166 -166
  9. package/dist/{blockDiagram-677ZJIJ3-D7RRzjUx.cjs → blockDiagram-677ZJIJ3-u7d3VCxA.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-CG6fvZQo.js → c4Diagram-LMCZKHZV-DW0yo5tR.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-W7Qa-ecL.cjs → c4Diagram-LMCZKHZV-nScsMUE3.cjs} +1 -1
  12. package/dist/{channel-TsF8sms_.js → channel-B2FBCr9X.js} +1 -1
  13. package/dist/channel-DlkTPSf_.cjs +1 -0
  14. package/dist/{chunk-2Q5K7J3B-CopwR1m3.js → chunk-2Q5K7J3B-BkE4Fsuz.js} +1 -1
  15. package/dist/chunk-2Q5K7J3B-evSha-HP.cjs +1 -0
  16. package/dist/{chunk-32BRIVSS-BnNlhc1M.js → chunk-32BRIVSS-CqpDiZD2.js} +1 -1
  17. package/dist/chunk-32BRIVSS-rIw6tBRO.cjs +1 -0
  18. package/dist/{chunk-5VM5RSS4-lKwSmIqG.cjs → chunk-5VM5RSS4-CYVpj2mc.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-O28FGAOF.js → chunk-5VM5RSS4-DAgNhPcU.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-CtFe4olX.cjs → chunk-EX3LRPZG-Ct2cyGh-.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-C36gZH3_.js → chunk-EX3LRPZG-QFjD28UF.js} +21 -21
  22. package/dist/{chunk-JWPE2WC7-DG0ebjV4.js → chunk-JWPE2WC7-Bj2m1SXZ.js} +1 -1
  23. package/dist/chunk-JWPE2WC7-Dgw1ILoe.cjs +1 -0
  24. package/dist/{chunk-MOJQB5TN-nqR_swpx.js → chunk-MOJQB5TN-B1fdnpCz.js} +122 -122
  25. package/dist/{chunk-MOJQB5TN-DADVbG98.cjs → chunk-MOJQB5TN-yjlPYCh4.cjs} +3 -3
  26. package/dist/{chunk-PUDLZKDR-BUSFO-Gx.cjs → chunk-PUDLZKDR-BlQ3qKcC.cjs} +4 -4
  27. package/dist/{chunk-PUDLZKDR-CD96jce3.js → chunk-PUDLZKDR-CIcw3cpm.js} +21 -21
  28. package/dist/chunk-RYQCIY6F-B-V6UOJy.cjs +1 -0
  29. package/dist/{chunk-RYQCIY6F-DJkrr1sD.js → chunk-RYQCIY6F-DyVk8fNp.js} +5 -5
  30. package/dist/{chunk-V7JOEXUC-BzCaDGop.cjs → chunk-V7JOEXUC-B1EgagKh.cjs} +3 -3
  31. package/dist/{chunk-V7JOEXUC-eBy2sAXD.js → chunk-V7JOEXUC-C776k7_V.js} +15 -15
  32. package/dist/{chunk-VR4S4FIN-C-qPzUSR.js → chunk-VR4S4FIN-CyqARa17.js} +5 -5
  33. package/dist/chunk-VR4S4FIN-Sx71KwIQ.cjs +1 -0
  34. package/dist/{chunk-XXDRQBXY-BK6HOWf6.js → chunk-XXDRQBXY-B-99Fbs_.js} +3 -3
  35. package/dist/chunk-XXDRQBXY-BgeRIUG1.cjs +1 -0
  36. package/dist/classDiagram-OUVF2IWQ-BLAiuPPL.cjs +1 -0
  37. package/dist/{classDiagram-v2-EOCWNBFH-CPDmG5kI.js → classDiagram-OUVF2IWQ-DJ0hW16Q.js} +2 -2
  38. package/dist/classDiagram-v2-EOCWNBFH-BLAiuPPL.cjs +1 -0
  39. package/dist/{classDiagram-OUVF2IWQ-CPDmG5kI.js → classDiagram-v2-EOCWNBFH-DJ0hW16Q.js} +2 -2
  40. package/dist/{code-blocks-BWr5Xg1I.js → code-blocks-C6J8rVTc.js} +23 -22
  41. package/dist/{code-blocks-BdKjppKq.cjs → code-blocks-CTESwslp.cjs} +3 -3
  42. package/dist/code-blocks.cjs +1 -1
  43. package/dist/code-blocks.d.ts +1 -0
  44. package/dist/code-blocks.js +15 -14
  45. package/dist/components/CopyButton.d.ts +1 -2
  46. package/dist/components/MarkdownRenderer.d.ts +36 -3
  47. package/dist/components/MarkdownViewer.d.ts +11 -2
  48. package/dist/components/MermaidDiagram.d.ts +21 -0
  49. package/dist/components/ReadingPlaceKeeper.d.ts +32 -0
  50. package/dist/components/SelectionKeeper.d.ts +38 -0
  51. package/dist/components/SpreadsheetBlock.d.ts +2 -1
  52. package/dist/components/blockKeys.d.ts +9 -2
  53. package/dist/components/blockNotice.d.ts +15 -0
  54. package/dist/components/blockOffsets.d.ts +3 -0
  55. package/dist/components/clipboard.d.ts +1 -0
  56. package/dist/components/embeds/ClientFrame.d.ts +1 -0
  57. package/dist/components/embeds/ProviderEmbed.d.ts +2 -1
  58. package/dist/components/embeds/embedLabels.d.ts +1 -1
  59. package/dist/components/embeds/linkCardFetch.d.ts +2 -0
  60. package/dist/components/embeds.d.ts +5 -0
  61. package/dist/components/fileSave.d.ts +1 -0
  62. package/dist/components/headingLevels.d.ts +6 -0
  63. package/dist/components/htmlNodes.d.ts +2 -0
  64. package/dist/components/htmlSanitizer.d.ts +15 -2
  65. package/dist/components/labels.d.ts +3 -2
  66. package/dist/components/links.d.ts +1 -0
  67. package/dist/components/mdastNodes/CodeNode.d.ts +3 -1
  68. package/dist/components/mermaidAccessibility.d.ts +11 -0
  69. package/dist/components/mermaidExport.d.ts +24 -0
  70. package/dist/components/mermaidLabels.d.ts +89 -0
  71. package/dist/components/mermaidSetup.d.ts +10 -0
  72. package/dist/components/missingImageLabels.d.ts +2 -0
  73. package/dist/components/ownPixels.d.ts +1 -0
  74. package/dist/components/rawHtml.d.ts +7 -3
  75. package/dist/components/spreadsheetClipboard.d.ts +1 -1
  76. package/dist/components/spreadsheetModel.d.ts +1 -0
  77. package/dist/components/svgRaster.d.ts +2 -2
  78. package/dist/components/viewerLabels.d.ts +13 -3
  79. package/dist/contentColors.d.ts +21 -0
  80. package/dist/conversion.d.ts +7 -0
  81. package/dist/converter/NOTICES.md +6 -6
  82. package/dist/converter/createMarkdownConverter.d.ts +1 -0
  83. package/dist/converter/protocol.d.ts +4 -0
  84. package/dist/converter.cjs +1 -1
  85. package/dist/converter.js +89 -71
  86. package/dist/converter.wasm +0 -0
  87. package/dist/{cose-bilkent-JH36ORCC-BxO1rjEU.js → cose-bilkent-JH36ORCC-CR6Hdvto.js} +24 -24
  88. package/dist/cose-bilkent-JH36ORCC-reAbGeDU.cjs +1 -0
  89. package/dist/cynefinDiagram-TSTJHNR4-2qz-sUtp.cjs +62 -0
  90. package/dist/{cynefinDiagram-TSTJHNR4-DBD-B_Un.js → cynefinDiagram-TSTJHNR4-D1eY-FSf.js} +65 -65
  91. package/dist/dagre-VKFMJZFB-Byr9WPjb.cjs +4 -0
  92. package/dist/{dagre-VKFMJZFB-B8vZCPJg.js → dagre-VKFMJZFB-CXSczF8v.js} +26 -26
  93. package/dist/{diagram-FQU43EPY-DwhEcKWF.cjs → diagram-FQU43EPY-2YWng437.cjs} +1 -1
  94. package/dist/{diagram-FQU43EPY-YrRTNuX-.js → diagram-FQU43EPY-BZo0xcaj.js} +54 -54
  95. package/dist/diagram-G47NLZAW-CQS7BN4F.cjs +24 -0
  96. package/dist/{diagram-G47NLZAW-D4vmirJw.js → diagram-G47NLZAW-CvJW9ny8.js} +65 -65
  97. package/dist/{diagram-NH7WQ7WH-Drekwiur.js → diagram-NH7WQ7WH-C6VIkj-R.js} +18 -18
  98. package/dist/diagram-NH7WQ7WH-DXUwOBe7.cjs +24 -0
  99. package/dist/{diagram-OA4YK3LP-DZsM4Fpo.js → diagram-OA4YK3LP-Co6nMbJc.js} +29 -29
  100. package/dist/{diagram-OA4YK3LP-DeJ7pMIO.cjs → diagram-OA4YK3LP-DBUm2qxb.cjs} +3 -3
  101. package/dist/{diagram-WEI45ONY-CjRbsbkF.js → diagram-WEI45ONY-BaMbc5o2.js} +76 -76
  102. package/dist/diagram-WEI45ONY-ChpK2gP3.cjs +41 -0
  103. package/dist/ebnfDiagram-CCIWWBDH-DMIRHp8N.cjs +1 -0
  104. package/dist/{ebnfDiagram-CCIWWBDH-D0kt5Zdu.js → ebnfDiagram-CCIWWBDH-i7CR-FU0.js} +3 -3
  105. package/dist/embeds/frames.d.ts +4 -0
  106. package/dist/embeds/linkCards.d.ts +3 -1
  107. package/dist/embeds/providers.d.ts +1 -0
  108. package/dist/embeds/testing.cjs +1 -1
  109. package/dist/embeds/testing.js +1 -1
  110. package/dist/embeds-B4g6w7Tf.cjs +1 -0
  111. package/dist/embeds-Dra-dGKD.js +64 -0
  112. package/dist/embeds.cjs +1 -1
  113. package/dist/embeds.d.ts +2 -2
  114. package/dist/embeds.js +31 -70
  115. package/dist/{erDiagram-Q63AITRT-Ce4GpK2Z.js → erDiagram-Q63AITRT-DC-HhdaO.js} +69 -69
  116. package/dist/{erDiagram-Q63AITRT-DqFANbZx.cjs → erDiagram-Q63AITRT-DjRvJyWK.cjs} +1 -1
  117. package/dist/errors-BWZJx2MD.cjs +1 -0
  118. package/dist/errors-CapTNE7l.js +62 -0
  119. package/dist/errors.d.ts +2 -2
  120. package/dist/extractHeadings-BfYlTVvN.js +6773 -0
  121. package/dist/extractHeadings-CZPJi4gM.cjs +12 -0
  122. package/dist/flowDiagram-23GEKE2U-CiNzp6BS.js +7 -0
  123. package/dist/flowDiagram-23GEKE2U-DzZNPkRJ.cjs +1 -0
  124. package/dist/{ganttDiagram-NO4QXBWP-DjpANtqX.js → ganttDiagram-NO4QXBWP-BwbtaPxc.js} +69 -69
  125. package/dist/ganttDiagram-NO4QXBWP-CJv5UQ4O.cjs +292 -0
  126. package/dist/gen/markdown/v1/linkcard_connect.d.ts +19 -0
  127. package/dist/gen/markdown/v1/linkcard_pb.d.ts +87 -0
  128. package/dist/gen/markdown/v1/markdown_pb.d.ts +4 -0
  129. package/dist/{gitGraphDiagram-IHSO6WYX-DzhnsGXo.js → gitGraphDiagram-IHSO6WYX--yebcp4V.js} +26 -26
  130. package/dist/gitGraphDiagram-IHSO6WYX-dSwtW7X6.cjs +106 -0
  131. package/dist/index.cjs +1 -1
  132. package/dist/index.client.cjs +1 -1
  133. package/dist/index.client.d.ts +6 -3
  134. package/dist/index.client.js +54 -46
  135. package/dist/index.js +54 -46
  136. package/dist/index.server.cjs +1 -1
  137. package/dist/index.server.d.ts +2 -1
  138. package/dist/index.server.js +126 -873
  139. package/dist/{infoDiagram-FWYZ7A6U-hraoyboI.js → infoDiagram-FWYZ7A6U-B4AiTiqD.js} +9 -9
  140. package/dist/infoDiagram-FWYZ7A6U-BOj0VF20.cjs +2 -0
  141. package/dist/{ishikawaDiagram-FXEZZL3T-cBJei3wJ.js → ishikawaDiagram-FXEZZL3T-BsYs_qnQ.js} +55 -55
  142. package/dist/{ishikawaDiagram-FXEZZL3T-D5b25aDN.cjs → ishikawaDiagram-FXEZZL3T-CisV4kPO.cjs} +1 -1
  143. package/dist/{journeyDiagram-5HDEW3XC-DrNyUSsx.cjs → journeyDiagram-5HDEW3XC-BAvgWwpr.cjs} +1 -1
  144. package/dist/{journeyDiagram-5HDEW3XC-IkQqMl8f.js → journeyDiagram-5HDEW3XC-DbDo-dqu.js} +29 -29
  145. package/dist/{kanban-definition-HUTT4EX6-D2UL88Cz.js → kanban-definition-HUTT4EX6-BlPZISwH.js} +111 -111
  146. package/dist/{kanban-definition-HUTT4EX6-CvBgN3eX.cjs → kanban-definition-HUTT4EX6-RjzOWas9.cjs} +2 -2
  147. package/dist/{linear-BiJV9gYf.js → linear-BXWX8YXI.js} +33 -33
  148. package/dist/linear-CKPQExK8.cjs +1 -0
  149. package/dist/linkCardServer/linkCardCore.d.ts +10 -0
  150. package/dist/linkCardServer/linkCardHandler.server.d.ts +1 -6
  151. package/dist/linkCardServer/pageFetchPort.d.ts +19 -0
  152. package/dist/linkCardServer/{pageMetadata.server.d.ts → pageMetadata.d.ts} +11 -3
  153. package/dist/linkCards-BikpIncf.cjs +1 -0
  154. package/dist/linkCards-DfSLqLPF.js +50 -0
  155. package/dist/linkCards.cjs +1 -0
  156. package/dist/linkCards.d.ts +2 -0
  157. package/dist/linkCards.js +5 -0
  158. package/dist/markdownServiceClient-C47z3Ynu.cjs +1 -0
  159. package/dist/markdownServiceClient-uDeklhtG.js +480 -0
  160. package/dist/markdownServiceClient.d.ts +20 -0
  161. package/dist/mermaid.core-C4EClWgB.js +15595 -0
  162. package/dist/mermaid.core-CRP55Hm1.cjs +305 -0
  163. package/dist/mermaidFrame/NOTICES.md +1345 -0
  164. package/dist/mermaidFrame/browserPaintView.d.ts +3 -0
  165. package/dist/mermaidFrame/cssCleaner.d.ts +29 -0
  166. package/dist/mermaidFrame/diagramPalette.d.ts +24 -0
  167. package/dist/mermaidFrame/diagramTheme.d.ts +7 -0
  168. package/dist/mermaidFrame/drawableTypes.d.ts +6 -0
  169. package/dist/mermaidFrame/drawer.d.ts +47 -0
  170. package/dist/mermaidFrame/frame.d.ts +1 -0
  171. package/dist/mermaidFrame/frame.js +3308 -0
  172. package/dist/mermaidFrame/insertion.d.ts +11 -0
  173. package/dist/mermaidFrame/katexInert.d.ts +4 -0
  174. package/dist/mermaidFrame/namespaces.d.ts +3 -0
  175. package/dist/mermaidFrame/paintCheck.d.ts +2 -0
  176. package/dist/mermaidFrame/paintContract.d.ts +3 -0
  177. package/dist/mermaidFrame/paintDiagram.d.ts +3 -0
  178. package/dist/mermaidFrame/paintMap.d.ts +103 -0
  179. package/dist/mermaidFrame/paintRules.d.ts +18 -0
  180. package/dist/mermaidFrame/protocol.d.ts +43 -0
  181. package/dist/mermaidFrame/serve.d.ts +19 -0
  182. package/dist/mermaidFrame/svgCleaner.d.ts +4 -0
  183. package/dist/{mindmap-definition-LN4V7U3C-CK67hf6V.js → mindmap-definition-LN4V7U3C-BEWpoMMG.js} +75 -75
  184. package/dist/{mindmap-definition-LN4V7U3C-CBrUse7P.cjs → mindmap-definition-LN4V7U3C-DnbSfqWP.cjs} +3 -3
  185. package/dist/pageFetchPort-2H18xcdi.cjs +1 -0
  186. package/dist/pageFetchPort-DVpXsKCz.js +624 -0
  187. package/dist/{pegDiagram-2B236MQR-CwWX4Irn.js → pegDiagram-2B236MQR-BF7gLiB-.js} +3 -3
  188. package/dist/pegDiagram-2B236MQR-BJysMObA.cjs +1 -0
  189. package/dist/{pieDiagram-ENE6RG2P-MO42pSl8.js → pieDiagram-ENE6RG2P-D_YzC3qc.js} +65 -65
  190. package/dist/{pieDiagram-ENE6RG2P-BKvggS7k.cjs → pieDiagram-ENE6RG2P-UMpeIUyV.cjs} +2 -2
  191. package/dist/{providers-BwQK7hZa.js → providers-CSvkTZsr.js} +17 -2
  192. package/dist/{providers-DO2t7ks4.cjs → providers-Cx0FuVQU.cjs} +1 -1
  193. package/dist/{quadrantDiagram-ABIIQ3AL-BHhoAvLS.cjs → quadrantDiagram-ABIIQ3AL-DANY0ipQ.cjs} +1 -1
  194. package/dist/{quadrantDiagram-ABIIQ3AL-CzHgLdS3.js → quadrantDiagram-ABIIQ3AL-DDm-r_6D.js} +57 -57
  195. package/dist/railroadDiagram-RFXS5EU6-CDUd4th1.cjs +1 -0
  196. package/dist/{railroadDiagram-RFXS5EU6-Bu_Fhi5x.js → railroadDiagram-RFXS5EU6-hJ6uB90G.js} +3 -3
  197. package/dist/remarkProcessor.server.d.ts +2 -0
  198. package/dist/{requirementDiagram-TGXJPOKE-CY-JYM-P.js → requirementDiagram-TGXJPOKE-BJef5Jb0.js} +29 -29
  199. package/dist/{requirementDiagram-TGXJPOKE-BhdvQnjG.cjs → requirementDiagram-TGXJPOKE-DaoCo7go.cjs} +1 -1
  200. package/dist/{sankeyDiagram-HTMAVEWB-BmHtjxlW.js → sankeyDiagram-HTMAVEWB-BZQs0bE-.js} +48 -48
  201. package/dist/{sankeyDiagram-HTMAVEWB-CUeYKZeQ.cjs → sankeyDiagram-HTMAVEWB-DXiv0YOu.cjs} +3 -3
  202. package/dist/{sequenceDiagram-DBY2YBRQ-GepntdDB.cjs → sequenceDiagram-DBY2YBRQ-CJGpsnsv.cjs} +1 -1
  203. package/dist/{sequenceDiagram-DBY2YBRQ-Cn2CC9BC.js → sequenceDiagram-DBY2YBRQ-D05U2w26.js} +86 -86
  204. package/dist/serviceClient.cjs +1 -0
  205. package/dist/serviceClient.d.ts +3 -0
  206. package/dist/serviceClient.js +9 -0
  207. package/dist/{sizeCapture-X5ZJPWSS-CZF99dy_.js → sizeCapture-X5ZJPWSS-DTr0Vm61.js} +1 -1
  208. package/dist/sizeCapture-X5ZJPWSS-DjuH1zNP.cjs +1 -0
  209. package/dist/{stateDiagram-2N3HPSRC-CCbBvBua.js → stateDiagram-2N3HPSRC-B8nvJKpB.js} +20 -20
  210. package/dist/stateDiagram-2N3HPSRC-BrB47FD-.cjs +1 -0
  211. package/dist/stateDiagram-v2-6OUMAXLB-CC8gOGDK.cjs +1 -0
  212. package/dist/{stateDiagram-v2-6OUMAXLB-_A1QESxx.js → stateDiagram-v2-6OUMAXLB-CV-JqAeP.js} +2 -2
  213. package/dist/styles/markdown.css +1 -1
  214. package/dist/styles/markdown.standalone.css +1 -1
  215. package/dist/{swimlanes-5IMT3BWC-B-BDM_Ae.js → swimlanes-5IMT3BWC-BPtufzUd.js} +3 -3
  216. package/dist/swimlanes-5IMT3BWC-WAbDPRgt.cjs +1 -0
  217. package/dist/{swimlanesDiagram-G3AALYLV-BysT2rWl.js → swimlanesDiagram-G3AALYLV-BQKEmJFX.js} +2 -2
  218. package/dist/{swimlanesDiagram-G3AALYLV-DZuQxKuB.cjs → swimlanesDiagram-G3AALYLV-BTwwtLZL.cjs} +1 -1
  219. package/dist/{timeline-definition-FHXFAJF6-DVzdzbl1.js → timeline-definition-FHXFAJF6-DJ6GV7Fz.js} +34 -34
  220. package/dist/{timeline-definition-FHXFAJF6-oFf_sUOI.cjs → timeline-definition-FHXFAJF6-qdkrah7t.cjs} +1 -1
  221. package/dist/vennDiagram-L72KCM5P-B5onSWPA.cjs +34 -0
  222. package/dist/{vennDiagram-L72KCM5P-Bm1TGZux.js → vennDiagram-L72KCM5P-DWnnndTj.js} +196 -196
  223. package/dist/viewer-settings.cjs +1 -1
  224. package/dist/viewer-settings.d.ts +8 -0
  225. package/dist/viewer-settings.js +11 -5
  226. package/dist/{wardleyDiagram-EHGQE667-BC_1RAbp.js → wardleyDiagram-EHGQE667-DFmDgQSb.js} +41 -41
  227. package/dist/{wardleyDiagram-EHGQE667-CqB3gLCH.cjs → wardleyDiagram-EHGQE667-DdeBbvVM.cjs} +2 -2
  228. package/dist/{xychartDiagram-FW5EYKEG-a1vb5UxD.cjs → xychartDiagram-FW5EYKEG-CiJQMClv.cjs} +1 -1
  229. package/dist/{xychartDiagram-FW5EYKEG-ClITdEhV.js → xychartDiagram-FW5EYKEG-L2Kj4cZA.js} +28 -28
  230. package/package.json +31 -13
  231. package/dist/abnfDiagram-VRR7QNED-Crz-ChMJ.cjs +0 -1
  232. package/dist/arc-BKGy6Me1.js +0 -83
  233. package/dist/arc-CYJCyviq.cjs +0 -1
  234. package/dist/architectureDiagram-ZJ3FMSHR-gTB8pttO.cjs +0 -36
  235. package/dist/channel-BKoPLS2j.cjs +0 -1
  236. package/dist/chunk-2Q5K7J3B-DgtYKcDs.cjs +0 -1
  237. package/dist/chunk-32BRIVSS-D-6GBFtx.cjs +0 -1
  238. package/dist/chunk-JWPE2WC7-5sd39cpa.cjs +0 -1
  239. package/dist/chunk-RYQCIY6F-BBTBydZd.cjs +0 -1
  240. package/dist/chunk-VR4S4FIN-CHKLwvYh.cjs +0 -1
  241. package/dist/chunk-XXDRQBXY-DttkP7wv.cjs +0 -1
  242. package/dist/classDiagram-OUVF2IWQ-BKruajP_.cjs +0 -1
  243. package/dist/classDiagram-v2-EOCWNBFH-BKruajP_.cjs +0 -1
  244. package/dist/cose-bilkent-JH36ORCC-Cjfa6NyL.cjs +0 -1
  245. package/dist/cynefinDiagram-TSTJHNR4-B3boTACW.cjs +0 -62
  246. package/dist/dagre-VKFMJZFB-DF3Mvuas.cjs +0 -4
  247. package/dist/diagram-G47NLZAW-CKIEbGLS.cjs +0 -24
  248. package/dist/diagram-NH7WQ7WH-D6wMwkLQ.cjs +0 -24
  249. package/dist/diagram-WEI45ONY-SYHw7k8b.cjs +0 -41
  250. package/dist/ebnfDiagram-CCIWWBDH-23bjk9FU.cjs +0 -1
  251. package/dist/errors-BW5JXRoX.cjs +0 -1
  252. package/dist/errors-Blk_XJ9C.js +0 -55
  253. package/dist/extractHeadings-DlQcPv5N.js +0 -20361
  254. package/dist/extractHeadings-wWAipplS.cjs +0 -315
  255. package/dist/flowDiagram-23GEKE2U-CRC9U6qD.cjs +0 -1
  256. package/dist/flowDiagram-23GEKE2U-CRo7TM3K.js +0 -7
  257. package/dist/ganttDiagram-NO4QXBWP-CR55KG5d.cjs +0 -292
  258. package/dist/gitGraphDiagram-IHSO6WYX-BWYUn1Bi.cjs +0 -106
  259. package/dist/infoDiagram-FWYZ7A6U-CsUGc58_.cjs +0 -2
  260. package/dist/linear-DwqXGYLc.cjs +0 -1
  261. package/dist/linkCardServer/addressGuard.server.d.ts +0 -25
  262. package/dist/linkCardServer/pageFetch.server.d.ts +0 -37
  263. package/dist/linkCards-1JxY8wdm.js +0 -48
  264. package/dist/linkCards-Bjd_vW39.cjs +0 -1
  265. package/dist/pegDiagram-2B236MQR-C5pLIpKI.cjs +0 -1
  266. package/dist/railroadDiagram-RFXS5EU6-CwGmOFD_.cjs +0 -1
  267. package/dist/sizeCapture-X5ZJPWSS-Cd-k8xwk.cjs +0 -1
  268. package/dist/stateDiagram-2N3HPSRC-D2cvrAtN.cjs +0 -1
  269. package/dist/stateDiagram-v2-6OUMAXLB-BaktPIVY.cjs +0 -1
  270. package/dist/swimlanes-5IMT3BWC-DtdLK5z3.cjs +0 -1
  271. package/dist/vennDiagram-L72KCM5P-Ba2FGeN1.cjs +0 -34
  272. /package/dist/linkCardServer/{htmlEncoding.server.d.ts → htmlEncoding.d.ts} +0 -0
  273. /package/dist/linkCardServer/{metadataCache.server.d.ts → metadataCache.d.ts} +0 -0
@@ -0,0 +1,624 @@
1
+ import { l as L, L as b, a as W, b as te } from "./linkCards-DfSLqLPF.js";
2
+ import { l as P } from "./simple-logger-DwH1YQvq.js";
3
+ import { Parser as ne } from "htmlparser2";
4
+ import { createClient as re, ConnectError as ae, Code as oe } from "@connectrpc/connect";
5
+ import { proto3 as l, Message as v, MethodKind as K } from "@bufbuild/protobuf";
6
+ const V = 1024, se = /^[\t\n\f\r ]$/u, p = (n) => se.test(n), R = (n) => n.replace(/[A-Z]/gu, (t) => t.toLowerCase()), I = (n) => {
7
+ try {
8
+ return new TextDecoder(n).encoding;
9
+ } catch {
10
+ return null;
11
+ }
12
+ }, ie = (n) => n[0] === 239 && n[1] === 187 && n[2] === 191 ? "utf-8" : n[0] === 254 && n[1] === 255 ? "utf-16be" : n[0] === 255 && n[1] === 254 ? "utf-16le" : null, le = (n) => {
13
+ for (const t of n.split(";").slice(1)) {
14
+ const e = t.indexOf("=");
15
+ if (e !== -1 && t.slice(0, e).trim().toLowerCase() === "charset")
16
+ return t.slice(e + 1).trim().replace(/^"(.*)"$/su, "$1");
17
+ }
18
+ return null;
19
+ }, ce = (n) => {
20
+ let t = 0;
21
+ for (; ; ) {
22
+ const e = n.indexOf("charset", t);
23
+ if (e === -1) return null;
24
+ let r = e + 7;
25
+ for (; p(n.charAt(r)); ) r += 1;
26
+ if (n.charAt(r) !== "=") {
27
+ t = r;
28
+ continue;
29
+ }
30
+ for (r += 1; p(n.charAt(r)); ) r += 1;
31
+ const a = n.charAt(r);
32
+ if (a === '"' || a === "'") {
33
+ const s = n.indexOf(a, r + 1);
34
+ return s === -1 ? null : n.slice(r + 1, s);
35
+ }
36
+ const o = n.slice(r).search(/[\t\n\f\r ;]/u);
37
+ return o === -1 ? n.slice(r) : n.slice(r, r + o);
38
+ }
39
+ }, q = (n, t) => {
40
+ let e = t;
41
+ for (; p(n.charAt(e)) || n.charAt(e) === "/"; ) e += 1;
42
+ if (n.charAt(e) === ">" || e >= n.length) return { attribute: null, end: e };
43
+ let r = "";
44
+ for (; ; ) {
45
+ const s = n.charAt(e);
46
+ if (s === "") return { attribute: null, end: e };
47
+ if (s === "=" && r !== "") break;
48
+ if (p(s)) {
49
+ for (; p(n.charAt(e)); ) e += 1;
50
+ if (n.charAt(e) !== "=") return { attribute: { name: r, value: "" }, end: e };
51
+ break;
52
+ }
53
+ if (s === "/" || s === ">") return { attribute: { name: r, value: "" }, end: e };
54
+ r += R(s), e += 1;
55
+ }
56
+ for (e += 1; p(n.charAt(e)); ) e += 1;
57
+ const a = n.charAt(e);
58
+ if (a === '"' || a === "'") {
59
+ const s = n.indexOf(a, e + 1);
60
+ return s === -1 ? { attribute: null, end: n.length } : { attribute: { name: r, value: R(n.slice(e + 1, s)) }, end: s + 1 };
61
+ }
62
+ if (a === ">") return { attribute: { name: r, value: "" }, end: e };
63
+ const o = n.slice(e).search(/[\t\n\f\r >]/u);
64
+ return o === -1 ? { attribute: null, end: n.length } : { attribute: { name: r, value: R(n.slice(e, e + o)) }, end: e + o };
65
+ }, ue = (n, t) => {
66
+ const e = /* @__PURE__ */ new Set();
67
+ let r = !1, a = null, o = null, s = t;
68
+ for (; ; ) {
69
+ const { attribute: i, end: u } = q(n, s);
70
+ if (s = u, i === null) break;
71
+ if (!e.has(i.name))
72
+ if (e.add(i.name), i.name === "http-equiv")
73
+ r = i.value === "content-type";
74
+ else if (i.name === "content") {
75
+ const d = ce(i.value), w = d === null ? null : I(d);
76
+ w !== null && o === null && (o = w, a = !0);
77
+ } else i.name === "charset" && (o = I(i.value) ?? !1, a = !1);
78
+ }
79
+ return a === null || typeof o != "string" || a && !r ? { encoding: null, end: s } : o === "utf-16be" || o === "utf-16le" ? { encoding: "utf-8", end: s } : { encoding: o === "x-user-defined" ? "windows-1252" : o, end: s };
80
+ }, fe = (n) => {
81
+ const t = Array.from(n.subarray(0, V), (r) => String.fromCharCode(r)).join("");
82
+ let e = 0;
83
+ for (; e < t.length; )
84
+ if (t.startsWith("<!--", e)) {
85
+ const r = t.indexOf("-->", e + 2);
86
+ if (r === -1) return null;
87
+ e = r + 3;
88
+ } else if (/^<meta[\t\n\f\r /]$/iu.test(t.slice(e, e + 6))) {
89
+ const { encoding: r, end: a } = ue(t, e + 5);
90
+ if (r !== null) return r;
91
+ e = a + 1;
92
+ } else if (/^<\/?[A-Za-z]/u.test(t.slice(e, e + 3))) {
93
+ let r = e + 1;
94
+ for (; r < t.length && !p(t.charAt(r)) && t.charAt(r) !== ">"; ) r += 1;
95
+ for (; ; ) {
96
+ const a = q(t, r);
97
+ if (r = a.end, a.attribute === null) break;
98
+ }
99
+ e = r + 1;
100
+ } else if (/^<[!/?]$/u.test(t.slice(e, e + 2))) {
101
+ const r = t.indexOf(">", e + 1);
102
+ if (r === -1) return null;
103
+ e = r + 1;
104
+ } else
105
+ e += 1;
106
+ return null;
107
+ }, de = (n, t) => {
108
+ const e = ie(n);
109
+ if (e !== null) return e;
110
+ const r = le(t), a = r === null ? null : I(r);
111
+ return a !== null ? a : fe(n) ?? "utf-8";
112
+ }, he = (n, t) => {
113
+ const e = new Uint8Array(t);
114
+ let r = 0;
115
+ for (const a of n)
116
+ e.set(a, r), r += a.byteLength;
117
+ return e;
118
+ }, me = (n) => {
119
+ const t = [];
120
+ let e = 0, r = null;
121
+ const a = () => {
122
+ const o = he(t, e);
123
+ t.length = 0;
124
+ const s = new TextDecoder(de(o, n));
125
+ return r = s, { started: s, text: s.decode(o, { stream: !0 }) };
126
+ };
127
+ return {
128
+ write: (o) => r !== null ? r.decode(o, { stream: !0 }) : (t.push(o), e += o.byteLength, e < V ? "" : a().text),
129
+ end: () => {
130
+ if (r !== null) return r.decode();
131
+ const { started: o, text: s } = a();
132
+ return s + o.decode();
133
+ }
134
+ };
135
+ }, pe = (n, t, e) => {
136
+ const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
137
+ return (o) => {
138
+ const s = r.get(o);
139
+ if (s !== void 0 && s.expireAt > e()) return Promise.resolve(s.value);
140
+ const i = a.get(o);
141
+ if (i !== void 0) return i;
142
+ const u = n(o).then((d) => (!r.has(o) && r.size >= t.maxEntries && r.delete(r.keys().next().value), r.set(o, { value: d, expireAt: e() + t.ttlMsOf(d) }), d)).finally(() => {
143
+ a.delete(o);
144
+ });
145
+ return a.set(o, u), u;
146
+ };
147
+ }, we = 256, Ee = 4096, ge = 64, Ae = /* @__PURE__ */ new Set(["html", "head", "title", "meta", "link", "base", "basefont", "bgsound", "noframes", "script", "style", "template", "noscript"]), ye = /* @__PURE__ */ new Set(["title", "script", "style"]), Te = /* @__PURE__ */ new Set(["noscript", "template", "noframes"]), Y = (n) => {
148
+ let t;
149
+ try {
150
+ t = new URL(n);
151
+ } catch {
152
+ return { ok: !1, detail: "Invalid URL" };
153
+ }
154
+ return t.protocol !== "http:" && t.protocol !== "https:" ? { ok: !1, detail: "Only http(s) URLs are allowed" } : t.username !== "" || t.password !== "" ? { ok: !1, detail: "URLs with a user name or password are not allowed" } : (t.hash = "", { ok: !0, href: t.href });
155
+ }, _ = (n) => {
156
+ let t;
157
+ try {
158
+ t = new URL(n);
159
+ } catch {
160
+ return "(unparsable URL)";
161
+ }
162
+ return t.protocol !== "http:" && t.protocol !== "https:" ? `(a ${t.protocol} URL)` : (t.username = "", t.password = "", t.search = "", t.hash = "", t.href);
163
+ }, ke = (n) => n?.toLowerCase().split(/[\t\n\f\r ]+/u).includes("icon") === !0, ve = (n, t) => {
164
+ if (n === void 0) return t;
165
+ let e;
166
+ try {
167
+ e = new URL(n, t);
168
+ } catch {
169
+ return t;
170
+ }
171
+ return (e.protocol === "http:" || e.protocol === "https:") && e.href.length <= W ? e.href : t;
172
+ }, j = (n, t) => {
173
+ const e = n?.trim();
174
+ if (e === void 0 || e === "") return;
175
+ let r;
176
+ try {
177
+ r = new URL(e, t);
178
+ } catch {
179
+ return;
180
+ }
181
+ return r.href.length <= W && Y(r.href).ok ? r.href : void 0;
182
+ }, Ce = (n) => {
183
+ let t = !1, e = 0, r = 0, a = 0, o = null, s = null, i = null, u, d, w, U, x, D, M = !1, J, B = !1;
184
+ const O = () => {
185
+ t = !0, N.pause();
186
+ }, N = new ne(
187
+ {
188
+ onopentagname(c) {
189
+ e += 1, r += 1, a = 0, (e > we || r > Ee || o === null && !Ae.has(c)) && O();
190
+ },
191
+ onattribute() {
192
+ a += 1, a > ge && O();
193
+ },
194
+ onopentag(c, f) {
195
+ if (!(t || o !== null)) {
196
+ if (Te.has(c)) {
197
+ o = e;
198
+ return;
199
+ }
200
+ if (c === "meta") {
201
+ const h = f.content;
202
+ f.property === "og:site_name" && (U = h), f.property === "og:title" && (d = h), f.property === "og:description" && (w = h), f.property === "og:image" && (x = h), f.name === "description" && (w = h);
203
+ } else c === "link" && !M && ke(f.rel) ? (M = !0, D = f.href) : c === "base" && !B && Object.hasOwn(f, "href") && (B = !0, J = f.href);
204
+ ye.has(c) && (s = c, c === "title" && u === void 0 && (i = ""));
205
+ }
206
+ },
207
+ ontext(c) {
208
+ o === null && (i !== null ? i += c : s === null && /[^\t\n\f\r ]/u.test(c) && O());
209
+ },
210
+ onclosetag(c) {
211
+ if (!t) {
212
+ if (e -= 1, o !== null) {
213
+ e < o && (o = null);
214
+ return;
215
+ }
216
+ c === s && (s = null, i !== null && (u = i, i = null));
217
+ }
218
+ }
219
+ },
220
+ { decodeEntities: !0 }
221
+ );
222
+ return {
223
+ write: (c) => (t || N.write(c), !t),
224
+ end: () => {
225
+ t || N.end();
226
+ const c = L(d, b.title) ?? L(u, b.title), f = L(w, b.description), h = L(U, b.siteName), H = ve(J, n), F = j(x, H), $ = j(D, H);
227
+ return {
228
+ ...c === null ? {} : { title: c },
229
+ ...f === null ? {} : { description: f },
230
+ ...h === null ? {} : { site_name: h },
231
+ ...F === void 0 ? {} : { image: F },
232
+ ...$ === void 0 ? {} : { icon: $ }
233
+ };
234
+ }
235
+ };
236
+ }, Le = Object.freeze(["authorize", "pageFetch"]), be = /* @__PURE__ */ new Set(["text/html", "application/xhtml+xml"]), Se = "private, max-age=1800", Oe = 3600 * 1e3, Z = Object.freeze({ "private-network": 1800, "forbidden-url": 1800, unreachable: 300, "not-html": 300 }), Ne = 1e3, S = "no-store", C = (n, t, e, r, a = {}) => new Response(n.method === "HEAD" ? null : JSON.stringify(e), {
237
+ status: t,
238
+ headers: { "Content-Type": "application/json; charset=utf-8", "Cache-Control": r, "X-Content-Type-Options": "nosniff", ...a }
239
+ }), z = (n) => new Response(null, {
240
+ status: 204,
241
+ headers: { "Cache-Control": `private, max-age=${Z[n]}`, "X-Content-Type-Options": "nosniff", [te]: n }
242
+ }), Re = (n, t, e) => {
243
+ if (typeof n != "object" || n === null)
244
+ throw new TypeError(`${t}: options must be an object with an authorize function`);
245
+ if (typeof n.authorize != "function")
246
+ throw new TypeError(`${t}: options.authorize must be a function (pass () => true to serve everyone)`);
247
+ const r = Object.keys(n).filter((a) => !e.includes(a));
248
+ if (r.length > 0)
249
+ throw new TypeError(`${t}: unknown option(s): ${r.join(", ")}`);
250
+ }, Pe = (n) => be.has(n.split(";", 1)[0].trim().toLowerCase()), Ie = () => new Promise((n) => {
251
+ setTimeout(n, 0);
252
+ }), _e = async (n) => {
253
+ const t = me(n.contentType), e = Ce(n.url), r = n.body.getReader();
254
+ for (; ; ) {
255
+ let a;
256
+ try {
257
+ a = await r.read();
258
+ } catch (o) {
259
+ return P.error("Error reading a link-card page:", _(n.url), o), { ok: !1, reason: "unreachable" };
260
+ }
261
+ if (a.done) break;
262
+ if (!e.write(t.write(a.value))) {
263
+ await Promise.allSettled([r.cancel()]);
264
+ break;
265
+ }
266
+ await Ie();
267
+ }
268
+ return e.write(t.end()), { ok: !0, value: e.end() };
269
+ }, Ue = async (n, t, e) => {
270
+ const r = ["image", "icon"].filter((s) => n[s] !== void 0);
271
+ if (r.length === 0) return n;
272
+ const a = await t.classify(
273
+ r.map((s) => n[s]),
274
+ e
275
+ ), o = { ...n };
276
+ for (const [s, i] of r.entries())
277
+ a[s] !== null && delete o[i];
278
+ return o;
279
+ }, xe = async (n, t) => {
280
+ const e = new AbortController();
281
+ try {
282
+ const r = await t.open(n, e.signal);
283
+ if (r.kind === "skip") return { ok: !1, reason: r.reason };
284
+ const a = r.status < 200 || r.status > 299 ? "unreachable" : Pe(r.contentType) ? null : "not-html";
285
+ if (a !== null)
286
+ return await Promise.allSettled([r.body.cancel()]), { ok: !1, reason: a };
287
+ const o = await _e(r);
288
+ return o.ok ? { ok: !0, value: await Ue(o.value, t, e.signal) } : o;
289
+ } finally {
290
+ e.abort();
291
+ }
292
+ }, je = (n) => {
293
+ Re(n, "createLinkCardHandlerCore", Le);
294
+ const { authorize: t, pageFetch: e } = n;
295
+ if (typeof e != "object" || e === null || typeof e.open != "function" || typeof e.classify != "function")
296
+ throw new TypeError("createLinkCardHandlerCore: options.pageFetch must be a PageFetchPort (createConnectPageFetch makes one)");
297
+ const r = pe((a) => xe(a, e), { maxEntries: Ne, ttlMsOf: (a) => a.ok ? Oe : Z[a.reason] * 1e3 }, Date.now);
298
+ return async (a) => {
299
+ if (a.method !== "GET" && a.method !== "HEAD")
300
+ return C(a, 405, { error: "Method Not Allowed" }, S, { Allow: "GET, HEAD" });
301
+ if (await t(a) !== !0)
302
+ return C(a, 401, { error: "Unauthorized" }, S);
303
+ const o = new URL(a.url).searchParams.get("url");
304
+ if (o === null || o === "")
305
+ return C(a, 400, { error: "Missing 'url' parameter" }, S);
306
+ const s = Y(o);
307
+ if (!s.ok)
308
+ return P.info("Refused link-card URL:", _(o), `(forbidden-url: ${s.detail})`), z("forbidden-url");
309
+ let i;
310
+ try {
311
+ i = await r(s.href);
312
+ } catch (u) {
313
+ return P.error("Unexpected error while reading link-card metadata:", _(s.href), u), C(a, 500, { error: "Internal Server Error" }, S);
314
+ }
315
+ return i.ok ? C(a, 200, i.value, Se) : z(i.reason);
316
+ };
317
+ };
318
+ var m = /* @__PURE__ */ ((n) => (n[n.UNSPECIFIED = 0] = "UNSPECIFIED", n[n.PRIVATE_NETWORK = 1] = "PRIVATE_NETWORK", n[n.FORBIDDEN_URL = 2] = "FORBIDDEN_URL", n[n.UNREACHABLE = 3] = "UNREACHABLE", n))(m || {});
319
+ l.util.setEnumType(m, "markdown.v1.SkipReason", [
320
+ { no: 0, name: "SKIP_REASON_UNSPECIFIED" },
321
+ { no: 1, name: "SKIP_REASON_PRIVATE_NETWORK" },
322
+ { no: 2, name: "SKIP_REASON_FORBIDDEN_URL" },
323
+ { no: 3, name: "SKIP_REASON_UNREACHABLE" }
324
+ ]);
325
+ class E extends v {
326
+ /**
327
+ * The URL to open. It is checked under the policy like every redirect
328
+ * target; a URL the policy refuses answers a skip.
329
+ *
330
+ * @generated from field: string url = 1;
331
+ */
332
+ url = "";
333
+ constructor(t) {
334
+ super(), l.util.initPartial(t, this);
335
+ }
336
+ static runtime = l;
337
+ static typeName = "markdown.v1.FetchPageRequest";
338
+ static fields = l.util.newFieldList(() => [{
339
+ no: 1,
340
+ name: "url",
341
+ kind: "scalar",
342
+ T: 9
343
+ /* ScalarType.STRING */
344
+ }]);
345
+ static fromBinary(t, e) {
346
+ return new E().fromBinary(t, e);
347
+ }
348
+ static fromJson(t, e) {
349
+ return new E().fromJson(t, e);
350
+ }
351
+ static fromJsonString(t, e) {
352
+ return new E().fromJsonString(t, e);
353
+ }
354
+ static equals(t, e) {
355
+ return l.util.equals(E, t, e);
356
+ }
357
+ }
358
+ class g extends v {
359
+ /**
360
+ * @generated from oneof markdown.v1.FetchPageResponse.part
361
+ */
362
+ part = { case: void 0 };
363
+ constructor(t) {
364
+ super(), l.util.initPartial(t, this);
365
+ }
366
+ static runtime = l;
367
+ static typeName = "markdown.v1.FetchPageResponse";
368
+ static fields = l.util.newFieldList(() => [
369
+ { no: 1, name: "head", kind: "message", T: A, oneof: "part" },
370
+ { no: 2, name: "chunk", kind: "scalar", T: 12, oneof: "part" },
371
+ { no: 3, name: "skip", kind: "message", T: y, oneof: "part" }
372
+ ]);
373
+ static fromBinary(t, e) {
374
+ return new g().fromBinary(t, e);
375
+ }
376
+ static fromJson(t, e) {
377
+ return new g().fromJson(t, e);
378
+ }
379
+ static fromJsonString(t, e) {
380
+ return new g().fromJsonString(t, e);
381
+ }
382
+ static equals(t, e) {
383
+ return l.util.equals(g, t, e);
384
+ }
385
+ }
386
+ class A extends v {
387
+ /**
388
+ * The URL of the final response, without its fragment.
389
+ *
390
+ * @generated from field: string final_url = 1;
391
+ */
392
+ finalUrl = "";
393
+ /**
394
+ * The HTTP status of the final response.
395
+ *
396
+ * @generated from field: int32 status = 2;
397
+ */
398
+ status = 0;
399
+ /**
400
+ * The Content-Type header of the final response, empty when absent.
401
+ *
402
+ * @generated from field: string content_type = 3;
403
+ */
404
+ contentType = "";
405
+ constructor(t) {
406
+ super(), l.util.initPartial(t, this);
407
+ }
408
+ static runtime = l;
409
+ static typeName = "markdown.v1.PageHead";
410
+ static fields = l.util.newFieldList(() => [
411
+ {
412
+ no: 1,
413
+ name: "final_url",
414
+ kind: "scalar",
415
+ T: 9
416
+ /* ScalarType.STRING */
417
+ },
418
+ {
419
+ no: 2,
420
+ name: "status",
421
+ kind: "scalar",
422
+ T: 5
423
+ /* ScalarType.INT32 */
424
+ },
425
+ {
426
+ no: 3,
427
+ name: "content_type",
428
+ kind: "scalar",
429
+ T: 9
430
+ /* ScalarType.STRING */
431
+ }
432
+ ]);
433
+ static fromBinary(t, e) {
434
+ return new A().fromBinary(t, e);
435
+ }
436
+ static fromJson(t, e) {
437
+ return new A().fromJson(t, e);
438
+ }
439
+ static fromJsonString(t, e) {
440
+ return new A().fromJsonString(t, e);
441
+ }
442
+ static equals(t, e) {
443
+ return l.util.equals(A, t, e);
444
+ }
445
+ }
446
+ class y extends v {
447
+ /**
448
+ * @generated from field: markdown.v1.SkipReason reason = 1;
449
+ */
450
+ reason = 0;
451
+ constructor(t) {
452
+ super(), l.util.initPartial(t, this);
453
+ }
454
+ static runtime = l;
455
+ static typeName = "markdown.v1.PageSkip";
456
+ static fields = l.util.newFieldList(() => [{ no: 1, name: "reason", kind: "enum", T: l.getEnumType(m) }]);
457
+ static fromBinary(t, e) {
458
+ return new y().fromBinary(t, e);
459
+ }
460
+ static fromJson(t, e) {
461
+ return new y().fromJson(t, e);
462
+ }
463
+ static fromJsonString(t, e) {
464
+ return new y().fromJsonString(t, e);
465
+ }
466
+ static equals(t, e) {
467
+ return l.util.equals(y, t, e);
468
+ }
469
+ }
470
+ class T extends v {
471
+ /**
472
+ * @generated from field: repeated string urls = 1;
473
+ */
474
+ urls = [];
475
+ constructor(t) {
476
+ super(), l.util.initPartial(t, this);
477
+ }
478
+ static runtime = l;
479
+ static typeName = "markdown.v1.ClassifyUrlsRequest";
480
+ static fields = l.util.newFieldList(() => [{ no: 1, name: "urls", kind: "scalar", T: 9, repeated: !0 }]);
481
+ static fromBinary(t, e) {
482
+ return new T().fromBinary(t, e);
483
+ }
484
+ static fromJson(t, e) {
485
+ return new T().fromJson(t, e);
486
+ }
487
+ static fromJsonString(t, e) {
488
+ return new T().fromJsonString(t, e);
489
+ }
490
+ static equals(t, e) {
491
+ return l.util.equals(T, t, e);
492
+ }
493
+ }
494
+ class k extends v {
495
+ /**
496
+ * One verdict for each of the request's URLs, in the same order.
497
+ *
498
+ * @generated from field: repeated markdown.v1.SkipReason verdicts = 1;
499
+ */
500
+ verdicts = [];
501
+ constructor(t) {
502
+ super(), l.util.initPartial(t, this);
503
+ }
504
+ static runtime = l;
505
+ static typeName = "markdown.v1.ClassifyUrlsResponse";
506
+ static fields = l.util.newFieldList(() => [{ no: 1, name: "verdicts", kind: "enum", T: l.getEnumType(m), repeated: !0 }]);
507
+ static fromBinary(t, e) {
508
+ return new k().fromBinary(t, e);
509
+ }
510
+ static fromJson(t, e) {
511
+ return new k().fromJson(t, e);
512
+ }
513
+ static fromJsonString(t, e) {
514
+ return new k().fromJsonString(t, e);
515
+ }
516
+ static equals(t, e) {
517
+ return l.util.equals(k, t, e);
518
+ }
519
+ }
520
+ const De = {
521
+ typeName: "markdown.v1.LinkCardService",
522
+ methods: {
523
+ /**
524
+ * FetchPage opens url and streams the final response: the head first, then
525
+ * body chunks of at most 64 KiB; a body over the server's MaxBodyBytes
526
+ * (8 MiB) is cut there and the stream ends normally (the reader parses the
527
+ * first bytes). A page that is not fetched answers a single skip. The stream
528
+ * ends early when the reader cancels it, and with an error when the body
529
+ * breaks off after the head: UNAVAILABLE, or DEADLINE_EXCEEDED past the
530
+ * server's time limit.
531
+ *
532
+ * @generated from rpc markdown.v1.LinkCardService.FetchPage
533
+ */
534
+ fetchPage: {
535
+ name: "FetchPage",
536
+ I: E,
537
+ O: g,
538
+ kind: K.ServerStreaming
539
+ },
540
+ /**
541
+ * ClassifyUrls answers, for each URL, whether the policy lets it be loaded
542
+ * (public), and otherwise why not. More URLs than the server's
543
+ * MaxClassifyUrls (16) fail with INVALID_ARGUMENT, and a classification past
544
+ * its ClassifyTimeout with DEADLINE_EXCEEDED.
545
+ *
546
+ * @generated from rpc markdown.v1.LinkCardService.ClassifyUrls
547
+ */
548
+ classifyUrls: {
549
+ name: "ClassifyUrls",
550
+ I: T,
551
+ O: k,
552
+ kind: K.Unary
553
+ }
554
+ }
555
+ }, Q = (n) => {
556
+ switch (n) {
557
+ case m.PRIVATE_NETWORK:
558
+ return "private-network";
559
+ case m.FORBIDDEN_URL:
560
+ return "forbidden-url";
561
+ case m.UNREACHABLE:
562
+ return "unreachable";
563
+ default:
564
+ throw new Error(`LinkCardService answered an unknown skip reason: ${n}`);
565
+ }
566
+ }, Me = (n) => n === m.UNSPECIFIED ? null : Q(n), ee = async (n, t) => {
567
+ try {
568
+ return await n.next();
569
+ } catch (e) {
570
+ throw t(), e;
571
+ }
572
+ }, Je = (n, t) => new ReadableStream(
573
+ {
574
+ pull: async (e) => {
575
+ const r = await ee(n, t);
576
+ if (r.done === !0) {
577
+ t(), e.close();
578
+ return;
579
+ }
580
+ if (r.value.part.case !== "chunk")
581
+ throw t(), new Error(`LinkCardService sent ${r.value.part.case ?? "nothing"} where a body chunk belongs`);
582
+ e.enqueue(r.value.part.value);
583
+ },
584
+ cancel: t
585
+ },
586
+ { highWaterMark: 0 }
587
+ ), X = 3e4, G = (n) => {
588
+ const t = new AbortController(), e = AbortSignal.any([n, t.signal]);
589
+ if (!e.aborted) {
590
+ const r = setTimeout(() => t.abort(new ae(`the call to LinkCardService took longer than ${X} ms`, oe.DeadlineExceeded)), X);
591
+ e.addEventListener("abort", () => clearTimeout(r), { once: !0 });
592
+ }
593
+ return { signal: e, stop: () => t.abort() };
594
+ }, ze = (n) => {
595
+ const t = re(De, n);
596
+ return {
597
+ open: async (e, r) => {
598
+ const a = G(r), o = a.stop, s = t.fetchPage({ url: e }, { signal: a.signal })[Symbol.asyncIterator](), i = await ee(s, o), u = i.done === !0 ? void 0 : i.value.part;
599
+ switch (u?.case) {
600
+ case "head":
601
+ return { kind: "page", url: u.value.finalUrl, status: u.value.status, contentType: u.value.contentType, body: Je(s, o) };
602
+ case "skip":
603
+ return o(), { kind: "skip", reason: Q(u.value.reason) };
604
+ default:
605
+ throw o(), new Error(`LinkCardService answered ${u?.case ?? "nothing"} where a head or a skip belongs`);
606
+ }
607
+ },
608
+ classify: async (e, r) => {
609
+ const a = G(r);
610
+ try {
611
+ const { verdicts: o } = await t.classifyUrls({ urls: [...e] }, { signal: a.signal });
612
+ if (o.length !== e.length) throw new Error(`LinkCardService answered ${o.length} verdicts for ${e.length} URLs`);
613
+ return o.map(Me);
614
+ } finally {
615
+ a.stop();
616
+ }
617
+ }
618
+ };
619
+ };
620
+ export {
621
+ je as a,
622
+ Re as b,
623
+ ze as c
624
+ };
@@ -1,6 +1,6 @@
1
- import { g as l, r as m, d as a } from "./chunk-MOJQB5TN-nqR_swpx.js";
2
- import { p } from "./chunk-JWPE2WC7-DG0ebjV4.js";
3
- import { _ as t, W as o } from "./extractHeadings-DlQcPv5N.js";
1
+ import { g as l, r as m, d as a } from "./chunk-MOJQB5TN-B1fdnpCz.js";
2
+ import { p } from "./chunk-JWPE2WC7-Bj2m1SXZ.js";
3
+ import { _ as t, l as o } from "./mermaid.core-C4EClWgB.js";
4
4
  import { M as u, d as c } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
5
5
  var f = c().RailroadPeg.parser.LangiumParser, i = /* @__PURE__ */ t((e) => {
6
6
  const r = e.alternatives.map(d);
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-yjlPYCh4.cjs"),l=require("./chunk-JWPE2WC7-Dgw1ILoe.cjs"),t=require("./mermaid.core-CRP55Hm1.cjs"),s=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var u=s.createRailroadPegServices().RailroadPeg.parser.LangiumParser,i=t.__name(e=>{const r=e.alternatives.map(m);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),m=t.__name(e=>{const r=e.elements.map(c);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),c=t.__name(e=>{const r=p(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${o(r)}`:`!${o(r)}`}:r},"transformPrefix"),o=t.__name(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),p=t.__name(e=>{const r=d(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),d=t.__name(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),f=t.__name(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),g=t.__name(e=>{l.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(f(r)))},"populateDb"),P={parse:t.__name(e=>{a.db.clear(),t.log.debug("[PEG Parser] Starting Langium parse");const r=u.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new s.MermaidParseError(r);const n=r.value;t.log.debug("[PEG Parser] Parsed rules:",n.rules.length),g(n),t.log.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a.db}},y={parser:P,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=y;