@aiquants/markdown 5.0.0 → 6.0.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 (170) hide show
  1. package/README.md +93 -14
  2. package/dist/{abnfDiagram-VRR7QNED-DeHJ63Vu.js → abnfDiagram-VRR7QNED-D7Rp9EaV.js} +3 -3
  3. package/dist/{abnfDiagram-VRR7QNED-CfVjEUzG.cjs → abnfDiagram-VRR7QNED-KTGT9TWM.cjs} +1 -1
  4. package/dist/{arc-XFFLkHkK.cjs → arc-D5T_urCC.cjs} +1 -1
  5. package/dist/arc-DzZml7Bc.js +83 -0
  6. package/dist/{architectureDiagram-ZJ3FMSHR-7xJ6YYGu.cjs → architectureDiagram-ZJ3FMSHR-BOo3y9aD.cjs} +1 -1
  7. package/dist/{architectureDiagram-ZJ3FMSHR-CQ1m3MUB.js → architectureDiagram-ZJ3FMSHR-DLrGYTYy.js} +123 -123
  8. package/dist/{blockDiagram-677ZJIJ3-BPC3se0e.js → blockDiagram-677ZJIJ3-B60l5Fpl.js} +166 -166
  9. package/dist/{blockDiagram-677ZJIJ3-CJOFqwiW.cjs → blockDiagram-677ZJIJ3-DnjCjo0a.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-BEIrp4t6.js → c4Diagram-LMCZKHZV-BmbplKCu.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-D8ytYGhR.cjs → c4Diagram-LMCZKHZV-bd8fWQ1F.cjs} +1 -1
  12. package/dist/channel-B3oXm84X.js +5 -0
  13. package/dist/{channel-CJQcZr8o.cjs → channel-DJ_PyD9w.cjs} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-l8ly7Yjr.js → chunk-2Q5K7J3B-C0hbxO3D.js} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-BbMQR3Sm.cjs → chunk-2Q5K7J3B-CWLCO342.cjs} +1 -1
  16. package/dist/{chunk-32BRIVSS-BwDfmprN.cjs → chunk-32BRIVSS-Cb9nTxqN.cjs} +1 -1
  17. package/dist/{chunk-32BRIVSS-BhQJBlVw.js → chunk-32BRIVSS-DUWtkDEY.js} +1 -1
  18. package/dist/{chunk-5VM5RSS4-Bfis-x7E.js → chunk-5VM5RSS4-C3mSh-gE.js} +1 -1
  19. package/dist/{chunk-5VM5RSS4-CqDQlS7v.cjs → chunk-5VM5RSS4-DHA5n_Ls.cjs} +1 -1
  20. package/dist/{chunk-EX3LRPZG-9aDULZwJ.cjs → chunk-EX3LRPZG-ByY6_kep.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-DUTbzwDM.js → chunk-EX3LRPZG-DCF1zjtT.js} +50 -50
  22. package/dist/{chunk-JWPE2WC7-DpcSSOP5.js → chunk-JWPE2WC7-CPLOunIL.js} +1 -1
  23. package/dist/{chunk-JWPE2WC7-5cM5nFf6.cjs → chunk-JWPE2WC7-CUBzYD4G.cjs} +1 -1
  24. package/dist/{chunk-MOJQB5TN-D_h6bolU.js → chunk-MOJQB5TN-CmOhW6SK.js} +9 -9
  25. package/dist/{chunk-MOJQB5TN-Cw864mUL.cjs → chunk-MOJQB5TN-P8-yb3-j.cjs} +1 -1
  26. package/dist/{chunk-PUDLZKDR-B0wZjmzv.js → chunk-PUDLZKDR-DH7B7ZTK.js} +22 -22
  27. package/dist/{chunk-PUDLZKDR-yLvT3c9x.cjs → chunk-PUDLZKDR-pKdIELvz.cjs} +1 -1
  28. package/dist/{chunk-RYQCIY6F-DTKYsCgk.js → chunk-RYQCIY6F-C7ytn_QX.js} +6 -6
  29. package/dist/{chunk-RYQCIY6F-hj9dRWMT.cjs → chunk-RYQCIY6F-DcvQCEoc.cjs} +1 -1
  30. package/dist/{chunk-V7JOEXUC-COa9uddv.js → chunk-V7JOEXUC-BgLcssUF.js} +5 -5
  31. package/dist/{chunk-V7JOEXUC-DIQ8n1AN.cjs → chunk-V7JOEXUC-CtXgqODy.cjs} +1 -1
  32. package/dist/{chunk-VR4S4FIN-B72PxPVm.js → chunk-VR4S4FIN-BK6xeIQk.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-Cy-2mZJB.cjs → chunk-VR4S4FIN-Cc4GDi2Z.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-D2Sgptl-.js → chunk-XXDRQBXY-COtZ25Ez.js} +1 -1
  35. package/dist/{chunk-XXDRQBXY-DmoUE7-y.cjs → chunk-XXDRQBXY-D1OixGzR.cjs} +1 -1
  36. package/dist/{classDiagram-OUVF2IWQ-GjsCEuKI.cjs → classDiagram-OUVF2IWQ-DDLmqaG6.cjs} +1 -1
  37. package/dist/{classDiagram-v2-EOCWNBFH-Dah4_VL7.js → classDiagram-OUVF2IWQ-Jc-IwOm0.js} +2 -2
  38. package/dist/{classDiagram-v2-EOCWNBFH-GjsCEuKI.cjs → classDiagram-v2-EOCWNBFH-DDLmqaG6.cjs} +1 -1
  39. package/dist/{classDiagram-OUVF2IWQ-Dah4_VL7.js → classDiagram-v2-EOCWNBFH-Jc-IwOm0.js} +2 -2
  40. package/dist/components/MarkdownRenderer.d.ts +5 -2
  41. package/dist/components/MarkdownViewer.d.ts +3 -2
  42. package/dist/components/NodesRenderer.d.ts +1 -5
  43. package/dist/components/embeds/ClientFrame.d.ts +13 -0
  44. package/dist/components/embeds/LinkCard.d.ts +9 -0
  45. package/dist/components/embeds/ProviderEmbed.d.ts +11 -0
  46. package/dist/components/embeds/embedLabels.d.ts +12 -0
  47. package/dist/components/embeds/frameMessages.d.ts +7 -0
  48. package/dist/components/embeds/markdownEmbeds.d.ts +2 -0
  49. package/dist/components/embeds/requestQueue.d.ts +16 -0
  50. package/dist/components/embeds.d.ts +0 -8
  51. package/dist/components/htmlSanitizer.d.ts +4 -0
  52. package/dist/components/mdastNodes/HTMLBlockContainerNode.d.ts +1 -2
  53. package/dist/components/rawHtml.d.ts +6 -3
  54. package/dist/components/viewerLabels.d.ts +3 -1
  55. package/dist/{cose-bilkent-JH36ORCC-Pi0l3C5o.js → cose-bilkent-JH36ORCC-DaucPocG.js} +1 -1
  56. package/dist/{cose-bilkent-JH36ORCC-Vi9pHFwc.cjs → cose-bilkent-JH36ORCC-OwiXHdQY.cjs} +1 -1
  57. package/dist/css/zenn-content.css +0 -40
  58. package/dist/{cynefinDiagram-TSTJHNR4-BQ2k9Z6b.cjs → cynefinDiagram-TSTJHNR4-Ag-HcuUm.cjs} +1 -1
  59. package/dist/{cynefinDiagram-TSTJHNR4-CIh03JTU.js → cynefinDiagram-TSTJHNR4-Dkmz7gDw.js} +47 -47
  60. package/dist/{dagre-VKFMJZFB-cINcPwV3.js → dagre-VKFMJZFB-BHGdcjt3.js} +27 -27
  61. package/dist/{dagre-VKFMJZFB-DI2wSrAy.cjs → dagre-VKFMJZFB-Q4CcAQ09.cjs} +1 -1
  62. package/dist/{diagram-FQU43EPY-BonrBTG_.js → diagram-FQU43EPY-DBASKnKu.js} +42 -42
  63. package/dist/{diagram-FQU43EPY-B6iUH2l5.cjs → diagram-FQU43EPY-jWCrN_AW.cjs} +1 -1
  64. package/dist/{diagram-G47NLZAW-CY6mWS2R.cjs → diagram-G47NLZAW-B4XMStX7.cjs} +1 -1
  65. package/dist/{diagram-G47NLZAW-5N876QQA.js → diagram-G47NLZAW-BY1mmnYA.js} +83 -83
  66. package/dist/{diagram-NH7WQ7WH-x3SaRfd6.cjs → diagram-NH7WQ7WH-BS1eEa9R.cjs} +1 -1
  67. package/dist/{diagram-NH7WQ7WH-LFuTbHxY.js → diagram-NH7WQ7WH-BXFvYRtm.js} +18 -18
  68. package/dist/{diagram-OA4YK3LP-B9mVw8cB.cjs → diagram-OA4YK3LP-CTaL_2Nc.cjs} +1 -1
  69. package/dist/{diagram-OA4YK3LP-Cinpbl0B.js → diagram-OA4YK3LP-DgGrzezu.js} +61 -61
  70. package/dist/{diagram-WEI45ONY-HPCHpafe.js → diagram-WEI45ONY-BHxWKH3v.js} +21 -21
  71. package/dist/{diagram-WEI45ONY-BRYVUhRr.cjs → diagram-WEI45ONY-DX7BGSMI.cjs} +1 -1
  72. package/dist/{ebnfDiagram-CCIWWBDH-oLOdtH39.js → ebnfDiagram-CCIWWBDH-BUK_anpV.js} +5 -5
  73. package/dist/{ebnfDiagram-CCIWWBDH-DhFlIi0a.cjs → ebnfDiagram-CCIWWBDH-BpDmVVJY.cjs} +1 -1
  74. package/dist/embeds/frames.d.ts +4 -0
  75. package/dist/embeds/linkCards.d.ts +16 -0
  76. package/dist/embeds/placeholder.d.ts +15 -0
  77. package/dist/embeds/providers.d.ts +73 -0
  78. package/dist/embeds/testing.cjs +1 -0
  79. package/dist/embeds/testing.d.ts +7 -0
  80. package/dist/embeds/testing.js +67 -0
  81. package/dist/embeds.cjs +1 -0
  82. package/dist/embeds.d.ts +4 -0
  83. package/dist/embeds.js +94 -0
  84. package/dist/{erDiagram-Q63AITRT-DCCFR1Ai.cjs → erDiagram-Q63AITRT-Cd9H9BtP.cjs} +1 -1
  85. package/dist/{erDiagram-Q63AITRT-CCtzpK78.js → erDiagram-Q63AITRT-Qb2bmkNp.js} +9 -9
  86. package/dist/{extractHeadings-CGJexznE.js → extractHeadings-B2pUyEPa.js} +5603 -5517
  87. package/dist/extractHeadings-DgefF9l1.cjs +311 -0
  88. package/dist/flowDiagram-23GEKE2U-BOmNlv7X.cjs +1 -0
  89. package/dist/flowDiagram-23GEKE2U-DMZnRz-6.js +7 -0
  90. package/dist/{ganttDiagram-NO4QXBWP-Dfi3nINO.js → ganttDiagram-NO4QXBWP-BVISsrzr.js} +69 -69
  91. package/dist/{ganttDiagram-NO4QXBWP-C9RPyo4r.cjs → ganttDiagram-NO4QXBWP-C6-ExcDz.cjs} +1 -1
  92. package/dist/{gitGraphDiagram-IHSO6WYX-CjAqPhww.js → gitGraphDiagram-IHSO6WYX-BDVA2TFP.js} +38 -38
  93. package/dist/{gitGraphDiagram-IHSO6WYX-mT3NNT7T.cjs → gitGraphDiagram-IHSO6WYX-DLzPc702.cjs} +1 -1
  94. package/dist/index.cjs +1 -1
  95. package/dist/index.client.cjs +1 -1
  96. package/dist/index.client.d.ts +1 -10
  97. package/dist/index.client.js +41 -49
  98. package/dist/index.js +41 -49
  99. package/dist/index.server.cjs +1 -1
  100. package/dist/index.server.d.ts +0 -2
  101. package/dist/index.server.js +116 -161
  102. package/dist/{infoDiagram-FWYZ7A6U-BXWQ9Vy4.js → infoDiagram-FWYZ7A6U-D31UwqjR.js} +1 -1
  103. package/dist/{infoDiagram-FWYZ7A6U-0Co9BitR.cjs → infoDiagram-FWYZ7A6U-DMF_wb2h.cjs} +1 -1
  104. package/dist/{ishikawaDiagram-FXEZZL3T-BKqUBw1i.cjs → ishikawaDiagram-FXEZZL3T-DUlnwraq.cjs} +1 -1
  105. package/dist/{ishikawaDiagram-FXEZZL3T-CZp5P1WE.js → ishikawaDiagram-FXEZZL3T-XA6-gyHY.js} +35 -35
  106. package/dist/{journeyDiagram-5HDEW3XC-DYVTgOOE.js → journeyDiagram-5HDEW3XC-B8sfsWpu.js} +39 -39
  107. package/dist/{journeyDiagram-5HDEW3XC-CeumPQ1I.cjs → journeyDiagram-5HDEW3XC-CwQyFcYa.cjs} +1 -1
  108. package/dist/{kanban-definition-HUTT4EX6-Cg5KnsE9.cjs → kanban-definition-HUTT4EX6-BjPlt2-E.cjs} +1 -1
  109. package/dist/{kanban-definition-HUTT4EX6-CnleRy80.js → kanban-definition-HUTT4EX6-FTrTBare.js} +123 -123
  110. package/dist/{linear-qqwu6T0F.cjs → linear-D3AJM3sY.cjs} +1 -1
  111. package/dist/{linear-Cf8i6Rsk.js → linear-DI9P_z72.js} +32 -32
  112. package/dist/markdown.css +1 -1
  113. package/dist/{mindmap-definition-LN4V7U3C-DfFWeFph.cjs → mindmap-definition-LN4V7U3C-CxgWZidl.cjs} +1 -1
  114. package/dist/{mindmap-definition-LN4V7U3C-lBin9VOm.js → mindmap-definition-LN4V7U3C-YW4YcL9x.js} +33 -33
  115. package/dist/{pegDiagram-2B236MQR-Cf1f-3yi.cjs → pegDiagram-2B236MQR-CUo7q5bl.cjs} +1 -1
  116. package/dist/{pegDiagram-2B236MQR-BiD21lOj.js → pegDiagram-2B236MQR-sJjLKeF3.js} +5 -5
  117. package/dist/{pieDiagram-ENE6RG2P-jwhVsZgX.cjs → pieDiagram-ENE6RG2P-Cy_sUuLQ.cjs} +1 -1
  118. package/dist/{pieDiagram-ENE6RG2P-BqZb6gaV.js → pieDiagram-ENE6RG2P-D4VanIOv.js} +58 -58
  119. package/dist/providers-Bxr2Wb-j.cjs +1 -0
  120. package/dist/providers-Drq7MT_K.js +209 -0
  121. package/dist/{quadrantDiagram-ABIIQ3AL-sO_sIA7b.cjs → quadrantDiagram-ABIIQ3AL-D3c8xLpt.cjs} +1 -1
  122. package/dist/{quadrantDiagram-ABIIQ3AL-CNe9fRLO.js → quadrantDiagram-ABIIQ3AL-ubxphjb_.js} +48 -48
  123. package/dist/{railroadDiagram-RFXS5EU6-53YTkJrs.js → railroadDiagram-RFXS5EU6-DvpD4C_A.js} +3 -3
  124. package/dist/{railroadDiagram-RFXS5EU6-Dkc8k3e9.cjs → railroadDiagram-RFXS5EU6-_Q4W5hB-.cjs} +1 -1
  125. package/dist/{requirementDiagram-TGXJPOKE-C0GMlJO4.cjs → requirementDiagram-TGXJPOKE-DdYIO-wU.cjs} +1 -1
  126. package/dist/{requirementDiagram-TGXJPOKE-D8Gz7jzA.js → requirementDiagram-TGXJPOKE-Dk_6BuX9.js} +3 -3
  127. package/dist/{sankeyDiagram-HTMAVEWB-CEC0GaCg.js → sankeyDiagram-HTMAVEWB-s3Kd7T8n.js} +67 -67
  128. package/dist/{sankeyDiagram-HTMAVEWB-Bw9J2Ay2.cjs → sankeyDiagram-HTMAVEWB-zuYg6LTg.cjs} +1 -1
  129. package/dist/{sequenceDiagram-DBY2YBRQ-BuqPCreB.cjs → sequenceDiagram-DBY2YBRQ-BvNPCevg.cjs} +1 -1
  130. package/dist/{sequenceDiagram-DBY2YBRQ-CKb4m3I0.js → sequenceDiagram-DBY2YBRQ-YQic4wxL.js} +47 -47
  131. package/dist/{sizeCapture-X5ZJPWSS-Dm3rsxXw.cjs → sizeCapture-X5ZJPWSS-BqrdzzsI.cjs} +1 -1
  132. package/dist/{sizeCapture-X5ZJPWSS-CotnTNAA.js → sizeCapture-X5ZJPWSS-qMsWGfjy.js} +1 -1
  133. package/dist/{stateDiagram-2N3HPSRC-GWEIP-C9.js → stateDiagram-2N3HPSRC-D1Ub8LYq.js} +22 -22
  134. package/dist/{stateDiagram-2N3HPSRC-5Y-OlePe.cjs → stateDiagram-2N3HPSRC-Ds8f-scd.cjs} +1 -1
  135. package/dist/{stateDiagram-v2-6OUMAXLB-BZFV8swJ.js → stateDiagram-v2-6OUMAXLB-DW8wjtk3.js} +2 -2
  136. package/dist/{stateDiagram-v2-6OUMAXLB-v77D3Qyf.cjs → stateDiagram-v2-6OUMAXLB-PmrsPXuZ.cjs} +1 -1
  137. package/dist/styles/markdown.css +1 -1
  138. package/dist/{swimlanes-5IMT3BWC-DujAOwAt.js → swimlanes-5IMT3BWC-C8P8vU0w.js} +313 -313
  139. package/dist/{swimlanes-5IMT3BWC-B1hLl8Ph.cjs → swimlanes-5IMT3BWC-jZhcesRT.cjs} +1 -1
  140. package/dist/{swimlanesDiagram-G3AALYLV-B-5z3jDg.js → swimlanesDiagram-G3AALYLV-B9FKeJRf.js} +2 -2
  141. package/dist/{swimlanesDiagram-G3AALYLV-Cklgsxbg.cjs → swimlanesDiagram-G3AALYLV-M5Cg2MHU.cjs} +1 -1
  142. package/dist/{timeline-definition-FHXFAJF6-Fmzt_lvR.js → timeline-definition-FHXFAJF6-Ch-He--D.js} +34 -34
  143. package/dist/{timeline-definition-FHXFAJF6-B2m-aQLI.cjs → timeline-definition-FHXFAJF6-DZm1-KlQ.cjs} +1 -1
  144. package/dist/{vennDiagram-L72KCM5P-zIXK42Cx.js → vennDiagram-L72KCM5P-CaoPscCM.js} +92 -92
  145. package/dist/{vennDiagram-L72KCM5P-rL7UDYbl.cjs → vennDiagram-L72KCM5P-mUSI238J.cjs} +1 -1
  146. package/dist/{wardleyDiagram-EHGQE667-pTeeZ0uM.js → wardleyDiagram-EHGQE667-CSAqF366.js} +11 -11
  147. package/dist/{wardleyDiagram-EHGQE667-CNLieFen.cjs → wardleyDiagram-EHGQE667-CkKP97H-.cjs} +1 -1
  148. package/dist/{xychartDiagram-FW5EYKEG-CD5ik4HK.cjs → xychartDiagram-FW5EYKEG-BivGpkVk.cjs} +1 -1
  149. package/dist/{xychartDiagram-FW5EYKEG-B6UdSSVZ.js → xychartDiagram-FW5EYKEG-OEsTD_k4.js} +37 -37
  150. package/package.json +21 -8
  151. package/dist/arc-DH6k2JIR.js +0 -83
  152. package/dist/channel-DoH_tsOQ.js +0 -5
  153. package/dist/components/mdastNodes/BlockLinkNode.d.ts +0 -5
  154. package/dist/components/mdastNodes/RichLinkCard.d.ts +0 -8
  155. package/dist/components/mdastNodes/TwitterEmbedNode.d.ts +0 -25
  156. package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +0 -6
  157. package/dist/extractHeadings-lDHB2sBb.cjs +0 -310
  158. package/dist/flowDiagram-23GEKE2U-ORytlvmX.js +0 -7
  159. package/dist/flowDiagram-23GEKE2U-h2WZTCCn.cjs +0 -1
  160. package/dist/plugins/createIntentTweetLink.d.ts +0 -10
  161. package/dist/plugins/extractYouTubeVideoId.d.ts +0 -5
  162. package/dist/plugins/fetchSiteMetadata.d.ts +0 -9
  163. package/dist/plugins/remark-auto-heading-id.d.ts +0 -2
  164. package/dist/plugins/remark-block-link-metadata.d.ts +0 -23
  165. package/dist/plugins/remark-block-link.d.ts +0 -12
  166. package/dist/plugins/remark-twitter-embed.d.ts +0 -20
  167. package/dist/plugins/remark-youtube-embed.d.ts +0 -14
  168. package/dist/simple-logger-DZxBpX7v.cjs +0 -1
  169. package/dist/simple-logger-i94ikRyH.js +0 -101
  170. package/dist/utils/getFaviconUrl.d.ts +0 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@ Advanced Markdown renderer for React with support for various extensions and cus
