reactjs-tiptap-editor 1.0.16 → 1.0.18

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 (263) hide show
  1. package/lib/{ActionMenuButton-a8LhmHXe.js → ActionMenuButton-BOjCHFTA.js} +12 -16
  2. package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +47 -89
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +11 -14
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +13 -16
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +15 -18
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +113 -113
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +12 -14
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +8 -11
  17. package/lib/CodeBlock.cjs +37 -37
  18. package/lib/CodeBlock.js +1566 -1613
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +9 -11
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +62 -82
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +27 -15
  25. package/lib/Drawer-DwrlY_lY.cjs +1 -0
  26. package/lib/Drawer-DxOoRiGQ.js +1099 -0
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +6 -5
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +71 -97
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +265 -5
  33. package/lib/ExportPdf.cjs +4 -4
  34. package/lib/ExportPdf.js +20 -31
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +11 -11
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +16 -39
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +25 -41
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +51 -65
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +60 -76
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +322 -320
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +8 -11
  49. package/lib/{Iframe-CmjbQQcz.js → Iframe-AhNV5WH5.js} +52 -65
  50. package/lib/Iframe-C6pBw-AF.cjs +1 -0
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +5 -4
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +5 -5
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +148 -181
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +19 -26
  59. package/lib/{Indent-BoG-vpIE.js → Indent-DZ5PcJA4.js} +24 -30
  60. package/lib/Indent-Do-X0AsY.cjs +1 -0
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +11 -14
  65. package/lib/Katex-CIC9ygbL.cjs +4 -0
  66. package/lib/{Katex-ByL9snce.js → Katex-bIgoenn_.js} +243 -262
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +5 -4
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +23 -34
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
  74. package/lib/{LinkEditBlock-Ckih17pU.js → LinkEditBlock-D_cF9fnc.js} +324 -381
  75. package/lib/MarkdownPaste.cjs +58 -0
  76. package/lib/MarkdownPaste.js +1656 -0
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +22 -17
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +125 -154
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +28 -40
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +13 -16
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +114 -186
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +15 -14
  89. package/lib/SlashCommandNodeView-Ba03hlVZ.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-cg0x3NRF.js} +72 -79
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +12 -15
  93. package/lib/{Table-BEwrZVup.js → Table-KqLiT5wG.js} +85 -125
  94. package/lib/Table-ddU2LSc6.cjs +9 -0
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +18 -21
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +65 -78
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +51 -77
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -10
  105. package/lib/Twitter-BIiR78Jh.cjs +1 -0
  106. package/lib/{Twitter-4U_ZBhpv.js → Twitter-C1Lzqc7u.js} +567 -599
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +4 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +5 -270
  111. package/lib/bubble.cjs +6 -4
  112. package/lib/bubble.js +3719 -3039
  113. package/lib/clsx-BWE7vnna.cjs +33 -0
  114. package/lib/clsx-eGVyq7ot.js +1062 -0
  115. package/lib/components/ActionButton.d.ts +2 -2
  116. package/lib/components/ActionMenuButton.d.ts +1 -1
  117. package/lib/components/Bubble/formatBubble.d.ts +5 -5
  118. package/lib/components/ReactBus.d.ts +11 -0
  119. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
  120. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
  121. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
  122. package/lib/components/ui/checkbox.d.ts +1 -1
  123. package/lib/components/ui/dialog.d.ts +1 -1
  124. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  125. package/lib/components/ui/emoji-picker.d.ts +1 -1
  126. package/lib/components/ui/label.d.ts +1 -1
  127. package/lib/components/ui/popover.d.ts +1 -1
  128. package/lib/components/ui/select.d.ts +1 -1
  129. package/lib/components/ui/separator.d.ts +1 -1
  130. package/lib/components/ui/switch.d.ts +1 -1
  131. package/lib/components/ui/tabs.d.ts +1 -1
  132. package/lib/components/ui/toast.d.ts +1 -1
  133. package/lib/components/ui/toggle.d.ts +1 -1
  134. package/lib/components/ui/tooltip.d.ts +1 -1
  135. package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
  136. package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-CexIkt_V.js} +8 -8
  137. package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
  138. package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
  139. package/lib/extensions/Bold/Bold.d.ts +1 -1
  140. package/lib/extensions/Code/Code.d.ts +1 -1
  141. package/lib/extensions/CodeView/CodeView.d.ts +2 -2
  142. package/lib/extensions/Heading/Heading.d.ts +1 -1
  143. package/lib/extensions/Highlight/Highlight.d.ts +1 -1
  144. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
  145. package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
  146. package/lib/extensions/Italic/Italic.d.ts +1 -1
  147. package/lib/extensions/Link/Link.d.ts +1 -1
  148. package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
  149. package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
  150. package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
  151. package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
  152. package/lib/extensions/Strike/Strike.d.ts +1 -1
  153. package/lib/extensions/Table/Table.d.ts +1 -1
  154. package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
  155. package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
  156. package/lib/index-BUTn2LY6.cjs +1 -0
  157. package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
  158. package/lib/{index-CpTykZBR.js → index-BnW6t8z6.js} +23 -23
  159. package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
  160. package/lib/index-BtxvYLJ1.cjs +12 -0
  161. package/lib/{index-DR5tIdL7.js → index-C6xmkxrQ.js} +232 -217
  162. package/lib/index-CJ9pyCM4.cjs +1 -0
  163. package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
  164. package/lib/index-DHUN85fV.js +4855 -0
  165. package/lib/index-DUpSE1Gb.cjs +1 -0
  166. package/lib/index-D_8P0LE5.js +1362 -0
  167. package/lib/{index-4bHF5ovf.js → index-RIXs7STX.js} +1 -1
  168. package/lib/index-mfGK4pFo.js +6469 -0
  169. package/lib/index-zig3Dj7A.cjs +22 -0
  170. package/lib/index.cjs +3 -3
  171. package/lib/index.js +60 -72
  172. package/lib/locale-bundle.cjs +1 -1
  173. package/lib/locale-bundle.js +1 -1
  174. package/lib/plugins/image-upload.d.ts +1 -1
  175. package/lib/popover-BYSZ3zBi.js +24 -0
  176. package/lib/popover-BcHDZqBt.cjs +1 -0
  177. package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BrM5kUj_.js} +2 -2
  178. package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
  179. package/lib/{select-F0ZZ3VZB.js → select-C5SHDLFj.js} +8 -5
  180. package/lib/{select-Doa_-jkZ.cjs → select-DHjzKkcu.cjs} +1 -1
  181. package/lib/separator-BmixLrnJ.cjs +1 -0
  182. package/lib/separator-CFKVxAea.js +293 -0
  183. package/lib/store/editor.d.ts +1 -1
  184. package/lib/store/store.d.ts +2 -22
  185. package/lib/style.css +1 -1
  186. package/lib/{textarea-BAolHF_W.cjs → textarea-CasDcv3u.cjs} +1 -1
  187. package/lib/{textarea-tOsPnxHf.js → textarea-DNLrJoRl.js} +1 -1
  188. package/lib/theme.js +1 -1
  189. package/lib/types.d.ts +3 -3
  190. package/lib/updatePosition-CBRjbQMH.js +16 -0
  191. package/lib/updatePosition-CfmY5Trk.cjs +1 -0
  192. package/lib/utils/checkIsVideoUrl.d.ts +1 -0
  193. package/lib/utils/columns.d.ts +1 -1
  194. package/lib/utils/customEvents/events.constant.d.ts +1 -0
  195. package/lib/utils/mitt.d.ts +6 -3
  196. package/lib/utils/pdf.d.ts +1 -1
  197. package/lib/utils/utils.d.ts +1 -1
  198. package/package.json +262 -247
  199. package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
  200. package/lib/Drawer-CbOJ1Igo.js +0 -1379
  201. package/lib/Drawer-DNaDMoAk.cjs +0 -1
  202. package/lib/Excalidraw-DnHTVOj8.js +0 -355
  203. package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
  204. package/lib/Icon-C0TJMAOm.js +0 -12
  205. package/lib/Icon-DzK0_ztP.cjs +0 -1
  206. package/lib/Iframe-BSNCsofW.cjs +0 -1
  207. package/lib/Image-BZEFuS0P.js +0 -925
  208. package/lib/Image-iKsGKjvg.cjs +0 -1
  209. package/lib/Indent-Bou16OcB.cjs +0 -1
  210. package/lib/Katex-BqDocr3a.cjs +0 -4
  211. package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
  212. package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
  213. package/lib/Table-BclWwp6P.cjs +0 -9
  214. package/lib/Twitter-Dtq6PEMC.cjs +0 -1
  215. package/lib/button-Bwn6gUuS.js +0 -43
  216. package/lib/button-CqJztfH2.cjs +0 -1
  217. package/lib/checkbox-BAzbZY2Y.cjs +0 -1
  218. package/lib/checkbox-B_rpz5Xq.js +0 -27
  219. package/lib/clsx-CXbNJWDD.cjs +0 -54
  220. package/lib/clsx-DSzxBzvL.js +0 -7391
  221. package/lib/dialog-CJvpoeMm.js +0 -101
  222. package/lib/dialog-CWYTvz5J.cjs +0 -1
  223. package/lib/events.constant-Dq21NPdV.cjs +0 -1
  224. package/lib/events.constant-do95b767.js +0 -21
  225. package/lib/extensions/Image/store.d.ts +0 -4
  226. package/lib/extensions/Video/store.d.ts +0 -4
  227. package/lib/file-BLas99n7.js +0 -43
  228. package/lib/file-i7e4nQY2.cjs +0 -1
  229. package/lib/index-BCzvbrf5.cjs +0 -12
  230. package/lib/index-CL7JP-Xz.js +0 -426
  231. package/lib/index-CjhjjJsN.cjs +0 -1
  232. package/lib/index-Cn-t3Zxw.cjs +0 -1
  233. package/lib/index-Cs6cp0Y6.cjs +0 -1
  234. package/lib/index-D8li6EQ4.js +0 -1351
  235. package/lib/index-DoiuU6VA.js +0 -2315
  236. package/lib/index-VhKd73hZ.cjs +0 -1
  237. package/lib/input-B1egKb-t.js +0 -21
  238. package/lib/input-ZGRt7lWR.cjs +0 -1
  239. package/lib/isNumber-BTYSVlKo.cjs +0 -1
  240. package/lib/isNumber-ClwLypY2.js +0 -15
  241. package/lib/label-Cjrzc5H2.js +0 -19
  242. package/lib/label-tzSPdqui.cjs +0 -1
  243. package/lib/popover-C6Cya3Cz.cjs +0 -1
  244. package/lib/popover-CeY3RbI5.js +0 -24
  245. package/lib/separator-CUh5Y7Rh.cjs +0 -1
  246. package/lib/separator-Cjn4YH8a.js +0 -329
  247. package/lib/store/fast-context.d.ts +0 -7
  248. package/lib/store-BsJz5QRC.js +0 -10
  249. package/lib/store-DjkMIIEN.cjs +0 -1
  250. package/lib/tabs-BP8ypR_m.cjs +0 -1
  251. package/lib/tabs-CBDjOLl_.js +0 -46
  252. package/lib/throttle-D040PfWL.js +0 -249
  253. package/lib/throttle-gTTvqDTW.cjs +0 -1
  254. package/lib/toggle-C_SSvDRy.cjs +0 -1
  255. package/lib/toggle-DEerYRil.js +0 -99
  256. package/lib/tooltip-BJIvosho.js +0 -24
  257. package/lib/tooltip-FS1rsvd3.cjs +0 -1
  258. package/lib/updatePosition-CDK7OR0i.js +0 -16
  259. package/lib/updatePosition-Cjuj2E26.cjs +0 -1
  260. package/lib/useButtonProps-CtZCbMQu.js +0 -136
  261. package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
  262. package/lib/utils/_event.d.ts +0 -13
  263. package/lib/utils/customEvents/customEvents.d.ts +0 -3
