@8wave/ai-elements 0.110.0-beta.4 → 0.111.0-beta.11

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 (234) hide show
  1. package/README.md +1 -0
  2. package/dist/_chunks/{Agent-Su_LDF9_.js → Agent-tE7ZJPxG.js} +80 -78
  3. package/dist/_chunks/Agent-tE7ZJPxG.js.map +1 -0
  4. package/dist/_chunks/{Document-DecVclEe.js → Document-Bmx6774B.js} +33 -21
  5. package/dist/_chunks/Document-Bmx6774B.js.map +1 -0
  6. package/dist/_chunks/Media-Cft7Pwrh.js +108 -0
  7. package/dist/_chunks/Media-Cft7Pwrh.js.map +1 -0
  8. package/dist/_chunks/{PkLazyImg-ClL4nr95.js → PkLazyImg-Dbj2dDXA.js} +2 -2
  9. package/dist/_chunks/{PkLazyImg-ClL4nr95.js.map → PkLazyImg-Dbj2dDXA.js.map} +1 -1
  10. package/dist/_chunks/{PkStreamingMarkdown-CwqsJnJJ.js → PkStreamingMarkdown-CNI8aV8t.js} +636 -427
  11. package/dist/_chunks/PkStreamingMarkdown-CNI8aV8t.js.map +1 -0
  12. package/dist/_chunks/{PkToolRequestGeolocation-CEVpl50q.js → PkToolRequestGeolocation-Bzy4IYSp.js} +4 -4
  13. package/dist/_chunks/PkToolRequestGeolocation-Bzy4IYSp.js.map +1 -0
  14. package/dist/_chunks/{PkToolRequestOAuthConnection-CncDU-Kl.js → PkToolRequestOAuthConnection-13CQH07t.js} +5 -5
  15. package/dist/_chunks/PkToolRequestOAuthConnection-13CQH07t.js.map +1 -0
  16. package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js → PkToolShowArtifact-CGbHDEie.js} +4 -4
  17. package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js.map → PkToolShowArtifact-CGbHDEie.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js → PkToolShowCalendarEvent-DIFX_rUz.js} +3 -3
  19. package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js.map → PkToolShowCalendarEvent-DIFX_rUz.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowComparison-DbbUD9pg.js → PkToolShowComparison-CWLFWT9h.js} +7 -7
  21. package/dist/_chunks/PkToolShowComparison-CWLFWT9h.js.map +1 -0
  22. package/dist/_chunks/{PkToolShowContactForm-D_dW59Dl.js → PkToolShowContactForm-CYxgatUA.js} +5 -5
  23. package/dist/_chunks/PkToolShowContactForm-CYxgatUA.js.map +1 -0
  24. package/dist/_chunks/{PkToolShowDiagram-Hy9qh68O.js → PkToolShowDiagram-Dx1Ba0PG.js} +4 -4
  25. package/dist/_chunks/PkToolShowDiagram-Dx1Ba0PG.js.map +1 -0
  26. package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js → PkToolShowEmail-DnFFgzom.js} +3 -3
  27. package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js.map → PkToolShowEmail-DnFFgzom.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowForm-DbJHMDbt.js → PkToolShowForm-B6x3Lp2i.js} +7 -8
  29. package/dist/_chunks/PkToolShowForm-B6x3Lp2i.js.map +1 -0
  30. package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js → PkToolShowImageGallery-D99N_Plf.js} +2 -2
  31. package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js.map → PkToolShowImageGallery-D99N_Plf.js.map} +1 -1
  32. package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js → PkToolShowLocation-AfnrtFVJ.js} +3 -3
  33. package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js.map → PkToolShowLocation-AfnrtFVJ.js.map} +1 -1
  34. package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js → PkToolShowMessage-DUo2c-im.js} +3 -3
  35. package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js.map → PkToolShowMessage-DUo2c-im.js.map} +1 -1
  36. package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js → PkToolShowProductList-BN6Qk1_y.js} +3 -3
  37. package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js.map → PkToolShowProductList-BN6Qk1_y.js.map} +1 -1
  38. package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js → PkToolShowQrCode-BLqeBecX.js} +3 -3
  39. package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js.map → PkToolShowQrCode-BLqeBecX.js.map} +1 -1
  40. package/dist/_chunks/{PkToolShowSources-B69JmwbZ.js → PkToolShowSources-DpZb5FUP.js} +5 -5
  41. package/dist/_chunks/PkToolShowSources-DpZb5FUP.js.map +1 -0
  42. package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js → PkToolShowSuggestedReply-C10nNgBs.js} +3 -3
  43. package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js.map → PkToolShowSuggestedReply-C10nNgBs.js.map} +1 -1
  44. package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js → PkToolShowVideo-S9b4QHUj.js} +2 -2
  45. package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js.map → PkToolShowVideo-S9b4QHUj.js.map} +1 -1
  46. package/dist/_chunks/{PkToolShowWeather-LPd3tC77.js → PkToolShowWeather-CqhG430w.js} +2 -2
  47. package/dist/_chunks/PkToolShowWeather-CqhG430w.js.map +1 -0
  48. package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js → PkToolShowWebPages-txAZi_iG.js} +3 -3
  49. package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js.map → PkToolShowWebPages-txAZi_iG.js.map} +1 -1
  50. package/dist/_chunks/PkUrl-BPbjZJ1A.js.map +1 -1
  51. package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js → VvCheckboxGroup.es-CTrF3pue.js} +2 -2
  52. package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js.map → VvCheckboxGroup.es-CTrF3pue.js.map} +1 -1
  53. package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js → VvCombobox.es-BWiXmQ_S.js} +10 -10
  54. package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js.map → VvCombobox.es-BWiXmQ_S.js.map} +1 -1
  55. package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js → VvInputText.es-Bo9I6g8H.js} +6 -6
  56. package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js.map → VvInputText.es-Bo9I6g8H.js.map} +1 -1
  57. package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js → VvRadioGroup.es-9ooHCuik.js} +2 -2
  58. package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js.map → VvRadioGroup.es-9ooHCuik.js.map} +1 -1
  59. package/dist/_chunks/{VvSelect.es-ovnZRHG5.js → VvSelect.es-DG0VuWtP.js} +2 -2
  60. package/dist/_chunks/{VvSelect.es-ovnZRHG5.js.map → VvSelect.es-DG0VuWtP.js.map} +1 -1
  61. package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js → VvTextarea.es-Dg3pxdZy.js} +6 -6
  62. package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js.map → VvTextarea.es-Dg3pxdZy.js.map} +1 -1
  63. package/dist/_chunks/{browser-NgY6LXg-.js → browser-B0Xnbqi7.js} +726 -751
  64. package/dist/_chunks/browser-B0Xnbqi7.js.map +1 -0
  65. package/dist/_chunks/{dist-n5iFNYf-.js → dist-QdjZA6MJ.js} +143 -133
  66. package/dist/_chunks/{dist-n5iFNYf-.js.map → dist-QdjZA6MJ.js.map} +1 -1
  67. package/dist/_chunks/{index.es-dtdl3VFG.js → index.es-0YpCa4c5.js} +6 -6
  68. package/dist/_chunks/{index.es-dtdl3VFG.js.map → index.es-0YpCa4c5.js.map} +1 -1
  69. package/dist/_chunks/{index.es-BJnUA_36.js → index.es-CHkJ2TMJ.js} +10 -10
  70. package/dist/_chunks/{index.es-BJnUA_36.js.map → index.es-CHkJ2TMJ.js.map} +1 -1
  71. package/dist/_chunks/text-DbSEK8si.js.map +1 -1
  72. package/dist/ai-elements.es.js +3077 -3134
  73. package/dist/ai-elements.es.js.map +1 -1
  74. package/dist-vue/PkChatbot.js +1 -1
  75. package/dist-vue/PkChatbotEmptyState.js +1 -1
  76. package/dist-vue/PkChatbotError.js +1 -1
  77. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  78. package/dist-vue/PkChatbotFilePreview.js +1 -1
  79. package/dist-vue/PkChatbotInput.js +1 -1
  80. package/dist-vue/PkChatbotMessages.js +1 -1
  81. package/dist-vue/PkChatbotStepPayload.js +1 -1
  82. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  83. package/dist-vue/PkChatbotSteps.js +1 -1
  84. package/dist-vue/PkChatbotViewChat.js +1 -1
  85. package/dist-vue/PkChatbotViewConversations.js +1 -1
  86. package/dist-vue/PkChatbotViewFiles.js +1 -1
  87. package/dist-vue/PkChatbotViewProfile.js +1 -1
  88. package/dist-vue/_chunks/{Agent-C8BsTAxk.js → Agent-De2gFNjR.js} +165 -176
  89. package/dist-vue/_chunks/Agent-De2gFNjR.js.map +1 -0
  90. package/dist-vue/_chunks/{Document-CaUfI_SZ.js → Document-8umjeTVS.js} +84 -72
  91. package/dist-vue/_chunks/Document-8umjeTVS.js.map +1 -0
  92. package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
  93. package/dist-vue/_chunks/{PkChatbot-o7k7d-fj.js → PkChatbot-CMajc7tE.js} +61 -61
  94. package/dist-vue/_chunks/PkChatbot-CMajc7tE.js.map +1 -0
  95. package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js → PkChatbotEmptyState-BtzBYOHJ.js} +2 -2
  96. package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js.map → PkChatbotEmptyState-BtzBYOHJ.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkChatbotError-CBP2mf-n.js → PkChatbotError-gvDpRcEz.js} +21 -19
  98. package/dist-vue/_chunks/PkChatbotError-gvDpRcEz.js.map +1 -0
  99. package/dist-vue/_chunks/{PkChatbotFeedbackForm-DO1QIgmo.js → PkChatbotFeedbackForm-CxLOdwkm.js} +2 -2
  100. package/dist-vue/_chunks/PkChatbotFeedbackForm-CxLOdwkm.js.map +1 -0
  101. package/dist-vue/_chunks/{PkChatbotFilePreview-DO1wZPPj.js → PkChatbotFilePreview-CwiVQDF2.js} +3 -3
  102. package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +1 -0
  103. package/dist-vue/_chunks/{PkChatbotInput-D8x52cVm.js → PkChatbotInput-MSpF6SB6.js} +140 -125
  104. package/dist-vue/_chunks/PkChatbotInput-MSpF6SB6.js.map +1 -0
  105. package/dist-vue/_chunks/PkChatbotMessages-Bz5q8EtT.js +776 -0
  106. package/dist-vue/_chunks/PkChatbotMessages-Bz5q8EtT.js.map +1 -0
  107. package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js → PkChatbotStepPayload-XW4gT9AZ.js} +2 -2
  108. package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js.map → PkChatbotStepPayload-XW4gT9AZ.js.map} +1 -1
  109. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js → PkChatbotStepToolDetail-C4-K6Glw.js} +3 -3
  110. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js.map → PkChatbotStepToolDetail-C4-K6Glw.js.map} +1 -1
  111. package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js +190 -0
  112. package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js.map +1 -0
  113. package/dist-vue/_chunks/{PkChatbotViewChat-CNH_glPI.js → PkChatbotViewChat-DXu5ncaU.js} +10 -10
  114. package/dist-vue/_chunks/{PkChatbotViewChat-CNH_glPI.js.map → PkChatbotViewChat-DXu5ncaU.js.map} +1 -1
  115. package/dist-vue/_chunks/{PkChatbotViewConversations-BENvHLZt.js → PkChatbotViewConversations-3LaZPFyw.js} +2 -2
  116. package/dist-vue/_chunks/{PkChatbotViewConversations-BENvHLZt.js.map → PkChatbotViewConversations-3LaZPFyw.js.map} +1 -1
  117. package/dist-vue/_chunks/{PkChatbotViewFiles-qmLESi1V.js → PkChatbotViewFiles-CTqnbsCj.js} +3 -3
  118. package/dist-vue/_chunks/{PkChatbotViewFiles-qmLESi1V.js.map → PkChatbotViewFiles-CTqnbsCj.js.map} +1 -1
  119. package/dist-vue/_chunks/{PkChatbotViewProfile-DzfZnitQ.js → PkChatbotViewProfile-B-Mp1jGQ.js} +2 -2
  120. package/dist-vue/_chunks/{PkChatbotViewProfile-DzfZnitQ.js.map → PkChatbotViewProfile-B-Mp1jGQ.js.map} +1 -1
  121. package/dist-vue/_chunks/PkRelativeTime--1cIphlA.js.map +1 -1
  122. package/dist-vue/_chunks/{PkStreamingMarkdown-D8_LwZMR.js → PkStreamingMarkdown-D0IOaETI.js} +432 -419
  123. package/dist-vue/_chunks/PkStreamingMarkdown-D0IOaETI.js.map +1 -0
  124. package/dist-vue/_chunks/{PkSvgViewer-DPpE9fiz.js → PkSvgViewer-D-0M5bqg.js} +2 -2
  125. package/dist-vue/_chunks/PkSvgViewer-D-0M5bqg.js.map +1 -0
  126. package/dist-vue/_chunks/{PkToolRequestGeolocation-D1ZPmWiB.js → PkToolRequestGeolocation-Q3N3jlO8.js} +3 -3
  127. package/dist-vue/_chunks/PkToolRequestGeolocation-Q3N3jlO8.js.map +1 -0
  128. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CoJyKEE6.js → PkToolRequestOAuthConnection-lYoTJIF_.js} +4 -4
  129. package/dist-vue/_chunks/PkToolRequestOAuthConnection-lYoTJIF_.js.map +1 -0
  130. package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js → PkToolShowArtifact-DHdJuzDi.js} +2 -2
  131. package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js.map → PkToolShowArtifact-DHdJuzDi.js.map} +1 -1
  132. package/dist-vue/_chunks/{PkToolShowComparison-DMSjIpCR.js → PkToolShowComparison-BLn4pkno.js} +5 -5
  133. package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js.map +1 -0
  134. package/dist-vue/_chunks/{PkToolShowContactForm-DHmzAIVF.js → PkToolShowContactForm-DceSyuX8.js} +3 -3
  135. package/dist-vue/_chunks/PkToolShowContactForm-DceSyuX8.js.map +1 -0
  136. package/dist-vue/_chunks/{PkToolShowDiagram-DuDp5EHd.js → PkToolShowDiagram-pwc0wpNo.js} +4 -4
  137. package/dist-vue/_chunks/PkToolShowDiagram-pwc0wpNo.js.map +1 -0
  138. package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js → PkToolShowEmail-DF__nKpR.js} +2 -2
  139. package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js.map → PkToolShowEmail-DF__nKpR.js.map} +1 -1
  140. package/dist-vue/_chunks/{PkToolShowForm-CO5A_j9L.js → PkToolShowForm-Dx10jOXm.js} +7 -7
  141. package/dist-vue/_chunks/PkToolShowForm-Dx10jOXm.js.map +1 -0
  142. package/dist-vue/_chunks/{PkToolShowImageGallery-V9U3LJfF.js → PkToolShowImageGallery-DudQzBx4.js} +2 -2
  143. package/dist-vue/_chunks/{PkToolShowImageGallery-V9U3LJfF.js.map → PkToolShowImageGallery-DudQzBx4.js.map} +1 -1
  144. package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js → PkToolShowMessage-Ck6VP-gw.js} +2 -2
  145. package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js.map → PkToolShowMessage-Ck6VP-gw.js.map} +1 -1
  146. package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js → PkToolShowProductList-zfM8cx-l.js} +2 -2
  147. package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js.map → PkToolShowProductList-zfM8cx-l.js.map} +1 -1
  148. package/dist-vue/_chunks/{PkToolShowSources-BvWOzVkQ.js → PkToolShowSources-Dlaz2Y77.js} +5 -5
  149. package/dist-vue/_chunks/PkToolShowSources-Dlaz2Y77.js.map +1 -0
  150. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js → PkToolShowSuggestedReply-DWLkUh2L.js} +2 -2
  151. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js.map → PkToolShowSuggestedReply-DWLkUh2L.js.map} +1 -1
  152. package/dist-vue/_chunks/PkToolShowWeather-Bzqalzh8.js.map +1 -1
  153. package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js → PkToolShowWebPages-CosBYLrE.js} +2 -2
  154. package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js.map → PkToolShowWebPages-CosBYLrE.js.map} +1 -1
  155. package/dist-vue/_chunks/{PkUrl-xUBKVJCv.js → PkUrl-B5CNTQj9.js} +2 -2
  156. package/dist-vue/_chunks/PkUrl-B5CNTQj9.js.map +1 -0
  157. package/dist-vue/_chunks/{createChatbotApiClient-CJ_5_3IT.js → createChatbotApiClient-MkaPbGWB.js} +6 -3
  158. package/dist-vue/_chunks/createChatbotApiClient-MkaPbGWB.js.map +1 -0
  159. package/dist-vue/_chunks/{useChatbotStore-CiRAuq7v.js → useChatbotStore-BzfqjiYz.js} +6 -3
  160. package/dist-vue/_chunks/useChatbotStore-BzfqjiYz.js.map +1 -0
  161. package/dist-vue/_chunks/useDialogConfirm-KWz0ohCQ.js.map +1 -1
  162. package/dist-vue/_chunks/{utils-Coqik0XI.js → utils-C1666_6C.js} +58 -43
  163. package/dist-vue/_chunks/utils-C1666_6C.js.map +1 -0
  164. package/dist-vue/api.js +1 -1
  165. package/dist-vue/composables.js +3 -3
  166. package/dist-vue/index.js +3867 -3488
  167. package/dist-vue/index.js.map +1 -1
  168. package/dist-vue/locales.js +36 -8
  169. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +20 -3
  170. package/dist-vue/packages/components/src/chat/PkChatButton.d.ts +3 -2
  171. package/dist-vue/packages/components/src/chat/PkLanguageModel.d.ts +26 -2
  172. package/dist-vue/packages/components/src/chat/PkLanguageModelCombobox.d.ts +53 -1
  173. package/dist-vue/packages/components/src/chat/PkModelOption.d.ts +19 -0
  174. package/dist-vue/packages/components/src/chat/PkReasoningSettings.d.ts +6 -0
  175. package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
  176. package/dist-vue/packages/components/src/chat/PkStreamingMarkdownAutoscroll.d.ts +1 -0
  177. package/dist-vue/packages/components/src/chat/constants.d.ts +5 -18
  178. package/dist-vue/packages/components/src/chat/index.d.ts +3 -1
  179. package/dist-vue/packages/components/src/chat/modelCatalog.d.ts +46 -0
  180. package/dist-vue/packages/components/src/chat/utils.d.ts +16 -0
  181. package/dist-vue/packages/components/src/table/PkTableSortable.d.ts +13 -1
  182. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
  183. package/dist-vue/packages/composable/src/useChatbotError.d.ts +2 -0
  184. package/dist-vue/packages/models/src/schema/Agent.d.ts +70 -10
  185. package/dist-vue/packages/models/src/schema/Chat.d.ts +31 -0
  186. package/dist-vue/packages/models/src/schema/ModelProvider.d.ts +316 -0
  187. package/dist-vue/packages/models/src/schema/Organization.d.ts +142 -2
  188. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +20 -0
  189. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +20 -0
  190. package/dist-vue/packages/models/src/schema/UserOverview.d.ts +41 -0
  191. package/dist-vue/packages/models/src/schema/constants.d.ts +56 -91
  192. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  193. package/dist-vue/style.css +1 -1
  194. package/package.json +1 -1
  195. package/dist/_chunks/Agent-Su_LDF9_.js.map +0 -1
  196. package/dist/_chunks/Document-DecVclEe.js.map +0 -1
  197. package/dist/_chunks/Media-C6SOQfJZ.js +0 -122
  198. package/dist/_chunks/Media-C6SOQfJZ.js.map +0 -1
  199. package/dist/_chunks/PkStreamingMarkdown-CwqsJnJJ.js.map +0 -1
  200. package/dist/_chunks/PkToolRequestGeolocation-CEVpl50q.js.map +0 -1
  201. package/dist/_chunks/PkToolRequestOAuthConnection-CncDU-Kl.js.map +0 -1
  202. package/dist/_chunks/PkToolShowComparison-DbbUD9pg.js.map +0 -1
  203. package/dist/_chunks/PkToolShowContactForm-D_dW59Dl.js.map +0 -1
  204. package/dist/_chunks/PkToolShowDiagram-Hy9qh68O.js.map +0 -1
  205. package/dist/_chunks/PkToolShowForm-DbJHMDbt.js.map +0 -1
  206. package/dist/_chunks/PkToolShowSources-B69JmwbZ.js.map +0 -1
  207. package/dist/_chunks/PkToolShowWeather-LPd3tC77.js.map +0 -1
  208. package/dist/_chunks/browser-NgY6LXg-.js.map +0 -1
  209. package/dist/_chunks/utils-YJ0ZOLDG.js +0 -185
  210. package/dist/_chunks/utils-YJ0ZOLDG.js.map +0 -1
  211. package/dist-vue/_chunks/Agent-C8BsTAxk.js.map +0 -1
  212. package/dist-vue/_chunks/Document-CaUfI_SZ.js.map +0 -1
  213. package/dist-vue/_chunks/PkChatbot-o7k7d-fj.js.map +0 -1
  214. package/dist-vue/_chunks/PkChatbotError-CBP2mf-n.js.map +0 -1
  215. package/dist-vue/_chunks/PkChatbotFeedbackForm-DO1QIgmo.js.map +0 -1
  216. package/dist-vue/_chunks/PkChatbotFilePreview-DO1wZPPj.js.map +0 -1
  217. package/dist-vue/_chunks/PkChatbotInput-D8x52cVm.js.map +0 -1
  218. package/dist-vue/_chunks/PkChatbotMessages-BFlU046I.js +0 -771
  219. package/dist-vue/_chunks/PkChatbotMessages-BFlU046I.js.map +0 -1
  220. package/dist-vue/_chunks/PkChatbotSteps-DtV1beDc.js +0 -180
  221. package/dist-vue/_chunks/PkChatbotSteps-DtV1beDc.js.map +0 -1
  222. package/dist-vue/_chunks/PkStreamingMarkdown-D8_LwZMR.js.map +0 -1
  223. package/dist-vue/_chunks/PkSvgViewer-DPpE9fiz.js.map +0 -1
  224. package/dist-vue/_chunks/PkToolRequestGeolocation-D1ZPmWiB.js.map +0 -1
  225. package/dist-vue/_chunks/PkToolRequestOAuthConnection-CoJyKEE6.js.map +0 -1
  226. package/dist-vue/_chunks/PkToolShowComparison-DMSjIpCR.js.map +0 -1
  227. package/dist-vue/_chunks/PkToolShowContactForm-DHmzAIVF.js.map +0 -1
  228. package/dist-vue/_chunks/PkToolShowDiagram-DuDp5EHd.js.map +0 -1
  229. package/dist-vue/_chunks/PkToolShowForm-CO5A_j9L.js.map +0 -1
  230. package/dist-vue/_chunks/PkToolShowSources-BvWOzVkQ.js.map +0 -1
  231. package/dist-vue/_chunks/PkUrl-xUBKVJCv.js.map +0 -1
  232. package/dist-vue/_chunks/createChatbotApiClient-CJ_5_3IT.js.map +0 -1
  233. package/dist-vue/_chunks/useChatbotStore-CiRAuq7v.js.map +0 -1
  234. package/dist-vue/_chunks/utils-Coqik0XI.js.map +0 -1