6
6
 
7
7
  - **Rich Markdown Support**: Full support for CommonMark, GitHub Flavored Markdown (GFM), and LaTeX Math expressions.
8
8
  - **Offloaded Parser**: CPU-heavy Markdown parsing and AST transformation are offloaded to a high-performance Go API server running `goldmark` and `ConnectRPC`.
9
- - **Custom Extensions & Plugins**: GitHub alerts, Zenn-style directives (`:::message` / `:::details`), single-line display math, and pluggable subscript, superscript, mark highlights, table cell merges and embeds (YouTube, Twitter).
9
+ - **Custom Extensions & Plugins**: GitHub alerts, Zenn-style directives (`:::message` / `:::details`), single-line display math, and pluggable subscript, superscript, mark highlights, table cell merges, and opt-in embeds: posts and videos of ten SNS and video providers as script-free cross-origin frames, and link cards from the host's metadata endpoint.
10
10
  - **Dynamic Configuration**: Easily enable or disable custom extensions dynamically using parse options.
11
11
  - **Syntax Highlighting**: Code blocks with Shiki syntax highlighting.
12
12
  - **TypeScript**: Full TypeScript support with comprehensive type definitions.
@@ -71,9 +71,13 @@ export MARKDOWN_API_BINARY=/path/to/markdown-api
71
71
 