@@ -0,0 +1,1656 @@
1
+ var me = Object.defineProperty;
2
+ var we = (n, e, t) => e in n ? me(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var d = (n, e, t) => we(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { E as ye } from "./index-mfGK4pFo.js";
5
+ import { Plugin as $e, PluginKey as Re } from "@tiptap/pm/state";
6
+ function j() {
7
+ return {
8
+ async: !1,
9
+ breaks: !1,
10
+ extensions: null,
11
+ gfm: !0,
12
+ hooks: null,
13
+ pedantic: !1,
14
+ renderer: null,
15
+ silent: !1,
16
+ tokenizer: null,
17
+ walkTokens: null
18
+ };
19
+ }
20
+ var S = j();
21
+ function ae(n) {
22
+ S = n;
23
+ }
24
+ var _ = { exec: () => null };
25
+ function u(n, e = "") {
26
+ let t = typeof n == "string" ? n : n.source;
27
+ const r = {
28
+ replace: (s, i) => {
29
+ let c = typeof i == "string" ? i : i.source;
30
+ return c = c.replace(b.caret, "$1"), t = t.replace(s, c), r;
31
+ },
32
+ getRegex: () => new RegExp(t, e)
33
+ };
34
+ return r;
35
+ }
36
+ var b = {
37
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
38
+ outputLinkReplace: /\\([\[\]])/g,
39
+ indentCodeCompensation: /^(\s+)(?:```)/,
40
+ beginningSpace: /^\s+/,
41
+ endingHash: /#$/,
42
+ startingSpaceChar: /^ /,
43
+ endingSpaceChar: / $/,
44
+ nonSpaceChar: /[^ ]/,
45
+ newLineCharGlobal: /\n/g,
46
+ tabCharGlobal: /\t/g,
47
+ multipleSpaceGlobal: /\s+/g,
48
+ blankLine: /^[ \t]*$/,
49
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
50
+ blockquoteStart: /^ {0,3}>/,
51
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
52
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
53
+ listReplaceTabs: /^\t+/,
54
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
55
+ listIsTask: /^\[[ xX]\] /,
56
+ listReplaceTask: /^\[[ xX]\] +/,
57
+ anyLine: /\n.*\n/,
58
+ hrefBrackets: /^<(.*)>$/,
59
+ tableDelimiter: /[:|]/,
60
+ tableAlignChars: /^\||\| *$/g,
61
+ tableRowBlankLine: /\n[ \t]*$/,
62
+ tableAlignRight: /^ *-+: *$/,
63
+ tableAlignCenter: /^ *:-+: *$/,
64
+ tableAlignLeft: /^ *:-+ *$/,
65
+ startATag: /^<a /i,
66
+ endATag: /^<\/a>/i,
67
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
68
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
69
+ startAngleBracket: /^</,
70
+ endAngleBracket: />$/,
71
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
72
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
73
+ escapeTest: /[&<>"']/,
74
+ escapeReplace: /[&<>"']/g,
75
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
76
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
77
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
78
+ caret: /(^|[^\[])\^/g,
79
+ percentDecode: /%25/g,
80
+ findPipe: /\|/g,
81
+ splitPipe: / \|/,
82
+ slashPipe: /\\\|/g,
83
+ carriageReturn: /\r\n|\r/g,
84
+ spaceLine: /^ +$/gm,
85
+ notSpaceStart: /^\S*/,
86
+ endingNewline: /\n$/,
87
+ listItemRegex: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),
88
+ nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
89
+ hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
90
+ fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`),
91
+ headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`),
92
+ htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i")
93
+ }, Se = /^(?:[ \t]*(?:\n|$))+/, ve = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, A = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ze = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, H = /(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ce = u(oe).replace(/bull/g, H).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), _e = u(oe).replace(/bull/g, H).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ae = /^[^\n]+/, W = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Pe = u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Le = u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, H).getRegex(), E = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", F = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ce = u(
94
+ "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
95
+ "i"
96
+ ).replace("comment", F).replace("tag", E).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), he = u(Q).replace("hr", A).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), Ie = u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", he).getRegex(), U = {
97
+ blockquote: Ie,
98
+ code: ve,
99
+ def: Pe,
100
+ fences: Te,
101
+ heading: ze,
102
+ hr: A,
103
+ html: Ce,
104
+ lheading: ce,
105
+ list: Le,
106
+ newline: Se,
107
+ paragraph: he,
108
+ table: _,
109
+ text: Ae
110
+ }, ne = u(
111
+ "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
112
+ ).replace("hr", A).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), Be = {
113
+ ...U,
114
+ lheading: _e,
115
+ table: ne,
116
+ paragraph: u(Q).replace("hr", A).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ne).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex()
117
+ }, Ee = {
118
+ ...U,
119
+ html: u(
120
+ `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
121
+ ).replace("comment", F).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
122
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
123
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
124
+ fences: _,
125
+ // fences not supported
126
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
127
+ paragraph: u(Q).replace("hr", A).replace("heading", ` *#{1,6} *[^
128
+ ]`).replace("lheading", ce).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
129
+ }, qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, De = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, pe = /^( {2,}|\\)\n(?!\s*$)/, Ze = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, q = /[\p{P}\p{S}]/u, X = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Me = u(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, X).getRegex(), ge = /(?!~)[\p{P}\p{S}]/u, Oe = /(?!~)[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|~)/u, Ne = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, fe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, je = u(fe, "u").replace(/punct/g, q).getRegex(), He = u(fe, "u").replace(/punct/g, ge).getRegex(), de = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Qe = u(de, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, X).replace(/punct/g, q).getRegex(), We = u(de, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, Oe).replace(/punct/g, ge).getRegex(), Fe = u(
130
+ "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
131
+ "gu"
132
+ ).replace(/notPunctSpace/g, ue).replace(/punctSpace/g, X).replace(/punct/g, q).getRegex(), Ue = u(/\\(punct)/, "gu").replace(/punct/g, q).getRegex(), Xe = u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ke = u(F).replace("(?:-->|$)", "-->").getRegex(), Je = u(
133
+ "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
134
+ ).replace("comment", Ke).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), C = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ve = u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", C).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = u(/^!?\[(label)\]\[(ref)\]/).replace("label", C).replace("ref", W).getRegex(), xe = u(/^!?\[(ref)\](?:\[\])?/).replace("ref", W).getRegex(), Ye = u("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", xe).getRegex(), K = {
135
+ _backpedal: _,
136
+ // only used for GFM url
137
+ anyPunctuation: Ue,
138
+ autolink: Xe,
139
+ blockSkip: Ne,
140
+ br: pe,
141
+ code: De,
142
+ del: _,
143
+ emStrongLDelim: je,
144
+ emStrongRDelimAst: Qe,
145
+ emStrongRDelimUnd: Fe,
146
+ escape: qe,
147
+ link: Ve,
148
+ nolink: xe,
149
+ punctuation: Me,
150
+ reflink: ke,
151
+ reflinkSearch: Ye,
152
+ tag: Je,
153
+ text: Ze,
154
+ url: _
155
+ }, et = {
156
+ ...K,
157
+ link: u(/^!?\[(label)\]\((.*?)\)/).replace("label", C).getRegex(),
158
+ reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", C).getRegex()
159
+ }, O = {
160
+ ...K,
161
+ emStrongRDelimAst: We,
162
+ emStrongLDelim: He,
163
+ url: u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
164
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
165
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
166
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
167
+ }, tt = {
168
+ ...O,
169
+ br: u(pe).replace("{2,}", "*").getRegex(),
170
+ text: u(O.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
171
+ }, P = {
172
+ normal: U,
173
+ gfm: Be,
174
+ pedantic: Ee
175
+ }, T = {
176
+ normal: K,
177
+ gfm: O,
178
+ breaks: tt,
179
+ pedantic: et
180
+ }, nt = {
181
+ "&": "&amp;",
182
+ "<": "&lt;",
183
+ ">": "&gt;",
184
+ '"': "&quot;",
185
+ "'": "&#39;"
186
+ }, re = (n) => nt[n];
187
+ function w(n, e) {
188
+ if (e) {
189
+ if (b.escapeTest.test(n))
190
+ return n.replace(b.escapeReplace, re);
191
+ } else if (b.escapeTestNoEncode.test(n))
192
+ return n.replace(b.escapeReplaceNoEncode, re);
193
+ return n;
194
+ }
195
+ function se(n) {
196
+ try {
197
+ n = encodeURI(n).replace(b.percentDecode, "%");
198
+ } catch {
199
+ return null;
200
+ }
201
+ return n;
202
+ }
203
+ function ie(n, e) {
204
+ var i;
205
+ const t = n.replace(b.findPipe, (c, l, h) => {
206
+ let a = !1, o = l;
207
+ for (; --o >= 0 && h[o] === "\\"; ) a = !a;
208
+ return a ? "|" : " |";
209
+ }), r = t.split(b.splitPipe);
210
+ let s = 0;
211
+ if (r[0].trim() || r.shift(), r.length > 0 && !((i = r.at(-1)) != null && i.trim()) && r.pop(), e)
212
+ if (r.length > e)
213
+ r.splice(e);
214
+ else
215
+ for (; r.length < e; ) r.push("");
216
+ for (; s < r.length; s++)
217
+ r[s] = r[s].trim().replace(b.slashPipe, "|");
218
+ return r;
219
+ }
220
+ function z(n, e, t) {
221
+ const r = n.length;
222
+ if (r === 0)
223
+ return "";
224
+ let s = 0;
225
+ for (; s < r && n.charAt(r - s - 1) === e; )
226
+ s++;
227
+ return n.slice(0, r - s);
228
+ }
229
+ function rt(n, e) {
230
+ if (n.indexOf(e[1]) === -1)
231
+ return -1;
232
+ let t = 0;
233
+ for (let r = 0; r < n.length; r++)
234
+ if (n[r] === "\\")
235
+ r++;
236
+ else if (n[r] === e[0])
237
+ t++;
238
+ else if (n[r] === e[1] && (t--, t < 0))
239
+ return r;
240
+ return t > 0 ? -2 : -1;
241
+ }
242
+ function le(n, e, t, r, s) {
243
+ const i = e.href, c = e.title || null, l = n[1].replace(s.other.outputLinkReplace, "$1");
244
+ r.state.inLink = !0;
245
+ const h = {
246
+ type: n[0].charAt(0) === "!" ? "image" : "link",
247
+ raw: t,
248
+ href: i,
249
+ title: c,
250
+ text: l,
251
+ tokens: r.inlineTokens(l)
252
+ };
253
+ return r.state.inLink = !1, h;
254
+ }
255
+ function st(n, e, t) {
256
+ const r = n.match(t.other.indentCodeCompensation);
257
+ if (r === null)
258
+ return e;
259
+ const s = r[1];
260
+ return e.split(`
261
+ `).map((i) => {
262
+ const c = i.match(t.other.beginningSpace);
263
+ if (c === null)
264
+ return i;
265
+ const [l] = c;
266
+ return l.length >= s.length ? i.slice(s.length) : i;
267
+ }).join(`
268
+ `);
269
+ }
270
+ var I = class {
271
+ // set by the lexer
272
+ constructor(n) {
273
+ d(this, "options");
274
+ d(this, "rules");
275
+ // set by the lexer
276
+ d(this, "lexer");
277
+ this.options = n || S;
278
+ }
279
+ space(n) {
280
+ const e = this.rules.block.newline.exec(n);
281
+ if (e && e[0].length > 0)
282
+ return {
283
+ type: "space",
284
+ raw: e[0]
285
+ };
286
+ }
287
+ code(n) {
288
+ const e = this.rules.block.code.exec(n);
289
+ if (e) {
290
+ const t = e[0].replace(this.rules.other.codeRemoveIndent, "");
291
+ return {
292
+ type: "code",
293
+ raw: e[0],
294
+ codeBlockStyle: "indented",
295
+ text: this.options.pedantic ? t : z(t, `
296
+ `)
297
+ };
298
+ }
299
+ }
300
+ fences(n) {
301
+ const e = this.rules.block.fences.exec(n);
302
+ if (e) {
303
+ const t = e[0], r = st(t, e[3] || "", this.rules);
304
+ return {
305
+ type: "code",
306
+ raw: t,
307
+ lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2],
308
+ text: r
309
+ };
310
+ }
311
+ }
312
+ heading(n) {
313
+ const e = this.rules.block.heading.exec(n);
314
+ if (e) {
315
+ let t = e[2].trim();
316
+ if (this.rules.other.endingHash.test(t)) {
317
+ const r = z(t, "#");
318
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (t = r.trim());
319
+ }
320
+ return {
321
+ type: "heading",
322
+ raw: e[0],
323
+ depth: e[1].length,
324
+ text: t,
325
+ tokens: this.lexer.inline(t)
326
+ };
327
+ }
328
+ }
329
+ hr(n) {
330
+ const e = this.rules.block.hr.exec(n);
331
+ if (e)
332
+ return {
333
+ type: "hr",
334
+ raw: z(e[0], `
335
+ `)
336
+ };
337
+ }
338
+ blockquote(n) {
339
+ const e = this.rules.block.blockquote.exec(n);
340
+ if (e) {
341
+ let t = z(e[0], `
342
+ `).split(`
343
+ `), r = "", s = "";
344
+ const i = [];
345
+ for (; t.length > 0; ) {
346
+ let c = !1;
347
+ const l = [];
348
+ let h;
349
+ for (h = 0; h < t.length; h++)
350
+ if (this.rules.other.blockquoteStart.test(t[h]))
351
+ l.push(t[h]), c = !0;
352
+ else if (!c)
353
+ l.push(t[h]);
354
+ else
355
+ break;
356
+ t = t.slice(h);
357
+ const a = l.join(`
358
+ `), o = a.replace(this.rules.other.blockquoteSetextReplace, `
359
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
360
+ r = r ? `${r}
361
+ ${a}` : a, s = s ? `${s}
362
+ ${o}` : o;
363
+ const k = this.lexer.state.top;
364
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(o, i, !0), this.lexer.state.top = k, t.length === 0)
365
+ break;
366
+ const p = i.at(-1);
367
+ if ((p == null ? void 0 : p.type) === "code")
368
+ break;
369
+ if ((p == null ? void 0 : p.type) === "blockquote") {
370
+ const x = p, g = x.raw + `
371
+ ` + t.join(`
372
+ `), m = this.blockquote(g);
373
+ i[i.length - 1] = m, r = r.substring(0, r.length - x.raw.length) + m.raw, s = s.substring(0, s.length - x.text.length) + m.text;
374
+ break;
375
+ } else if ((p == null ? void 0 : p.type) === "list") {
376
+ const x = p, g = x.raw + `
377
+ ` + t.join(`
378
+ `), m = this.list(g);
379
+ i[i.length - 1] = m, r = r.substring(0, r.length - p.raw.length) + m.raw, s = s.substring(0, s.length - x.raw.length) + m.raw, t = g.substring(i.at(-1).raw.length).split(`
380
+ `);
381
+ continue;
382
+ }
383
+ }
384
+ return {
385
+ type: "blockquote",
386
+ raw: r,
387
+ tokens: i,
388
+ text: s
389
+ };
390
+ }
391
+ }
392
+ list(n) {
393
+ let e = this.rules.block.list.exec(n);
394
+ if (e) {
395
+ let t = e[1].trim();
396
+ const r = t.length > 1, s = {
397
+ type: "list",
398
+ raw: "",
399
+ ordered: r,
400
+ start: r ? +t.slice(0, -1) : "",
401
+ loose: !1,
402
+ items: []
403
+ };
404
+ t = r ? `\\d{1,9}\\${t.slice(-1)}` : `\\${t}`, this.options.pedantic && (t = r ? t : "[*+-]");
405
+ const i = this.rules.other.listItemRegex(t);
406
+ let c = !1;
407
+ for (; n; ) {
408
+ let h = !1, a = "", o = "";
409
+ if (!(e = i.exec(n)) || this.rules.block.hr.test(n))
410
+ break;
411
+ a = e[0], n = n.substring(a.length);
412
+ let k = e[2].split(`
413
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (D) => " ".repeat(3 * D.length)), p = n.split(`
414
+ `, 1)[0], x = !k.trim(), g = 0;
415
+ if (this.options.pedantic ? (g = 2, o = k.trimStart()) : x ? g = e[1].length + 1 : (g = e[2].search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, o = k.slice(g), g += e[1].length), x && this.rules.other.blankLine.test(p) && (a += p + `
416
+ `, n = n.substring(p.length + 1), h = !0), !h) {
417
+ const D = this.rules.other.nextBulletRegex(g), Y = this.rules.other.hrRegex(g), ee = this.rules.other.fencesBeginRegex(g), te = this.rules.other.headingBeginRegex(g), be = this.rules.other.htmlBeginRegex(g);
418
+ for (; n; ) {
419
+ const Z = n.split(`
420
+ `, 1)[0];
421
+ let v;
422
+ if (p = Z, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), v = p) : v = p.replace(this.rules.other.tabCharGlobal, " "), ee.test(p) || te.test(p) || be.test(p) || D.test(p) || Y.test(p))
423
+ break;
424
+ if (v.search(this.rules.other.nonSpaceChar) >= g || !p.trim())
425
+ o += `
426
+ ` + v.slice(g);
427
+ else {
428
+ if (x || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(k) || te.test(k) || Y.test(k))
429
+ break;
430
+ o += `
431
+ ` + p;
432
+ }
433
+ !x && !p.trim() && (x = !0), a += Z + `
434
+ `, n = n.substring(Z.length + 1), k = v.slice(g);
435
+ }
436
+ }
437
+ s.loose || (c ? s.loose = !0 : this.rules.other.doubleBlankLine.test(a) && (c = !0));
438
+ let m = null, V;
439
+ this.options.gfm && (m = this.rules.other.listIsTask.exec(o), m && (V = m[0] !== "[ ] ", o = o.replace(this.rules.other.listReplaceTask, ""))), s.items.push({
440
+ type: "list_item",
441
+ raw: a,
442
+ task: !!m,
443
+ checked: V,
444
+ loose: !1,
445
+ text: o,
446
+ tokens: []
447
+ }), s.raw += a;
448
+ }
449
+ const l = s.items.at(-1);
450
+ if (l)
451
+ l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();
452
+ else
453
+ return;
454
+ s.raw = s.raw.trimEnd();
455
+ for (let h = 0; h < s.items.length; h++)
456
+ if (this.lexer.state.top = !1, s.items[h].tokens = this.lexer.blockTokens(s.items[h].text, []), !s.loose) {
457
+ const a = s.items[h].tokens.filter((k) => k.type === "space"), o = a.length > 0 && a.some((k) => this.rules.other.anyLine.test(k.raw));
458
+ s.loose = o;
459
+ }
460
+ if (s.loose)
461
+ for (let h = 0; h < s.items.length; h++)
462
+ s.items[h].loose = !0;
463
+ return s;
464
+ }
465
+ }
466
+ html(n) {
467
+ const e = this.rules.block.html.exec(n);
468
+ if (e)
469
+ return {
470
+ type: "html",
471
+ block: !0,
472
+ raw: e[0],
473
+ pre: e[1] === "pre" || e[1] === "script" || e[1] === "style",
474
+ text: e[0]
475
+ };
476
+ }
477
+ def(n) {
478
+ const e = this.rules.block.def.exec(n);
479
+ if (e) {
480
+ const t = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
481
+ return {
482
+ type: "def",
483
+ tag: t,
484
+ raw: e[0],
485
+ href: r,
486
+ title: s
487
+ };
488
+ }
489
+ }
490
+ table(n) {
491
+ var c;
492
+ const e = this.rules.block.table.exec(n);
493
+ if (!e || !this.rules.other.tableDelimiter.test(e[2]))
494
+ return;
495
+ const t = ie(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (c = e[3]) != null && c.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
496
+ `) : [], i = {
497
+ type: "table",
498
+ raw: e[0],
499
+ header: [],
500
+ align: [],
501
+ rows: []
502
+ };
503
+ if (t.length === r.length) {
504
+ for (const l of r)
505
+ this.rules.other.tableAlignRight.test(l) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? i.align.push("left") : i.align.push(null);
506
+ for (let l = 0; l < t.length; l++)
507
+ i.header.push({
508
+ text: t[l],
509
+ tokens: this.lexer.inline(t[l]),
510
+ header: !0,
511
+ align: i.align[l]
512
+ });
513
+ for (const l of s)
514
+ i.rows.push(ie(l, i.header.length).map((h, a) => ({
515
+ text: h,
516
+ tokens: this.lexer.inline(h),
517
+ header: !1,
518
+ align: i.align[a]
519
+ })));
520
+ return i;
521
+ }
522
+ }
523
+ lheading(n) {
524
+ const e = this.rules.block.lheading.exec(n);
525
+ if (e)
526
+ return {
527
+ type: "heading",
528
+ raw: e[0],
529
+ depth: e[2].charAt(0) === "=" ? 1 : 2,
530
+ text: e[1],
531
+ tokens: this.lexer.inline(e[1])
532
+ };
533
+ }
534
+ paragraph(n) {
535
+ const e = this.rules.block.paragraph.exec(n);
536
+ if (e) {
537
+ const t = e[1].charAt(e[1].length - 1) === `
538
+ ` ? e[1].slice(0, -1) : e[1];
539
+ return {
540
+ type: "paragraph",
541
+ raw: e[0],
542
+ text: t,
543
+ tokens: this.lexer.inline(t)
544
+ };
545
+ }
546
+ }
547
+ text(n) {
548
+ const e = this.rules.block.text.exec(n);
549
+ if (e)
550
+ return {
551
+ type: "text",
552
+ raw: e[0],
553
+ text: e[0],
554
+ tokens: this.lexer.inline(e[0])
555
+ };
556
+ }
557
+ escape(n) {
558
+ const e = this.rules.inline.escape.exec(n);
559
+ if (e)
560
+ return {
561
+ type: "escape",
562
+ raw: e[0],
563
+ text: e[1]
564
+ };
565
+ }
566
+ tag(n) {
567
+ const e = this.rules.inline.tag.exec(n);
568
+ if (e)
569
+ return !this.lexer.state.inLink && this.rules.other.startATag.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(e[0]) && (this.lexer.state.inRawBlock = !1), {
570
+ type: "html",
571
+ raw: e[0],
572
+ inLink: this.lexer.state.inLink,
573
+ inRawBlock: this.lexer.state.inRawBlock,
574
+ block: !1,
575
+ text: e[0]
576
+ };
577
+ }
578
+ link(n) {
579
+ const e = this.rules.inline.link.exec(n);
580
+ if (e) {
581
+ const t = e[2].trim();
582
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(t)) {
583
+ if (!this.rules.other.endAngleBracket.test(t))
584
+ return;
585
+ const i = z(t.slice(0, -1), "\\");
586
+ if ((t.length - i.length) % 2 === 0)
587
+ return;
588
+ } else {
589
+ const i = rt(e[2], "()");
590
+ if (i === -2)
591
+ return;
592
+ if (i > -1) {
593
+ const l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
594
+ e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, l).trim(), e[3] = "";
595
+ }
596
+ }
597
+ let r = e[2], s = "";
598
+ if (this.options.pedantic) {
599
+ const i = this.rules.other.pedanticHrefTitle.exec(r);
600
+ i && (r = i[1], s = i[3]);
601
+ } else
602
+ s = e[3] ? e[3].slice(1, -1) : "";
603
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? r = r.slice(1) : r = r.slice(1, -1)), le(e, {
604
+ href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
605
+ title: s && s.replace(this.rules.inline.anyPunctuation, "$1")
606
+ }, e[0], this.lexer, this.rules);
607
+ }
608
+ }
609
+ reflink(n, e) {
610
+ let t;
611
+ if ((t = this.rules.inline.reflink.exec(n)) || (t = this.rules.inline.nolink.exec(n))) {
612
+ const r = (t[2] || t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
613
+ if (!s) {
614
+ const i = t[0].charAt(0);
615
+ return {
616
+ type: "text",
617
+ raw: i,
618
+ text: i
619
+ };
620
+ }
621
+ return le(t, s, t[0], this.lexer, this.rules);
622
+ }
623
+ }
624
+ emStrong(n, e, t = "") {
625
+ let r = this.rules.inline.emStrongLDelim.exec(n);
626
+ if (!r || r[3] && t.match(this.rules.other.unicodeAlphaNumeric)) return;
627
+ if (!(r[1] || r[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
628
+ const i = [...r[0]].length - 1;
629
+ let c, l, h = i, a = 0;
630
+ const o = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
631
+ for (o.lastIndex = 0, e = e.slice(-1 * n.length + i); (r = o.exec(e)) != null; ) {
632
+ if (c = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !c) continue;
633
+ if (l = [...c].length, r[3] || r[4]) {
634
+ h += l;
635
+ continue;
636
+ } else if ((r[5] || r[6]) && i % 3 && !((i + l) % 3)) {
637
+ a += l;
638
+ continue;
639
+ }
640
+ if (h -= l, h > 0) continue;
641
+ l = Math.min(l, l + h + a);
642
+ const k = [...r[0]][0].length, p = n.slice(0, i + r.index + k + l);
643
+ if (Math.min(i, l) % 2) {
644
+ const g = p.slice(1, -1);
645
+ return {
646
+ type: "em",
647
+ raw: p,
648
+ text: g,
649
+ tokens: this.lexer.inlineTokens(g)
650
+ };
651
+ }
652
+ const x = p.slice(2, -2);
653
+ return {
654
+ type: "strong",
655
+ raw: p,
656
+ text: x,
657
+ tokens: this.lexer.inlineTokens(x)
658
+ };
659
+ }
660
+ }
661
+ }
662
+ codespan(n) {
663
+ const e = this.rules.inline.code.exec(n);
664
+ if (e) {
665
+ let t = e[2].replace(this.rules.other.newLineCharGlobal, " ");
666
+ const r = this.rules.other.nonSpaceChar.test(t), s = this.rules.other.startingSpaceChar.test(t) && this.rules.other.endingSpaceChar.test(t);
667
+ return r && s && (t = t.substring(1, t.length - 1)), {
668
+ type: "codespan",
669
+ raw: e[0],
670
+ text: t
671
+ };
672
+ }
673
+ }
674
+ br(n) {
675
+ const e = this.rules.inline.br.exec(n);
676
+ if (e)
677
+ return {
678
+ type: "br",
679
+ raw: e[0]
680
+ };
681
+ }
682
+ del(n) {
683
+ const e = this.rules.inline.del.exec(n);
684
+ if (e)
685
+ return {
686
+ type: "del",
687
+ raw: e[0],
688
+ text: e[2],
689
+ tokens: this.lexer.inlineTokens(e[2])
690
+ };
691
+ }
692
+ autolink(n) {
693
+ const e = this.rules.inline.autolink.exec(n);
694
+ if (e) {
695
+ let t, r;
696
+ return e[2] === "@" ? (t = e[1], r = "mailto:" + t) : (t = e[1], r = t), {
697
+ type: "link",
698
+ raw: e[0],
699
+ text: t,
700
+ href: r,
701
+ tokens: [
702
+ {
703
+ type: "text",
704
+ raw: t,
705
+ text: t
706
+ }
707
+ ]
708
+ };
709
+ }
710
+ }
711
+ url(n) {
712
+ var t;
713
+ let e;
714
+ if (e = this.rules.inline.url.exec(n)) {
715
+ let r, s;
716
+ if (e[2] === "@")
717
+ r = e[0], s = "mailto:" + r;
718
+ else {
719
+ let i;
720
+ do
721
+ i = e[0], e[0] = ((t = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : t[0]) ?? "";
722
+ while (i !== e[0]);
723
+ r = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
724
+ }
725
+ return {
726
+ type: "link",
727
+ raw: e[0],
728
+ text: r,
729
+ href: s,
730
+ tokens: [
731
+ {
732
+ type: "text",
733
+ raw: r,
734
+ text: r
735
+ }
736
+ ]
737
+ };
738
+ }
739
+ }
740
+ inlineText(n) {
741
+ const e = this.rules.inline.text.exec(n);
742
+ if (e) {
743
+ const t = this.lexer.state.inRawBlock;
744
+ return {
745
+ type: "text",
746
+ raw: e[0],
747
+ text: e[0],
748
+ escaped: t
749
+ };
750
+ }
751
+ }
752
+ }, y = class G {
753
+ constructor(e) {
754
+ d(this, "tokens");
755
+ d(this, "options");
756
+ d(this, "state");
757
+ d(this, "tokenizer");
758
+ d(this, "inlineQueue");
759
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || S, this.options.tokenizer = this.options.tokenizer || new I(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
760
+ inLink: !1,
761
+ inRawBlock: !1,
762
+ top: !0
763
+ };
764
+ const t = {
765
+ other: b,
766
+ block: P.normal,
767
+ inline: T.normal
768
+ };
769
+ this.options.pedantic ? (t.block = P.pedantic, t.inline = T.pedantic) : this.options.gfm && (t.block = P.gfm, this.options.breaks ? t.inline = T.breaks : t.inline = T.gfm), this.tokenizer.rules = t;
770
+ }
771
+ /**
772
+ * Expose Rules
773
+ */
774
+ static get rules() {
775
+ return {
776
+ block: P,
777
+ inline: T
778
+ };
779
+ }
780
+ /**
781
+ * Static Lex Method
782
+ */
783
+ static lex(e, t) {
784
+ return new G(t).lex(e);
785
+ }
786
+ /**
787
+ * Static Lex Inline Method
788
+ */
789
+ static lexInline(e, t) {
790
+ return new G(t).inlineTokens(e);
791
+ }
792
+ /**
793
+ * Preprocessing
794
+ */
795
+ lex(e) {
796
+ e = e.replace(b.carriageReturn, `
797
+ `), this.blockTokens(e, this.tokens);
798
+ for (let t = 0; t < this.inlineQueue.length; t++) {
799
+ const r = this.inlineQueue[t];
800
+ this.inlineTokens(r.src, r.tokens);
801
+ }
802
+ return this.inlineQueue = [], this.tokens;
803
+ }
804
+ blockTokens(e, t = [], r = !1) {
805
+ var s, i, c;
806
+ for (this.options.pedantic && (e = e.replace(b.tabCharGlobal, " ").replace(b.spaceLine, "")); e; ) {
807
+ let l;
808
+ if ((i = (s = this.options.extensions) == null ? void 0 : s.block) != null && i.some((a) => (l = a.call({ lexer: this }, e, t)) ? (e = e.substring(l.raw.length), t.push(l), !0) : !1))
809
+ continue;
810
+ if (l = this.tokenizer.space(e)) {
811
+ e = e.substring(l.raw.length);
812
+ const a = t.at(-1);
813
+ l.raw.length === 1 && a !== void 0 ? a.raw += `
814
+ ` : t.push(l);
815
+ continue;
816
+ }
817
+ if (l = this.tokenizer.code(e)) {
818
+ e = e.substring(l.raw.length);
819
+ const a = t.at(-1);
820
+ (a == null ? void 0 : a.type) === "paragraph" || (a == null ? void 0 : a.type) === "text" ? (a.raw += `
821
+ ` + l.raw, a.text += `
822
+ ` + l.text, this.inlineQueue.at(-1).src = a.text) : t.push(l);
823
+ continue;
824
+ }
825
+ if (l = this.tokenizer.fences(e)) {
826
+ e = e.substring(l.raw.length), t.push(l);
827
+ continue;
828
+ }
829
+ if (l = this.tokenizer.heading(e)) {
830
+ e = e.substring(l.raw.length), t.push(l);
831
+ continue;
832
+ }
833
+ if (l = this.tokenizer.hr(e)) {
834
+ e = e.substring(l.raw.length), t.push(l);
835
+ continue;
836
+ }
837
+ if (l = this.tokenizer.blockquote(e)) {
838
+ e = e.substring(l.raw.length), t.push(l);
839
+ continue;
840
+ }
841
+ if (l = this.tokenizer.list(e)) {
842
+ e = e.substring(l.raw.length), t.push(l);
843
+ continue;
844
+ }
845
+ if (l = this.tokenizer.html(e)) {
846
+ e = e.substring(l.raw.length), t.push(l);
847
+ continue;
848
+ }
849
+ if (l = this.tokenizer.def(e)) {
850
+ e = e.substring(l.raw.length);
851
+ const a = t.at(-1);
852
+ (a == null ? void 0 : a.type) === "paragraph" || (a == null ? void 0 : a.type) === "text" ? (a.raw += `
853
+ ` + l.raw, a.text += `
854
+ ` + l.raw, this.inlineQueue.at(-1).src = a.text) : this.tokens.links[l.tag] || (this.tokens.links[l.tag] = {
855
+ href: l.href,
856
+ title: l.title
857
+ });
858
+ continue;
859
+ }
860
+ if (l = this.tokenizer.table(e)) {
861
+ e = e.substring(l.raw.length), t.push(l);
862
+ continue;
863
+ }
864
+ if (l = this.tokenizer.lheading(e)) {
865
+ e = e.substring(l.raw.length), t.push(l);
866
+ continue;
867
+ }
868
+ let h = e;
869
+ if ((c = this.options.extensions) != null && c.startBlock) {
870
+ let a = 1 / 0;
871
+ const o = e.slice(1);
872
+ let k;
873
+ this.options.extensions.startBlock.forEach((p) => {
874
+ k = p.call({ lexer: this }, o), typeof k == "number" && k >= 0 && (a = Math.min(a, k));
875
+ }), a < 1 / 0 && a >= 0 && (h = e.substring(0, a + 1));
876
+ }
877
+ if (this.state.top && (l = this.tokenizer.paragraph(h))) {
878
+ const a = t.at(-1);
879
+ r && (a == null ? void 0 : a.type) === "paragraph" ? (a.raw += `
880
+ ` + l.raw, a.text += `
881
+ ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(l), r = h.length !== e.length, e = e.substring(l.raw.length);
882
+ continue;
883
+ }
884
+ if (l = this.tokenizer.text(e)) {
885
+ e = e.substring(l.raw.length);
886
+ const a = t.at(-1);
887
+ (a == null ? void 0 : a.type) === "text" ? (a.raw += `
888
+ ` + l.raw, a.text += `
889
+ ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(l);
890
+ continue;
891
+ }
892
+ if (e) {
893
+ const a = "Infinite loop on byte: " + e.charCodeAt(0);
894
+ if (this.options.silent) {
895
+ console.error(a);
896
+ break;
897
+ } else
898
+ throw new Error(a);
899
+ }
900
+ }
901
+ return this.state.top = !0, t;
902
+ }
903
+ inline(e, t = []) {
904
+ return this.inlineQueue.push({ src: e, tokens: t }), t;
905
+ }
906
+ /**
907
+ * Lexing/Compiling
908
+ */
909
+ inlineTokens(e, t = []) {
910
+ var l, h, a;
911
+ let r = e, s = null;
912
+ if (this.tokens.links) {
913
+ const o = Object.keys(this.tokens.links);
914
+ if (o.length > 0)
915
+ for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
916
+ o.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
917
+ }
918
+ for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(r)) != null; )
919
+ r = r.slice(0, s.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
920
+ for (; (s = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
921
+ r = r.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
922
+ let i = !1, c = "";
923
+ for (; e; ) {
924
+ i || (c = ""), i = !1;
925
+ let o;
926
+ if ((h = (l = this.options.extensions) == null ? void 0 : l.inline) != null && h.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1))
927
+ continue;
928
+ if (o = this.tokenizer.escape(e)) {
929
+ e = e.substring(o.raw.length), t.push(o);
930
+ continue;
931
+ }
932
+ if (o = this.tokenizer.tag(e)) {
933
+ e = e.substring(o.raw.length), t.push(o);
934
+ continue;
935
+ }
936
+ if (o = this.tokenizer.link(e)) {
937
+ e = e.substring(o.raw.length), t.push(o);
938
+ continue;
939
+ }
940
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
941
+ e = e.substring(o.raw.length);
942
+ const p = t.at(-1);
943
+ o.type === "text" && (p == null ? void 0 : p.type) === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
944
+ continue;
945
+ }
946
+ if (o = this.tokenizer.emStrong(e, r, c)) {
947
+ e = e.substring(o.raw.length), t.push(o);
948
+ continue;
949
+ }
950
+ if (o = this.tokenizer.codespan(e)) {
951
+ e = e.substring(o.raw.length), t.push(o);
952
+ continue;
953
+ }
954
+ if (o = this.tokenizer.br(e)) {
955
+ e = e.substring(o.raw.length), t.push(o);
956
+ continue;
957
+ }
958
+ if (o = this.tokenizer.del(e)) {
959
+ e = e.substring(o.raw.length), t.push(o);
960
+ continue;
961
+ }
962
+ if (o = this.tokenizer.autolink(e)) {
963
+ e = e.substring(o.raw.length), t.push(o);
964
+ continue;
965
+ }
966
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
967
+ e = e.substring(o.raw.length), t.push(o);
968
+ continue;
969
+ }
970
+ let k = e;
971
+ if ((a = this.options.extensions) != null && a.startInline) {
972
+ let p = 1 / 0;
973
+ const x = e.slice(1);
974
+ let g;
975
+ this.options.extensions.startInline.forEach((m) => {
976
+ g = m.call({ lexer: this }, x), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
977
+ }), p < 1 / 0 && p >= 0 && (k = e.substring(0, p + 1));
978
+ }
979
+ if (o = this.tokenizer.inlineText(k)) {
980
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (c = o.raw.slice(-1)), i = !0;
981
+ const p = t.at(-1);
982
+ (p == null ? void 0 : p.type) === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
983
+ continue;
984
+ }
985
+ if (e) {
986
+ const p = "Infinite loop on byte: " + e.charCodeAt(0);
987
+ if (this.options.silent) {
988
+ console.error(p);
989
+ break;
990
+ } else
991
+ throw new Error(p);
992
+ }
993
+ }
994
+ return t;
995
+ }
996
+ }, B = class {
997
+ // set by the parser
998
+ constructor(n) {
999
+ d(this, "options");
1000
+ d(this, "parser");
1001
+ this.options = n || S;
1002
+ }
1003
+ space(n) {
1004
+ return "";
1005
+ }
1006
+ code({ text: n, lang: e, escaped: t }) {
1007
+ var i;
1008
+ const r = (i = (e || "").match(b.notSpaceStart)) == null ? void 0 : i[0], s = n.replace(b.endingNewline, "") + `
1009
+ `;
1010
+ return r ? '<pre><code class="language-' + w(r) + '">' + (t ? s : w(s, !0)) + `</code></pre>
1011
+ ` : "<pre><code>" + (t ? s : w(s, !0)) + `</code></pre>
1012
+ `;
1013
+ }
1014
+ blockquote({ tokens: n }) {
1015
+ return `<blockquote>
1016
+ ${this.parser.parse(n)}</blockquote>
1017
+ `;
1018
+ }
1019
+ html({ text: n }) {
1020
+ return n;
1021
+ }
1022
+ heading({ tokens: n, depth: e }) {
1023
+ return `<h${e}>${this.parser.parseInline(n)}</h${e}>
1024
+ `;
1025
+ }
1026
+ hr(n) {
1027
+ return `<hr>
1028
+ `;
1029
+ }
1030
+ list(n) {
1031
+ const e = n.ordered, t = n.start;
1032
+ let r = "";
1033
+ for (let c = 0; c < n.items.length; c++) {
1034
+ const l = n.items[c];
1035
+ r += this.listitem(l);
1036
+ }
1037
+ const s = e ? "ol" : "ul", i = e && t !== 1 ? ' start="' + t + '"' : "";
1038
+ return "<" + s + i + `>
1039
+ ` + r + "</" + s + `>
1040
+ `;
1041
+ }
1042
+ listitem(n) {
1043
+ var t;
1044
+ let e = "";
1045
+ if (n.task) {
1046
+ const r = this.checkbox({ checked: !!n.checked });
1047
+ n.loose ? ((t = n.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (n.tokens[0].text = r + " " + n.tokens[0].text, n.tokens[0].tokens && n.tokens[0].tokens.length > 0 && n.tokens[0].tokens[0].type === "text" && (n.tokens[0].tokens[0].text = r + " " + w(n.tokens[0].tokens[0].text), n.tokens[0].tokens[0].escaped = !0)) : n.tokens.unshift({
1048
+ type: "text",
1049
+ raw: r + " ",
1050
+ text: r + " ",
1051
+ escaped: !0
1052
+ }) : e += r + " ";
1053
+ }
1054
+ return e += this.parser.parse(n.tokens, !!n.loose), `<li>${e}</li>
1055
+ `;
1056
+ }
1057
+ checkbox({ checked: n }) {
1058
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1059
+ }
1060
+ paragraph({ tokens: n }) {
1061
+ return `<p>${this.parser.parseInline(n)}</p>
1062
+ `;
1063
+ }
1064
+ table(n) {
1065
+ let e = "", t = "";
1066
+ for (let s = 0; s < n.header.length; s++)
1067
+ t += this.tablecell(n.header[s]);
1068
+ e += this.tablerow({ text: t });
1069
+ let r = "";
1070
+ for (let s = 0; s < n.rows.length; s++) {
1071
+ const i = n.rows[s];
1072
+ t = "";
1073
+ for (let c = 0; c < i.length; c++)
1074
+ t += this.tablecell(i[c]);
1075
+ r += this.tablerow({ text: t });
1076
+ }
1077
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
1078
+ <thead>
1079
+ ` + e + `</thead>
1080
+ ` + r + `</table>
1081
+ `;
1082
+ }
1083
+ tablerow({ text: n }) {
1084
+ return `<tr>
1085
+ ${n}</tr>
1086
+ `;
1087
+ }
1088
+ tablecell(n) {
1089
+ const e = this.parser.parseInline(n.tokens), t = n.header ? "th" : "td";
1090
+ return (n.align ? `<${t} align="${n.align}">` : `<${t}>`) + e + `</${t}>
1091
+ `;
1092
+ }
1093
+ /**
1094
+ * span level renderer
1095
+ */
1096
+ strong({ tokens: n }) {
1097
+ return `<strong>${this.parser.parseInline(n)}</strong>`;
1098
+ }
1099
+ em({ tokens: n }) {
1100
+ return `<em>${this.parser.parseInline(n)}</em>`;
1101
+ }
1102
+ codespan({ text: n }) {
1103
+ return `<code>${w(n, !0)}</code>`;
1104
+ }
1105
+ br(n) {
1106
+ return "<br>";
1107
+ }
1108
+ del({ tokens: n }) {
1109
+ return `<del>${this.parser.parseInline(n)}</del>`;
1110
+ }
1111
+ link({ href: n, title: e, tokens: t }) {
1112
+ const r = this.parser.parseInline(t), s = se(n);
1113
+ if (s === null)
1114
+ return r;
1115
+ n = s;
1116
+ let i = '<a href="' + n + '"';
1117
+ return e && (i += ' title="' + w(e) + '"'), i += ">" + r + "</a>", i;
1118
+ }
1119
+ image({ href: n, title: e, text: t, tokens: r }) {
1120
+ r && (t = this.parser.parseInline(r, this.parser.textRenderer));
1121
+ const s = se(n);
1122
+ if (s === null)
1123
+ return w(t);
1124
+ n = s;
1125
+ let i = `<img src="${n}" alt="${t}"`;
1126
+ return e && (i += ` title="${w(e)}"`), i += ">", i;
1127
+ }
1128
+ text(n) {
1129
+ return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : w(n.text);
1130
+ }
1131
+ }, J = class {
1132
+ // no need for block level renderers
1133
+ strong({ text: n }) {
1134
+ return n;
1135
+ }
1136
+ em({ text: n }) {
1137
+ return n;
1138
+ }
1139
+ codespan({ text: n }) {
1140
+ return n;
1141
+ }
1142
+ del({ text: n }) {
1143
+ return n;
1144
+ }
1145
+ html({ text: n }) {
1146
+ return n;
1147
+ }
1148
+ text({ text: n }) {
1149
+ return n;
1150
+ }
1151
+ link({ text: n }) {
1152
+ return "" + n;
1153
+ }
1154
+ image({ text: n }) {
1155
+ return "" + n;
1156
+ }
1157
+ br() {
1158
+ return "";
1159
+ }
1160
+ }, $ = class N {
1161
+ constructor(e) {
1162
+ d(this, "options");
1163
+ d(this, "renderer");
1164
+ d(this, "textRenderer");
1165
+ this.options = e || S, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new J();
1166
+ }
1167
+ /**
1168
+ * Static Parse Method
1169
+ */
1170
+ static parse(e, t) {
1171
+ return new N(t).parse(e);
1172
+ }
1173
+ /**
1174
+ * Static Parse Inline Method
1175
+ */
1176
+ static parseInline(e, t) {
1177
+ return new N(t).parseInline(e);
1178
+ }
1179
+ /**
1180
+ * Parse Loop
1181
+ */
1182
+ parse(e, t = !0) {
1183
+ var s, i;
1184
+ let r = "";
1185
+ for (let c = 0; c < e.length; c++) {
1186
+ const l = e[c];
1187
+ if ((i = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && i[l.type]) {
1188
+ const a = l, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1189
+ if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
1190
+ r += o || "";
1191
+ continue;
1192
+ }
1193
+ }
1194
+ const h = l;
1195
+ switch (h.type) {
1196
+ case "space": {
1197
+ r += this.renderer.space(h);
1198
+ continue;
1199
+ }
1200
+ case "hr": {
1201
+ r += this.renderer.hr(h);
1202
+ continue;
1203
+ }
1204
+ case "heading": {
1205
+ r += this.renderer.heading(h);
1206
+ continue;
1207
+ }
1208
+ case "code": {
1209
+ r += this.renderer.code(h);
1210
+ continue;
1211
+ }
1212
+ case "table": {
1213
+ r += this.renderer.table(h);
1214
+ continue;
1215
+ }
1216
+ case "blockquote": {
1217
+ r += this.renderer.blockquote(h);
1218
+ continue;
1219
+ }
1220
+ case "list": {
1221
+ r += this.renderer.list(h);
1222
+ continue;
1223
+ }
1224
+ case "html": {
1225
+ r += this.renderer.html(h);
1226
+ continue;
1227
+ }
1228
+ case "paragraph": {
1229
+ r += this.renderer.paragraph(h);
1230
+ continue;
1231
+ }
1232
+ case "text": {
1233
+ let a = h, o = this.renderer.text(a);
1234
+ for (; c + 1 < e.length && e[c + 1].type === "text"; )
1235
+ a = e[++c], o += `
1236
+ ` + this.renderer.text(a);
1237
+ t ? r += this.renderer.paragraph({
1238
+ type: "paragraph",
1239
+ raw: o,
1240
+ text: o,
1241
+ tokens: [{ type: "text", raw: o, text: o, escaped: !0 }]
1242
+ }) : r += o;
1243
+ continue;
1244
+ }
1245
+ default: {
1246
+ const a = 'Token with "' + h.type + '" type was not found.';
1247
+ if (this.options.silent)
1248
+ return console.error(a), "";
1249
+ throw new Error(a);
1250
+ }
1251
+ }
1252
+ }
1253
+ return r;
1254
+ }
1255
+ /**
1256
+ * Parse Inline Tokens
1257
+ */
1258
+ parseInline(e, t = this.renderer) {
1259
+ var s, i;
1260
+ let r = "";
1261
+ for (let c = 0; c < e.length; c++) {
1262
+ const l = e[c];
1263
+ if ((i = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && i[l.type]) {
1264
+ const a = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1265
+ if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(l.type)) {
1266
+ r += a || "";
1267
+ continue;
1268
+ }
1269
+ }
1270
+ const h = l;
1271
+ switch (h.type) {
1272
+ case "escape": {
1273
+ r += t.text(h);
1274
+ break;
1275
+ }
1276
+ case "html": {
1277
+ r += t.html(h);
1278
+ break;
1279
+ }
1280
+ case "link": {
1281
+ r += t.link(h);
1282
+ break;
1283
+ }
1284
+ case "image": {
1285
+ r += t.image(h);
1286
+ break;
1287
+ }
1288
+ case "strong": {
1289
+ r += t.strong(h);
1290
+ break;
1291
+ }
1292
+ case "em": {
1293
+ r += t.em(h);
1294
+ break;
1295
+ }
1296
+ case "codespan": {
1297
+ r += t.codespan(h);
1298
+ break;
1299
+ }
1300
+ case "br": {
1301
+ r += t.br(h);
1302
+ break;
1303
+ }
1304
+ case "del": {
1305
+ r += t.del(h);
1306
+ break;
1307
+ }
1308
+ case "text": {
1309
+ r += t.text(h);
1310
+ break;
1311
+ }
1312
+ default: {
1313
+ const a = 'Token with "' + h.type + '" type was not found.';
1314
+ if (this.options.silent)
1315
+ return console.error(a), "";
1316
+ throw new Error(a);
1317
+ }
1318
+ }
1319
+ }
1320
+ return r;
1321
+ }
1322
+ }, M, L = (M = class {
1323
+ constructor(n) {
1324
+ d(this, "options");
1325
+ d(this, "block");
1326
+ this.options = n || S;
1327
+ }
1328
+ /**
1329
+ * Process markdown before marked
1330
+ */
1331
+ preprocess(n) {
1332
+ return n;
1333
+ }
1334
+ /**
1335
+ * Process HTML after marked is finished
1336
+ */
1337
+ postprocess(n) {
1338
+ return n;
1339
+ }
1340
+ /**
1341
+ * Process all tokens before walk tokens
1342
+ */
1343
+ processAllTokens(n) {
1344
+ return n;
1345
+ }
1346
+ /**
1347
+ * Provide function to tokenize markdown
1348
+ */
1349
+ provideLexer() {
1350
+ return this.block ? y.lex : y.lexInline;
1351
+ }
1352
+ /**
1353
+ * Provide function to parse tokens
1354
+ */
1355
+ provideParser() {
1356
+ return this.block ? $.parse : $.parseInline;
1357
+ }
1358
+ }, d(M, "passThroughHooks", /* @__PURE__ */ new Set([
1359
+ "preprocess",
1360
+ "postprocess",
1361
+ "processAllTokens"
1362
+ ])), M), it = class {
1363
+ constructor(...n) {
1364
+ d(this, "defaults", j());
1365
+ d(this, "options", this.setOptions);
1366
+ d(this, "parse", this.parseMarkdown(!0));
1367
+ d(this, "parseInline", this.parseMarkdown(!1));
1368
+ d(this, "Parser", $);
1369
+ d(this, "Renderer", B);
1370
+ d(this, "TextRenderer", J);
1371
+ d(this, "Lexer", y);
1372
+ d(this, "Tokenizer", I);
1373
+ d(this, "Hooks", L);
1374
+ this.use(...n);
1375
+ }
1376
+ /**
1377
+ * Run callback for every token
1378
+ */
1379
+ walkTokens(n, e) {
1380
+ var r, s;
1381
+ let t = [];
1382
+ for (const i of n)
1383
+ switch (t = t.concat(e.call(this, i)), i.type) {
1384
+ case "table": {
1385
+ const c = i;
1386
+ for (const l of c.header)
1387
+ t = t.concat(this.walkTokens(l.tokens, e));
1388
+ for (const l of c.rows)
1389
+ for (const h of l)
1390
+ t = t.concat(this.walkTokens(h.tokens, e));
1391
+ break;
1392
+ }
1393
+ case "list": {
1394
+ const c = i;
1395
+ t = t.concat(this.walkTokens(c.items, e));
1396
+ break;
1397
+ }
1398
+ default: {
1399
+ const c = i;
1400
+ (s = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && s[c.type] ? this.defaults.extensions.childTokens[c.type].forEach((l) => {
1401
+ const h = c[l].flat(1 / 0);
1402
+ t = t.concat(this.walkTokens(h, e));
1403
+ }) : c.tokens && (t = t.concat(this.walkTokens(c.tokens, e)));
1404
+ }
1405
+ }
1406
+ return t;
1407
+ }
1408
+ use(...n) {
1409
+ const e = this.defaults.extensions || { renderers: {}, childTokens: {} };
1410
+ return n.forEach((t) => {
1411
+ const r = { ...t };
1412
+ if (r.async = this.defaults.async || r.async || !1, t.extensions && (t.extensions.forEach((s) => {
1413
+ if (!s.name)
1414
+ throw new Error("extension name required");
1415
+ if ("renderer" in s) {
1416
+ const i = e.renderers[s.name];
1417
+ i ? e.renderers[s.name] = function(...c) {
1418
+ let l = s.renderer.apply(this, c);
1419
+ return l === !1 && (l = i.apply(this, c)), l;
1420
+ } : e.renderers[s.name] = s.renderer;
1421
+ }
1422
+ if ("tokenizer" in s) {
1423
+ if (!s.level || s.level !== "block" && s.level !== "inline")
1424
+ throw new Error("extension level must be 'block' or 'inline'");
1425
+ const i = e[s.level];
1426
+ i ? i.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
1427
+ }
1428
+ "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
1429
+ }), r.extensions = e), t.renderer) {
1430
+ const s = this.defaults.renderer || new B(this.defaults);
1431
+ for (const i in t.renderer) {
1432
+ if (!(i in s))
1433
+ throw new Error(`renderer '${i}' does not exist`);
1434
+ if (["options", "parser"].includes(i))
1435
+ continue;
1436
+ const c = i, l = t.renderer[c], h = s[c];
1437
+ s[c] = (...a) => {
1438
+ let o = l.apply(s, a);
1439
+ return o === !1 && (o = h.apply(s, a)), o || "";
1440
+ };
1441
+ }
1442
+ r.renderer = s;
1443
+ }
1444
+ if (t.tokenizer) {
1445
+ const s = this.defaults.tokenizer || new I(this.defaults);
1446
+ for (const i in t.tokenizer) {
1447
+ if (!(i in s))
1448
+ throw new Error(`tokenizer '${i}' does not exist`);
1449
+ if (["options", "rules", "lexer"].includes(i))
1450
+ continue;
1451
+ const c = i, l = t.tokenizer[c], h = s[c];
1452
+ s[c] = (...a) => {
1453
+ let o = l.apply(s, a);
1454
+ return o === !1 && (o = h.apply(s, a)), o;
1455
+ };
1456
+ }
1457
+ r.tokenizer = s;
1458
+ }
1459
+ if (t.hooks) {
1460
+ const s = this.defaults.hooks || new L();
1461
+ for (const i in t.hooks) {
1462
+ if (!(i in s))
1463
+ throw new Error(`hook '${i}' does not exist`);
1464
+ if (["options", "block"].includes(i))
1465
+ continue;
1466
+ const c = i, l = t.hooks[c], h = s[c];
1467
+ L.passThroughHooks.has(i) ? s[c] = (a) => {
1468
+ if (this.defaults.async)
1469
+ return Promise.resolve(l.call(s, a)).then((k) => h.call(s, k));
1470
+ const o = l.call(s, a);
1471
+ return h.call(s, o);
1472
+ } : s[c] = (...a) => {
1473
+ let o = l.apply(s, a);
1474
+ return o === !1 && (o = h.apply(s, a)), o;
1475
+ };
1476
+ }
1477
+ r.hooks = s;
1478
+ }
1479
+ if (t.walkTokens) {
1480
+ const s = this.defaults.walkTokens, i = t.walkTokens;
1481
+ r.walkTokens = function(c) {
1482
+ let l = [];
1483
+ return l.push(i.call(this, c)), s && (l = l.concat(s.call(this, c))), l;
1484
+ };
1485
+ }
1486
+ this.defaults = { ...this.defaults, ...r };
1487
+ }), this;
1488
+ }
1489
+ setOptions(n) {
1490
+ return this.defaults = { ...this.defaults, ...n }, this;
1491
+ }
1492
+ lexer(n, e) {
1493
+ return y.lex(n, e ?? this.defaults);
1494
+ }
1495
+ parser(n, e) {
1496
+ return $.parse(n, e ?? this.defaults);
1497
+ }
1498
+ parseMarkdown(n) {
1499
+ return (t, r) => {
1500
+ const s = { ...r }, i = { ...this.defaults, ...s }, c = this.onError(!!i.silent, !!i.async);
1501
+ if (this.defaults.async === !0 && s.async === !1)
1502
+ return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1503
+ if (typeof t > "u" || t === null)
1504
+ return c(new Error("marked(): input parameter is undefined or null"));
1505
+ if (typeof t != "string")
1506
+ return c(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1507
+ i.hooks && (i.hooks.options = i, i.hooks.block = n);
1508
+ const l = i.hooks ? i.hooks.provideLexer() : n ? y.lex : y.lexInline, h = i.hooks ? i.hooks.provideParser() : n ? $.parse : $.parseInline;
1509
+ if (i.async)
1510
+ return Promise.resolve(i.hooks ? i.hooks.preprocess(t) : t).then((a) => l(a, i)).then((a) => i.hooks ? i.hooks.processAllTokens(a) : a).then((a) => i.walkTokens ? Promise.all(this.walkTokens(a, i.walkTokens)).then(() => a) : a).then((a) => h(a, i)).then((a) => i.hooks ? i.hooks.postprocess(a) : a).catch(c);
1511
+ try {
1512
+ i.hooks && (t = i.hooks.preprocess(t));
1513
+ let a = l(t, i);
1514
+ i.hooks && (a = i.hooks.processAllTokens(a)), i.walkTokens && this.walkTokens(a, i.walkTokens);
1515
+ let o = h(a, i);
1516
+ return i.hooks && (o = i.hooks.postprocess(o)), o;
1517
+ } catch (a) {
1518
+ return c(a);
1519
+ }
1520
+ };
1521
+ }
1522
+ onError(n, e) {
1523
+ return (t) => {
1524
+ if (t.message += `
1525
+ Please report this to https://github.com/markedjs/marked.`, n) {
1526
+ const r = "<p>An error occurred:</p><pre>" + w(t.message + "", !0) + "</pre>";
1527
+ return e ? Promise.resolve(r) : r;
1528
+ }
1529
+ if (e)
1530
+ return Promise.reject(t);
1531
+ throw t;
1532
+ };
1533
+ }
1534
+ }, R = new it();
1535
+ function f(n, e) {
1536
+ return R.parse(n, e);
1537
+ }
1538
+ f.options = f.setOptions = function(n) {
1539
+ return R.setOptions(n), f.defaults = R.defaults, ae(f.defaults), f;
1540
+ };
1541
+ f.getDefaults = j;
1542
+ f.defaults = S;
1543
+ f.use = function(...n) {
1544
+ return R.use(...n), f.defaults = R.defaults, ae(f.defaults), f;
1545
+ };
1546
+ f.walkTokens = function(n, e) {
1547
+ return R.walkTokens(n, e);
1548
+ };
1549
+ f.parseInline = R.parseInline;
1550
+ f.Parser = $;
1551
+ f.parser = $.parse;
1552
+ f.Renderer = B;
1553
+ f.TextRenderer = J;
1554
+ f.Lexer = y;
1555
+ f.lexer = y.lex;
1556
+ f.Tokenizer = I;
1557
+ f.Hooks = L;
1558
+ f.parse = f;
1559
+ f.options;
1560
+ f.setOptions;
1561
+ f.use;
1562
+ f.walkTokens;
1563
+ f.parseInline;
1564
+ $.parse;
1565
+ y.lex;
1566
+ function lt(n) {
1567
+ const e = [
1568
+ /^#{1,6}\s+/m,
1569
+ // Headings: ## Heading
1570
+ /^\s*[-*+]\s+/m,
1571
+ // Unordered lists: - item
1572
+ /^\s*\d+\.\s+/m,
1573
+ // Ordered lists: 1. item
1574
+ /^\s*>\s+/m,
1575
+ // Blockquotes: > quote
1576
+ /\*\*.+?\*\*/,
1577
+ // Bold: **text**
1578
+ /\*.+?\*/,
1579
+ // Italic: *text*
1580
+ /`[^`]+`/,
1581
+ // Inline code: `code`
1582
+ /^```/m,
1583
+ // Code blocks: ```
1584
+ /^\s*---\s*$/m,
1585
+ // Horizontal rules: ---
1586
+ /^\s*\*\*\*\s*$/m,
1587
+ // Horizontal rules: ***
1588
+ /\[.+?\]\(.+?\)/,
1589
+ // Links: [text](url)
1590
+ /!\[.*?\]\(.+?\)/,
1591
+ // Images: ![alt](url)
1592
+ /^\s*[-*]\s+\[[ x]\]/m,
1593
+ // Task lists: - [ ] or - [x]
1594
+ /\|.+\|.+\|/
1595
+ // Tables: |col|col|
1596
+ ];
1597
+ let t = 0;
1598
+ for (const r of e)
1599
+ if (r.test(n) && (t++, t >= 2))
1600
+ return !0;
1601
+ return !!/^#{1,6}\s+/.test(n.trim());
1602
+ }
1603
+ function at(n) {
1604
+ const e = n.split(`
1605
+ `), t = [];
1606
+ for (let r = 0; r < e.length; r++) {
1607
+ const s = e[r];
1608
+ if (s.trim() === "" && t.length > 0) {
1609
+ let c = r + 1;
1610
+ for (; c < e.length && e[c].trim() === ""; )
1611
+ c++;
1612
+ const l = t[t.length - 1].trim(), h = c < e.length ? e[c].trim() : "";
1613
+ if (l.startsWith("|") && l.endsWith("|") && h.startsWith("|") && h.endsWith("|"))
1614
+ continue;
1615
+ }
1616
+ t.push(s);
1617
+ }
1618
+ return t.join(`
1619
+ `);
1620
+ }
1621
+ const pt = ye.create({
1622
+ name: "markdownPaste",
1623
+ addOptions() {
1624
+ return {
1625
+ enabled: !0
1626
+ };
1627
+ },
1628
+ addProseMirrorPlugins() {
1629
+ const n = this.editor;
1630
+ return [
1631
+ new $e({
1632
+ key: new Re("markdownPaste"),
1633
+ props: {
1634
+ handlePaste: (e, t) => {
1635
+ if (!this.options.enabled) return !1;
1636
+ const r = t.clipboardData;
1637
+ if (!r) return !1;
1638
+ const s = r.getData("text/plain");
1639
+ if (!s || !lt(s)) return !1;
1640
+ const i = at(s);
1641
+ let c = f.parse(i, {
1642
+ gfm: !0,
1643
+ breaks: !0
1644
+ });
1645
+ return c = c.replace(/<\/?(thead|tbody)>/g, ""), n.commands.insertContent(c, {
1646
+ parseOptions: { preserveWhitespace: !1 }
1647
+ }), !0;
1648
+ }
1649
+ }
1650
+ })
1651
+ ];
1652
+ }
1653
+ });
1654
+ export {
1655
+ pt as MarkdownPaste
1656
+ };