@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.
- package/README.md +1 -0
- package/dist/_chunks/{Agent-Su_LDF9_.js → Agent-tE7ZJPxG.js} +80 -78
- package/dist/_chunks/Agent-tE7ZJPxG.js.map +1 -0
- package/dist/_chunks/{Document-DecVclEe.js → Document-Bmx6774B.js} +33 -21
- package/dist/_chunks/Document-Bmx6774B.js.map +1 -0
- package/dist/_chunks/Media-Cft7Pwrh.js +108 -0
- package/dist/_chunks/Media-Cft7Pwrh.js.map +1 -0
- package/dist/_chunks/{PkLazyImg-ClL4nr95.js → PkLazyImg-Dbj2dDXA.js} +2 -2
- package/dist/_chunks/{PkLazyImg-ClL4nr95.js.map → PkLazyImg-Dbj2dDXA.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CwqsJnJJ.js → PkStreamingMarkdown-CNI8aV8t.js} +636 -427
- package/dist/_chunks/PkStreamingMarkdown-CNI8aV8t.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-CEVpl50q.js → PkToolRequestGeolocation-Bzy4IYSp.js} +4 -4
- package/dist/_chunks/PkToolRequestGeolocation-Bzy4IYSp.js.map +1 -0
- package/dist/_chunks/{PkToolRequestOAuthConnection-CncDU-Kl.js → PkToolRequestOAuthConnection-13CQH07t.js} +5 -5
- package/dist/_chunks/PkToolRequestOAuthConnection-13CQH07t.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js → PkToolShowArtifact-CGbHDEie.js} +4 -4
- package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js.map → PkToolShowArtifact-CGbHDEie.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js → PkToolShowCalendarEvent-DIFX_rUz.js} +3 -3
- package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js.map → PkToolShowCalendarEvent-DIFX_rUz.js.map} +1 -1
- package/dist/_chunks/{PkToolShowComparison-DbbUD9pg.js → PkToolShowComparison-CWLFWT9h.js} +7 -7
- package/dist/_chunks/PkToolShowComparison-CWLFWT9h.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-D_dW59Dl.js → PkToolShowContactForm-CYxgatUA.js} +5 -5
- package/dist/_chunks/PkToolShowContactForm-CYxgatUA.js.map +1 -0
- package/dist/_chunks/{PkToolShowDiagram-Hy9qh68O.js → PkToolShowDiagram-Dx1Ba0PG.js} +4 -4
- package/dist/_chunks/PkToolShowDiagram-Dx1Ba0PG.js.map +1 -0
- package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js → PkToolShowEmail-DnFFgzom.js} +3 -3
- package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js.map → PkToolShowEmail-DnFFgzom.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DbJHMDbt.js → PkToolShowForm-B6x3Lp2i.js} +7 -8
- package/dist/_chunks/PkToolShowForm-B6x3Lp2i.js.map +1 -0
- package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js → PkToolShowImageGallery-D99N_Plf.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js.map → PkToolShowImageGallery-D99N_Plf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js → PkToolShowLocation-AfnrtFVJ.js} +3 -3
- package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js.map → PkToolShowLocation-AfnrtFVJ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js → PkToolShowMessage-DUo2c-im.js} +3 -3
- package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js.map → PkToolShowMessage-DUo2c-im.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js → PkToolShowProductList-BN6Qk1_y.js} +3 -3
- package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js.map → PkToolShowProductList-BN6Qk1_y.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js → PkToolShowQrCode-BLqeBecX.js} +3 -3
- package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js.map → PkToolShowQrCode-BLqeBecX.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-B69JmwbZ.js → PkToolShowSources-DpZb5FUP.js} +5 -5
- package/dist/_chunks/PkToolShowSources-DpZb5FUP.js.map +1 -0
- package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js → PkToolShowSuggestedReply-C10nNgBs.js} +3 -3
- package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js.map → PkToolShowSuggestedReply-C10nNgBs.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js → PkToolShowVideo-S9b4QHUj.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js.map → PkToolShowVideo-S9b4QHUj.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-LPd3tC77.js → PkToolShowWeather-CqhG430w.js} +2 -2
- package/dist/_chunks/PkToolShowWeather-CqhG430w.js.map +1 -0
- package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js → PkToolShowWebPages-txAZi_iG.js} +3 -3
- package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js.map → PkToolShowWebPages-txAZi_iG.js.map} +1 -1
- package/dist/_chunks/PkUrl-BPbjZJ1A.js.map +1 -1
- package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js → VvCheckboxGroup.es-CTrF3pue.js} +2 -2
- package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js.map → VvCheckboxGroup.es-CTrF3pue.js.map} +1 -1
- package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js → VvCombobox.es-BWiXmQ_S.js} +10 -10
- package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js.map → VvCombobox.es-BWiXmQ_S.js.map} +1 -1
- package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js → VvInputText.es-Bo9I6g8H.js} +6 -6
- package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js.map → VvInputText.es-Bo9I6g8H.js.map} +1 -1
- package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js → VvRadioGroup.es-9ooHCuik.js} +2 -2
- package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js.map → VvRadioGroup.es-9ooHCuik.js.map} +1 -1
- package/dist/_chunks/{VvSelect.es-ovnZRHG5.js → VvSelect.es-DG0VuWtP.js} +2 -2
- package/dist/_chunks/{VvSelect.es-ovnZRHG5.js.map → VvSelect.es-DG0VuWtP.js.map} +1 -1
- package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js → VvTextarea.es-Dg3pxdZy.js} +6 -6
- package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js.map → VvTextarea.es-Dg3pxdZy.js.map} +1 -1
- package/dist/_chunks/{browser-NgY6LXg-.js → browser-B0Xnbqi7.js} +726 -751
- package/dist/_chunks/browser-B0Xnbqi7.js.map +1 -0
- package/dist/_chunks/{dist-n5iFNYf-.js → dist-QdjZA6MJ.js} +143 -133
- package/dist/_chunks/{dist-n5iFNYf-.js.map → dist-QdjZA6MJ.js.map} +1 -1
- package/dist/_chunks/{index.es-dtdl3VFG.js → index.es-0YpCa4c5.js} +6 -6
- package/dist/_chunks/{index.es-dtdl3VFG.js.map → index.es-0YpCa4c5.js.map} +1 -1
- package/dist/_chunks/{index.es-BJnUA_36.js → index.es-CHkJ2TMJ.js} +10 -10
- package/dist/_chunks/{index.es-BJnUA_36.js.map → index.es-CHkJ2TMJ.js.map} +1 -1
- package/dist/_chunks/text-DbSEK8si.js.map +1 -1
- package/dist/ai-elements.es.js +3077 -3134
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotError.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-C8BsTAxk.js → Agent-De2gFNjR.js} +165 -176
- package/dist-vue/_chunks/Agent-De2gFNjR.js.map +1 -0
- package/dist-vue/_chunks/{Document-CaUfI_SZ.js → Document-8umjeTVS.js} +84 -72
- package/dist-vue/_chunks/Document-8umjeTVS.js.map +1 -0
- package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbot-o7k7d-fj.js → PkChatbot-CMajc7tE.js} +61 -61
- package/dist-vue/_chunks/PkChatbot-CMajc7tE.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js → PkChatbotEmptyState-BtzBYOHJ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js.map → PkChatbotEmptyState-BtzBYOHJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotError-CBP2mf-n.js → PkChatbotError-gvDpRcEz.js} +21 -19
- package/dist-vue/_chunks/PkChatbotError-gvDpRcEz.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-DO1QIgmo.js → PkChatbotFeedbackForm-CxLOdwkm.js} +2 -2
- package/dist-vue/_chunks/PkChatbotFeedbackForm-CxLOdwkm.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotFilePreview-DO1wZPPj.js → PkChatbotFilePreview-CwiVQDF2.js} +3 -3
- package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotInput-D8x52cVm.js → PkChatbotInput-MSpF6SB6.js} +140 -125
- package/dist-vue/_chunks/PkChatbotInput-MSpF6SB6.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-Bz5q8EtT.js +776 -0
- package/dist-vue/_chunks/PkChatbotMessages-Bz5q8EtT.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js → PkChatbotStepPayload-XW4gT9AZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js.map → PkChatbotStepPayload-XW4gT9AZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js → PkChatbotStepToolDetail-C4-K6Glw.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js.map → PkChatbotStepToolDetail-C4-K6Glw.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js +190 -0
- package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-CNH_glPI.js → PkChatbotViewChat-DXu5ncaU.js} +10 -10
- package/dist-vue/_chunks/{PkChatbotViewChat-CNH_glPI.js.map → PkChatbotViewChat-DXu5ncaU.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BENvHLZt.js → PkChatbotViewConversations-3LaZPFyw.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BENvHLZt.js.map → PkChatbotViewConversations-3LaZPFyw.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-qmLESi1V.js → PkChatbotViewFiles-CTqnbsCj.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-qmLESi1V.js.map → PkChatbotViewFiles-CTqnbsCj.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-DzfZnitQ.js → PkChatbotViewProfile-B-Mp1jGQ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-DzfZnitQ.js.map → PkChatbotViewProfile-B-Mp1jGQ.js.map} +1 -1
- package/dist-vue/_chunks/PkRelativeTime--1cIphlA.js.map +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-D8_LwZMR.js → PkStreamingMarkdown-D0IOaETI.js} +432 -419
- package/dist-vue/_chunks/PkStreamingMarkdown-D0IOaETI.js.map +1 -0
- package/dist-vue/_chunks/{PkSvgViewer-DPpE9fiz.js → PkSvgViewer-D-0M5bqg.js} +2 -2
- package/dist-vue/_chunks/PkSvgViewer-D-0M5bqg.js.map +1 -0
- package/dist-vue/_chunks/{PkToolRequestGeolocation-D1ZPmWiB.js → PkToolRequestGeolocation-Q3N3jlO8.js} +3 -3
- package/dist-vue/_chunks/PkToolRequestGeolocation-Q3N3jlO8.js.map +1 -0
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CoJyKEE6.js → PkToolRequestOAuthConnection-lYoTJIF_.js} +4 -4
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-lYoTJIF_.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js → PkToolShowArtifact-DHdJuzDi.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js.map → PkToolShowArtifact-DHdJuzDi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowComparison-DMSjIpCR.js → PkToolShowComparison-BLn4pkno.js} +5 -5
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-DHmzAIVF.js → PkToolShowContactForm-DceSyuX8.js} +3 -3
- package/dist-vue/_chunks/PkToolShowContactForm-DceSyuX8.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowDiagram-DuDp5EHd.js → PkToolShowDiagram-pwc0wpNo.js} +4 -4
- package/dist-vue/_chunks/PkToolShowDiagram-pwc0wpNo.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js → PkToolShowEmail-DF__nKpR.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js.map → PkToolShowEmail-DF__nKpR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CO5A_j9L.js → PkToolShowForm-Dx10jOXm.js} +7 -7
- package/dist-vue/_chunks/PkToolShowForm-Dx10jOXm.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowImageGallery-V9U3LJfF.js → PkToolShowImageGallery-DudQzBx4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-V9U3LJfF.js.map → PkToolShowImageGallery-DudQzBx4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js → PkToolShowMessage-Ck6VP-gw.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js.map → PkToolShowMessage-Ck6VP-gw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js → PkToolShowProductList-zfM8cx-l.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js.map → PkToolShowProductList-zfM8cx-l.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BvWOzVkQ.js → PkToolShowSources-Dlaz2Y77.js} +5 -5
- package/dist-vue/_chunks/PkToolShowSources-Dlaz2Y77.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js → PkToolShowSuggestedReply-DWLkUh2L.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js.map → PkToolShowSuggestedReply-DWLkUh2L.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowWeather-Bzqalzh8.js.map +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js → PkToolShowWebPages-CosBYLrE.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js.map → PkToolShowWebPages-CosBYLrE.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-xUBKVJCv.js → PkUrl-B5CNTQj9.js} +2 -2
- package/dist-vue/_chunks/PkUrl-B5CNTQj9.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-CJ_5_3IT.js → createChatbotApiClient-MkaPbGWB.js} +6 -3
- package/dist-vue/_chunks/createChatbotApiClient-MkaPbGWB.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-CiRAuq7v.js → useChatbotStore-BzfqjiYz.js} +6 -3
- package/dist-vue/_chunks/useChatbotStore-BzfqjiYz.js.map +1 -0
- package/dist-vue/_chunks/useDialogConfirm-KWz0ohCQ.js.map +1 -1
- package/dist-vue/_chunks/{utils-Coqik0XI.js → utils-C1666_6C.js} +58 -43
- package/dist-vue/_chunks/utils-C1666_6C.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +3 -3
- package/dist-vue/index.js +3867 -3488
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +36 -8
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +20 -3
- package/dist-vue/packages/components/src/chat/PkChatButton.d.ts +3 -2
- package/dist-vue/packages/components/src/chat/PkLanguageModel.d.ts +26 -2
- package/dist-vue/packages/components/src/chat/PkLanguageModelCombobox.d.ts +53 -1
- package/dist-vue/packages/components/src/chat/PkModelOption.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/PkReasoningSettings.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkStreamingMarkdownAutoscroll.d.ts +1 -0
- package/dist-vue/packages/components/src/chat/constants.d.ts +5 -18
- package/dist-vue/packages/components/src/chat/index.d.ts +3 -1
- package/dist-vue/packages/components/src/chat/modelCatalog.d.ts +46 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +16 -0
- package/dist-vue/packages/components/src/table/PkTableSortable.d.ts +13 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
- package/dist-vue/packages/composable/src/useChatbotError.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +70 -10
- package/dist-vue/packages/models/src/schema/Chat.d.ts +31 -0
- package/dist-vue/packages/models/src/schema/ModelProvider.d.ts +316 -0
- package/dist-vue/packages/models/src/schema/Organization.d.ts +142 -2
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +20 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +20 -0
- package/dist-vue/packages/models/src/schema/UserOverview.d.ts +41 -0
- package/dist-vue/packages/models/src/schema/constants.d.ts +56 -91
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-Su_LDF9_.js.map +0 -1
- package/dist/_chunks/Document-DecVclEe.js.map +0 -1
- package/dist/_chunks/Media-C6SOQfJZ.js +0 -122
- package/dist/_chunks/Media-C6SOQfJZ.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-CwqsJnJJ.js.map +0 -1
- package/dist/_chunks/PkToolRequestGeolocation-CEVpl50q.js.map +0 -1
- package/dist/_chunks/PkToolRequestOAuthConnection-CncDU-Kl.js.map +0 -1
- package/dist/_chunks/PkToolShowComparison-DbbUD9pg.js.map +0 -1
- package/dist/_chunks/PkToolShowContactForm-D_dW59Dl.js.map +0 -1
- package/dist/_chunks/PkToolShowDiagram-Hy9qh68O.js.map +0 -1
- package/dist/_chunks/PkToolShowForm-DbJHMDbt.js.map +0 -1
- package/dist/_chunks/PkToolShowSources-B69JmwbZ.js.map +0 -1
- package/dist/_chunks/PkToolShowWeather-LPd3tC77.js.map +0 -1
- package/dist/_chunks/browser-NgY6LXg-.js.map +0 -1
- package/dist/_chunks/utils-YJ0ZOLDG.js +0 -185
- package/dist/_chunks/utils-YJ0ZOLDG.js.map +0 -1
- package/dist-vue/_chunks/Agent-C8BsTAxk.js.map +0 -1
- package/dist-vue/_chunks/Document-CaUfI_SZ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-o7k7d-fj.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotError-CBP2mf-n.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFeedbackForm-DO1QIgmo.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-DO1wZPPj.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-D8x52cVm.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BFlU046I.js +0 -771
- package/dist-vue/_chunks/PkChatbotMessages-BFlU046I.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-DtV1beDc.js +0 -180
- package/dist-vue/_chunks/PkChatbotSteps-DtV1beDc.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-D8_LwZMR.js.map +0 -1
- package/dist-vue/_chunks/PkSvgViewer-DPpE9fiz.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestGeolocation-D1ZPmWiB.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-CoJyKEE6.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowComparison-DMSjIpCR.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowContactForm-DHmzAIVF.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowDiagram-DuDp5EHd.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-CO5A_j9L.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowSources-BvWOzVkQ.js.map +0 -1
- package/dist-vue/_chunks/PkUrl-xUBKVJCv.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-CJ_5_3IT.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-CiRAuq7v.js.map +0 -1
- package/dist-vue/_chunks/utils-Coqik0XI.js.map +0 -1
package/dist-vue/_chunks/{PkStreamingMarkdown-D8_LwZMR.js → PkStreamingMarkdown-D0IOaETI.js}
RENAMED
|
@@ -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 {
|
|
5
|
-
import {
|
|
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
|
|
8
|
-
function
|
|
9
|
-
return e && e.replace(
|
|
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
|
|
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
|
|
17
|
+
return se.exec(e)?.[1];
|
|
16
18
|
}
|
|
17
19
|
function v(e) {
|
|
18
|
-
let t =
|
|
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
|
|
22
|
-
if (
|
|
23
|
-
let n = await e(
|
|
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
|
|
28
|
+
for (let e of i) n.add(e);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
function s(e) {
|
|
30
|
-
t.has(e) ||
|
|
32
|
+
t.has(e) || r.has(e) || (r.add(e), a || (a = !0, queueMicrotask(o)));
|
|
31
33
|
}
|
|
32
34
|
function c(e) {
|
|
33
|
-
return
|
|
34
|
-
let r =
|
|
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
|
|
51
|
-
let n =
|
|
52
|
-
return n && n.replace(
|
|
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
|
|
66
|
+
function le(e) {
|
|
65
67
|
let t = v(e);
|
|
66
|
-
return
|
|
68
|
+
return f(y, t), t;
|
|
67
69
|
}
|
|
68
|
-
var
|
|
69
|
-
resolve: (e) =>
|
|
70
|
-
url:
|
|
70
|
+
var ue = {
|
|
71
|
+
resolve: (e) => i(() => ({
|
|
72
|
+
url: h(e),
|
|
71
73
|
loading: !1
|
|
72
74
|
})),
|
|
73
|
-
resolveText: (e) =>
|
|
75
|
+
resolveText: (e) => i(() => h(e) ?? "")
|
|
74
76
|
};
|
|
75
|
-
function
|
|
76
|
-
return
|
|
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
|
|
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,
|
|
86
|
-
for (var n in t ||= {})
|
|
87
|
-
if (b) for (var n of b(t))
|
|
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
|
-
},
|
|
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
|
-
},
|
|
108
|
-
let n =
|
|
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:
|
|
112
|
-
},
|
|
113
|
-
},
|
|
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
|
-
},
|
|
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] === "`" && !
|
|
125
|
+
e[n] === "`" && !xe(e, n) && (t += 1);
|
|
124
126
|
}
|
|
125
127
|
return t;
|
|
126
|
-
},
|
|
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
|
-
},
|
|
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 ||
|
|
149
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
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] === "$" && !
|
|
175
|
+
if (e[r] === "$" && !Be(n)) {
|
|
174
176
|
let t = e[r + 1] === "$";
|
|
175
|
-
n =
|
|
177
|
+
n = He(n, t), t && (r += 1);
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
return n !== "none";
|
|
179
|
-
},
|
|
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
|
-
},
|
|
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] === "]" &&
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
221
|
-
let i =
|
|
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
|
-
},
|
|
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 (
|
|
240
|
-
let c =
|
|
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
|
-
},
|
|
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
|
-
|
|
255
|
+
Ze(e, i, a, o) || (t += 1);
|
|
254
256
|
}
|
|
255
257
|
return t;
|
|
256
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
290
|
-
},
|
|
291
|
-
let t = e.match(
|
|
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) ||
|
|
295
|
-
},
|
|
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
|
|
299
|
-
},
|
|
300
|
-
let t = e.match(
|
|
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(
|
|
304
|
+
let t = e.match(Fe);
|
|
303
305
|
if (t) {
|
|
304
306
|
let n = e.lastIndexOf(t[1]);
|
|
305
|
-
if (!(S(e, n) ||
|
|
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) ||
|
|
311
|
-
},
|
|
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 ||
|
|
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
|
-
},
|
|
326
|
-
if (!e.match(
|
|
327
|
-
let t =
|
|
328
|
-
if (t === -1 || S(e, t) ||
|
|
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 :
|
|
331
|
-
},
|
|
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) && !
|
|
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
|
-
},
|
|
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
|
-
},
|
|
351
|
+
}, ut = (e) => {
|
|
350
352
|
if (!e.endsWith("**")) return null;
|
|
351
353
|
let t = e.slice(0, -2);
|
|
352
|
-
if (
|
|
353
|
-
let n = t.indexOf("**"), r =
|
|
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
|
-
},
|
|
356
|
-
if (!e.match(
|
|
357
|
-
let t =
|
|
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) ||
|
|
361
|
-
if (
|
|
362
|
-
let t =
|
|
363
|
-
return t === null ?
|
|
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
|
-
},
|
|
367
|
-
let t =
|
|
368
|
+
}, ft = (e) => {
|
|
369
|
+
let t = et(e), n = Xe(e);
|
|
368
370
|
return t % 2 == 0 && n % 2 == 0;
|
|
369
|
-
},
|
|
370
|
-
if (
|
|
371
|
-
let t = e.match(
|
|
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
|
|
375
|
-
},
|
|
376
|
-
let t = e.match(
|
|
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
|
-
},
|
|
379
|
-
let t =
|
|
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(
|
|
382
|
-
if (n && !
|
|
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 (
|
|
387
|
+
if (Se(e) % 2 == 1) return `${e}\``;
|
|
386
388
|
}
|
|
387
389
|
return e;
|
|
388
|
-
},
|
|
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] === "`" && !
|
|
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
|
-
},
|
|
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] === "`" && !
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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 =
|
|
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 (
|
|
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 =
|
|
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
|
-
},
|
|
453
|
+
}, kt = (e, t = "protocol") => {
|
|
452
454
|
let n = e.lastIndexOf("](");
|
|
453
455
|
if (n !== -1 && !S(e, n)) {
|
|
454
|
-
let r =
|
|
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 =
|
|
460
|
+
let r = Ot(e, n, t);
|
|
459
461
|
if (r !== null) return r;
|
|
460
462
|
}
|
|
461
463
|
return e;
|
|
462
|
-
},
|
|
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 (
|
|
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 (
|
|
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
|
-
},
|
|
477
|
-
let t = e.match(
|
|
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) ||
|
|
483
|
-
if (e.match(
|
|
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(
|
|
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) ||
|
|
489
|
-
if (e.match(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
511
|
+
}, Bt = [
|
|
510
512
|
{
|
|
511
513
|
handler: {
|
|
512
514
|
name: "singleTilde",
|
|
513
|
-
handle:
|
|
514
|
-
priority:
|
|
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:
|
|
522
|
-
priority:
|
|
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:
|
|
530
|
-
priority:
|
|
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:
|
|
538
|
-
priority:
|
|
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:
|
|
546
|
-
priority:
|
|
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:
|
|
555
|
-
priority:
|
|
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:
|
|
563
|
-
priority:
|
|
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:
|
|
571
|
-
priority:
|
|
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:
|
|
579
|
-
priority:
|
|
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:
|
|
587
|
-
priority:
|
|
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:
|
|
595
|
-
priority:
|
|
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:
|
|
603
|
-
priority:
|
|
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:
|
|
611
|
-
priority:
|
|
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:
|
|
619
|
-
priority:
|
|
620
|
+
handle: Tt,
|
|
621
|
+
priority: A.INLINE_KATEX
|
|
620
622
|
},
|
|
621
623
|
optionKey: "inlineKatex"
|
|
622
624
|
}
|
|
623
|
-
],
|
|
625
|
+
], Vt = (e) => {
|
|
624
626
|
let t = e?.linkMode ?? "protocol";
|
|
625
|
-
return
|
|
626
|
-
handler:
|
|
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
|
-
},
|
|
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 =
|
|
635
|
-
handler:
|
|
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.
|
|
643
|
-
function
|
|
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
|
|
658
|
-
function
|
|
659
|
-
|
|
659
|
+
var j = Ut();
|
|
660
|
+
function Wt(e) {
|
|
661
|
+
j = e;
|
|
660
662
|
}
|
|
661
|
-
var
|
|
662
|
-
function
|
|
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
|
|
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(
|
|
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
|
|
681
|
+
var Gt = ((e = "") => {
|
|
680
682
|
try {
|
|
681
683
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
682
684
|
} catch {
|
|
683
685
|
return !1;
|
|
684
686
|
}
|
|
685
|
-
})(),
|
|
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:
|
|
738
|
-
hrRegex:
|
|
739
|
-
fencesBeginRegex:
|
|
740
|
-
headingBeginRegex:
|
|
741
|
-
htmlBeginRegex:
|
|
742
|
-
blockquoteBeginRegex:
|
|
743
|
-
},
|
|
744
|
-
blockquote:
|
|
745
|
-
code:
|
|
746
|
-
def:
|
|
747
|
-
fences:
|
|
748
|
-
heading:
|
|
749
|
-
hr:
|
|
750
|
-
html:
|
|
751
|
-
lheading:
|
|
752
|
-
list:
|
|
753
|
-
newline:
|
|
754
|
-
paragraph:
|
|
755
|
-
table:
|
|
756
|
-
text:
|
|
757
|
-
},
|
|
758
|
-
...
|
|
759
|
-
lheading:
|
|
760
|
-
table:
|
|
761
|
-
paragraph:
|
|
762
|
-
},
|
|
763
|
-
...
|
|
764
|
-
html:
|
|
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:
|
|
771
|
+
fences: M,
|
|
768
772
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
769
|
-
paragraph:
|
|
770
|
-
},
|
|
771
|
-
_backpedal:
|
|
772
|
-
anyPunctuation:
|
|
773
|
-
autolink:
|
|
774
|
-
blockSkip:
|
|
775
|
-
br:
|
|
776
|
-
code:
|
|
777
|
-
del:
|
|
778
|
-
delLDelim:
|
|
779
|
-
delRDelim:
|
|
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:
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
url:
|
|
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:
|
|
809
|
-
},
|
|
810
|
-
...
|
|
811
|
-
br:
|
|
812
|
-
text:
|
|
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:
|
|
819
|
-
gfm:
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
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
|
"&": "&",
|
|
824
828
|
"<": "<",
|
|
825
829
|
">": ">",
|
|
826
830
|
"\"": """,
|
|
827
831
|
"'": "'"
|
|
828
|
-
},
|
|
829
|
-
function
|
|
832
|
+
}, tr = (e) => er[e];
|
|
833
|
+
function W(e, t) {
|
|
830
834
|
if (t) {
|
|
831
|
-
if (
|
|
832
|
-
} else if (
|
|
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
|
|
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(
|
|
847
|
+
e = encodeURI(e).replace(F.percentDecode, "%");
|
|
838
848
|
} catch {
|
|
839
849
|
return null;
|
|
840
850
|
}
|
|
841
851
|
return e;
|
|
842
852
|
}
|
|
843
|
-
function
|
|
844
|
-
let n = e.replace(
|
|
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(
|
|
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(
|
|
863
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(F.slashPipe, "|");
|
|
854
864
|
return n;
|
|
855
865
|
}
|
|
856
|
-
function
|
|
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
|
|
878
|
+
function ar(e) {
|
|
869
879
|
let t = e.split("\n"), n = t.length - 1;
|
|
870
|
-
for (; n >= 0 &&
|
|
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
|
|
874
|
-
return e.toLowerCase().toUpperCase().toLowerCase();
|
|
883
|
+
function K(e) {
|
|
884
|
+
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
875
885
|
}
|
|
876
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
958
|
+
var q = class {
|
|
949
959
|
options;
|
|
950
960
|
rules;
|
|
951
961
|
lexer;
|
|
952
962
|
constructor(e) {
|
|
953
|
-
this.options = e ||
|
|
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] :
|
|
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 =
|
|
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 =
|
|
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:
|
|
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:
|
|
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 =
|
|
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
|
|
1031
|
-
|
|
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 =
|
|
1066
|
-
if (this.options.pedantic ? (
|
|
1067
|
-
let t = this.rules.other.nextBulletRegex(
|
|
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
|
|
1070
|
-
if (
|
|
1071
|
-
if (m.search(this.rules.other.nonSpaceChar) >=
|
|
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 (
|
|
1074
|
-
s += "\n" +
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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:
|
|
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 =
|
|
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:
|
|
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(
|
|
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:
|
|
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 &&
|
|
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 =
|
|
1253
|
+
let e = G(r.slice(0, -1), "\\");
|
|
1242
1254
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1243
1255
|
} else {
|
|
1244
|
-
let e =
|
|
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)),
|
|
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 &&
|
|
1267
|
-
let i = t[
|
|
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
|
|
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
|
-
},
|
|
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 ||
|
|
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:
|
|
1429
|
-
block:
|
|
1430
|
-
inline:
|
|
1440
|
+
other: F,
|
|
1441
|
+
block: H.normal,
|
|
1442
|
+
inline: U.normal
|
|
1431
1443
|
};
|
|
1432
|
-
this.options.pedantic ? (t.block =
|
|
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:
|
|
1437
|
-
inline:
|
|
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(
|
|
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(
|
|
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,
|
|
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,
|
|
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
|
-
},
|
|
1667
|
+
}, Y = class {
|
|
1656
1668
|
options;
|
|
1657
1669
|
parser;
|
|
1658
1670
|
constructor(e) {
|
|
1659
|
-
this.options = e ||
|
|
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(
|
|
1666
|
-
return r ? "<pre><code class=\"language-" +
|
|
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>${
|
|
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 ?
|
|
1757
|
+
let a = i ? W(n, !0) : this.parser.parseInline(r), o = rr(e);
|
|
1746
1758
|
if (o === null) return a;
|
|
1747
|
-
e =
|
|
1759
|
+
e = W(o, i);
|
|
1748
1760
|
let s = "<a href=\"" + e + "\"";
|
|
1749
|
-
return t && (s += " title=\"" +
|
|
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 =
|
|
1754
|
-
if (i === null) return
|
|
1765
|
+
let i = rr(e);
|
|
1766
|
+
if (i === null) return W(n);
|
|
1755
1767
|
e = i;
|
|
1756
|
-
let a = `<img src="${
|
|
1757
|
-
return t && (a += ` title="${
|
|
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 :
|
|
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
|
-
},
|
|
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 ||
|
|
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 ||
|
|
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 ?
|
|
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 =
|
|
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 =
|
|
1988
|
-
TextRenderer =
|
|
1989
|
-
Lexer =
|
|
1990
|
-
Tokenizer =
|
|
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
|
|
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
|
|
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
|
|
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 ?
|
|
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 ?
|
|
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>" +
|
|
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,
|
|
2162
|
-
}, $.getDefaults =
|
|
2163
|
-
function
|
|
2164
|
-
return Q.use(...e), $.defaults = Q.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 =
|
|
2178
|
+
$.use = fr, $.walkTokens = function(e, t) {
|
|
2167
2179
|
return Q.walkTokens(e, t);
|
|
2168
|
-
}, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer =
|
|
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
|
|
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(
|
|
2187
|
-
let
|
|
2188
|
-
function
|
|
2189
|
-
return
|
|
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
|
|
2192
|
-
function
|
|
2193
|
-
return
|
|
2204
|
+
let re = null;
|
|
2205
|
+
function ie() {
|
|
2206
|
+
return re ||= import("katex").then((e) => e.default), re;
|
|
2194
2207
|
}
|
|
2195
|
-
let
|
|
2196
|
-
function
|
|
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, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2198
2211
|
}
|
|
2199
2212
|
function _(e, t) {
|
|
2200
|
-
return `<span class="katex-pending" data-katex="${
|
|
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(
|
|
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(
|
|
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, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"),
|
|
2268
|
+
let v = new $.Renderer(), y = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), 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 ||
|
|
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
|
|
2265
|
-
v.code = ({ text: e }) =>
|
|
2266
|
-
function
|
|
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
|
|
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
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
], b =
|
|
2287
|
-
let e =
|
|
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
|
|
2295
|
-
if (
|
|
2296
|
-
await
|
|
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
|
|
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
|
|
2310
|
-
await
|
|
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
|
|
2317
|
-
await
|
|
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
|
|
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
|
|
2336
|
-
await
|
|
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
|
|
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
|
|
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 ||
|
|
2366
|
+
n.className = "markdown-broken-image", n.textContent = t.alt || f("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
2354
2367
|
}
|
|
2355
|
-
|
|
2356
|
-
b.value?.addEventListener("error",
|
|
2357
|
-
}),
|
|
2358
|
-
b.value?.removeEventListener("error",
|
|
2359
|
-
}),
|
|
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
|
|
2374
|
+
function Ce(e, t) {
|
|
2362
2375
|
let n = document.createElement("span");
|
|
2363
|
-
return n.style.cssText = `animation:ft-${
|
|
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(
|
|
2388
|
+
t.insertBefore(Ce(e, i * 30), n), i++;
|
|
2376
2389
|
}
|
|
2377
2390
|
return i;
|
|
2378
2391
|
}
|
|
2379
|
-
function
|
|
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
|
|
2387
|
-
if (!b.value || !
|
|
2388
|
-
let e =
|
|
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
|
|
2405
|
-
await
|
|
2406
|
-
}, { immediate: !0 }),
|
|
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) => (
|
|
2421
|
+
}), (e, t) => (d(), a("div", {
|
|
2409
2422
|
ref: "container",
|
|
2410
2423
|
innerHTML: x.value
|
|
2411
|
-
}, null, 8,
|
|
2424
|
+
}, null, 8, pr));
|
|
2412
2425
|
}
|
|
2413
2426
|
});
|
|
2414
2427
|
//#endregion
|
|
2415
|
-
export {
|
|
2428
|
+
export { le as n, de as r, hr as t };
|
|
2416
2429
|
|
|
2417
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
2430
|
+
//# sourceMappingURL=PkStreamingMarkdown-D0IOaETI.js.map
|