72
72
  ```tsx
73
73
  import { MarkdownRenderer } from "@aiquants/markdown"
74
+ import type { MarkdownEmbeds } from "@aiquants/markdown/embeds"
74
75
  import { parseMarkdown } from "@aiquants/markdown/server"
75
76
  import "@aiquants/markdown/styles/markdown.css"
76
77
 
78
+ // A module constant: the providers whose posts embed, and the host's link-card endpoint (see Embeds)
79
+ const EMBEDS: MarkdownEmbeds = { providers: ["youtube", "x"], linkCardEndpoint: "/api/site_metadata" }
80
+
77
81
  const MyComponent = async () => {
78
82
  const markdownText = `# Hello World
79
83
 
@@ -103,7 +107,7 @@ console.log("Hello, World!")
103
107
  <MarkdownRenderer
104
108
  htmlContent={parseResult.htmlContent}
105
109
  theme="light"
106
- iFrameAllowedDomains={["www.youtube.com"]}
110
+ embeds={EMBEDS}
107
111
  />
108
112
  )
109
113
  }
@@ -133,7 +137,7 @@ const parseResult = await parseMarkdown(
133
137
  enableSuperscript: true, // Enable superscript
134
138
  enableMark: false, // Disable highlight mark
135
139
  enableTableMerge: true, // Enable table merges (> and ^)
136
- enableEmbeds: true, // Enable YouTube / Twitter embeds
140
+ enableEmbeds: true, // Mark a paragraph holding one web link (data-embed-url)
137
141
  enableZennDirectives: true // Enable :::message / :::details
138
142
  }