@@ -1,37 +1,39 @@
1
1
  import { n as e, t } from "./cdn-css-JUUNhyQ6.js";
2
2
  import "./src-DT8FLE4_.js";
3
3
  import { n } from "./url-validation-uLMZ5-AU.js";
4
- import { computed as r, createElementBlock as i, defineComponent as a, inject as o, nextTick as s, onBeforeUnmount as c, onMounted as l, openBlock as u, provide as d, reactive as f, toValue as p, useTemplateRef as m, watch as h } from "vue";
5
- import { useI18n as ee } from "vue-i18n";
4
+ import { c as r } from "./utils-C1666_6C.js";
5
+ import { computed as i, createElementBlock as a, defineComponent as o, inject as s, nextTick as c, onBeforeUnmount as l, onMounted as u, openBlock as d, provide as f, reactive as p, toRef as m, toValue as h, useTemplateRef as ee, watch as g } from "vue";
6
+ import { useI18n as te } from "vue-i18n";
7
+ import { refThrottled as ne } from "@vueuse/core";
6
8
  //#region ../../packages/utils/src/citations.ts
7
- var g = /[ \t]*\uE200[^\uE201]*\uE201/g, te = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, ne = /[\uE200-\uE20F]/g;
8
- function re(e) {
9
- return e && e.replace(g, "").replace(te, "").replace(ne, "");
9
+ var re = /[ \t]*\uE200[^\uE201]*\uE201/g, ie = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, ae = /[\uE200-\uE20F]/g;
10
+ function oe(e) {
11
+ return e && e.replace(re, "").replace(ie, "").replace(ae, "");
10
12
  }
11
13
  //#endregion
12
14
  //#region ../../packages/composable/src/chatbot/useShortUrlResolver.ts
13
- var ie = /\/api\/r\/([A-Za-z0-9_-]{1,20})(?:[?#]|$)/, ae = /https?:\/\/[^\s)"'<>]*\/api\/r\/([A-Za-z0-9_-]{1,20})/g;
15
+ var se = /\/api\/r\/([A-Za-z0-9_-]{1,20})(?:[?#]|$)/, ce = /https?:\/\/[^\s)"'<>]*\/api\/r\/([A-Za-z0-9_-]{1,20})/g;
14
16
  function _(e) {
15
- return ie.exec(e)?.[1];
17
+ return se.exec(e)?.[1];
16
18
  }
17
19
  function v(e) {
18
- let t = f(/* @__PURE__ */ new Map()), n = f(/* @__PURE__ */ new Set()), i = /* @__PURE__ */ new Set(), a = !1;
20
+ let t = p(/* @__PURE__ */ new Map()), n = p(/* @__PURE__ */ new Set()), r = /* @__PURE__ */ new Set(), a = !1;
19
21
  async function o() {
20
22
  a = !1;
21
- let r = [...i];
22
- if (i.clear(), r.length !== 0) try {
23
- let n = await e(r);
23
+ let i = [...r];
24
+ if (r.clear(), i.length !== 0) try {
25
+ let n = await e(i);
24
26
  for (let [e, r] of Object.entries(n)) t.set(e, r);
25
27
  } catch {} finally {
26
- for (let e of r) n.add(e);
28
+ for (let e of i) n.add(e);
27
29
  }
28
30
  }
29
31
  function s(e) {
30
- t.has(e) || i.has(e) || (i.add(e), a || (a = !0, queueMicrotask(o)));
32
+ t.has(e) || r.has(e) || (r.add(e), a || (a = !0, queueMicrotask(o)));
31
33
  }
32
34
  function c(e) {
33
- return r(() => {
34
- let r = p(e), i = r ? _(r) : void 0;
35
+ return i(() => {
36
+ let r = h(e), i = r ? _(r) : void 0;
35
37
  if (!i) return {
36
38
  url: r,
37
39
  loading: !1
@@ -47,9 +49,9 @@ function v(e) {
47
49
  });
48
50
  }
49
51
  function l(e) {
50
- return r(() => {
51
- let n = p(e) ?? "";
52
- return n && n.replace(ae, (e, n) => {
52
+ return i(() => {
53
+ let n = h(e) ?? "";
54
+ return n && n.replace(ce, (e, n) => {
53
55
  let r = t.get(n);
54
56
  return r === void 0 ? (s(n), e) : r;
55
57
  });
@@ -61,32 +63,32 @@ function v(e) {
61
63
  };
62
64
  }
63
65
  var y = Symbol("shortUrlResolver");
64
- function oe(e) {
66
+ function le(e) {
65
67
  let t = v(e);
66
- return d(y, t), t;
68
+ return f(y, t), t;
67
69
  }
68
- var se = {
69
- resolve: (e) => r(() => ({
70
- url: p(e),
70
+ var ue = {
71
+ resolve: (e) => i(() => ({
72
+ url: h(e),
71
73
  loading: !1
72
74
  })),
73
- resolveText: (e) => r(() => p(e) ?? "")
75
+ resolveText: (e) => i(() => h(e) ?? "")
74
76
  };
75
- function ce() {
76
- return o(y, se);
77
+ function de() {
78
+ return s(y, ue);
77
79
  }
78
80
  //#endregion
79
81
  //#region ../../node_modules/.pnpm/remend@1.3.1/node_modules/remend/dist/index.js
80
- var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwnPropertyDescriptors, b = Object.getOwnPropertySymbols, fe = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable, x = (e, t, n) => t in e ? le(e, t, {
82
+ var fe = Object.defineProperty, pe = Object.defineProperties, me = Object.getOwnPropertyDescriptors, b = Object.getOwnPropertySymbols, he = Object.prototype.hasOwnProperty, ge = Object.prototype.propertyIsEnumerable, _e = (e, t, n) => t in e ? fe(e, t, {
81
83
  enumerable: !0,
82
84
  configurable: !0,
83
85
  writable: !0,
84
86
  value: n
85
- }) : e[t] = n, me = (e, t) => {
86
- for (var n in t ||= {}) fe.call(t, n) && x(e, n, t[n]);
87
- if (b) for (var n of b(t)) pe.call(t, n) && x(e, n, t[n]);
87
+ }) : e[t] = n, ve = (e, t) => {
88
+ for (var n in t ||= {}) he.call(t, n) && _e(e, n, t[n]);
89
+ if (b) for (var n of b(t)) ge.call(t, n) && _e(e, n, t[n]);
88
90
  return e;
89
- }, he = (e, t) => ue(e, de(t)), ge = (e) => {
91
+ }, x = (e, t) => pe(e, me(t)), ye = (e) => {
90
92
  let t = new Uint8Array(e.length + 1), n = !1, r = !1, i = 0;
91
93
  for (; i < e.length;) {
92
94
  if (e[i] === "\\" && i + 1 < e.length && e[i + 1] === "`") {
@@ -104,26 +106,26 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
104
106
  !r && e[i] === "`" && (n = !n), t[i + 1] = n || r ? 1 : 0, i += 1;
105
107
  }
106
108
  return t;
107
- }, _e = null, S = (e, t) => {
108
- let n = _e;
109
+ }, be = null, S = (e, t) => {
110
+ let n = be;
109
111
  return (n === null || n.text !== e) && (n = {
110
112
  text: e,
111
- lookup: ge(e)
112
- }, _e = n), n.lookup[Math.min(t, e.length)] === 1;
113
- }, C = (e, t) => {
113
+ lookup: ye(e)
114
+ }, be = n), n.lookup[Math.min(t, e.length)] === 1;
115
+ }, xe = (e, t) => {
114
116
  let n = e.substring(t, t + 3) === "```", r = t > 0 && e.substring(t - 1, t + 2) === "```", i = t > 1 && e.substring(t - 2, t + 1) === "```";
115
117
  return n || r || i;
116
- }, ve = (e) => {
118
+ }, Se = (e) => {
117
119
  let t = 0;
118
120
  for (let n = 0; n < e.length; n += 1) {
119
121
  if (e[n] === "\\" && n + 1 < e.length && e[n + 1] === "`") {
120
122
  n += 1;
121
123
  continue;
122
124
  }
123
- e[n] === "`" && !C(e, n) && (t += 1);
125
+ e[n] === "`" && !xe(e, n) && (t += 1);
124
126
  }
125
127
  return t;
126
- }, w = (e, t) => {
128
+ }, C = (e, t) => {
127
129
  let n = !1, r = !1, i = -1;
128
130
  for (let a = 0; a < e.length; a += 1) {
129
131
  if (e[a] === "\\" && a + 1 < e.length && e[a + 1] === "`") {
@@ -142,21 +144,21 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
142
144
  }
143
145
  }
144
146
  return !1;
145
- }, ye = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, be = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(ye, (t, n, r, i) => S(e, i) ? t : `${n}\\>${r}`), xe = /(\*\*)([^*]*\*?)$/, Se = /(__)([^_]*?)$/, Ce = /(\*\*\*)([^*]*?)$/, we = /(\*)([^*]*?)$/, Te = /(_)([^_]*?)$/, Ee = /(`)([^`]*?)$/, De = /(~~)([^~]*?)$/, T = /^[\s_~*`]*$/, Oe = /^[\s]*[-*+][\s]+$/, ke = /[\p{L}\p{N}_]/u, Ae = /^```[^`\n]*```?$/, je = /^\*{4,}$/, Me = /(__)([^_]+)_$/, Ne = /(~~)([^~]+)~$/, Pe = /~~/g, E = (e) => {
147
+ }, Ce = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, w = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ce, (t, n, r, i) => S(e, i) ? t : `${n}\\>${r}`), we = /(\*\*)([^*]*\*?)$/, Te = /(__)([^_]*?)$/, Ee = /(\*\*\*)([^*]*?)$/, De = /(\*)([^*]*?)$/, Oe = /(_)([^_]*?)$/, ke = /(`)([^`]*?)$/, Ae = /(~~)([^~]*?)$/, T = /^[\s_~*`]*$/, je = /^[\s]*[-*+][\s]+$/, Me = /[\p{L}\p{N}_]/u, Ne = /^```[^`\n]*```?$/, Pe = /^\*{4,}$/, Fe = /(__)([^_]+)_$/, Ie = /(~~)([^~]+)~$/, Le = /~~/g, E = (e) => {
146
148
  if (!e) return !1;
147
149
  let t = e.charCodeAt(0);
148
- return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || ke.test(e);
149
- }, Fe = (e, t) => {
150
+ return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || Me.test(e);
151
+ }, Re = (e, t) => {
150
152
  let n = 1;
151
153
  for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
152
154
  else if (e[r] === "[" && (--n, n === 0)) return r;
153
155
  return -1;
154
- }, Ie = (e, t) => {
156
+ }, ze = (e, t) => {
155
157
  let n = 1;
156
158
  for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
157
159
  else if (e[r] === "]" && (--n, n === 0)) return r;
158
160
  return -1;
159
- }, Le = (e) => e === "inlineLatex" || e === "blockLatex", Re = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, ze = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", D = (e, t) => {
161
+ }, Be = (e) => e === "inlineLatex" || e === "blockLatex", Ve = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, He = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", D = (e, t) => {
160
162
  let n = "none";
161
163
  for (let r = 0; r < e.length && r < t; r += 1) {
162
164
  if (e[r] === "\\" && e[r + 1] === "$") {
@@ -164,32 +166,32 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
164
166
  continue;
165
167
  }
166
168
  if (e[r] === "\\") {
167
- let t = Re(n, e[r + 1]);
169
+ let t = Ve(n, e[r + 1]);
168
170
  if (t !== null) {
169
171
  n = t, r += 1;
170
172
  continue;
171
173
  }
172
174
  }
173
- if (e[r] === "$" && !Le(n)) {
175
+ if (e[r] === "$" && !Be(n)) {
174
176
  let t = e[r + 1] === "$";
175
- n = ze(n, t), t && (r += 1);
177
+ n = He(n, t), t && (r += 1);
176
178
  }
177
179
  }
178
180
  return n !== "none";
179
- }, Be = (e, t) => {
181
+ }, Ue = (e, t) => {
180
182
  for (let n = t; n < e.length; n += 1) {
181
183
  if (e[n] === ")") return !0;
182
184
  if (e[n] === "\n") return !1;
183
185
  }
184
186
  return !1;
185
- }, Ve = (e, t) => {
187
+ }, We = (e, t) => {
186
188
  for (let n = t - 1; n >= 0; --n) {
187
189
  if (e[n] === ")") return !1;
188
- if (e[n] === "(") return n > 0 && e[n - 1] === "]" && Be(e, t);
190
+ if (e[n] === "(") return n > 0 && e[n - 1] === "]" && Ue(e, t);
189
191
  if (e[n] === "\n") return !1;
190
192
  }
191
193
  return !1;
192
- }, He = (e, t) => {
194
+ }, Ge = (e, t) => {
193
195
  for (let n = t - 1; n >= 0; --n) {
194
196
  if (e[n] === ">") return !1;
195
197
  if (e[n] === "<") {
@@ -199,7 +201,7 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
199
201
  if (e[n] === "\n") return !1;
200
202
  }
201
203
  return !1;
202
- }, Ue = (e, t, n) => {
204
+ }, O = (e, t, n) => {
203
205
  let r = 0;
204
206
  for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
205
207
  r = n + 1;
@@ -217,13 +219,13 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
217
219
  break;
218
220
  }
219
221
  return o >= 3 && !s;
220
- }, We = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ge = (e, t, n, r) => n === "\\" || We(e) && D(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), O = (e) => e === " " || e === " " || e === "\n", Ke = (e, t) => !!(e && t && E(e) && E(t)), qe = (e, t, n, r) => {
221
- let i = Ke(e, t), a = !!t && !O(t), o = !!e && !O(e);
222
+ }, Ke = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), qe = (e, t, n, r) => n === "\\" || Ke(e) && D(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), k = (e) => e === " " || e === " " || e === "\n", Je = (e, t) => !!(e && t && E(e) && E(t)), Ye = (e, t, n, r) => {
223
+ let i = Je(e, t), a = !!t && !k(t), o = !!e && !k(e);
222
224
  return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
223
225
  count: !0,
224
226
  inWordAsteriskChain: i
225
227
  } : { count: !1 };
226
- }, Je = (e) => {
228
+ }, Xe = (e) => {
227
229
  let t = 0, n = !1, r = !1, i = e.length;
228
230
  for (let a = 0; a < i; a += 1) {
229
231
  if (e[a] === "`" && a + 2 < i && e[a + 1] === "`" && e[a + 2] === "`") {
@@ -236,12 +238,12 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
236
238
  continue;
237
239
  }
238
240
  let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
239
- if (Ge(e, a, o, s)) continue;
240
- let c = qe(o, s, t, r);
241
+ if (qe(e, a, o, s)) continue;
242
+ let c = Ye(o, s, t, r);
241
243
  c.count && (t += 1, r = c.inWordAsteriskChain);
242
244
  }
243
245
  return t;
244
- }, Ye = (e, t, n, r) => !!(n === "\\" || We(e) && D(e, t) || Ve(e, t) || He(e, t) || n === "_" || r === "_" || n && r && E(n) && E(r)), Xe = (e) => {
246
+ }, Ze = (e, t, n, r) => !!(n === "\\" || Ke(e) && D(e, t) || We(e, t) || Ge(e, t) || n === "_" || r === "_" || n && r && E(n) && E(r)), Qe = (e) => {
245
247
  let t = 0, n = !1, r = e.length;
246
248
  for (let i = 0; i < r; i += 1) {
247
249
  if (e[i] === "`" && i + 2 < r && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -250,10 +252,10 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
250
252
  }
251
253
  if (n || e[i] !== "_") continue;
252
254
  let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
253
- Ye(e, i, a, o) || (t += 1);
255
+ Ze(e, i, a, o) || (t += 1);
254
256
  }
255
257
  return t;
256
- }, Ze = (e) => {
258
+ }, $e = (e) => {
257
259
  let t = 0, n = 0, r = !1;
258
260
  for (let i = 0; i < e.length; i += 1) {
259
261
  if (e[i] === "`" && i + 2 < e.length && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -263,7 +265,7 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
263
265
  r || (e[i] === "*" ? n += 1 : (n >= 3 && (t += Math.floor(n / 3)), n = 0));
264
266
  }
265
267
  return n >= 3 && (t += Math.floor(n / 3)), t;
266
- }, Qe = (e) => {
268
+ }, et = (e) => {
267
269
  let t = 0, n = !1;
268
270
  for (let r = 0; r < e.length; r += 1) {
269
271
  if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
@@ -273,7 +275,7 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
273
275
  n || e[r] === "*" && r + 1 < e.length && e[r + 1] === "*" && (t += 1, r += 1);
274
276
  }
275
277
  return t;
276
- }, $e = (e) => {
278
+ }, tt = (e) => {
277
279
  let t = 0, n = !1;
278
280
  for (let r = 0; r < e.length; r += 1) {
279
281
  if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
@@ -283,32 +285,32 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
283
285
  n || e[r] === "_" && r + 1 < e.length && e[r + 1] === "_" && (t += 1, r += 1);
284
286
  }
285
287
  return t;
286
- }, et = (e, t, n) => {
288
+ }, nt = (e, t, n) => {
287
289
  if (!t || T.test(t)) return !0;
288
290
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
289
- return Oe.test(a) && t.includes("\n") ? !0 : Ue(e, n, "*");
290
- }, tt = (e) => {
291
- let t = e.match(xe);
291
+ return je.test(a) && t.includes("\n") ? !0 : O(e, n, "*");
292
+ }, rt = (e) => {
293
+ let t = e.match(we);
292
294
  if (!t) return e;
293
295
  let n = t[2], r = e.lastIndexOf(t[1]);
294
- return S(e, r) || w(e, r) || et(e, n, r) ? e : Qe(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
295
- }, nt = (e, t, n) => {
296
+ return S(e, r) || C(e, r) || nt(e, n, r) ? e : et(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
297
+ }, it = (e, t, n) => {
296
298
  if (!t || T.test(t)) return !0;
297
299
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
298
- return Oe.test(a) && t.includes("\n") ? !0 : Ue(e, n, "_");
299
- }, rt = (e) => {
300
- let t = e.match(Se);
300
+ return je.test(a) && t.includes("\n") ? !0 : O(e, n, "_");
301
+ }, at = (e) => {
302
+ let t = e.match(Te);
301
303
  if (!t) {
302
- let t = e.match(Me);
304
+ let t = e.match(Fe);
303
305
  if (t) {
304
306
  let n = e.lastIndexOf(t[1]);
305
- if (!(S(e, n) || w(e, n)) && $e(e) % 2 == 1) return `${e}_`;
307
+ if (!(S(e, n) || C(e, n)) && tt(e) % 2 == 1) return `${e}_`;
306
308
  }
307
309
  return e;
308
310
  }
309
311
  let n = t[2], r = e.lastIndexOf(t[1]);
310
- return S(e, r) || w(e, r) || nt(e, n, r) ? e : $e(e) % 2 == 1 ? `${e}__` : e;
311
- }, it = (e) => {
312
+ return S(e, r) || C(e, r) || it(e, n, r) ? e : tt(e) % 2 == 1 ? `${e}__` : e;
313
+ }, ot = (e) => {
312
314
  let t = !1;
313
315
  for (let n = 0; n < e.length; n += 1) {
314
316
  if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
@@ -316,110 +318,110 @@ var le = Object.defineProperty, ue = Object.defineProperties, de = Object.getOwn
316
318
  continue;
317
319
  }
318
320
  if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !D(e, n)) {
319
- let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t || O(t), a = !r || O(r);
321
+ let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t || k(t), a = !r || k(r);
320
322
  if (i && a || t && r && E(t) && E(r) || a) continue;
321
323
  return n;
322
324
  }
323
325
  }
324
326
  return -1;
325
- }, at = (e) => {
326
- if (!e.match(we)) return e;
327
- let t = it(e);
328
- if (t === -1 || S(e, t) || w(e, t)) return e;
327
+ }, st = (e) => {
328
+ if (!e.match(De)) return e;
329
+ let t = ot(e);
330
+ if (t === -1 || S(e, t) || C(e, t)) return e;
329
331
  let n = e.substring(t + 1);
330
- return !n || T.test(n) ? e : Je(e) % 2 == 1 ? `${e}*` : e;
331
- }, ot = (e) => {
332
+ return !n || T.test(n) ? e : Xe(e) % 2 == 1 ? `${e}*` : e;
333
+ }, ct = (e) => {
332
334
  let t = !1;
333
335
  for (let n = 0; n < e.length; n += 1) {
334
336
  if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
335
337
  t = !t, n += 2;
336
338
  continue;
337
339
  }
338
- if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !D(e, n) && !Ve(e, n)) {
340
+ if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !D(e, n) && !We(e, n)) {
339
341
  let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
340
342
  if (t && r && E(t) && E(r)) continue;
341
343
  return n;
342
344
  }
343
345
  }
344
346
  return -1;
345
- }, st = (e) => {
347
+ }, lt = (e) => {
346
348
  let t = e.length;
347
349
  for (; t > 0 && e[t - 1] === "\n";) --t;
348
350
  return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
349
- }, ct = (e) => {
351
+ }, ut = (e) => {
350
352
  if (!e.endsWith("**")) return null;
351
353
  let t = e.slice(0, -2);
352
- if (Qe(t) % 2 != 1) return null;
353
- let n = t.indexOf("**"), r = ot(t);
354
+ if (et(t) % 2 != 1) return null;
355
+ let n = t.indexOf("**"), r = ct(t);
354
356
  return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
355
- }, lt = (e) => {
356
- if (!e.match(Te)) return e;
357
- let t = ot(e);
357
+ }, dt = (e) => {
358
+ if (!e.match(Oe)) return e;
359
+ let t = ct(e);
358
360
  if (t === -1) return e;
359
361
  let n = e.substring(t + 1);
360
- if (!n || T.test(n) || S(e, t) || w(e, t)) return e;
361
- if (Xe(e) % 2 == 1) {
362
- let t = ct(e);
363
- return t === null ? st(e) : t;
362
+ if (!n || T.test(n) || S(e, t) || C(e, t)) return e;
363
+ if (Qe(e) % 2 == 1) {
364
+ let t = ut(e);
365
+ return t === null ? lt(e) : t;
364
366
  }
365
367
  return e;
366
- }, ut = (e) => {
367
- let t = Qe(e), n = Je(e);
368
+ }, ft = (e) => {
369
+ let t = et(e), n = Xe(e);
368
370
  return t % 2 == 0 && n % 2 == 0;
369
- }, dt = (e, t, n) => !t || T.test(t) || S(e, n) || w(e, n) ? !0 : Ue(e, n, "*"), ft = (e) => {
370
- if (je.test(e)) return e;
371
- let t = e.match(Ce);
371
+ }, pt = (e, t, n) => !t || T.test(t) || S(e, n) || C(e, n) ? !0 : O(e, n, "*"), mt = (e) => {
372
+ if (Pe.test(e)) return e;
373
+ let t = e.match(Ee);
372
374
  if (!t) return e;
373
375
  let n = t[2];
374
- return dt(e, n, e.lastIndexOf(t[1])) ? e : Ze(e) % 2 == 1 ? ut(e) ? e : `${e}***` : e;
375
- }, pt = /<[a-zA-Z/][^>]*$/, mt = (e) => {
376
- let t = e.match(pt);
376
+ return pt(e, n, e.lastIndexOf(t[1])) ? e : $e(e) % 2 == 1 ? ft(e) ? e : `${e}***` : e;
377
+ }, ht = /<[a-zA-Z/][^>]*$/, gt = (e) => {
378
+ let t = e.match(ht);
377
379
  return !t || t.index === void 0 || S(e, t.index) ? e : e.substring(0, t.index).trimEnd();
378
- }, ht = (e) => !e.match(Ae) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, gt = (e) => (e.match(/```/g) || []).length % 2 == 1, _t = (e) => {
379
- let t = ht(e);
380
+ }, _t = (e) => !e.match(Ne) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, vt = (e) => (e.match(/```/g) || []).length % 2 == 1, yt = (e) => {
381
+ let t = _t(e);
380
382
  if (t !== null) return t;
381
- let n = e.match(Ee);
382
- if (n && !gt(e)) {
383
+ let n = e.match(ke);
384
+ if (n && !vt(e)) {
383
385
  let t = n[2];
384
386
  if (!t || T.test(t)) return e;
385
- if (ve(e) % 2 == 1) return `${e}\``;
387
+ if (Se(e) % 2 == 1) return `${e}\``;
386
388
  }
387
389
  return e;
388
- }, vt = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", yt = (e) => {
390
+ }, bt = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", xt = (e) => {
389
391
  let t = 0, n = !1;
390
- for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !vt(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
392
+ for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !bt(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
391
393
  return t;
392
- }, bt = (e) => {
394
+ }, St = (e) => {
393
395
  let t = 0, n = !1;
394
396
  for (let r = 0; r < e.length; r += 1) {
395
397
  if (e[r] === "\\") {
396
398
  r += 1;
397
399
  continue;
398
400
  }
399
- if (e[r] === "`" && !vt(e, r)) {
401
+ if (e[r] === "`" && !bt(e, r)) {
400
402
  n = !n;
401
403
  continue;
402
404
  }
403
405
  !n && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : t += 1);
404
406
  }
405
407
  return t;
406
- }, xt = (e) => {
408
+ }, Ct = (e) => {
407
409
  if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
408
410
  let t = e.indexOf("$$");
409
411
  return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
410
412
  $$` : `${e}$$`;
411
- }, St = (e) => yt(e) % 2 == 0 ? e : xt(e), Ct = (e) => bt(e) % 2 == 1 ? `${e}$` : e, wt = (e, t, n) => {
413
+ }, wt = (e) => xt(e) % 2 == 0 ? e : Ct(e), Tt = (e) => St(e) % 2 == 1 ? `${e}$` : e, Et = (e, t, n) => {
412
414
  if (e.substring(t + 2).includes(")")) return null;
413
- let r = Fe(e, t);
415
+ let r = Re(e, t);
414
416
  if (r === -1 || S(e, r)) return null;
415
417
  let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a);
416
418
  if (i) return o;
417
419
  let s = e.substring(r + 1, t);
418
420
  return n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
419
- }, Tt = (e, t) => {
421
+ }, Dt = (e, t) => {
420
422
  for (let n = 0; n < t; n++) if (e[n] === "[" && !S(e, n)) {
421
423
  if (n > 0 && e[n - 1] === "!") continue;
422
- let t = Ie(e, n);
424
+ let t = ze(e, n);
423
425
  if (t === -1) return n;
424
426
  if (t + 1 < e.length && e[t + 1] === "(") {
425
427
  let r = e.indexOf(")", t + 2);
@@ -427,70 +429,70 @@ $$` : `${e}$$`;
427
429
  }
428
430
  }
429
431
  return t;
430
- }, Et = (e, t, n) => {
432
+ }, Ot = (e, t, n) => {
431
433
  let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
432
434
  if (!e.substring(t + 1).includes("]")) {
433
435
  let a = e.substring(0, i);
434
436
  if (r) return a;
435
437
  if (n === "text-only") {
436
- let n = Tt(e, t);
438
+ let n = Dt(e, t);
437
439
  return e.substring(0, n) + e.substring(n + 1);
438
440
  }
439
441
  return `${e}](streamdown:incomplete-link)`;
440
442
  }
441
- if (Ie(e, t) === -1) {
443
+ if (ze(e, t) === -1) {
442
444
  let a = e.substring(0, i);
443
445
  if (r) return a;
444
446
  if (n === "text-only") {
445
- let n = Tt(e, t);
447
+ let n = Dt(e, t);
446
448
  return e.substring(0, n) + e.substring(n + 1);
447
449
  }
448
450
  return `${e}](streamdown:incomplete-link)`;
449
451
  }
450
452
  return null;
451
- }, Dt = (e, t = "protocol") => {
453
+ }, kt = (e, t = "protocol") => {
452
454
  let n = e.lastIndexOf("](");
453
455
  if (n !== -1 && !S(e, n)) {
454
- let r = wt(e, n, t);
456
+ let r = Et(e, n, t);
455
457
  if (r !== null) return r;
456
458
  }
457
459
  for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !S(e, n)) {
458
- let r = Et(e, n, t);
460
+ let r = Ot(e, n, t);
459
461
  if (r !== null) return r;
460
462
  }
461
463
  return e;
462
- }, Ot = /^-{1,2}$/, kt = /^[\s]*-{1,2}[\s]+$/, At = /^={1,2}$/, jt = /^[\s]*={1,2}[\s]+$/, Mt = (e) => {
464
+ }, At = /^-{1,2}$/, jt = /^[\s]*-{1,2}[\s]+$/, Mt = /^={1,2}$/, Nt = /^[\s]*={1,2}[\s]+$/, Pt = (e) => {
463
465
  if (!e || typeof e != "string") return e;
464
466
  let t = e.lastIndexOf("\n");
465
467
  if (t === -1) return e;
466
468
  let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
467
- if (Ot.test(i) && !n.match(kt)) {
469
+ if (At.test(i) && !n.match(jt)) {
468
470
  let t = r.split("\n").at(-1);
469
471
  if (t && t.trim().length > 0) return `${e}\u200B`;
470
472
  }
471
- if (At.test(i) && !n.match(jt)) {
473
+ if (Mt.test(i) && !n.match(Nt)) {
472
474
  let t = r.split("\n").at(-1);
473
475
  if (t && t.trim().length > 0) return `${e}\u200B`;
474
476
  }
475
477
  return e;
476
- }, Nt = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, Pt = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(Nt, (t, n, r) => S(e, r + n.length) ? t : `${n}\\~`), Ft = (e) => {
477
- let t = e.match(De);
478
+ }, Ft = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, It = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(Ft, (t, n, r) => S(e, r + n.length) ? t : `${n}\\~`), Lt = (e) => {
479
+ let t = e.match(Ae);
478
480
  if (t) {
479
481
  let n = t[2];
480
482
  if (!n || T.test(n)) return e;
481
483
  let r = e.lastIndexOf(t[1]);
482
- if (S(e, r) || w(e, r)) return e;
483
- if (e.match(Pe)?.length % 2 == 1) return `${e}~~`;
484
+ if (S(e, r) || C(e, r)) return e;
485
+ if (e.match(Le)?.length % 2 == 1) return `${e}~~`;
484
486
  } else {
485
- let t = e.match(Ne);
487
+ let t = e.match(Ie);
486
488
  if (t) {
487
489
  let n = e.lastIndexOf(t[0].slice(0, 2));
488
- if (S(e, n) || w(e, n)) return e;
489
- if (e.match(Pe)?.length % 2 == 1) return `${e}~`;
490
+ if (S(e, n) || C(e, n)) return e;
491
+ if (e.match(Le)?.length % 2 == 1) return `${e}~`;
490
492
  }
491
493
  }
492
494
  return e;
493
- }, It = (e) => e !== !1, Lt = (e) => e === !0, k = {
495
+ }, Rt = (e) => e !== !1, zt = (e) => e === !0, A = {
494
496
  SINGLE_TILDE: 0,
495
497
  COMPARISON_OPERATORS: 5,
496
498
  HTML_TAGS: 10,
@@ -506,44 +508,44 @@ $$` : `${e}$$`;
506
508
  KATEX: 70,
507
509
  INLINE_KATEX: 75,
508
510
  DEFAULT: 100
509
- }, Rt = [
511
+ }, Bt = [
510
512
  {
511
513
  handler: {
512
514
  name: "singleTilde",
513
- handle: Pt,
514
- priority: k.SINGLE_TILDE
515
+ handle: It,
516
+ priority: A.SINGLE_TILDE
515
517
  },
516
518
  optionKey: "singleTilde"
517
519
  },
518
520
  {
519
521
  handler: {
520
522
  name: "comparisonOperators",
521
- handle: be,
522
- priority: k.COMPARISON_OPERATORS
523
+ handle: w,
524
+ priority: A.COMPARISON_OPERATORS
523
525
  },
524
526
  optionKey: "comparisonOperators"
525
527
  },
526
528
  {
527
529
  handler: {
528
530
  name: "htmlTags",
529
- handle: mt,
530
- priority: k.HTML_TAGS
531
+ handle: gt,
532
+ priority: A.HTML_TAGS
531
533
  },
532
534
  optionKey: "htmlTags"
533
535
  },
534
536
  {
535
537
  handler: {
536
538
  name: "setextHeadings",
537
- handle: Mt,
538
- priority: k.SETEXT_HEADINGS
539
+ handle: Pt,
540
+ priority: A.SETEXT_HEADINGS
539
541
  },
540
542
  optionKey: "setextHeadings"
541
543
  },
542
544
  {
543
545
  handler: {
544
546
  name: "links",
545
- handle: Dt,
546
- priority: k.LINKS
547
+ handle: kt,
548
+ priority: A.LINKS
547
549
  },
548
550
  optionKey: "links",
549
551
  earlyReturn: (e) => e.endsWith("](streamdown:incomplete-link)")
@@ -551,96 +553,96 @@ $$` : `${e}$$`;
551
553
  {
552
554
  handler: {
553
555
  name: "boldItalic",
554
- handle: ft,
555
- priority: k.BOLD_ITALIC
556
+ handle: mt,
557
+ priority: A.BOLD_ITALIC
556
558
  },
557
559
  optionKey: "boldItalic"
558
560
  },
559
561
  {
560
562
  handler: {
561
563
  name: "bold",
562
- handle: tt,
563
- priority: k.BOLD
564
+ handle: rt,
565
+ priority: A.BOLD
564
566
  },
565
567
  optionKey: "bold"
566
568
  },
567
569
  {
568
570
  handler: {
569
571
  name: "italicDoubleUnderscore",
570
- handle: rt,
571
- priority: k.ITALIC_DOUBLE_UNDERSCORE
572
+ handle: at,
573
+ priority: A.ITALIC_DOUBLE_UNDERSCORE
572
574
  },
573
575
  optionKey: "italic"
574
576
  },
575
577
  {
576
578
  handler: {
577
579
  name: "italicSingleAsterisk",
578
- handle: at,
579
- priority: k.ITALIC_SINGLE_ASTERISK
580
+ handle: st,
581
+ priority: A.ITALIC_SINGLE_ASTERISK
580
582
  },
581
583
  optionKey: "italic"
582
584
  },
583
585
  {
584
586
  handler: {
585
587
  name: "italicSingleUnderscore",
586
- handle: lt,
587
- priority: k.ITALIC_SINGLE_UNDERSCORE
588
+ handle: dt,
589
+ priority: A.ITALIC_SINGLE_UNDERSCORE
588
590
  },
589
591
  optionKey: "italic"
590
592
  },
591
593
  {
592
594
  handler: {
593
595
  name: "inlineCode",
594
- handle: _t,
595
- priority: k.INLINE_CODE
596
+ handle: yt,
597
+ priority: A.INLINE_CODE
596
598
  },
597
599
  optionKey: "inlineCode"
598
600
  },
599
601
  {
600
602
  handler: {
601
603
  name: "strikethrough",
602
- handle: Ft,
603
- priority: k.STRIKETHROUGH
604
+ handle: Lt,
605
+ priority: A.STRIKETHROUGH
604
606
  },
605
607
  optionKey: "strikethrough"
606
608
  },
607
609
  {
608
610
  handler: {
609
611
  name: "katex",
610
- handle: St,
611
- priority: k.KATEX
612
+ handle: wt,
613
+ priority: A.KATEX
612
614
  },
613
615
  optionKey: "katex"
614
616
  },
615
617
  {
616
618
  handler: {
617
619
  name: "inlineKatex",
618
- handle: Ct,
619
- priority: k.INLINE_KATEX
620
+ handle: Tt,
621
+ priority: A.INLINE_KATEX
620
622
  },
621
623
  optionKey: "inlineKatex"
622
624
  }
623
- ], zt = (e) => {
625
+ ], Vt = (e) => {
624
626
  let t = e?.linkMode ?? "protocol";
625
- return Rt.filter(({ handler: t, optionKey: n }) => t.name === "links" ? It(e?.links) || It(e?.images) : t.name === "inlineKatex" ? Lt(e?.inlineKatex) : It(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
626
- handler: he(me({}, e), { handle: (e) => Dt(e, t) }),
627
+ return Bt.filter(({ handler: t, optionKey: n }) => t.name === "links" ? Rt(e?.links) || Rt(e?.images) : t.name === "inlineKatex" ? zt(e?.inlineKatex) : Rt(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
628
+ handler: x(ve({}, e), { handle: (e) => kt(e, t) }),
627
629
  earlyReturn: t === "protocol" ? n : void 0
628
630
  } : {
629
631
  handler: e,
630
632
  earlyReturn: n
631
633
  });
632
- }, Bt = (e, t) => {
634
+ }, Ht = (e, t) => {
633
635
  if (!e || typeof e != "string") return e;
634
- let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = zt(t), i = (t?.handlers ?? []).map((e) => ({
635
- handler: he(me({}, e), { priority: e.priority ?? k.DEFAULT }),
636
+ let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = Vt(t), i = (t?.handlers ?? []).map((e) => ({
637
+ handler: x(ve({}, e), { priority: e.priority ?? A.DEFAULT }),
636
638
  earlyReturn: void 0
637
639
  })), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
638
640
  for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
639
641
  return n;
640
642
  };
641
643
  //#endregion
642
- //#region ../../node_modules/.pnpm/marked@18.0.13/node_modules/marked/lib/marked.esm.js
643
- function Vt() {
644
+ //#region ../../node_modules/.pnpm/marked@18.0.14/node_modules/marked/lib/marked.esm.js
645
+ function Ut() {
644
646
  return {
645
647
  async: !1,
646
648
  breaks: !1,
@@ -654,35 +656,35 @@ function Vt() {
654
656
  walkTokens: null
655
657
  };
656
658
  }
657
- var A = Vt();
658
- function Ht(e) {
659
- A = e;
659
+ var j = Ut();
660
+ function Wt(e) {
661
+ j = e;
660
662
  }
661
- var j = { exec: () => null };
662
- function M(e) {
663
+ var M = { exec: () => null };
664
+ function N(e) {
663
665
  let t = [];
664
666
  return (n) => {
665
667
  let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
666
668
  return i || (i = e(r), t[r] = i), i;
667
669
  };
668
670
  }
669
- function N(e, t = "") {
671
+ function P(e, t = "") {
670
672
  let n = typeof e == "string" ? e : e.source, r = {
671
673
  replace: (e, t) => {
672
674
  let i = typeof t == "string" ? t : t.source;
673
- return i = i.replace(P.caret, "$1"), n = n.replace(e, i), r;
675
+ return i = i.replace(F.caret, "$1"), n = n.replace(e, i), r;
674
676
  },
675
677
  getRegex: () => new RegExp(n, t)
676
678
  };
677
679
  return r;
678
680
  }
679
- var Ut = ((e = "") => {
681
+ var Gt = ((e = "") => {
680
682
  try {
681
683
  return !!RegExp("(?<=1)(?<!1)" + e);
682
684
  } catch {
683
685
  return !1;
684
686
  }
685
- })(), P = {
687
+ })(), F = {
686
688
  codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
687
689
  outputLinkReplace: /\\([\[\]])/g,
688
690
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -694,6 +696,7 @@ var Ut = ((e = "") => {
694
696
  nonSpaceChar: /[^ ]/,
695
697
  newLineCharGlobal: /\n/g,
696
698
  tabCharGlobal: /\t/g,
699
+ leadingSpaceTab: /^[ \t]+/,
697
700
  multipleSpaceGlobal: /\s+/g,
698
701
  blankLine: /^[ \t]*$/,
699
702
  doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
@@ -720,6 +723,7 @@ var Ut = ((e = "") => {
720
723
  endAngleBracket: />$/,
721
724
  pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
722
725
  unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
726
+ numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,
723
727
  escapeTest: /[&<>"']/,
724
728
  escapeReplace: /[&<>"']/g,
725
729
  escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
@@ -734,126 +738,132 @@ var Ut = ((e = "") => {
734
738
  notSpaceStart: /^\S*/,
735
739
  endingNewline: /\n$/,
736
740
  listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
737
- nextBulletRegex: M((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
738
- hrRegex: M((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
739
- fencesBeginRegex: M((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
740
- headingBeginRegex: M((e) => RegExp(`^ {0,${e}}#`)),
741
- htmlBeginRegex: M((e) => RegExp(`^ {0,${e}}(?:</?(?:${I})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
742
- blockquoteBeginRegex: M((e) => RegExp(`^ {0,${e}}>`))
743
- }, Wt = /^(?:[ \t]*(?:\n|$))+/, Gt = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Kt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, F = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, qt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Jt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Yt = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Xt = N(Yt).replace(/bull/g, Jt).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Zt = N(Yt).replace(/bull/g, Jt).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Qt = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, $t = /^[^\n]+/, en = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, tn = N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", en).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), nn = N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Jt).getRegex(), I = "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", rn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, an = N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", rn).replace("tag", I).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), on = (e) => N(Qt).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", I).getRegex(), sn = on(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), cn = on(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), ln = {
744
- blockquote: N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", cn).getRegex(),
745
- code: Gt,
746
- def: tn,
747
- fences: Kt,
748
- heading: qt,
749
- hr: F,
750
- html: an,
751
- lheading: Xt,
752
- list: nn,
753
- newline: Wt,
754
- paragraph: sn,
755
- table: j,
756
- text: $t
757
- }, un = N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", I).getRegex(), dn = {
758
- ...ln,
759
- lheading: Zt,
760
- table: un,
761
- paragraph: N(Qt).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", un).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", I).getRegex()
762
- }, fn = {
763
- ...ln,
764
- html: N("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", rn).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(),
741
+ nextBulletRegex: N((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
742
+ hrRegex: N((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
743
+ fencesBeginRegex: N((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
744
+ headingBeginRegex: N((e) => RegExp(`^ {0,${e}}#`)),
745
+ htmlBeginRegex: N((e) => RegExp(`^ {0,${e}}(?:</?(?:${L})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
746
+ blockquoteBeginRegex: N((e) => RegExp(`^ {0,${e}}>`))
747
+ }, Kt = /^(?:[ \t]*(?:\n|$))+/, qt = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Jt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Yt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Xt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Zt = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Qt = P(Zt).replace(/bull/g, Xt).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), $t = P(Zt).replace(/bull/g, Xt).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), en = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, tn = /^[^\n]+/, nn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, rn = P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", nn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), an = P(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Xt).getRegex(), L = "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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, sn = P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", on).replace("tag", L).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), cn = (e) => P(en).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", L).getRegex(), ln = cn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), un = cn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), dn = {
748
+ blockquote: P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", un).getRegex(),
749
+ code: qt,
750
+ def: rn,
751
+ fences: Jt,
752
+ heading: Yt,
753
+ hr: I,
754
+ html: sn,
755
+ lheading: Qt,
756
+ list: an,
757
+ newline: Kt,
758
+ paragraph: ln,
759
+ table: M,
760
+ text: tn
761
+ }, fn = P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", L).getRegex(), pn = {
762
+ ...dn,
763
+ lheading: $t,
764
+ table: fn,
765
+ paragraph: P(en).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", fn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", L).getRegex()
766
+ }, mn = {
767
+ ...dn,
768
+ html: P("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", on).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(),
765
769
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
766
770
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
767
- fences: j,
771
+ fences: M,
768
772
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
769
- paragraph: N(Qt).replace("hr", F).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Xt).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
770
- }, pn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, mn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, hn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, gn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = /[\p{P}\p{S}]/u, R = /[\s\p{P}\p{S}]/u, z = /[^\s\p{P}\p{S}]/u, _n = N(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, R).getRegex(), vn = /[\p{Pi}\p{Ps}"']/u, yn = /(?!~)[\p{P}\p{S}]/u, bn = /(?!~)[\s\p{P}\p{S}]/u, xn = /(?:[^\s\p{P}\p{S}]|~)/u, Sn = N(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ut ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Cn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, wn = N(Cn, "u").replace(/punct/g, L).getRegex(), Tn = N(Cn, "u").replace(/punct/g, yn).getRegex(), En = N(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, vn).replace(/punct/g, L).getRegex(), Dn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", On = N(Dn, "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), kn = N(Dn, "gu").replace(/notPunctSpace/g, xn).replace(/punctSpace/g, bn).replace(/punct/g, yn).getRegex(), An = N("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), jn = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), Mn = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), Nn = N(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, L).getRegex(), Pn = N("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), Fn = N(/\\(punct)/, "gu").replace(/punct/g, L).getRegex(), In = N(/^<(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(), Ln = N(rn).replace("(?:-->|$)", "-->").getRegex(), Rn = N("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ln).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zn = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, B = N(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", zn).getRegex(), Bn = N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", B).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Vn = N(/^!?\[(label)\]\[(ref)\]/).replace("label", B).replace("ref", en).getRegex(), Hn = N(/^!?\[(ref)\](?:\[\])?/).replace("ref", en).getRegex(), Un = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Wn = N(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", zn).getRegex(), Gn = N("reflink|nolink(?!\\()", "g").replace("reflink", N(/^!?\[(label)\]\[(ref)\]/).replace("label", Wn).replace("ref", Un).getRegex()).replace("nolink", N(/^!?\[(ref)\](?:\[\])?/).replace("ref", Un).getRegex()).getRegex(), Kn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, qn = {
771
- _backpedal: j,
772
- anyPunctuation: Fn,
773
- autolink: In,
774
- blockSkip: Sn,
775
- br: hn,
776
- code: mn,
777
- del: j,
778
- delLDelim: j,
779
- delRDelim: j,
780
- emStrongLDelim: wn,
781
- emStrongRDelimAst: On,
782
- emStrongRDelimUnd: jn,
783
- escape: pn,
784
- link: Bn,
785
- nolink: Hn,
786
- punctuation: _n,
787
- reflink: Vn,
788
- reflinkSearch: Gn,
789
- tag: Rn,
790
- text: gn,
791
- url: j
792
- }, Jn = {
793
- ...qn,
773
+ paragraph: P(en).replace("hr", I).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Qt).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
774
+ }, hn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, gn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _n = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, vn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, R = /[\p{P}\p{S}]/u, z = /[\s\p{P}\p{S}]/u, B = /[^\s\p{P}\p{S}]/u, yn = P(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, z).getRegex(), bn = /[\p{Pi}\p{Ps}"']/u, xn = /(?!~)[\p{P}\p{S}]/u, Sn = /(?!~)[\s\p{P}\p{S}]/u, Cn = /(?:[^\s\p{P}\p{S}]|~)/u, wn = P(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Gt ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Tn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, En = P(Tn, "u").replace(/punct/g, R).getRegex(), Dn = P(Tn, "u").replace(/punct/g, xn).getRegex(), On = P(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, bn).replace(/punct/g, R).getRegex(), kn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", An = P(kn, "gu").replace(/notPunctSpace/g, B).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), jn = P(kn, "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Sn).replace(/punct/g, xn).getRegex(), Mn = P("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, B).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), Nn = P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, B).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), Pn = P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, B).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), Fn = P(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, R).getRegex(), In = P("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, B).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), Ln = P(/\\(punct)/, "gu").replace(/punct/g, R).getRegex(), Rn = P(/^<(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(), zn = P(on).replace("(?:-->|$)", "-->").getRegex(), Bn = P("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", zn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Vn = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, V = P(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Vn).getRegex(), Hn = P(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", V).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Un = P(/^!?\[(label)\]\[(ref)\]/).replace("label", V).replace("ref", nn).getRegex(), Wn = P(/^!?\[(ref)\](?:\[\])?/).replace("ref", nn).getRegex(), Gn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Kn = P(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Vn).getRegex(), qn = P("reflink|nolink(?!\\()", "g").replace("reflink", P(/^!?\[(label)\]\[(ref)\]/).replace("label", Kn).replace("ref", Gn).getRegex()).replace("nolink", P(/^!?\[(ref)\](?:\[\])?/).replace("ref", Gn).getRegex()).getRegex(), Jn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Yn = P(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), Xn = {
775
+ _backpedal: M,
776
+ anyPunctuation: Ln,
777
+ autolink: Rn,
778
+ blockSkip: wn,
779
+ br: _n,
780
+ code: gn,
781
+ del: M,
782
+ delLDelim: M,
783
+ delRDelim: M,
794
784
  emStrongLDelim: En,
795
785
  emStrongRDelimAst: An,
796
- emStrongRDelimUnd: Mn,
797
- link: N(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(),
798
- reflink: N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex()
799
- }, Yn = {
800
- ...qn,
801
- emStrongRDelimAst: kn,
802
- emStrongLDelim: Tn,
803
- delLDelim: Nn,
804
- delRDelim: Pn,
805
- url: N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Kn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
786
+ emStrongRDelimUnd: Nn,
787
+ escape: hn,
788
+ link: Hn,
789
+ nolink: Wn,
790
+ punctuation: yn,
791
+ reflink: Un,
792
+ reflinkSearch: qn,
793
+ tag: Bn,
794
+ text: vn,
795
+ url: M
796
+ }, Zn = {
797
+ ...Xn,
798
+ emStrongLDelim: On,
799
+ emStrongRDelimAst: Mn,
800
+ emStrongRDelimUnd: Pn,
801
+ link: P(/^!?\[(label)\]\((.*?)\)/).replace("label", V).getRegex(),
802
+ reflink: P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", V).getRegex()
803
+ }, Qn = {
804
+ ...Xn,
805
+ emStrongRDelimAst: jn,
806
+ emStrongLDelim: Dn,
807
+ delLDelim: Fn,
808
+ delRDelim: In,
809
+ url: P(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Yn).replace("protocol", Jn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
806
810
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
807
811
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
808
- text: N(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Kn).getRegex()
809
- }, Xn = {
810
- ...Yn,
811
- br: N(hn).replace("{2,}", "*").getRegex(),
812
- text: N(Yn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
813
- }, V = {
814
- normal: ln,
815
- gfm: dn,
816
- pedantic: fn
812
+ text: P(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Jn).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
813
+ }, $n = {
814
+ ...Qn,
815
+ br: P(_n).replace("{2,}", "*").getRegex(),
816
+ text: P(Qn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
817
817
  }, H = {
818
- normal: qn,
819
- gfm: Yn,
820
- breaks: Xn,
821
- pedantic: Jn
822
- }, Zn = {
818
+ normal: dn,
819
+ gfm: pn,
820
+ pedantic: mn
821
+ }, U = {
822
+ normal: Xn,
823
+ gfm: Qn,
824
+ breaks: $n,
825
+ pedantic: Zn
826
+ }, er = {
823
827
  "&": "&amp;",
824
828
  "<": "&lt;",
825
829
  ">": "&gt;",
826
830
  "\"": "&quot;",
827
831
  "'": "&#39;"
828
- }, Qn = (e) => Zn[e];
829
- function U(e, t) {
832
+ }, tr = (e) => er[e];
833
+ function W(e, t) {
830
834
  if (t) {
831
- if (P.escapeTest.test(e)) return e.replace(P.escapeReplace, Qn);
832
- } else if (P.escapeTestNoEncode.test(e)) return e.replace(P.escapeReplaceNoEncode, Qn);
835
+ if (F.escapeTest.test(e)) return e.replace(F.escapeReplace, tr);
836
+ } else if (F.escapeTestNoEncode.test(e)) return e.replace(F.escapeReplaceNoEncode, tr);
833
837
  return e;
834
838
  }
835
- function $n(e) {
839
+ function nr(e) {
840
+ return e.replace(F.numericCharacterReference, (e, t, n) => {
841
+ let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
842
+ return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
843
+ });
844
+ }
845
+ function rr(e) {
836
846
  try {
837
- e = encodeURI(e).replace(P.percentDecode, "%");
847
+ e = encodeURI(e).replace(F.percentDecode, "%");
838
848
  } catch {
839
849
  return null;
840
850
  }
841
851
  return e;
842
852
  }
843
- function er(e, t) {
844
- let n = e.replace(P.findPipe, (e, t, n) => {
853
+ function ir(e, t) {
854
+ let n = e.replace(F.findPipe, (e, t, n) => {
845
855
  let r = !1, i = t;
846
856
  for (; --i >= 0 && n[i] === "\\";) r = !r;
847
857
  return r ? "|" : " |";
848
- }).split(P.splitPipe), r = 0;
858
+ }).split(F.splitPipe), r = 0;
849
859
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
850
860
  if (n.length > t) n.splice(t);
851
861
  else for (; n.length < t;) n.push("");
852
862
  }
853
- for (; r < n.length; r++) n[r] = n[r].trim().replace(P.slashPipe, "|");
863
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(F.slashPipe, "|");
854
864
  return n;
855
865
  }
856
- function W(e, t, n) {
866
+ function G(e, t, n) {
857
867
  let r = e.length;
858
868
  if (r === 0) return "";
859
869
  let i = 0;
@@ -865,15 +875,15 @@ function W(e, t, n) {
865
875
  }
866
876
  return e.slice(0, r - i);
867
877
  }
868
- function tr(e) {
878
+ function ar(e) {
869
879
  let t = e.split("\n"), n = t.length - 1;
870
- for (; n >= 0 && P.blankLine.test(t[n]);) n--;
880
+ for (; n >= 0 && F.blankLine.test(t[n]);) n--;
871
881
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
872
882
  }
873
- function G(e) {
874
- return e.toLowerCase().toUpperCase().toLowerCase();
883
+ function K(e) {
884
+ return e.trim().toLowerCase().toUpperCase().toLowerCase();
875
885
  }
876
- function nr(e, t) {
886
+ function or(e, t) {
877
887
  if (e.indexOf(t[1]) === -1) return -1;
878
888
  let n = 0;
879
889
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -881,7 +891,7 @@ function nr(e, t) {
881
891
  else if (e[r] === t[1] && (n--, n < 0)) return r;
882
892
  return n > 0 ? -2 : -1;
883
893
  }
884
- function rr(e, t = 0) {
894
+ function sr(e, t = 0) {
885
895
  let n = t, r = "";
886
896
  for (let t of e) if (t === " ") {
887
897
  let e = 4 - n % 4;
@@ -889,7 +899,7 @@ function rr(e, t = 0) {
889
899
  } else r += t, n++;
890
900
  return r;
891
901
  }
892
- function ir(e, t, n, r, i) {
902
+ function cr(e, t, n, r, i) {
893
903
  let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
894
904
  r.state.inLink = !0;
895
905
  let l = r.state.linkEmitted, u = r.state.inRawBlock;
@@ -911,7 +921,7 @@ function ir(e, t, n, r, i) {
911
921
  tokens: d
912
922
  };
913
923
  }
914
- function ar(e, t, n) {
924
+ function lr(e, t, n) {
915
925
  let r = e.match(n.other.indentCodeCompensation);
916
926
  if (r === null) return t;
917
927
  let i = r[1];
@@ -922,7 +932,7 @@ function ar(e, t, n) {
922
932
  return e.slice(Math.min(r.length, i.length));
923
933
  }).join("\n");
924
934
  }
925
- function or(e, t, n, r) {
935
+ function ur(e, t, n, r) {
926
936
  if (!t.includes("<")) return !1;
927
937
  for (let i = 0; i < t.length; i++) {
928
938
  if (t[i] === "\\") {
@@ -945,12 +955,12 @@ function or(e, t, n, r) {
945
955
  }
946
956
  return !1;
947
957
  }
948
- var K = class {
958
+ var q = class {
949
959
  options;
950
960
  rules;
951
961
  lexer;
952
962
  constructor(e) {
953
- this.options = e || A;
963
+ this.options = e || j;
954
964
  }
955
965
  space(e) {
956
966
  let t = this.rules.block.newline.exec(e);
@@ -962,7 +972,7 @@ var K = class {
962
972
  code(e) {
963
973
  let t = this.rules.block.code.exec(e);
964
974
  if (t) {
965
- let e = this.options.pedantic ? t[0] : tr(t[0]);
975
+ let e = this.options.pedantic ? t[0] : ar(t[0]);
966
976
  return {
967
977
  type: "code",
968
978
  raw: e,
@@ -974,7 +984,7 @@ var K = class {
974
984
  fences(e) {
975
985
  let t = this.rules.block.fences.exec(e);
976
986
  if (t) {
977
- let e = t[0], n = ar(e, t[3] || "", this.rules);
987
+ let e = t[0], n = lr(e, t[3] || "", this.rules);
978
988
  return {
979
989
  type: "code",
980
990
  raw: e,
@@ -988,12 +998,12 @@ var K = class {
988
998
  if (t) {
989
999
  let e = t[2].trim();
990
1000
  if (this.rules.other.endingHash.test(e)) {
991
- let t = W(e, "#");
1001
+ let t = G(e, "#");
992
1002
  (this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
993
1003
  }
994
1004
  return {
995
1005
  type: "heading",
996
- raw: W(t[0], "\n"),
1006
+ raw: G(t[0], "\n"),
997
1007
  depth: t[1].length,
998
1008
  text: e,
999
1009
  tokens: this.lexer.inline(e)
@@ -1004,13 +1014,13 @@ var K = class {
1004
1014
  let t = this.rules.block.hr.exec(e);
1005
1015
  if (t) return {
1006
1016
  type: "hr",
1007
- raw: W(t[0], "\n")
1017
+ raw: G(t[0], "\n")
1008
1018
  };
1009
1019
  }
1010
1020
  blockquote(e) {
1011
1021
  let t = this.rules.block.blockquote.exec(e);
1012
1022
  if (t) {
1013
- let e = W(t[0], "\n").split("\n"), n = "", r = "", i = [];
1023
+ let e = G(t[0], "\n").split("\n"), n = "", r = "", i = [];
1014
1024
  for (; e.length > 0;) {
1015
1025
  let t = !1, a = [], o = 0;
1016
1026
  for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
@@ -1027,8 +1037,10 @@ ${c}` : c;
1027
1037
  if (u?.type === "code") break;
1028
1038
  if (u?.type === "blockquote") {
1029
1039
  let t = u, a = e.join("\n"), o = t.raw + "\n" + a.replace(this.rules.other.blockquoteSetextReplace2, ""), s = this.blockquote(o);
1030
- i[i.length - 1] = s, n = `${n}
1031
- ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1040
+ i[i.length - 1] = s;
1041
+ let c = o.substring(s.raw.length).replace(/^\n/, ""), l = c ? c.split("\n").length : 0, d = l ? e.slice(0, -l) : e;
1042
+ d.length > 0 && (n = `${n}
1043
+ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1032
1044
  break;
1033
1045
  }
1034
1046
  if (u?.type === "list") {
@@ -1062,18 +1074,18 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1062
1074
  let n = !1, r = "", s = "";
1063
1075
  if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
1064
1076
  r = t[0], e = e.substring(r.length);
1065
- let c = rr(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
1066
- if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
1067
- let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
1077
+ let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? sr(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => sr(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
1078
+ if (this.options.pedantic ? (p = 2, s = u.trimStart()) : f ? p = l + 1 : (p = u.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = u.slice(p), p += l), f && this.rules.other.blankLine.test(d) && (r += d + "\n", e = e.substring(d.length + 1), n = !0), !n) {
1079
+ let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), c = this.rules.other.blockquoteBeginRegex(p);
1068
1080
  for (; e;) {
1069
- let p = e.split("\n", 1)[0], m;
1070
- if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
1071
- if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
1081
+ let l = e.split("\n", 1)[0], m;
1082
+ if (d = l, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), m = d) : m = d.replace(this.rules.other.leadingSpaceTab, (e) => e.replace(this.rules.other.tabCharGlobal, " ")), i.test(d) || a.test(d) || o.test(d) || c.test(d) || t.test(d) || n.test(d)) break;
1083
+ if (m.search(this.rules.other.nonSpaceChar) >= p || !d.trim()) s += "\n" + m.slice(p);
1072
1084
  else {
1073
- if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
1074
- s += "\n" + l;
1085
+ if (f || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(u) || a.test(u) || n.test(u)) break;
1086
+ s += "\n" + d;
1075
1087
  }
1076
- u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
1088
+ f = !d.trim(), r += l + "\n", e = e.substring(l.length + 1), u = m.slice(p);
1077
1089
  }
1078
1090
  }
1079
1091
  i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
@@ -1127,7 +1139,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1127
1139
  html(e) {
1128
1140
  let t = this.rules.block.html.exec(e);
1129
1141
  if (t) {
1130
- let e = tr(t[0]);
1142
+ let e = ar(t[0]);
1131
1143
  return {
1132
1144
  type: "html",
1133
1145
  block: !0,
@@ -1140,11 +1152,11 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1140
1152
  def(e) {
1141
1153
  let t = this.rules.block.def.exec(e);
1142
1154
  if (t) {
1143
- let e = G(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
1155
+ let e = K(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
1144
1156
  return {
1145
1157
  type: "def",
1146
1158
  tag: e,
1147
- raw: W(t[0], "\n"),
1159
+ raw: G(t[0], "\n"),
1148
1160
  href: n,
1149
1161
  title: r
1150
1162
  };
@@ -1153,9 +1165,9 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1153
1165
  table(e) {
1154
1166
  let t = this.rules.block.table.exec(e);
1155
1167
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1156
- let n = er(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1168
+ let n = ir(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1157
1169
  type: "table",
1158
- raw: W(t[0], "\n"),
1170
+ raw: G(t[0], "\n"),
1159
1171
  header: [],
1160
1172
  align: [],
1161
1173
  rows: []
@@ -1168,7 +1180,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1168
1180
  header: !0,
1169
1181
  align: a.align[e]
1170
1182
  });
1171
- for (let e of i) a.rows.push(er(e, a.header.length).map((e, t) => ({
1183
+ for (let e of i) a.rows.push(ir(e, a.header.length).map((e, t) => ({
1172
1184
  text: e,
1173
1185
  tokens: this.lexer.inline(e),
1174
1186
  header: !1,
@@ -1183,7 +1195,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1183
1195
  let e = t[1].trim();
1184
1196
  return {
1185
1197
  type: "heading",
1186
- raw: W(t[0], "\n"),
1198
+ raw: G(t[0], "\n"),
1187
1199
  depth: t[2].charAt(0) === "=" ? 1 : 2,
1188
1200
  text: e,
1189
1201
  tokens: this.lexer.inline(e)
@@ -1234,14 +1246,14 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1234
1246
  let t = this.rules.inline.link.exec(e);
1235
1247
  if (t) {
1236
1248
  let n = t[0].charAt(0) === "!" ? 2 : 1;
1237
- if (!this.options.pedantic && or(e, t[1], n, this.rules)) return;
1249
+ if (!this.options.pedantic && ur(e, t[1], n, this.rules)) return;
1238
1250
  let r = t[2].trim();
1239
1251
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
1240
1252
  if (!this.rules.other.endAngleBracket.test(r)) return;
1241
- let e = W(r.slice(0, -1), "\\");
1253
+ let e = G(r.slice(0, -1), "\\");
1242
1254
  if ((r.length - e.length) % 2 == 0) return;
1243
1255
  } else {
1244
- let e = nr(t[2], "()");
1256
+ let e = or(t[2], "()");
1245
1257
  if (e === -2) return;
1246
1258
  if (e > -1) {
1247
1259
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
@@ -1253,7 +1265,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1253
1265
  let e = this.rules.other.pedanticHrefTitle.exec(i);
1254
1266
  e && (i = e[1], a = e[3]);
1255
1267
  } else a = t[3] ? t[3].slice(1, -1) : "";
1256
- return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), ir(t, {
1268
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), cr(t, {
1257
1269
  href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
1258
1270
  title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
1259
1271
  }, t[0], this.lexer, this.rules);
@@ -1263,8 +1275,8 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1263
1275
  let n;
1264
1276
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
1265
1277
  let r = n[0].charAt(0) === "!" ? 2 : 1;
1266
- if (!this.options.pedantic && or(e, n[1], r, this.rules)) return;
1267
- let i = t[G((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1278
+ if (!this.options.pedantic && ur(e, n[1], r, this.rules)) return;
1279
+ let i = t[K((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1268
1280
  if (!i) {
1269
1281
  let e = n[0].charAt(0);
1270
1282
  return {
@@ -1273,7 +1285,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1273
1285
  text: e
1274
1286
  };
1275
1287
  }
1276
- return ir(n, i, n[0], this.lexer, this.rules);
1288
+ return cr(n, i, n[0], this.lexer, this.rules);
1277
1289
  }
1278
1290
  }
1279
1291
  emStrong(e, t, n = "") {
@@ -1406,35 +1418,35 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1406
1418
  return {
1407
1419
  type: "text",
1408
1420
  raw: t[0],
1409
- text: t[0],
1421
+ text: e ? t[0] : nr(t[0]),
1410
1422
  escaped: e
1411
1423
  };
1412
1424
  }
1413
1425
  }
1414
- }, q = class e {
1426
+ }, J = class e {
1415
1427
  tokens;
1416
1428
  options;
1417
1429
  state;
1418
1430
  inlineQueue;
1419
1431
  tokenizer;
1420
1432
  constructor(e) {
1421
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || A, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1433
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || j, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1422
1434
  inLink: !1,
1423
1435
  inRawBlock: !1,
1424
1436
  linkEmitted: !1,
1425
1437
  top: !0
1426
1438
  };
1427
1439
  let t = {
1428
- other: P,
1429
- block: V.normal,
1430
- inline: H.normal
1440
+ other: F,
1441
+ block: H.normal,
1442
+ inline: U.normal
1431
1443
  };
1432
- this.options.pedantic ? (t.block = V.pedantic, t.inline = H.pedantic) : this.options.gfm && (t.block = V.gfm, t.inline = this.options.breaks ? H.breaks : H.gfm), this.tokenizer.rules = t;
1444
+ this.options.pedantic ? (t.block = H.pedantic, t.inline = U.pedantic) : this.options.gfm && (t.block = H.gfm, t.inline = this.options.breaks ? U.breaks : U.gfm), this.tokenizer.rules = t;
1433
1445
  }
1434
1446
  static get rules() {
1435
1447
  return {
1436
- block: V,
1437
- inline: H
1448
+ block: H,
1449
+ inline: U
1438
1450
  };
1439
1451
  }
1440
1452
  static lex(t, n) {
@@ -1444,7 +1456,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1444
1456
  return new e(n).inlineTokens(t);
1445
1457
  }
1446
1458
  lex(e) {
1447
- e = e.replace(P.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1459
+ e = e.replace(F.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1448
1460
  for (let e = 0; e < this.inlineQueue.length; e++) {
1449
1461
  let t = this.inlineQueue[e];
1450
1462
  this.inlineTokens(t.src, t.tokens);
@@ -1452,7 +1464,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1452
1464
  return this.inlineQueue = [], this.tokens;
1453
1465
  }
1454
1466
  blockTokens(e, t = [], n = !1) {
1455
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(P.tabCharGlobal, " ").replace(P.spaceLine, ""));
1467
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(F.tabCharGlobal, " ").replace(F.spaceLine, ""));
1456
1468
  let r = 1 / 0;
1457
1469
  for (; e;) {
1458
1470
  if (e.length < r) r = e.length;
@@ -1552,7 +1564,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1552
1564
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
1553
1565
  for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
1554
1566
  let e = t[0], n = e.lastIndexOf("[");
1555
- if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, G(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1567
+ if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, K(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1556
1568
  }
1557
1569
  return !1;
1558
1570
  }
@@ -1562,7 +1574,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1562
1574
  if (this.tokens.links && e.includes("[")) {
1563
1575
  let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
1564
1576
  let r = n.lastIndexOf("[");
1565
- if (!Object.hasOwn(this.tokens.links, G(n.slice(r + 1, -1)))) return n;
1577
+ if (!Object.hasOwn(this.tokens.links, K(n.slice(r + 1, -1)))) return n;
1566
1578
  if (r > 1 && n.charAt(0) !== "!") {
1567
1579
  let i = n.slice(1, r - 1);
1568
1580
  if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
@@ -1652,18 +1664,18 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1652
1664
  if (this.options.silent) console.error(t);
1653
1665
  else throw Error(t);
1654
1666
  }
1655
- }, J = class {
1667
+ }, Y = class {
1656
1668
  options;
1657
1669
  parser;
1658
1670
  constructor(e) {
1659
- this.options = e || A;
1671
+ this.options = e || j;
1660
1672
  }
1661
1673
  space(e) {
1662
1674
  return "";
1663
1675
  }
1664
1676
  code({ text: e, lang: t, escaped: n }) {
1665
- let r = (t || "").match(P.notSpaceStart)?.[0], i = e ? e.replace(P.endingNewline, "") + "\n" : "";
1666
- return r ? "<pre><code class=\"language-" + U(r) + "\">" + (n ? i : U(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : U(i, !0)) + "</code></pre>\n";
1677
+ let r = (t || "").match(F.notSpaceStart)?.[0], i = e ? e.replace(F.endingNewline, "") + "\n" : "";
1678
+ return r ? "<pre><code class=\"language-" + W(r) + "\">" + (n ? i : W(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : W(i, !0)) + "</code></pre>\n";
1667
1679
  }
1668
1680
  blockquote({ tokens: e }) {
1669
1681
  return `<blockquote>
@@ -1733,7 +1745,7 @@ ${e}</tr>
1733
1745
  return `<em>${this.parser.parseInline(e)}</em>`;
1734
1746
  }
1735
1747
  codespan({ text: e }) {
1736
- return `<code>${U(e, !0)}</code>`;
1748
+ return `<code>${W(e, !0)}</code>`;
1737
1749
  }
1738
1750
  br(e) {
1739
1751
  return "<br>";
@@ -1742,24 +1754,24 @@ ${e}</tr>
1742
1754
  return `<del>${this.parser.parseInline(e)}</del>`;
1743
1755
  }
1744
1756
  link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
1745
- let a = i ? U(n, !0) : this.parser.parseInline(r), o = $n(e);
1757
+ let a = i ? W(n, !0) : this.parser.parseInline(r), o = rr(e);
1746
1758
  if (o === null) return a;
1747
- e = U(o, i);
1759
+ e = W(o, i);
1748
1760
  let s = "<a href=\"" + e + "\"";
1749
- return t && (s += " title=\"" + U(t) + "\""), s += ">" + a + "</a>", s;
1761
+ return t && (s += " title=\"" + W(t) + "\""), s += ">" + a + "</a>", s;
1750
1762
  }
1751
1763
  image({ href: e, title: t, text: n, tokens: r }) {
1752
1764
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1753
- let i = $n(e);
1754
- if (i === null) return U(n);
1765
+ let i = rr(e);
1766
+ if (i === null) return W(n);
1755
1767
  e = i;
1756
- let a = `<img src="${U(e)}" alt="${U(n)}"`;
1757
- return t && (a += ` title="${U(t)}"`), a += ">", a;
1768
+ let a = `<img src="${W(e)}" alt="${W(n)}"`;
1769
+ return t && (a += ` title="${W(t)}"`), a += ">", a;
1758
1770
  }
1759
1771
  text(e) {
1760
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : U(e.text);
1772
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : W(e.text);
1761
1773
  }
1762
- }, Y = class {
1774
+ }, dr = class {
1763
1775
  strong({ text: e }) {
1764
1776
  return e;
1765
1777
  }
@@ -1795,7 +1807,7 @@ ${e}</tr>
1795
1807
  renderer;
1796
1808
  textRenderer;
1797
1809
  constructor(e) {
1798
- this.options = e || A, this.options.renderer = this.options.renderer || new J(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
1810
+ this.options = e || j, this.options.renderer = this.options.renderer || new Y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new dr();
1799
1811
  }
1800
1812
  static parse(t, n) {
1801
1813
  return new e(n).parse(t);
@@ -1947,7 +1959,7 @@ ${e}</tr>
1947
1959
  options;
1948
1960
  block;
1949
1961
  constructor(e) {
1950
- this.options = e || A;
1962
+ this.options = e || j;
1951
1963
  }
1952
1964
  static passThroughHooks = /* @__PURE__ */ new Set([
1953
1965
  "preprocess",
@@ -1973,21 +1985,21 @@ ${e}</tr>
1973
1985
  return e;
1974
1986
  }
1975
1987
  provideLexer(e = this.block) {
1976
- return e ? q.lex : q.lexInline;
1988
+ return e ? J.lex : J.lexInline;
1977
1989
  }
1978
1990
  provideParser(e = this.block) {
1979
1991
  return e ? X.parse : X.parseInline;
1980
1992
  }
1981
1993
  }, Q = new class {
1982
- defaults = Vt();
1994
+ defaults = Ut();
1983
1995
  options = this.setOptions;
1984
1996
  parse = this.parseMarkdown(!0);
1985
1997
  parseInline = this.parseMarkdown(!1);
1986
1998
  Parser = X;
1987
- Renderer = J;
1988
- TextRenderer = Y;
1989
- Lexer = q;
1990
- Tokenizer = K;
1999
+ Renderer = Y;
2000
+ TextRenderer = dr;
2001
+ Lexer = J;
2002
+ Tokenizer = q;
1991
2003
  Hooks = Z;
1992
2004
  constructor(...e) {
1993
2005
  this.use(...e);
@@ -2039,7 +2051,7 @@ ${e}</tr>
2039
2051
  }
2040
2052
  "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
2041
2053
  }), n.extensions = t), e.renderer) {
2042
- let t = this.defaults.renderer || new J(this.defaults);
2054
+ let t = this.defaults.renderer || new Y(this.defaults);
2043
2055
  for (let n in e.renderer) {
2044
2056
  if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
2045
2057
  if (["options", "parser"].includes(n)) continue;
@@ -2052,7 +2064,7 @@ ${e}</tr>
2052
2064
  n.renderer = t;
2053
2065
  }
2054
2066
  if (e.tokenizer) {
2055
- let t = this.defaults.tokenizer || new K(this.defaults);
2067
+ let t = this.defaults.tokenizer || new q(this.defaults);
2056
2068
  for (let n in e.tokenizer) {
2057
2069
  if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
2058
2070
  if ([
@@ -2112,7 +2124,7 @@ ${e}</tr>
2112
2124
  }, this;
2113
2125
  }
2114
2126
  lexer(e, t) {
2115
- return q.lex(e, t ?? this.defaults);
2127
+ return J.lex(e, t ?? this.defaults);
2116
2128
  }
2117
2129
  parser(e, t) {
2118
2130
  return X.parse(e, t ?? this.defaults);
@@ -2127,14 +2139,14 @@ ${e}</tr>
2127
2139
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
2128
2140
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
2129
2141
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
2130
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
2142
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? J.lex : J.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
2131
2143
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
2132
2144
  let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? X.parse : X.parseInline)(a, i);
2133
2145
  return i.hooks ? await i.hooks.postprocess(o) : o;
2134
2146
  })().catch(a);
2135
2147
  try {
2136
2148
  i.hooks && (t = i.hooks.preprocess(t));
2137
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(t, i);
2149
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? J.lex : J.lexInline)(t, i);
2138
2150
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
2139
2151
  let r = (i.hooks ? i.hooks.provideParser(e) : e ? X.parse : X.parseInline)(n, i);
2140
2152
  return i.hooks && (r = i.hooks.postprocess(r)), r;
@@ -2146,7 +2158,7 @@ ${e}</tr>
2146
2158
  onError(e, t) {
2147
2159
  return (n) => {
2148
2160
  if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
2149
- let e = "<p>An error occurred:</p><pre>" + U(n.message + "", !0) + "</pre>";
2161
+ let e = "<p>An error occurred:</p><pre>" + W(n.message + "", !0) + "</pre>";
2150
2162
  return t ? Promise.resolve(e) : e;
2151
2163
  }
2152
2164
  if (t) return Promise.reject(n);
@@ -2158,17 +2170,17 @@ function $(e, t) {
2158
2170
  return Q.parse(e, t);
2159
2171
  }
2160
2172
  $.options = $.setOptions = function(e) {
2161
- return Q.setOptions(e), $.defaults = Q.defaults, Ht($.defaults), $;
2162
- }, $.getDefaults = Vt, $.defaults = A;
2163
- function sr(...e) {
2164
- return Q.use(...e), $.defaults = Q.defaults, Ht($.defaults), $;
2173
+ return Q.setOptions(e), $.defaults = Q.defaults, Wt($.defaults), $;
2174
+ }, $.getDefaults = Ut, $.defaults = j;
2175
+ function fr(...e) {
2176
+ return Q.use(...e), $.defaults = Q.defaults, Wt($.defaults), $;
2165
2177
  }
2166
- $.use = sr, $.walkTokens = function(e, t) {
2178
+ $.use = fr, $.walkTokens = function(e, t) {
2167
2179
  return Q.walkTokens(e, t);
2168
- }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.walkTokens, $.parseInline, X.parse, q.lex;
2180
+ }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = Y, $.TextRenderer = dr, $.Lexer = J, $.lexer = J.lex, $.Tokenizer = q, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.walkTokens, $.parseInline, X.parse, J.lex;
2169
2181
  //#endregion
2170
2182
  //#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
2171
- var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2183
+ var pr = ["innerHTML"], mr = 100, hr = /* @__PURE__ */ o({
2172
2184
  __name: "PkStreamingMarkdown",
2173
2185
  props: {
2174
2186
  markdown: { default: "" },
@@ -2181,23 +2193,24 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2181
2193
  isDark: {
2182
2194
  type: Boolean,
2183
2195
  default: !1
2184
- }
2196
+ },
2197
+ tailLength: { default: void 0 }
2185
2198
  },
2186
- setup(a) {
2187
- let o = a, { t: d } = ee({ useScope: "global" }), f = null;
2188
- function p() {
2189
- return f ||= import("beautiful-mermaid"), f;
2199
+ setup(o) {
2200
+ let s = o, { t: f } = te({ useScope: "global" }), p = null;
2201
+ function h() {
2202
+ return p ||= import("beautiful-mermaid"), p;
2190
2203
  }
2191
- let g = null;
2192
- function te() {
2193
- return g ||= import("katex").then((e) => e.default), g;
2204
+ let re = null;
2205
+ function ie() {
2206
+ return re ||= import("katex").then((e) => e.default), re;
2194
2207
  }
2195
- let ne = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ie = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
2196
- function ae(e) {
2208
+ let ae = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, se = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
2209
+ function ce(e) {
2197
2210
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2198
2211
  }
2199
2212
  function _(e, t) {
2200
- return `<span class="katex-pending" data-katex="${ae(e)}" data-display="${t}"></span>`;
2213
+ return `<span class="katex-pending" data-katex="${ce(e)}" data-display="${t}"></span>`;
2201
2214
  }
2202
2215
  $.use({ extensions: [{
2203
2216
  name: "inlineKatex",
@@ -2207,7 +2220,7 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2207
2220
  if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
2208
2221
  },
2209
2222
  tokenizer(e) {
2210
- let t = e.match(ne);
2223
+ let t = e.match(ae);
2211
2224
  if (t) return {
2212
2225
  type: "inlineKatex",
2213
2226
  raw: t[0],
@@ -2222,7 +2235,7 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2222
2235
  name: "blockKatex",
2223
2236
  level: "block",
2224
2237
  tokenizer(e) {
2225
- let t = e.match(ie);
2238
+ let t = e.match(se);
2226
2239
  if (t) return {
2227
2240
  type: "blockKatex",
2228
2241
  raw: t[0],
@@ -2252,22 +2265,22 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2252
2265
  return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
2253
2266
  }
2254
2267
  }] });
2255
- let v = new $.Renderer(), y = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), oe = /^(?:javascript|data|vbscript|file):/i;
2268
+ let v = new $.Renderer(), y = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), le = /^(?:javascript|data|vbscript|file):/i;
2256
2269
  v.link = function({ href: e, title: t, tokens: r }) {
2257
2270
  let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
2258
- if (!a || oe.test(a)) return i;
2271
+ if (!a || le.test(a)) return i;
2259
2272
  let o = t ? ` title="${y(t)}"` : "", s = n(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
2260
2273
  return `<a href="${y(a)}"${o}${s}>${i}</a>`;
2261
2274
  }, v.table = function(e) {
2262
2275
  return `<div class="table-wrapper">${$.Renderer.prototype.table.call(this, e)}</div>`;
2263
2276
  };
2264
- let se = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
2265
- v.code = ({ text: e }) => se.test(e) ? `<pre class="mermaid">${e}</pre>` : `<pre><code>${e}</code></pre>`;
2266
- function le(e) {
2277
+ let ue = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
2278
+ v.code = ({ text: e }) => ue.test(e) ? `<pre class="mermaid">${e}</pre>` : `<pre><code>${e}</code></pre>`;
2279
+ function fe(e) {
2267
2280
  return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
2268
2281
  }
2269
- function ue(e) {
2270
- let t = /* @__PURE__ */ new Set(), n = /^(`{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
2282
+ function pe(e) {
2283
+ let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
2271
2284
  for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
2272
2285
  return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
2273
2286
  if (t.has(r)) return e;
@@ -2278,25 +2291,25 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2278
2291
  }
2279
2292
  }).replace(/\n{3,}/g, "\n\n");
2280
2293
  }
2281
- let de = [
2282
- re,
2283
- ue,
2284
- Bt,
2285
- le
2286
- ], b = m("container"), { resolveText: fe } = ce(), pe = fe(() => o.markdown), x = r(() => {
2287
- let e = de.reduce((e, t) => t(e), pe.value);
2294
+ let me = [
2295
+ oe,
2296
+ pe,
2297
+ Ht,
2298
+ fe
2299
+ ], b = ee("container"), he = ne(m(s, "markdown"), mr), ge = i(() => s.tailLength ? r(he.value, s.tailLength) : he.value), { resolveText: _e } = de(), ve = _e(ge), x = i(() => {
2300
+ let e = me.reduce((e, t) => t(e), ve.value);
2288
2301
  return $.parse(e, {
2289
2302
  async: !1,
2290
2303
  breaks: !0,
2291
2304
  renderer: v
2292
2305
  });
2293
2306
  });
2294
- async function me() {
2295
- if (o.loading) return;
2296
- await s();
2307
+ async function ye() {
2308
+ if (s.loading) return;
2309
+ await c();
2297
2310
  let e = b.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
2298
2311
  if (!e?.length) return;
2299
- let { renderMermaidSVG: t, THEMES: n } = await p(), r = o.isDark ? n["github-dark"] : n["github-light"];
2312
+ let { renderMermaidSVG: t, THEMES: n } = await h(), r = s.isDark ? n["github-dark"] : n["github-light"];
2300
2313
  for (let n of Array.from(e)) {
2301
2314
  if (!n.isConnected) continue;
2302
2315
  let e = n.textContent?.trim();
@@ -2306,18 +2319,18 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2306
2319
  } catch {}
2307
2320
  }
2308
2321
  }
2309
- async function he() {
2310
- await s();
2322
+ async function be() {
2323
+ await c();
2311
2324
  let e = b.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
2312
2325
  if (!e?.length) return;
2313
2326
  let t = (await import("highlight.js/lib/common")).default;
2314
2327
  for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
2315
2328
  }
2316
- async function ge() {
2317
- await s();
2329
+ async function S() {
2330
+ await c();
2318
2331
  let n = b.value?.querySelectorAll(".katex-pending");
2319
2332
  if (!n?.length) return;
2320
- let r = await te();
2333
+ let r = await ie();
2321
2334
  e("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", t(b.value));
2322
2335
  for (let e of Array.from(n)) {
2323
2336
  if (!e.isConnected) continue;
@@ -2332,11 +2345,11 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2332
2345
  } catch {}
2333
2346
  }
2334
2347
  }
2335
- async function _e() {
2336
- await s();
2348
+ async function xe() {
2349
+ await c();
2337
2350
  let e = b.value?.querySelectorAll("pre.mermaid[data-rendered]");
2338
2351
  if (!e?.length) return;
2339
- let { renderMermaidSVG: t, THEMES: n } = await p(), r = o.isDark ? n["github-dark"] : n["github-light"];
2352
+ let { renderMermaidSVG: t, THEMES: n } = await h(), r = s.isDark ? n["github-dark"] : n["github-light"];
2340
2353
  for (let n of Array.from(e)) {
2341
2354
  if (!n.isConnected) continue;
2342
2355
  let e = n.dataset.code;
@@ -2345,22 +2358,22 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2345
2358
  } catch {}
2346
2359
  }
2347
2360
  }
2348
- function S(e) {
2361
+ function Se(e) {
2349
2362
  let t = e.target;
2350
2363
  if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
2351
2364
  t.dataset.broken = "true";
2352
2365
  let n = document.createElement("span");
2353
- n.className = "markdown-broken-image", n.textContent = t.alt || d("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
2366
+ n.className = "markdown-broken-image", n.textContent = t.alt || f("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
2354
2367
  }
2355
- l(() => {
2356
- b.value?.addEventListener("error", S, !0);
2357
- }), c(() => {
2358
- b.value?.removeEventListener("error", S, !0);
2359
- }), h([x, () => o.loading], me, { immediate: !0 }), h(() => o.isDark, _e), h(x, he, { immediate: !0 }), h(x, ge, { immediate: !0 });
2368
+ u(() => {
2369
+ b.value?.addEventListener("error", Se, !0);
2370
+ }), l(() => {
2371
+ b.value?.removeEventListener("error", Se, !0);
2372
+ }), g([x, () => s.loading], ye, { immediate: !0 }), g(() => s.isDark, xe), g(x, be, { immediate: !0 }), g(x, S, { immediate: !0 });
2360
2373
  let C = 0;
2361
- function ve(e, t) {
2374
+ function Ce(e, t) {
2362
2375
  let n = document.createElement("span");
2363
- return n.style.cssText = `animation:ft-${o.animation} ${o.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
2376
+ return n.style.cssText = `animation:ft-${s.animation} ${s.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
2364
2377
  let t = n.parentNode;
2365
2378
  t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
2366
2379
  }, { once: !0 }), n;
@@ -2372,20 +2385,20 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2372
2385
  t.insertBefore(document.createTextNode(e), n);
2373
2386
  continue;
2374
2387
  }
2375
- t.insertBefore(ve(e, i * 30), n), i++;
2388
+ t.insertBefore(Ce(e, i * 30), n), i++;
2376
2389
  }
2377
2390
  return i;
2378
2391
  }
2379
- function ye(e) {
2392
+ function we(e) {
2380
2393
  let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
2381
2394
  return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2382
2395
  } }), n = [];
2383
2396
  for (; t.nextNode();) n.push(t.currentNode);
2384
2397
  return n;
2385
2398
  }
2386
- function be() {
2387
- if (!b.value || !o.loading || !o.animation) return;
2388
- let e = ye(b.value), t = 0, n = 0;
2399
+ function Te() {
2400
+ if (!b.value || !s.loading || !s.animation) return;
2401
+ let e = we(b.value), t = 0, n = 0;
2389
2402
  for (let r of e) {
2390
2403
  let e = r.textContent || "", i = t, a = t + e.length;
2391
2404
  if (t = a, a <= C) continue;
@@ -2401,17 +2414,17 @@ var cr = ["innerHTML"], lr = /* @__PURE__ */ a({
2401
2414
  }
2402
2415
  C = t;
2403
2416
  }
2404
- return h(x, async () => {
2405
- await s(), be();
2406
- }, { immediate: !0 }), h(() => o.markdown, (e, t) => {
2417
+ return g(x, async () => {
2418
+ await c(), Te();
2419
+ }, { immediate: !0 }), g(() => s.markdown, (e, t) => {
2407
2420
  (!e || t && e.length < t.length) && (C = 0);
2408
- }), (e, t) => (u(), i("div", {
2421
+ }), (e, t) => (d(), a("div", {
2409
2422
  ref: "container",
2410
2423
  innerHTML: x.value
2411
- }, null, 8, cr));
2424
+ }, null, 8, pr));
2412
2425
  }
2413
2426
  });
2414
2427
  //#endregion
2415
- export { oe as n, ce as r, lr as t };
2428
+ export { le as n, de as r, hr as t };
2416
2429
 
2417
- //# sourceMappingURL=PkStreamingMarkdown-D8_LwZMR.js.map
2430
+ //# sourceMappingURL=PkStreamingMarkdown-D0IOaETI.js.map