139
143
  )
@@ -187,28 +191,79 @@ Every renderer of the package — `MarkdownRenderer` (and so `MarkdownViewer`) f
187
191
  - **Kept**: the elements Markdown produces and common text and structure elements (`a`, `img`, `p`, `div`, `span`, headings, lists, tables, `blockquote`, `pre`, `code`, `details`, `summary`, `aside`, `section`, `figure`, `sup`, `sub`, `mark`, `video`, `audio`, `source` …) and, for icons, an `svg` with `g` and `path` inside it (anything else inside an `svg` is removed).
188
192
  - **Unwrapped** (the element is dropped, its children render): every other element — `form`, `button`, `textarea`, `label`, `font`, `center`, custom elements and the like — so its text survives.
189
193
  - **Attributes**: `title`, `lang`, `dir`, `role`, `hidden`, `translate`, `aria-*`, a reduced `class`, `id` and `style`, and each element's own (`href`, `src`, `alt`, `width`, `height`, `colspan`, `rowspan`, `align`, `open`, `start` …; a link keeps `name`, the fragment target of older documents).
190
- The `data-*` attributes the renderers read survive on their element only: `data-link-kind`, `data-doc-path`, `data-doc-exists`, `data-footnote-ref` and `data-footnote-backref` on links, `data-asset-src` and `data-asset-exists` on images, `data-footnotes` on sections, and the embed placeholders' `data-plugin-type`, `data-video-id`, `data-tweet-id` and `data-url` on `div`. Event handlers, `target`, `rel`, `name` (except on links), `srcset`, `usemap`, `ping`, `formaction`, `xlink:href`, `tabindex` and every other attribute are dropped.
194
+ The `data-*` attributes the renderers read survive on their element only: `data-link-kind`, `data-doc-path`, `data-doc-exists`, `data-footnote-ref` and `data-footnote-backref` on links, `data-asset-src` and `data-asset-exists` on images, and `data-footnotes` on sections. A paragraph's `data-embed-url` never renders: when it is a safe URL the paragraph becomes an embed placeholder (see [Embeds](#embeds)); the 5.x `div` markers (`data-plugin-type`, `data-video-id`, `data-tweet-id`, `data-url`) are dropped.
195
+ Event handlers, `target`, `rel`, `name` (except on links), `srcset`, `usemap`, `ping`, `formaction`, `xlink:href`, `tabindex` and every other attribute are dropped.
191
196
  - **Attribute names** are read as an HTML parser stores them: in lower case, and of names that differ only in case the first one written. Kept attributes carry lower-case names, so `<p STYLE="text-align:center">` or `<a HREF="https://…">` renders the same on the server (where html-react-parser keeps the author's case) and in the browser, and hydrates without a mismatch.
192
197
  - **`class`** keeps only the package's own tokens: the converter's markup (`markdown-alert`, `markdown-alert-{note,tip,important,warning,caution}`, `markdown-alert-title`, `octicon`, `octicon-{info,light-bulb,report,alert,stop}`, `mr-2`, `message`, `alert`, `info`, `warning`, `message-symbol`, `message-content`, `markdown-details`, `markdown-details-content`, `footnotes`, `footnote-ref`, `footnote-backref`, `math`, `inline`, `display`) and a code block's language (`language-*`).
193
198
  An author's tokens and utility classes (`fixed inset-0 z-50` …) are dropped, so a document can neither restyle the page nor lay an element over it; a link's `className` (also the one `linkComponent` receives) holds only the kept tokens and the package's link classes. Tables carry their alignment in `align` and `style`, not in classes.
194
199
  - **`id`** survives only on a heading (the table of contents, in-document links and a host's fragment navigation name headings by it), on the converter's footnotes (`fnref:N` / `fnrefK:N` on a reference's `sup`, `fn:N` on a note's `li`) and in the user-content namespace (`user-content-…`, the prefix GitHub-style footnotes use; write raw HTML fragment targets with it, or as `<a name="…">`).
195
- Every other element loses its id, so a document cannot take a name the page or a script looks up (`getElementById`, the named properties of `window`). A heading keeps whatever id the document gives it: a host should not look up its own elements by an id a document could also give a heading (prefer refs), and the package's own lookups check what they find (see [Embeds](#embeds)).
200
+ Every other element loses its id, so a document cannot take a name the page or a script looks up (`getElementById`, the named properties of `window`). A heading keeps whatever id the document gives it: a host should not look up its own elements by an id a document could also give a heading (prefer refs).
196
201
  - **Host sanitizers**: a host that sanitizes the HTML before the renderer (as `@aiquants/markdown-explorer` does with DOMPurify) gets the intersection of both allow lists; DOMPurify keeps `class` and `id` by default, so on the page the rules above are the ones that apply.
197
- - **URLs** (`href`, `src`, `cite`, `poster`, `data-url`): `http:`, `https:`, `mailto:` and `tel:` in any letter case, and references without a scheme. `javascript:`, `data:` and every other scheme are dropped, however they are spelled (entities, spaces, tabs, control characters). The mdast `LinkNode` and `ImageNode`, the block link card `RichLinkCard` (its `href`, and the `url` and `image` of the site metadata it shows) and the table of contents' entries follow the same rule.
202
+ - **URLs** (`href`, `src`, `cite`, `poster`, `data-embed-url`): `http:`, `https:`, `mailto:` and `tel:` in any letter case, and references without a scheme. `javascript:`, `data:` and every other scheme are dropped, however they are spelled (entities, spaces, tabs, control characters). The mdast `LinkNode` and `ImageNode`, link cards (their link, image and icon) and the table of contents' entries follow the same rule.
198
203
  - **`style`** keeps only its last valid `text-align` declaration (the alignment of table cells); positioning, `url()` and every other declaration are dropped. An SVG `fill` that references anything (`url(…)`) is dropped.
199
204
 
200
205
  ### Embeds
201
206
 
202
- - `iFrameAllowedDomains` lists the hostnames an iframe may load from: the `src` must be `https:`, without a user name, a password or an explicit port, and its hostname must match an entry exactly. Every other iframe is removed (fail closed), including an iframe without `src` (`srcdoc`). An allowed iframe is rendered from validated values and keeps only `title`, `width`, `height`, `allow`, `allowfullscreen`, `sandbox`, `referrerpolicy`, `loading`, `frameborder` and `scrolling` (no `id` or `class`: the package's markup gives an iframe neither).
203
- `allow` keeps each feature's name without its allowlist, so a feature applies to the embedded origin only (`camera *; microphone 'self' https://x.example` becomes `camera; microphone`); `referrerpolicy` is kept only as `no-referrer`, `origin`, `same-origin`, `strict-origin` or `strict-origin-when-cross-origin`.
204
- - An iframe plugin (`data-plugin-type="dify"`) receives the validated iframe as structured props, never as an HTML string. The Dify plugin acts only on messages its own frame's window posts from an allowed origin, and ignores a message that is not an object with a string `type`.
205
- - A YouTube embed loads the player only when `www.youtube.com` is in `iFrameAllowedDomains`; otherwise it renders a link to the video's watch page.
206
- - A tweet renders as a link to its address unless the host sets `allowTwitterWidgetScript` (on `MarkdownRenderer` and `MarkdownViewer`), which lets the page load and run `https://platform.twitter.com/widgets.js`. The widgets are taken from that script only: an existing copy is found as a `script` element with that `src` (never by the `twitter-wjs` id), and `window.twttr.widgets` is used only when its `createTweet` is a function, so an element a document names `twitter-wjs` or `twttr` cannot block or impersonate it.
207
+ Embeds are opt in. `MarkdownRenderer` and `MarkdownViewer` take `embeds={{ providers, linkCardEndpoint }}` (type `MarkdownEmbeds` from `@aiquants/markdown/embeds`); the default `NO_EMBEDS` renders every link alone in a paragraph as that paragraph. Pass the value from a module constant (the viewer also compares it by value). An unknown provider id or a bad endpoint throws a `RangeError` at render.
207
208
 
208
209
  ```tsx
209
- <MarkdownViewer {...props} iFrameAllowedDomains={["www.youtube.com"]} allowTwitterWidgetScript={false} />
210
+ import type { MarkdownEmbeds } from "@aiquants/markdown/embeds"
211
+
212
+ const EMBEDS: MarkdownEmbeds = { providers: ["youtube", "x", "instagram", "bluesky"], linkCardEndpoint: "/api/site_metadata" }
213
+
214
+ <MarkdownViewer {...props} embeds={EMBEDS} iFrameAllowedDomains={["www.youtube.com"]} />
210
215
  ```
211
216
 
217
+ **What a link alone in a paragraph becomes.** The converter marks a paragraph whose only element is one link to an absolute `http(s)` URL without a user name or password (besides white space, U+00A0 and U+3000) with `data-embed-url`, and keeps the paragraph and the link. The renderer then decides, in this order:
218
+
219
+ 1. The marked link must be the paragraph's only link, with the same sanitized `href` (`placeholderLinkOf`); otherwise the paragraph renders as written.
220
+ 2. The fallback is a link card when `linkCardEndpoint` is set and the link's text is the URL itself (`isBareLink`), otherwise the paragraph.
221
+ 3. An enabled provider that recognizes the URL embeds its post or video, whatever the link text says, with the paragraph's own link as the caption; otherwise the fallback renders.
222
+
223
+ The link is always kept: under the frame, as the card, or as the paragraph.
224
+
225
+ | Provider id | URLs it recognizes | Frame origin |
226
+ | --- | --- | --- |
227
+ | `youtube` | `www.youtube.com`, `youtube.com`, `m.youtube.com`: `/watch?v=` (any position; `si`, `list`, `feature` ignored), `/shorts/ID`, `/live/ID`, `/embed/ID`; `youtu.be/ID`; `www.youtube-nocookie.com/embed/ID` | `https://www.youtube-nocookie.com` |
228
+ | `x` | `x.com`, `twitter.com` (`www.`, `mobile.`): `/USER/status/ID` (with `/photo/N` or `/video/N`), `/i/web/status/ID` | `https://platform.twitter.com` |
229
+ | `instagram` | `www.instagram.com`, `instagram.com`, `instagr.am`: `/p/CODE`, `/reel/CODE`, `/USER/p/CODE`, `/USER/reel/CODE` | `https://www.instagram.com` |
230
+ | `threads` | `www.threads.com`, `threads.com`, `www.threads.net`, `threads.net`: `/@USER/post/CODE` | `https://www.threads.com` |
231
+ | `tiktok` | `www.tiktok.com`, `tiktok.com`: `/@USER/video/ID`, `/player/v1/ID`, `/embed/v2/ID` | `https://www.tiktok.com` |
232
+ | `bluesky` | `bsky.app/profile/ACTOR/post/RKEY` (a DID, or a handle looked up at `https://public.api.bsky.app`) | `https://embed.bsky.app` |
233
+ | `linkedin` | `www.linkedin.com`, `linkedin.com`: `/feed/update/URN`, `/embed/feed/update/URN`, `/posts/…-activity-ID-…` | `https://www.linkedin.com` |
234
+ | `reddit` | `www.reddit.com`, `reddit.com`, `old.reddit.com`, `new.reddit.com`: `/r/SUB/comments/ID[/SLUG]` | `https://embed.reddit.com` |
235
+ | `note` | `note.com/USER/n/KEY` | `https://note.com` |
236
+ | `niconico` | `www.nicovideo.jp`, `nicovideo.jp`: `/watch/ID`; `nico.ms/ID` | `https://embed.nicovideo.jp` |
237
+
238
+ Every host must match exactly (look-alike hosts, user info, ports and URLs carrying a provider URL in their query never match), and each path segment must match its own grammar. Short links without an id, Facebook, Pinterest, TikTok photo posts and LinkedIn articles have no provider: as bare URLs they become cards.
239
+
240
+ **Frames.** No provider script ever runs in the page: posts and videos are cross-origin iframes with the registry's attributes (an `allow` within the six shared features, a `sandbox`, a referrer policy, `loading="lazy"`), titled `"<provider>: <label>"`. Every iframe — provider frames, iframes written in documents and the Dify plugin — mounts only on the client after hydration, and **never when its origin is the page's own origin**, whatever the host allows.
241
+ The server HTML holds the link and a reserved box (`width: 100%` up to the provider's maximum, its aspect ratio or height, never a CSS `min-width`), hidden for readers without JavaScript. A frame whose box is narrower than the provider's minimum (YouTube 356 px, Shorts 200 px, X 250 px, Instagram 326 px, Threads 281 px, Bluesky 300 px) shows the fallback instead, and mounts again when the pane widens. X follows the primary subtag of the page's `<html lang>`; X, Threads and Bluesky follow `theme`.
242
+ Frames that report their height (X, Instagram, Threads, Bluesky, Reddit, note) are sized through one `message` listener that accepts only the frame's own window from its exact provider origin.
243
+
244
+ **Link cards.** A card asks `GET <linkCardEndpoint>?url=<href>` (same-origin credentials, `redirect: "error"`) once an IntersectionObserver rooted at the viewer's scroller sees it, through a page-wide queue (two requests at once, 256 answers kept, aborted when no card needs the answer).
245
+ It links to the written `href` (never `og:url`), takes the host name from the `href`, and shows the image and the icon only when the endpoint gives absolute `http(s)` URLs that are not on the page's own host, whatever the scheme or port (a browser loads an `http:` image of an `https:` page over `https:`, and cookies ignore the port), with no referrer. The package asks no favicon service. Any failure renders the paragraph.
246
+
247
+ The endpoint contract:
248
+
249
+ - `GET <endpoint>?url=<href>` answers JSON `{ title?, description?, site_name?, image?, icon? }`; other fields (`url` included) are ignored.
250
+ - It must not set cookies or refresh credentials: the request runs in the background and can be in flight during a sign-out.
251
+ - A redirect, a 401, any other non-OK status or a non-JSON answer means no card.
252
+
253
+ **Iframes written in documents.** `iFrameAllowedDomains` lists the hostnames such an iframe may load from: the `src` must be `https:`, without a user name, a password or an explicit port, and its hostname must match an entry exactly. Every other iframe is removed (fail closed), including an iframe without `src` (`srcdoc`). An allowed iframe is rendered from validated values and keeps only `title`, `width`, `height`, `allow`, `allowfullscreen`, `sandbox`, `referrerpolicy`, `loading`, `frameborder` and `scrolling` (no `id` or `class`).
254
+ An iframe without a `title` gets `"<embeddedFrame>: <host>"` (for example `Embedded content: www.youtube.com`), marked with the built-in label's language.
255
+ `allow` keeps only the six shared frame features — `autoplay`, `clipboard-write`, `encrypted-media`, `fullscreen`, `picture-in-picture`, `web-share` — each without its allowlist (`camera; microphone; autoplay` becomes `autoplay`); `referrerpolicy` is kept only as `no-referrer`, `origin`, `same-origin`, `strict-origin` or `strict-origin-when-cross-origin`. Until it mounts, and for good when its origin is the page's, the iframe renders as `<span data-embed-frame="pending|refused">` holding a link to its `src`.
256
+ An iframe inside a link never mounts and stays that text, without a nested link: interactive content may not sit inside an `<a>`, and activating the link would follow the author's URL instead of the frame.
257
+ An iframe plugin (`data-plugin-type="dify"`) receives the validated iframe as structured props, never as an HTML string. The Dify plugin acts only on messages its own frame's window posts from an allowed origin, and ignores a message that is not an object with a string `type`.
258
+
259
+ **Labels.** `embedLabels` (`embeddedVideo`, `embeddedPost`, `embeddedFrame`; built-in "embedded video", "embedded post", "Embedded content", in `DEFAULT_MARKDOWN_EMBED_LABELS`) name the frames; `MarkdownViewer` takes the same keys in `labels`.
260
+
261
+ **DOM hooks.** `figure[data-embed-provider][data-embed-state="pending|frame"]` with its box `[data-embed-box]`, the width probe `[data-embed-measure]`, `span[data-embed-frame]` for iframes written in documents, and `a[data-link-card="pending|ready"]`.
262
+
263
+ **Content Security Policy.** Put `embedFrameHostsOf(embeds.providers)` and the hosts of `iFrameAllowedDomains` in `frame-src`, `embedConnectOriginsOf(embeds.providers)` in `connect-src` (Bluesky handles), and allow `https:` images in `img-src` for card images and icons. Provider frames may open popups that escape their sandbox, so a host that enables providers should send `Cross-Origin-Opener-Policy: same-origin`.
264
+
265
+ `@aiquants/markdown/embeds` holds the placeholder contract, the frame policy, the provider registry and the card contract without React, for host sanitizers, configuration and CSP. `@aiquants/markdown/embeds/testing` holds captured provider messages and `embedProviderStubPage(url)` for offline end-to-end tests.
266
+
212
267
  ### Links
213
268
 
214
269
  - A link is external when its `href` names a scheme in any case (`https:`, `HTTPS:`, `mailto:`) or another host (`//host/…`, `/\host/…`), whatever its `data-link-kind` says, and when `data-link-kind` is `external`. An external link opens in a new tab with `rel="noreferrer"` and is never handed to `linkComponent`. The author's `target` and `rel` never survive.
@@ -279,7 +334,8 @@ An open, unpinned popover closes on Escape while the focus is inside its menu, r
279
334
 
280
335
  Activating an entry closes an unpinned table of contents, reveals the heading if it is hidden, scrolls to it (instantly under `prefers-reduced-motion: reduce`) and moves the focus to it (adding `tabindex="-1"` when the heading has none), so the next Tab continues from that section. Pass `onHeadingSelect(heading, event)` to take part: return `false` to let the viewer reveal, scroll and focus after your own work (writing the URL hash, say), or `true` when you have handled the navigation yourself.
281
336
 
282
- An entry links to `#` followed by the heading's id. Where the page's URL does not address the document (several documents side by side, a document chosen by state), pass `headingHref(heading)` (`MarkdownHeadingHrefResolver`) to give each entry the heading's own address, so copying the entry's address or opening it in a new tab with a middle click reaches the heading; pass a stable function, since the table of contents is built again when it changes.
337
+ The entry of a heading without an id (`# ★`, whose text keeps no character) is its text alone, not a link: no fragment names that heading, so neither `headingHref` nor `onHeadingSelect` is called for it.
338
+ Any other entry links to `#` followed by the heading's id. Where the page's URL does not address the document (several documents side by side, a document chosen by state), pass `headingHref(heading)` (`MarkdownHeadingHrefResolver`) to give each entry the heading's own address, so copying the entry's address or opening it in a new tab with a middle click reaches the heading; pass a stable function, since the table of contents is built again when it changes.
283
339
  The href goes through the package's URL rule (an entry with a refused href has none), and activating an entry still runs `onHeadingSelect` and the viewer's navigation. A Ctrl-, Cmd- or Shift-click is an activation, so return `true` from `onHeadingSelect` when a modifier key is down to let the browser open the address instead.
284
340
 
285
341
  The viewer stops the link's own navigation, so it reveals the heading the way a browser reveals the fragment it navigates to:
@@ -313,7 +369,7 @@ const headingHref: MarkdownHeadingHrefResolver = (heading) => `/docs/guide.md#${
313
369
 
314
370
  Every name and text the viewer draws comes from `labels` (`MarkdownViewerLabels`), including the table-of-contents and alignment controls and, through the `mermaid*` keys, the controls of each Mermaid diagram (`MermaidDiagram` takes `MermaidDiagramLabels` as `labels`).
315
371
  A label you pass carries no language of its own and is read in your page's language.
316
- A built-in label marks the element that bears it with its own language: the status texts and style controls are English (`lang="en"`), the table-of-contents, alignment and Mermaid menu controls are Japanese (`lang="ja"`), and the Mermaid zoom buttons are English. `DEFAULT_MARKDOWN_VIEWER_LABELS` and `DEFAULT_MERMAID_DIAGRAM_LABELS` hold the built-in texts.
372
+ A built-in label marks the element that bears it with its own language: the status texts and style controls are English (`lang="en"`), the table-of-contents, alignment and Mermaid menu controls are Japanese (`lang="ja"`), and the Mermaid zoom buttons are English. The embed labels (`embeddedVideo`, `embeddedPost`, `embeddedFrame`) are English. `DEFAULT_MARKDOWN_VIEWER_LABELS`, `DEFAULT_MERMAID_DIAGRAM_LABELS` and `DEFAULT_MARKDOWN_EMBED_LABELS` hold the built-in texts.
317
373
 
318
374
  ### Settings without React
319
375
 
@@ -327,6 +383,29 @@ import { DEFAULT_MARKDOWN_STYLES, toContentAlign } from "@aiquants/markdown/view
327
383
 
328
384
  The parser supports the following extended markdown syntax in addition to CommonMark and GFM.
329
385
 
386
+ ### Heading ids
387
+
388
+ The converter gives every heading its id; `MarkdownViewer` and `MarkdownRenderer` render the ids of the HTML and assign none.
389
+
390
+ - **Written id**: end the heading's last line with `{#id}`, or with `{id="…"}` when the id holds a space or ASCII punctuation other than `_`, `-`, `:` and `.` (a `}`, say). `## 概要 {#overview}` gets the id `overview`.
391
+ - It is kept exactly as written, in any script.
392
+ - No automatic id takes it, wherever the heading is.
393
+ - When two headings write the same id, both keep it and a fragment names the first.
394
+ - An id attribute that names nothing — empty (`{#}`, `{id=""}`) or not a string (`{id=123}`) — is removed, and the heading gets its automatic id.
395
+ - **Automatic id**: GitHub's, as github-slugger 2.0.0 makes it from the heading's text:
396
+ - lower-cased;
397
+ - punctuation and symbols removed;
398
+ - letters, marks, digits, `_` and `-` of every script kept;
399
+ - each space becomes `-`;
400
+ - a repeated id gets `-1`, `-2`, ….
401
+ - Examples: `概要` → `概要`, `API の使い方` → `api-の使い方`, `Step 2: Install` → `step-2-install`, a second `重複` → `重複-1`.
402
+ - A heading whose text keeps no character (`★`) has no id, its `ParseResult.headings[].id` is `""`, and its table-of-contents entry is plain text, not a link.
403
+ - The text is the heading's text as GitHub reads it: no Typographer substitution (`A -- B` → `a----b`), white space as written, an image's alt and raw HTML left out. The spaces and tabs before an ATX closing sequence or a `{…}` block are not text (`# Title ##` → `title`).
404
+ - Where the converter parses a construct differently from GitHub, the id follows the converter's rendering: `$ x $` (text here, a formula on GitHub), the number of a footnote referenced from inside another note, a code span continued on an indented line, `<<x>>`, Zenn directives and definition lists.
405
+ - **Anchors in raw HTML**: the viewer keeps `<a name="…">` and ids starting with `user-content-`. `<a id="user-content-faq"></a>` is reached by `#user-content-faq`. It removes any other author id (see [Raw HTML](#raw-html)).
406
+
407
+ Links written for GitHub or VS Code (`[概要へ](#概要)`, `[使い方](#api-の使い方)`) land on the heading.
408
+
330
409
  ### LaTeX Math Expressions
331
410
 
332
411
  - Inline math: `$y=x^2$`. A single `$` follows the `tex_math_dollars` rule of Pandoc 3.12: the opening `$` must be followed by a character that is not white space, and the formula ends at the first `$` after it that is not escaped by `\` and not inside a `\text{…}` group whose braces close; that `$` must follow a character that is not white space (a character escaped by `\`, such as the space in `$a\ $`, is not) and must not be followed by an ASCII digit; otherwise the `$` stays text.
@@ -1,6 +1,6 @@
1
- import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-D_h6bolU.js";
2
- import { p as f } from "./chunk-JWPE2WC7-DpcSSOP5.js";
3
- import { _ as n, $ as o } from "./extractHeadings-CGJexznE.js";
1
+ import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-CmOhW6SK.js";
2
+ import { p as f } from "./chunk-JWPE2WC7-CPLOunIL.js";
3
+ import { _ as n, O as o } from "./extractHeadings-B2pUyEPa.js";
4
4
  import { M as c, b as d } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
5
5
  var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ n((e) => {
6
6
  const r = e.alternatives.map(g);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-Cw864mUL.cjs"),u=require("./chunk-JWPE2WC7-5cM5nFf6.cjs"),n=require("./extractHeadings-lDHB2sBb.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-P8-yb3-j.cjs"),u=require("./chunk-JWPE2WC7-CUBzYD4G.cjs"),n=require("./extractHeadings-DgefF9l1.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
@@ -1 +1 @@
1
- "use strict";const n=require("./extractHeadings-lDHB2sBb.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;
1
+ "use strict";const n=require("./extractHeadings-DgefF9l1.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;
@@ -0,0 +1,83 @@
1
+ import { aC as ln, aD as an, aE as y, aF as tn, aG as M, aH as D, aI as _, aJ as un, aK as rn, aL as S, aM as o, aN as H, aO as sn, aP as on, aQ as fn } from "./extractHeadings-B2pUyEPa.js";
2
+ function cn(l) {
3
+ return l.innerRadius;
4
+ }
5
+ function yn(l) {
6
+ return l.outerRadius;
7
+ }
8
+ function gn(l) {
9
+ return l.startAngle;
10
+ }
11
+ function dn(l) {
12
+ return l.endAngle;
13
+ }
14
+ function mn(l) {
15
+ return l && l.padAngle;
16
+ }
17
+ function pn(l, h, O, E, v, A, J, a) {
18
+ var q = O - l, i = E - h, n = J - v, d = a - A, u = d * q - n * i;
19
+ if (!(u * u < y))
20
+ return u = (n * (h - A) - d * (l - v)) / u, [l + u * q, h + u * i];
21
+ }
22
+ function W(l, h, O, E, v, A, J) {
23
+ var a = l - O, q = h - E, i = (J ? A : -A) / S(a * a + q * q), n = i * q, d = -i * a, u = l + n, s = h + d, f = O + n, c = E + d, K = (u + f) / 2, t = (s + c) / 2, m = f - u, g = c - s, R = m * m + g * g, T = v - A, P = u * c - f * s, C = (g < 0 ? -1 : 1) * S(fn(0, T * T * R - P * P)), F = (P * g - m * C) / R, G = (-P * m - g * C) / R, w = (P * g + m * C) / R, p = (-P * m + g * C) / R, x = F - K, e = G - t, r = w - K, L = p - t;
24
+ return x * x + e * e > r * r + L * L && (F = w, G = p), {
25
+ cx: F,
26
+ cy: G,
27
+ x01: -n,
28
+ y01: -d,
29
+ x11: F * (v / T - 1),
30
+ y11: G * (v / T - 1)
31
+ };
32
+ }
33
+ function hn() {
34
+ var l = cn, h = yn, O = H(0), E = null, v = gn, A = dn, J = mn, a = null, q = ln(i);
35
+ function i() {
36
+ var n, d, u = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - an, c = A.apply(this, arguments) - an, K = un(c - f), t = c > f;
37
+ if (a || (a = n = q()), s < u && (d = s, s = u, u = d), !(s > y)) a.moveTo(0, 0);
38
+ else if (K > tn - y)
39
+ a.moveTo(s * M(f), s * D(f)), a.arc(0, 0, s, f, c, !t), u > y && (a.moveTo(u * M(c), u * D(c)), a.arc(0, 0, u, c, f, t));
40
+ else {
41
+ var m = f, g = c, R = f, T = c, P = K, C = K, F = J.apply(this, arguments) / 2, G = F > y && (E ? +E.apply(this, arguments) : S(u * u + s * s)), w = _(un(s - u) / 2, +O.apply(this, arguments)), p = w, x = w, e, r;
42
+ if (G > y) {
43
+ var L = sn(G / u * D(F)), j = sn(G / s * D(F));
44
+ (P -= L * 2) > y ? (L *= t ? 1 : -1, R += L, T -= L) : (P = 0, R = T = (f + c) / 2), (C -= j * 2) > y ? (j *= t ? 1 : -1, m += j, g -= j) : (C = 0, m = g = (f + c) / 2);
45
+ }
46
+ var N = s * M(m), Q = s * D(m), z = u * M(T), B = u * D(T);
47
+ if (w > y) {
48
+ var U = s * M(g), V = s * D(g), X = u * M(R), Y = u * D(R), I;
49
+ if (K < rn)
50
+ if (I = pn(N, Q, X, Y, U, V, z, B)) {
51
+ var Z = N - I[0], $ = Q - I[1], k = U - I[0], b = V - I[1], nn = 1 / D(on((Z * k + $ * b) / (S(Z * Z + $ * $) * S(k * k + b * b))) / 2), en = S(I[0] * I[0] + I[1] * I[1]);
52
+ p = _(w, (u - en) / (nn - 1)), x = _(w, (s - en) / (nn + 1));
53
+ } else
54
+ p = x = 0;
55
+ }
56
+ C > y ? x > y ? (e = W(X, Y, N, Q, s, x, t), r = W(U, V, z, B, s, x, t), a.moveTo(e.cx + e.x01, e.cy + e.y01), x < w ? a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, s, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), !t), a.arc(r.cx, r.cy, x, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : (a.moveTo(N, Q), a.arc(0, 0, s, m, g, !t)) : a.moveTo(N, Q), !(u > y) || !(P > y) ? a.lineTo(z, B) : p > y ? (e = W(z, B, U, V, u, -p, t), r = W(N, Q, X, Y, u, -p, t), a.lineTo(e.cx + e.x01, e.cy + e.y01), p < w ? a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, u, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), t), a.arc(r.cx, r.cy, p, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : a.arc(0, 0, u, T, R, t);
57
+ }
58
+ if (a.closePath(), n) return a = null, n + "" || null;
59
+ }
60
+ return i.centroid = function() {
61
+ var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, d = (+v.apply(this, arguments) + +A.apply(this, arguments)) / 2 - rn / 2;
62
+ return [M(d) * n, D(d) * n];
63
+ }, i.innerRadius = function(n) {
64
+ return arguments.length ? (l = typeof n == "function" ? n : H(+n), i) : l;
65
+ }, i.outerRadius = function(n) {
66
+ return arguments.length ? (h = typeof n == "function" ? n : H(+n), i) : h;
67
+ }, i.cornerRadius = function(n) {
68
+ return arguments.length ? (O = typeof n == "function" ? n : H(+n), i) : O;
69
+ }, i.padRadius = function(n) {
70
+ return arguments.length ? (E = n == null ? null : typeof n == "function" ? n : H(+n), i) : E;
71
+ }, i.startAngle = function(n) {
72
+ return arguments.length ? (v = typeof n == "function" ? n : H(+n), i) : v;
73
+ }, i.endAngle = function(n) {
74
+ return arguments.length ? (A = typeof n == "function" ? n : H(+n), i) : A;
75
+ }, i.padAngle = function(n) {
76
+ return arguments.length ? (J = typeof n == "function" ? n : H(+n), i) : J;
77
+ }, i.context = function(n) {
78
+ return arguments.length ? (a = n ?? null, i) : a;
79
+ }, i;
80
+ }
81
+ export {
82
+ hn as d
83
+ };