file-viewer3 1.0.8 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/LICENSE +160 -0
  2. package/README.en.md +390 -0
  3. package/README.md +306 -89
  4. package/dist/components/3MFLoader.js +527 -0
  5. package/dist/components/AMFLoader.js +188 -0
  6. package/dist/components/ArchiveViewer.js +526 -0
  7. package/dist/components/AudioViewer.js +66 -0
  8. package/dist/components/CadViewer.js +9040 -0
  9. package/dist/components/CodeViewer.js +151 -0
  10. package/dist/components/ColladaLoader.js +2282 -0
  11. package/dist/components/DrawingViewer.js +295 -0
  12. package/dist/components/EdaViewer.js +630 -0
  13. package/dist/components/EmailViewer.js +276 -0
  14. package/dist/components/EpubViewer.js +172 -0
  15. package/dist/components/FBXLoader.js +1574 -0
  16. package/dist/components/GLTFLoader.js +1383 -0
  17. package/dist/components/ImageViewer.js +1516 -1895
  18. package/dist/components/KMZLoader.js +45 -0
  19. package/dist/components/MarkdownViewer.js +1456 -1557
  20. package/dist/components/ModelViewer.js +797 -0
  21. package/dist/components/OBJLoader.js +287 -0
  22. package/dist/components/OfdViewer.js +133 -0
  23. package/dist/components/PCDLoader.js +141 -0
  24. package/dist/components/PLYLoader.js +305 -0
  25. package/dist/components/PdfView.js +27662 -21655
  26. package/dist/components/PptxRender.js +11170 -21118
  27. package/dist/components/STLLoader.js +83 -0
  28. package/dist/components/TDSLoader.js +228 -0
  29. package/dist/components/TypstViewer.js +1697 -0
  30. package/dist/components/USDLoader.js +2526 -0
  31. package/dist/components/UmdViewer.js +1873 -0
  32. package/dist/components/VRMLLoader.js +6422 -0
  33. package/dist/components/VTKLoader.js +337 -0
  34. package/dist/components/XYZLoader.js +30 -0
  35. package/dist/components/XlsxTable.js +7871 -69873
  36. package/dist/components/__vite-browser-external.js +7 -0
  37. package/dist/components/_plugin-vue_export-helper.js +8 -0
  38. package/dist/components/ar-SA-G6X2FPQ2.js +523 -0
  39. package/dist/components/arc.js +79 -0
  40. package/dist/components/architecture-7EHR7CIX.js +3 -0
  41. package/dist/components/architectureDiagram-3BPJPVTR.js +4096 -0
  42. package/dist/components/archive.js +24 -0
  43. package/dist/components/asyncToGenerator.js +29 -0
  44. package/dist/components/audio.js +19 -0
  45. package/dist/components/az-AZ-76LH7QW2.js +523 -0
  46. package/dist/components/bash.js +169 -0
  47. package/dist/components/bg-BG-XCXSNQG7.js +523 -0
  48. package/dist/components/blockDiagram-GPEHLZMM.js +3357 -0
  49. package/dist/components/bn-BD-2XOGV67Q.js +523 -0
  50. package/dist/components/c4Diagram-AAUBKEIU.js +2957 -0
  51. package/dist/components/ca-ES-6MX7JW3Y.js +523 -0
  52. package/dist/components/cad.js +23 -0
  53. package/dist/components/cfb.js +1174 -0
  54. package/dist/components/channel.js +5 -0
  55. package/dist/components/chunk-2J33WTMH.js +26 -0
  56. package/dist/components/chunk-3OPIFGDE.js +4167 -0
  57. package/dist/components/chunk-4BX2VUAB.js +19 -0
  58. package/dist/components/chunk-55IACEB6.js +9 -0
  59. package/dist/components/chunk-5ZQYHXKU.js +669 -0
  60. package/dist/components/chunk-6U3AYISY.js +624 -0
  61. package/dist/components/chunk-727SXJPM.js +3356 -0
  62. package/dist/components/chunk-AGHRB4JF.js +324 -0
  63. package/dist/components/chunk-AQP2D5EJ.js +2055 -0
  64. package/dist/components/chunk-BSJP7CBP.js +83 -0
  65. package/dist/components/chunk-CSCIHK7Q.js +3500 -0
  66. package/dist/components/chunk-EIO257PC.js +1836 -0
  67. package/dist/components/chunk-FMBD7UC4.js +5 -0
  68. package/dist/components/chunk-K2UTITRG.js +17627 -0
  69. package/dist/components/chunk-KSCS5N6A.js +572 -0
  70. package/dist/components/chunk-L5ZTLDWV.js +40 -0
  71. package/dist/components/chunk-LZXEDZCA.js +60 -0
  72. package/dist/components/chunk-ND2GUHAM.js +61 -0
  73. package/dist/components/chunk-NNHCCRGN.js +20425 -0
  74. package/dist/components/chunk-NZK2D7GU.js +68 -0
  75. package/dist/components/chunk-O5CBEL6O.js +1894 -0
  76. package/dist/components/chunk-QZHKN3VN.js +12 -0
  77. package/dist/components/chunk-SRAX5OIU.js +22 -0
  78. package/dist/components/chunk-WU5MYG2G.js +14 -0
  79. package/dist/components/chunk-XPW4576I.js +1146 -0
  80. package/dist/components/chunk-Z3N5DIM6.js +59 -0
  81. package/dist/components/chunk-ZUYEQ4TG.js +22 -0
  82. package/dist/components/chunk.js +23 -0
  83. package/dist/components/classDiagram-4FO5ZUOK.js +29 -0
  84. package/dist/components/classDiagram-v2-Q7XG4LA2.js +29 -0
  85. package/dist/components/compiler.js +2 -0
  86. package/dist/components/core.js +845 -0
  87. package/dist/components/cose-bilkent-S5V4N54A.js +2268 -0
  88. package/dist/components/cpp.js +225 -0
  89. package/dist/components/cs-CZ-2BRQDIVT.js +523 -0
  90. package/dist/components/csharp.js +260 -0
  91. package/dist/components/css.js +140 -0
  92. package/dist/components/cytoscape.esm.js +18114 -0
  93. package/dist/components/da-DK-5WZEPLOC.js +523 -0
  94. package/dist/components/dagre-BM42HDAG.js +325 -0
  95. package/dist/components/dagre.js +1936 -0
  96. package/dist/components/de-DE-XR44H4JA.js +523 -0
  97. package/dist/components/defaultLocale.js +201 -0
  98. package/dist/components/defineProperty.js +50 -0
  99. package/dist/components/diagram-2AECGRRQ.js +229 -0
  100. package/dist/components/diagram-5GNKFQAL.js +108 -0
  101. package/dist/components/diagram-KO2AKTUF.js +443 -0
  102. package/dist/components/diagram-LMA3HP47.js +139 -0
  103. package/dist/components/diagram-OG6HWLK6.js +541 -0
  104. package/dist/components/diff.js +39 -0
  105. package/dist/components/directory-open-01563666.js +26 -0
  106. package/dist/components/directory-open-4ed118d0.js +83 -0
  107. package/dist/components/dist.js +50 -0
  108. package/dist/components/dist2.js +3291 -0
  109. package/dist/components/dist3.js +1593 -0
  110. package/dist/components/documentSearch.js +378 -0
  111. package/dist/components/docx-preview.js +3113 -0
  112. package/dist/components/drawing.js +19 -0
  113. package/dist/components/ebook.js +16 -0
  114. package/dist/components/eda.js +20 -0
  115. package/dist/components/el-GR-BZB4AONW.js +523 -0
  116. package/dist/components/email.js +21 -0
  117. package/dist/components/en-B4ZKOASM.js +3 -0
  118. package/dist/components/erDiagram-TEJ5UH35.js +1719 -0
  119. package/dist/components/es-ES-U4NZUMDT.js +523 -0
  120. package/dist/components/eu-ES-A7QVB2H4.js +523 -0
  121. package/dist/components/eventmodeling-FCH6USID.js +3 -0
  122. package/dist/components/fa-IR-HGAKTJCU.js +523 -0
  123. package/dist/components/fflate.module.js +323 -0
  124. package/dist/components/fi-FI-Z5N7JZ37.js +523 -0
  125. package/dist/components/file-open-002ab408.js +38 -0
  126. package/dist/components/file-open-7c801643.js +24 -0
  127. package/dist/components/file-save-3189631c.js +40 -0
  128. package/dist/components/file-save-745eba88.js +36 -0
  129. package/dist/components/flowDiagram-I6XJVG4X.js +4181 -0
  130. package/dist/components/fr-FR-RHASNOE6.js +523 -0
  131. package/dist/components/ganttDiagram-6RSMTGT7.js +2182 -0
  132. package/dist/components/gitGraph-WXDBUCRP.js +3 -0
  133. package/dist/components/gitGraphDiagram-PVQCEYII.js +788 -0
  134. package/dist/components/gl-ES-HMX3MZ6V.js +523 -0
  135. package/dist/components/global-compiler.js +23 -0
  136. package/dist/components/global-renderer.js +23 -0
  137. package/dist/components/go.js +140 -0
  138. package/dist/components/graphlib.js +1267 -0
  139. package/dist/components/he-IL-6SHJWFNN.js +523 -0
  140. package/dist/components/hi-IN-IWLTKZ5I.js +523 -0
  141. package/dist/components/hu-HU-A5ZG7DT2.js +523 -0
  142. package/dist/components/id-ID-SAP4L64H.js +523 -0
  143. package/dist/components/image-GAAHSSAO.js +3 -0
  144. package/dist/components/image-blob-reduce.esm.js +1429 -0
  145. package/dist/components/image.js +17 -0
  146. package/dist/components/info-J43DQDTF.js +3 -0
  147. package/dist/components/infoDiagram-5YYISTIA.js +26 -0
  148. package/dist/components/ini.js +88 -0
  149. package/dist/components/init.js +15 -0
  150. package/dist/components/ishikawaDiagram-YF4QCWOH.js +718 -0
  151. package/dist/components/it-IT-JPQ66NNP.js +523 -0
  152. package/dist/components/ja-JP-DBVTYXUO.js +523 -0
  153. package/dist/components/java.js +169 -0
  154. package/dist/components/javascript.js +436 -0
  155. package/dist/components/journeyDiagram-JHISSGLW.js +885 -0
  156. package/dist/components/json.js +36 -0
  157. package/dist/components/jszip.min.js +3033 -0
  158. package/dist/components/kaa-6HZHGXH3.js +523 -0
  159. package/dist/components/kab-KAB-ZGHBKWFO.js +523 -0
  160. package/dist/components/kanban-definition-UN3LZRKU.js +986 -0
  161. package/dist/components/katex.js +21979 -0
  162. package/dist/components/kk-KZ-P5N5QNE5.js +523 -0
  163. package/dist/components/km-KH-HSX4SM5Z.js +523 -0
  164. package/dist/components/ko-KR-MTYHY66A.js +523 -0
  165. package/dist/components/ku-TR-6OUDTVRD.js +523 -0
  166. package/dist/components/lib.js +4877 -0
  167. package/dist/components/libarchive.js +360 -0
  168. package/dist/components/linear.js +289 -0
  169. package/dist/components/lt-LT-XHIRWOB4.js +523 -0
  170. package/dist/components/lv-LV-5QDEKY6T.js +523 -0
  171. package/dist/components/markdown.js +181 -0
  172. package/dist/components/md.js +17 -0
  173. package/dist/components/mermaid-parser.core.js +328 -0
  174. package/dist/components/mindmap-definition-RKZ34NQL.js +1016 -0
  175. package/dist/components/model.js +21 -0
  176. package/dist/components/mp4.js +12 -0
  177. package/dist/components/mr-IN-CRQNXWMA.js +523 -0
  178. package/dist/components/my-MM-5M5IBNSE.js +523 -0
  179. package/dist/components/nb-NO-T6EIAALU.js +523 -0
  180. package/dist/components/nestedRender.js +158 -0
  181. package/dist/components/nl-NL-IS3SIHDZ.js +523 -0
  182. package/dist/components/nn-NO-6E72VCQL.js +523 -0
  183. package/dist/components/objectSpread2.js +29 -0
  184. package/dist/components/objectWithoutProperties.js +28 -0
  185. package/dist/components/oc-FR-POXYY2M6.js +523 -0
  186. package/dist/components/ofd.js +5261 -0
  187. package/dist/components/ofd2.js +16 -0
  188. package/dist/components/ordinal.js +65 -0
  189. package/dist/components/pa-IN-N4M65BXN.js +523 -0
  190. package/dist/components/packet-YPE3B663.js +3 -0
  191. package/dist/components/pdf.js +24 -0
  192. package/dist/components/percentages-BXMCSKIN.js +3 -0
  193. package/dist/components/php.js +294 -0
  194. package/dist/components/pica.js +1009 -0
  195. package/dist/components/pie-LRSECV5Y.js +3 -0
  196. package/dist/components/pie.js +47 -0
  197. package/dist/components/pieDiagram-4H26LBE5.js +130 -0
  198. package/dist/components/pl-PL-T2D74RX3.js +523 -0
  199. package/dist/components/postal-mime.js +3146 -0
  200. package/dist/components/pptx.js +15 -0
  201. package/dist/components/printLayout.js +42 -0
  202. package/dist/components/prod.js +21770 -0
  203. package/dist/components/pt-BR-5N22H2LF.js +523 -0
  204. package/dist/components/pt-PT-UZXXM6DQ.js +523 -0
  205. package/dist/components/python.js +238 -0
  206. package/dist/components/quadrantDiagram-W4KKPZXB.js +1988 -0
  207. package/dist/components/radar-GUYGQ44K.js +3 -0
  208. package/dist/components/renderer.js +2 -0
  209. package/dist/components/requirementDiagram-4Y6WPE33.js +2230 -0
  210. package/dist/components/ro-RO-JPDTUUEW.js +523 -0
  211. package/dist/components/rough.esm.js +1355 -0
  212. package/dist/components/roundRect.js +90 -0
  213. package/dist/components/ru-RU-B4JR7IUQ.js +523 -0
  214. package/dist/components/rust.js +169 -0
  215. package/dist/components/sankeyDiagram-5OEKKPKP.js +972 -0
  216. package/dist/components/sequenceDiagram-3UESZ5HK.js +4255 -0
  217. package/dist/components/shared.js +175 -0
  218. package/dist/components/shared2.js +4 -0
  219. package/dist/components/si-LK-N5RQ5JYF.js +523 -0
  220. package/dist/components/sk-SK-C5VTKIMK.js +523 -0
  221. package/dist/components/sl-SI-NN7IZMDC.js +523 -0
  222. package/dist/components/sourceLoading.js +134 -0
  223. package/dist/components/sql.js +118 -0
  224. package/dist/components/src.js +2664 -0
  225. package/dist/components/src2.js +10722 -0
  226. package/dist/components/stateDiagram-AJRCARHV.js +217 -0
  227. package/dist/components/stateDiagram-v2-BHNVJYJU.js +27 -0
  228. package/dist/components/subset-shared.chunk.js +3 -0
  229. package/dist/components/subset-worker.chunk.js +21 -0
  230. package/dist/components/sv-SE-XGPEYMSR.js +523 -0
  231. package/dist/components/ta-IN-2NMHFXQM.js +523 -0
  232. package/dist/components/text.js +20 -0
  233. package/dist/components/th-TH-HPSO5L25.js +523 -0
  234. package/dist/components/three.module.js +13134 -0
  235. package/dist/components/time.js +910 -0
  236. package/dist/components/timeline-definition-PNZ67QCA.js +1084 -0
  237. package/dist/components/tr-TR-DEFEU3FU.js +523 -0
  238. package/dist/components/treeView-BLDUP644.js +3 -0
  239. package/dist/components/treemap-LRROVOQU.js +3 -0
  240. package/dist/components/typescript.js +521 -0
  241. package/dist/components/typst.js +25 -0
  242. package/dist/components/uk-UA-QMV73CPH.js +523 -0
  243. package/dist/components/umd.js +16 -0
  244. package/dist/components/use.js +422 -0
  245. package/dist/components/util.js +49 -0
  246. package/dist/components/vennDiagram-CIIHVFJN.js +1880 -0
  247. package/dist/components/vi-VN-M7AON7JQ.js +523 -0
  248. package/dist/components/viewerZoom.js +92 -0
  249. package/dist/components/wardley-L42UT6IY.js +3 -0
  250. package/dist/components/wardleyDiagram-YWT4CUSO.js +656 -0
  251. package/dist/components/wasm-pack-shim.js +1711 -0
  252. package/dist/components/wasm-pack-shim2.js +934 -0
  253. package/dist/components/wasm.js +97 -0
  254. package/dist/components/word.js +3055 -0
  255. package/dist/components/worker-ref.js +15 -20
  256. package/dist/components/xlsx.js +21 -0
  257. package/dist/components/xml.js +166 -0
  258. package/dist/components/xychartDiagram-2RQKCTM6.js +2015 -0
  259. package/dist/components/yaml.js +144 -0
  260. package/dist/components/zh-CN-LNUGB5OW.js +523 -0
  261. package/dist/components/zh-HK-E62DVLB3.js +523 -0
  262. package/dist/components/zh-TW-RAJ6MFWO.js +523 -0
  263. package/dist/file-viewer3.css +2 -0
  264. package/dist/index.mjs +3292 -5
  265. package/dist/src/App.vue.d.ts +3 -0
  266. package/dist/src/compare/CompareApp.vue.d.ts +3 -0
  267. package/dist/src/compare/main.d.ts +0 -0
  268. package/dist/src/compare/useSynchronizedScroll.d.ts +7 -0
  269. package/dist/src/components/HelloWorld.vue.d.ts +3 -0
  270. package/dist/src/components/utils.d.ts +4 -0
  271. package/dist/src/main.d.ts +0 -0
  272. package/dist/src/package/common/printCapability.d.ts +27 -0
  273. package/dist/src/package/common/printLayout.d.ts +16 -0
  274. package/dist/src/package/common/sourceLoading.d.ts +10 -0
  275. package/dist/src/package/common/type.d.ts +522 -8
  276. package/dist/src/package/common/worker-ref.d.ts +1 -1
  277. package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +74 -24
  278. package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +9 -0
  279. package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +29 -0
  280. package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +21 -0
  281. package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +8 -0
  282. package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +34 -0
  283. package/dist/src/package/components/FileViewer/index.d.ts +1 -1
  284. package/dist/src/package/components/FileViewer/util.d.ts +2 -1
  285. package/dist/src/package/index.d.ts +14 -4
  286. package/dist/src/package/use/documentLocation.d.ts +15 -0
  287. package/dist/src/package/use/documentSearch.d.ts +234 -0
  288. package/dist/src/package/use/index.d.ts +4 -0
  289. package/dist/src/package/use/loading.d.ts +33 -0
  290. package/dist/src/package/use/viewerZoom.d.ts +42 -0
  291. package/dist/src/package/use/worker.d.ts +2 -2
  292. package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +9 -0
  293. package/dist/src/package/vendors/archive/cache.d.ts +10 -0
  294. package/dist/src/package/vendors/archive/fallback.d.ts +9 -0
  295. package/dist/src/package/vendors/archive/index.d.ts +3 -0
  296. package/dist/src/package/vendors/archive/shared.d.ts +24 -0
  297. package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +7 -0
  298. package/dist/src/package/vendors/audio/index.d.ts +7 -0
  299. package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +9 -0
  300. package/dist/src/package/vendors/cad/index.d.ts +8 -0
  301. package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +15 -0
  302. package/dist/src/package/vendors/drawing/index.d.ts +7 -0
  303. package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +6 -0
  304. package/dist/src/package/vendors/ebook/index.d.ts +7 -0
  305. package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +8 -0
  306. package/dist/src/package/vendors/eda/index.d.ts +2 -0
  307. package/dist/src/package/vendors/eda/parser.d.ts +77 -0
  308. package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +10 -0
  309. package/dist/src/package/vendors/email/index.d.ts +2 -0
  310. package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +6 -13
  311. package/dist/src/package/vendors/image/index.d.ts +1 -1
  312. package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +6 -13
  313. package/dist/src/package/vendors/md/index.d.ts +1 -1
  314. package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +8 -0
  315. package/dist/src/package/vendors/model/index.d.ts +3 -0
  316. package/dist/src/package/vendors/model/shared.d.ts +1 -0
  317. package/dist/src/package/vendors/nestedRender.d.ts +10 -0
  318. package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +6 -0
  319. package/dist/src/package/vendors/ofd/index.d.ts +7 -0
  320. package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +10 -13
  321. package/dist/src/package/vendors/pdf/index.d.ts +2 -1
  322. package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
  323. package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +9 -81
  324. package/dist/src/package/vendors/pptx/index.d.ts +1 -1
  325. package/dist/src/package/vendors/renders.d.ts +1 -1
  326. package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +7 -13
  327. package/dist/src/package/vendors/text/index.d.ts +6 -2
  328. package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +15 -0
  329. package/dist/src/package/vendors/typst/index.d.ts +8 -0
  330. package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +6 -0
  331. package/dist/src/package/vendors/umd/index.d.ts +7 -0
  332. package/dist/src/package/vendors/umd/parser.d.ts +30 -0
  333. package/dist/src/package/vendors/word/doc.d.ts +5 -0
  334. package/dist/src/package/vendors/word/docx.d.ts +5 -0
  335. package/dist/src/package/vendors/word/docx.worker.d.ts +1 -0
  336. package/dist/src/package/vendors/word/index.d.ts +3 -0
  337. package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +80 -0
  338. package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +25 -0
  339. package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +6 -21
  340. package/dist/src/package/vendors/xlsx/index.d.ts +3 -2
  341. package/dist/src/package/vendors/xlsx/util.d.ts +0 -5
  342. package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -6
  343. package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +73 -0
  344. package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +1 -0
  345. package/dist/style.css +1 -57
  346. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  347. package/dist/wasm/cad/dwg-worker.js +24 -0
  348. package/dist/wasm/cad/libredwg-web.js +15 -0
  349. package/dist/wasm/cad/libredwg-web.wasm +0 -0
  350. package/package.json +118 -42
  351. package/.vscode/extensions.json +0 -3
  352. package/dist/components/_commonjs-dynamic-modules.js +0 -6
  353. package/dist/components/_commonjsHelpers.js +0 -36
  354. package/dist/components/docx-preview.min.js +0 -5287
  355. package/dist/components/index.js +0 -1717
  356. package/dist/favicon.ico +0 -0
  357. package/dist/index.umd.js +0 -436
  358. package/dist/src/package/vendors/docx/index.d.ts +0 -4
  359. package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
  360. package/dist/src/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -36
  361. package/dist/src/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -39
  362. package/dist/src/package/vendors/xlsx/worker/xlsx/context.d.ts +0 -7
  363. package/dist/src/package/vendors/xlsx/worker/xlsx/index.d.ts +0 -4
  364. package/dist/src/package/vendors/xlsx/worker/xlsx/util.d.ts +0 -10
  365. package/dist/worker/pdf.worker.js +0 -66
  366. package/dist/worker/pptx.worker.js +0 -21
  367. package/dist/worker/sheet.worker.js +0 -38
  368. package/dist/worker/xlsx.worker.js +0 -65
  369. /package/dist/src/package/vendors/xlsx/worker/{xlsx → sheetjs}/color.d.ts +0 -0
  370. /package/dist/src/package/vendors/xlsx/worker/{xls → sheetjs}/index.d.ts +0 -0
@@ -1,1577 +1,1476 @@
1
- var Y = Object.defineProperty;
2
- var ee = (o, n, t) => n in o ? Y(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
3
- var O = (o, n, t) => (ee(o, typeof n != "symbol" ? n + "" : n, t), t);
4
- import { defineComponent as te, computed as ne, openBlock as ie, createElementBlock as se, unref as re } from "vue";
5
- import { _ as le } from "./index.js";
6
- function F() {
7
- return {
8
- async: !1,
9
- baseUrl: null,
10
- breaks: !1,
11
- extensions: null,
12
- gfm: !0,
13
- headerIds: !0,
14
- headerPrefix: "",
15
- highlight: null,
16
- hooks: null,
17
- langPrefix: "language-",
18
- mangle: !0,
19
- pedantic: !1,
20
- renderer: null,
21
- sanitize: !1,
22
- sanitizer: null,
23
- silent: !1,
24
- smartypants: !1,
25
- tokenizer: null,
26
- walkTokens: null,
27
- xhtml: !1
28
- };
1
+ import { n as e, t } from "./defineProperty.js";
2
+ import { n, t as r } from "./objectSpread2.js";
3
+ import { n as i, t as a } from "./asyncToGenerator.js";
4
+ import { n as o, r as s, t as c } from "./viewerZoom.js";
5
+ import { t as l } from "./_plugin-vue_export-helper.js";
6
+ import { computed as u, createElementBlock as d, createElementVNode as f, defineComponent as p, normalizeStyle as m, onBeforeUnmount as ee, onMounted as te, openBlock as ne, ref as re, watch as ie } from "vue";
7
+ n(), e(), i();
8
+ var h;
9
+ function g() {
10
+ return {
11
+ async: !1,
12
+ breaks: !1,
13
+ extensions: null,
14
+ gfm: !0,
15
+ hooks: null,
16
+ pedantic: !1,
17
+ renderer: null,
18
+ silent: !1,
19
+ tokenizer: null,
20
+ walkTokens: null
21
+ };
29
22
  }
30
- let I = F();
31
- function oe(o) {
32
- I = o;
23
+ var _ = g();
24
+ function ae(e) {
25
+ _ = e;
33
26
  }
34
- const V = /[&<>"']/, ae = new RegExp(V.source, "g"), X = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, ce = new RegExp(X.source, "g"), he = {
35
- "&": "&amp;",
36
- "<": "&lt;",
37
- ">": "&gt;",
38
- '"': "&quot;",
39
- "'": "&#39;"
40
- }, U = (o) => he[o];
41
- function b(o, n) {
42
- if (n) {
43
- if (V.test(o))
44
- return o.replace(ae, U);
45
- } else if (X.test(o))
46
- return o.replace(ce, U);
47
- return o;
27
+ var v = { exec: () => null };
28
+ function y(e) {
29
+ let t = [];
30
+ return (n) => {
31
+ let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
32
+ return i || (i = e(r), t[r] = i), i;
33
+ };
48
34
  }
49
- const ue = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
50
- function W(o) {
51
- return o.replace(ue, (n, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
35
+ function b(e, t = "") {
36
+ let n = typeof e == "string" ? e : e.source, r = {
37
+ replace: (e, t) => {
38
+ let i = typeof t == "string" ? t : t.source;
39
+ return i = i.replace(x.caret, "$1"), n = n.replace(e, i), r;
40
+ },
41
+ getRegex: () => new RegExp(n, t)
42
+ };
43
+ return r;
52
44
  }
53
- const pe = /(^|[^\[])\^/g;
54
- function m(o, n) {
55
- o = typeof o == "string" ? o : o.source, n = n || "";
56
- const t = {
57
- replace: (e, i) => (i = i.source || i, i = i.replace(pe, "$1"), o = o.replace(e, i), t),
58
- getRegex: () => new RegExp(o, n)
59
- };
60
- return t;
45
+ var oe = ((e = "") => {
46
+ try {
47
+ return !!RegExp("(?<=1)(?<!1)" + e);
48
+ } catch (e) {
49
+ return !1;
50
+ }
51
+ })(), x = {
52
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
53
+ outputLinkReplace: /\\([\[\]])/g,
54
+ indentCodeCompensation: /^(\s+)(?:```)/,
55
+ beginningSpace: /^\s+/,
56
+ endingHash: /#$/,
57
+ startingSpaceChar: /^ /,
58
+ endingSpaceChar: / $/,
59
+ nonSpaceChar: /[^ ]/,
60
+ newLineCharGlobal: /\n/g,
61
+ tabCharGlobal: /\t/g,
62
+ multipleSpaceGlobal: /\s+/g,
63
+ blankLine: /^[ \t]*$/,
64
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
65
+ blockquoteStart: /^ {0,3}>/,
66
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
67
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
68
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
69
+ listIsTask: /^\[[ xX]\] +\S/,
70
+ listReplaceTask: /^\[[ xX]\] +/,
71
+ listTaskCheckbox: /\[[ xX]\]/,
72
+ anyLine: /\n.*\n/,
73
+ hrefBrackets: /^<(.*)>$/,
74
+ tableDelimiter: /[:|]/,
75
+ tableAlignChars: /^\||\| *$/g,
76
+ tableRowBlankLine: /\n[ \t]*$/,
77
+ tableAlignRight: /^ *-+: *$/,
78
+ tableAlignCenter: /^ *:-+: *$/,
79
+ tableAlignLeft: /^ *:-+ *$/,
80
+ startATag: /^<a /i,
81
+ endATag: /^<\/a>/i,
82
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
83
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
84
+ startAngleBracket: /^</,
85
+ endAngleBracket: />$/,
86
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
87
+ unicodeAlphaNumeric: /* @__PURE__ */ RegExp("[\\p{L}\\p{N}]", "u"),
88
+ escapeTest: /[&<>"']/,
89
+ escapeReplace: /[&<>"']/g,
90
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
91
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
92
+ caret: /(^|[^\[])\^/g,
93
+ percentDecode: /%25/g,
94
+ findPipe: /\|/g,
95
+ splitPipe: / \|/,
96
+ slashPipe: /\\\|/g,
97
+ carriageReturn: /\r\n|\r/g,
98
+ spaceLine: /^ +$/gm,
99
+ notSpaceStart: /^\S*/,
100
+ endingNewline: /\n$/,
101
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
102
+ nextBulletRegex: y((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
103
+ hrRegex: y((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
104
+ fencesBeginRegex: y((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
105
+ headingBeginRegex: y((e) => RegExp(`^ {0,${e}}#`)),
106
+ htmlBeginRegex: y((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
107
+ blockquoteBeginRegex: y((e) => RegExp(`^ {0,${e}}>`))
108
+ }, se = /^(?:[ \t]*(?:\n|$))+/, ce = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, le = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, S = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ue = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, C = / {0,3}(?:[*+-]|\d{1,9}[.)])/, de = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, fe = b(de).replace(/bull/g, C).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), pe = b(de).replace(/bull/g, C).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), w = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, me = /^[^\n]+/, T = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, he = b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", T).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ge = b(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, C).getRegex(), E = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", D = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", D).replace("tag", E).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ve = b(w).replace("hr", S).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), O = {
109
+ blockquote: b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ve).getRegex(),
110
+ code: ce,
111
+ def: he,
112
+ fences: le,
113
+ heading: ue,
114
+ hr: S,
115
+ html: _e,
116
+ lheading: fe,
117
+ list: ge,
118
+ newline: se,
119
+ paragraph: ve,
120
+ table: v,
121
+ text: me
122
+ }, k = b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", S).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), ye = r(r({}, O), {}, {
123
+ lheading: pe,
124
+ table: k,
125
+ paragraph: b(w).replace("hr", S).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", k).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex()
126
+ }), be = r(r({}, O), {}, {
127
+ html: b("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", D).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(),
128
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
129
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
130
+ fences: v,
131
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
132
+ paragraph: b(w).replace("hr", S).replace("heading", " *#{1,6} *[^\n]").replace("lheading", fe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
133
+ }), xe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Se = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, A = /^( {2,}|\\)\n(?!\s*$)/, Ce = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, j = /* @__PURE__ */ RegExp("[\\p{P}\\p{S}]", "u"), M = /* @__PURE__ */ RegExp("[\\s\\p{P}\\p{S}]", "u"), N = /* @__PURE__ */ RegExp("[^\\s\\p{P}\\p{S}]", "u"), we = b(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, M).getRegex(), P = /* @__PURE__ */ RegExp("(?!~)[\\p{P}\\p{S}]", "u"), Te = /* @__PURE__ */ RegExp("(?!~)[\\s\\p{P}\\p{S}]", "u"), Ee = /* @__PURE__ */ RegExp("(?:[^\\s\\p{P}\\p{S}]|~)", "u"), De = b(/link|precode-code|html/, "g").replace("link", /* @__PURE__ */ RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)", "")).replace("precode-", oe ? "(?<!`)()" : "(^^|[^`])").replace("code", /* @__PURE__ */ RegExp("(?<b>`+)[^`]+\\k<b>(?!`)", "")).replace("html", /<(?! )[^<>]*?>/).getRegex(), F = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Oe = b(F, "u").replace(/punct/g, j).getRegex(), ke = b(F, "u").replace(/punct/g, P).getRegex(), I = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ae = b(I, "gu").replace(/notPunctSpace/g, N).replace(/punctSpace/g, M).replace(/punct/g, j).getRegex(), je = b(I, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Te).replace(/punct/g, P).getRegex(), Me = b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, N).replace(/punctSpace/g, M).replace(/punct/g, j).getRegex(), Ne = b(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, j).getRegex(), Pe = b("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, N).replace(/punctSpace/g, M).replace(/punct/g, j).getRegex(), Fe = b(/\\(punct)/, "gu").replace(/punct/g, j).getRegex(), Ie = b(/^<(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(), Le = b(D).replace("(?:-->|$)", "-->").getRegex(), Re = b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Le).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ze = b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), R = b(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", T).getRegex(), z = b(/^!?\[(ref)\](?:\[\])?/).replace("ref", T).getRegex(), Be = b("reflink|nolink(?!\\()", "g").replace("reflink", R).replace("nolink", z).getRegex(), Ve = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, B = {
134
+ _backpedal: v,
135
+ anyPunctuation: Fe,
136
+ autolink: Ie,
137
+ blockSkip: De,
138
+ br: A,
139
+ code: Se,
140
+ del: v,
141
+ delLDelim: v,
142
+ delRDelim: v,
143
+ emStrongLDelim: Oe,
144
+ emStrongRDelimAst: Ae,
145
+ emStrongRDelimUnd: Me,
146
+ escape: xe,
147
+ link: ze,
148
+ nolink: z,
149
+ punctuation: we,
150
+ reflink: R,
151
+ reflinkSearch: Be,
152
+ tag: Re,
153
+ text: Ce,
154
+ url: v
155
+ }, He = r(r({}, B), {}, {
156
+ link: b(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(),
157
+ reflink: b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex()
158
+ }), V = r(r({}, B), {}, {
159
+ emStrongRDelimAst: je,
160
+ emStrongLDelim: ke,
161
+ delLDelim: Ne,
162
+ delRDelim: Pe,
163
+ url: b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Ve).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
164
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
165
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
166
+ text: b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Ve).getRegex()
167
+ }), Ue = r(r({}, V), {}, {
168
+ br: b(A).replace("{2,}", "*").getRegex(),
169
+ text: b(V.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
170
+ }), H = {
171
+ normal: O,
172
+ gfm: ye,
173
+ pedantic: be
174
+ }, U = {
175
+ normal: B,
176
+ gfm: V,
177
+ breaks: Ue,
178
+ pedantic: He
179
+ }, We = {
180
+ "&": "&amp;",
181
+ "<": "&lt;",
182
+ ">": "&gt;",
183
+ "\"": "&quot;",
184
+ "'": "&#39;"
185
+ }, Ge = (e) => We[e];
186
+ function W(e, t) {
187
+ if (t) {
188
+ if (x.escapeTest.test(e)) return e.replace(x.escapeReplace, Ge);
189
+ } else if (x.escapeTestNoEncode.test(e)) return e.replace(x.escapeReplaceNoEncode, Ge);
190
+ return e;
61
191
  }
62
- const fe = /[^\w:]/g, ge = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
63
- function P(o, n, t) {
64
- if (o) {
65
- let e;
66
- try {
67
- e = decodeURIComponent(W(t)).replace(fe, "").toLowerCase();
68
- } catch {
69
- return null;
70
- }
71
- if (e.indexOf("javascript:") === 0 || e.indexOf("vbscript:") === 0 || e.indexOf("data:") === 0)
72
- return null;
73
- }
74
- n && !ge.test(t) && (t = xe(n, t));
75
- try {
76
- t = encodeURI(t).replace(/%25/g, "%");
77
- } catch {
78
- return null;
79
- }
80
- return t;
192
+ function Ke(e) {
193
+ try {
194
+ e = encodeURI(e).replace(x.percentDecode, "%");
195
+ } catch (e) {
196
+ return null;
197
+ }
198
+ return e;
81
199
  }
82
- const L = {}, de = /^[^:]+:\/*[^/]*$/, ke = /^([^:]+:)[\s\S]*$/, me = /^([^:]+:\/*[^/]*)[\s\S]*$/;
83
- function xe(o, n) {
84
- L[" " + o] || (de.test(o) ? L[" " + o] = o + "/" : L[" " + o] = B(o, "/", !0)), o = L[" " + o];
85
- const t = o.indexOf(":") === -1;
86
- return n.substring(0, 2) === "//" ? t ? n : o.replace(ke, "$1") + n : n.charAt(0) === "/" ? t ? n : o.replace(me, "$1") + n : o + n;
200
+ function qe(e, t) {
201
+ var n;
202
+ let r = e.replace(x.findPipe, (e, t, n) => {
203
+ let r = !1, i = t;
204
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
205
+ return r ? "|" : " |";
206
+ }).split(x.splitPipe), i = 0;
207
+ if (r[0].trim() || r.shift(), r.length > 0 && !((n = r.at(-1)) != null && n.trim()) && r.pop(), t) if (r.length > t) r.splice(t);
208
+ else for (; r.length < t;) r.push("");
209
+ for (; i < r.length; i++) r[i] = r[i].trim().replace(x.slashPipe, "|");
210
+ return r;
87
211
  }
88
- const Z = { exec: function() {
89
- } };
90
- function Q(o, n) {
91
- const t = o.replace(/\|/g, (s, r, l) => {
92
- let c = !1, d = r;
93
- for (; --d >= 0 && l[d] === "\\"; )
94
- c = !c;
95
- return c ? "|" : " |";
96
- }), e = t.split(/ \|/);
97
- let i = 0;
98
- if (e[0].trim() || e.shift(), e.length > 0 && !e[e.length - 1].trim() && e.pop(), e.length > n)
99
- e.splice(n);
100
- else
101
- for (; e.length < n; )
102
- e.push("");
103
- for (; i < e.length; i++)
104
- e[i] = e[i].trim().replace(/\\\|/g, "|");
105
- return e;
212
+ function G(e, t, n) {
213
+ let r = e.length;
214
+ if (r === 0) return "";
215
+ let i = 0;
216
+ for (; i < r;) {
217
+ let a = e.charAt(r - i - 1);
218
+ if (a === t && !n) i++;
219
+ else if (a !== t && n) i++;
220
+ else break;
221
+ }
222
+ return e.slice(0, r - i);
106
223
  }
107
- function B(o, n, t) {
108
- const e = o.length;
109
- if (e === 0)
110
- return "";
111
- let i = 0;
112
- for (; i < e; ) {
113
- const s = o.charAt(e - i - 1);
114
- if (s === n && !t)
115
- i++;
116
- else if (s !== n && t)
117
- i++;
118
- else
119
- break;
120
- }
121
- return o.slice(0, e - i);
224
+ function Je(e) {
225
+ let t = e.split("\n"), n = t.length - 1;
226
+ for (; n >= 0 && x.blankLine.test(t[n]);) n--;
227
+ return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
122
228
  }
123
- function we(o, n) {
124
- if (o.indexOf(n[1]) === -1)
125
- return -1;
126
- const t = o.length;
127
- let e = 0, i = 0;
128
- for (; i < t; i++)
129
- if (o[i] === "\\")
130
- i++;
131
- else if (o[i] === n[0])
132
- e++;
133
- else if (o[i] === n[1] && (e--, e < 0))
134
- return i;
135
- return -1;
229
+ function Ye(e, t) {
230
+ if (e.indexOf(t[1]) === -1) return -1;
231
+ let n = 0;
232
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
233
+ else if (e[r] === t[0]) n++;
234
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
235
+ return n > 0 ? -2 : -1;
136
236
  }
137
- function be(o) {
138
- o && o.sanitize && !o.silent && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
237
+ function Xe(e, t = 0) {
238
+ let n = t, r = "";
239
+ for (let t of e) if (t === " ") {
240
+ let e = 4 - n % 4;
241
+ r += " ".repeat(e), n += e;
242
+ } else r += t, n++;
243
+ return r;
139
244
  }
140
- function j(o, n) {
141
- if (n < 1)
142
- return "";
143
- let t = "";
144
- for (; n > 1; )
145
- n & 1 && (t += o), n >>= 1, o += o;
146
- return t + o;
245
+ function Ze(e, t, n, r, i) {
246
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
247
+ r.state.inLink = !0;
248
+ let c = {
249
+ type: e[0].charAt(0) === "!" ? "image" : "link",
250
+ raw: n,
251
+ href: a,
252
+ title: o,
253
+ text: s,
254
+ tokens: r.inlineTokens(s)
255
+ };
256
+ return r.state.inLink = !1, c;
147
257
  }
148
- function N(o, n, t, e) {
149
- const i = n.href, s = n.title ? b(n.title) : null, r = o[1].replace(/\\([\[\]])/g, "$1");
150
- if (o[0].charAt(0) !== "!") {
151
- e.state.inLink = !0;
152
- const l = {
153
- type: "link",
154
- raw: t,
155
- href: i,
156
- title: s,
157
- text: r,
158
- tokens: e.inlineTokens(r)
159
- };
160
- return e.state.inLink = !1, l;
161
- }
162
- return {
163
- type: "image",
164
- raw: t,
165
- href: i,
166
- title: s,
167
- text: b(r)
168
- };
258
+ function Qe(e, t, n) {
259
+ let r = e.match(n.other.indentCodeCompensation);
260
+ if (r === null) return t;
261
+ let i = r[1];
262
+ return t.split("\n").map((e) => {
263
+ let t = e.match(n.other.beginningSpace);
264
+ if (t === null) return e;
265
+ let [r] = t;
266
+ return r.length >= i.length ? e.slice(i.length) : e;
267
+ }).join("\n");
169
268
  }
170
- function _e(o, n) {
171
- const t = o.match(/^(\s+)(?:```)/);
172
- if (t === null)
173
- return n;
174
- const e = t[1];
175
- return n.split(`
176
- `).map((i) => {
177
- const s = i.match(/^\s+/);
178
- if (s === null)
179
- return i;
180
- const [r] = s;
181
- return r.length >= e.length ? i.slice(e.length) : i;
182
- }).join(`
183
- `);
184
- }
185
- class q {
186
- constructor(n) {
187
- this.options = n || I;
188
- }
189
- space(n) {
190
- const t = this.rules.block.newline.exec(n);
191
- if (t && t[0].length > 0)
192
- return {
193
- type: "space",
194
- raw: t[0]
195
- };
196
- }
197
- code(n) {
198
- const t = this.rules.block.code.exec(n);
199
- if (t) {
200
- const e = t[0].replace(/^ {1,4}/gm, "");
201
- return {
202
- type: "code",
203
- raw: t[0],
204
- codeBlockStyle: "indented",
205
- text: this.options.pedantic ? e : B(e, `
206
- `)
207
- };
208
- }
209
- }
210
- fences(n) {
211
- const t = this.rules.block.fences.exec(n);
212
- if (t) {
213
- const e = t[0], i = _e(e, t[3] || "");
214
- return {
215
- type: "code",
216
- raw: e,
217
- lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2],
218
- text: i
219
- };
220
- }
221
- }
222
- heading(n) {
223
- const t = this.rules.block.heading.exec(n);
224
- if (t) {
225
- let e = t[2].trim();
226
- if (/#$/.test(e)) {
227
- const i = B(e, "#");
228
- (this.options.pedantic || !i || / $/.test(i)) && (e = i.trim());
229
- }
230
- return {
231
- type: "heading",
232
- raw: t[0],
233
- depth: t[1].length,
234
- text: e,
235
- tokens: this.lexer.inline(e)
236
- };
237
- }
238
- }
239
- hr(n) {
240
- const t = this.rules.block.hr.exec(n);
241
- if (t)
242
- return {
243
- type: "hr",
244
- raw: t[0]
245
- };
246
- }
247
- blockquote(n) {
248
- const t = this.rules.block.blockquote.exec(n);
249
- if (t) {
250
- const e = t[0].replace(/^ *>[ \t]?/gm, ""), i = this.lexer.state.top;
251
- this.lexer.state.top = !0;
252
- const s = this.lexer.blockTokens(e);
253
- return this.lexer.state.top = i, {
254
- type: "blockquote",
255
- raw: t[0],
256
- tokens: s,
257
- text: e
258
- };
259
- }
260
- }
261
- list(n) {
262
- let t = this.rules.block.list.exec(n);
263
- if (t) {
264
- let e, i, s, r, l, c, d, f, g, k, h, z, _ = t[1].trim();
265
- const T = _.length > 1, x = {
266
- type: "list",
267
- raw: "",
268
- ordered: T,
269
- start: T ? +_.slice(0, -1) : "",
270
- loose: !1,
271
- items: []
272
- };
273
- _ = T ? `\\d{1,9}\\${_.slice(-1)}` : `\\${_}`, this.options.pedantic && (_ = T ? _ : "[*+-]");
274
- const w = new RegExp(`^( {0,3}${_})((?:[ ][^\\n]*)?(?:\\n|$))`);
275
- for (; n && (z = !1, !(!(t = w.exec(n)) || this.rules.block.hr.test(n))); ) {
276
- if (e = t[0], n = n.substring(e.length), f = t[2].split(`
277
- `, 1)[0].replace(/^\t+/, (S) => " ".repeat(3 * S.length)), g = n.split(`
278
- `, 1)[0], this.options.pedantic ? (r = 2, h = f.trimLeft()) : (r = t[2].search(/[^ ]/), r = r > 4 ? 1 : r, h = f.slice(r), r += t[1].length), c = !1, !f && /^ *$/.test(g) && (e += g + `
279
- `, n = n.substring(g.length + 1), z = !0), !z) {
280
- const S = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), y = new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), $ = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), C = new RegExp(`^ {0,${Math.min(3, r - 1)}}#`);
281
- for (; n && (k = n.split(`
282
- `, 1)[0], g = k, this.options.pedantic && (g = g.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !($.test(g) || C.test(g) || S.test(g) || y.test(n))); ) {
283
- if (g.search(/[^ ]/) >= r || !g.trim())
284
- h += `
285
- ` + g.slice(r);
286
- else {
287
- if (c || f.search(/[^ ]/) >= 4 || $.test(f) || C.test(f) || y.test(f))
288
- break;
289
- h += `
290
- ` + g;
291
- }
292
- !c && !g.trim() && (c = !0), e += k + `
293
- `, n = n.substring(k.length + 1), f = g.slice(r);
294
- }
295
- }
296
- x.loose || (d ? x.loose = !0 : /\n *\n *$/.test(e) && (d = !0)), this.options.gfm && (i = /^\[[ xX]\] /.exec(h), i && (s = i[0] !== "[ ] ", h = h.replace(/^\[[ xX]\] +/, ""))), x.items.push({
297
- type: "list_item",
298
- raw: e,
299
- task: !!i,
300
- checked: s,
301
- loose: !1,
302
- text: h
303
- }), x.raw += e;
304
- }
305
- x.items[x.items.length - 1].raw = e.trimRight(), x.items[x.items.length - 1].text = h.trimRight(), x.raw = x.raw.trimRight();
306
- const E = x.items.length;
307
- for (l = 0; l < E; l++)
308
- if (this.lexer.state.top = !1, x.items[l].tokens = this.lexer.blockTokens(x.items[l].text, []), !x.loose) {
309
- const S = x.items[l].tokens.filter(($) => $.type === "space"), y = S.length > 0 && S.some(($) => /\n.*\n/.test($.raw));
310
- x.loose = y;
311
- }
312
- if (x.loose)
313
- for (l = 0; l < E; l++)
314
- x.items[l].loose = !0;
315
- return x;
316
- }
317
- }
318
- html(n) {
319
- const t = this.rules.block.html.exec(n);
320
- if (t) {
321
- const e = {
322
- type: "html",
323
- raw: t[0],
324
- pre: !this.options.sanitizer && (t[1] === "pre" || t[1] === "script" || t[1] === "style"),
325
- text: t[0]
326
- };
327
- if (this.options.sanitize) {
328
- const i = this.options.sanitizer ? this.options.sanitizer(t[0]) : b(t[0]);
329
- e.type = "paragraph", e.text = i, e.tokens = this.lexer.inline(i);
330
- }
331
- return e;
332
- }
333
- }
334
- def(n) {
335
- const t = this.rules.block.def.exec(n);
336
- if (t) {
337
- const e = t[1].toLowerCase().replace(/\s+/g, " "), i = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3];
338
- return {
339
- type: "def",
340
- tag: e,
341
- raw: t[0],
342
- href: i,
343
- title: s
344
- };
345
- }
346
- }
347
- table(n) {
348
- const t = this.rules.block.table.exec(n);
349
- if (t) {
350
- const e = {
351
- type: "table",
352
- header: Q(t[1]).map((i) => ({ text: i })),
353
- align: t[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
354
- rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
355
- `) : []
356
- };
357
- if (e.header.length === e.align.length) {
358
- e.raw = t[0];
359
- let i = e.align.length, s, r, l, c;
360
- for (s = 0; s < i; s++)
361
- /^ *-+: *$/.test(e.align[s]) ? e.align[s] = "right" : /^ *:-+: *$/.test(e.align[s]) ? e.align[s] = "center" : /^ *:-+ *$/.test(e.align[s]) ? e.align[s] = "left" : e.align[s] = null;
362
- for (i = e.rows.length, s = 0; s < i; s++)
363
- e.rows[s] = Q(e.rows[s], e.header.length).map((d) => ({ text: d }));
364
- for (i = e.header.length, r = 0; r < i; r++)
365
- e.header[r].tokens = this.lexer.inline(e.header[r].text);
366
- for (i = e.rows.length, r = 0; r < i; r++)
367
- for (c = e.rows[r], l = 0; l < c.length; l++)
368
- c[l].tokens = this.lexer.inline(c[l].text);
369
- return e;
370
- }
371
- }
372
- }
373
- lheading(n) {
374
- const t = this.rules.block.lheading.exec(n);
375
- if (t)
376
- return {
377
- type: "heading",
378
- raw: t[0],
379
- depth: t[2].charAt(0) === "=" ? 1 : 2,
380
- text: t[1],
381
- tokens: this.lexer.inline(t[1])
382
- };
383
- }
384
- paragraph(n) {
385
- const t = this.rules.block.paragraph.exec(n);
386
- if (t) {
387
- const e = t[1].charAt(t[1].length - 1) === `
388
- ` ? t[1].slice(0, -1) : t[1];
389
- return {
390
- type: "paragraph",
391
- raw: t[0],
392
- text: e,
393
- tokens: this.lexer.inline(e)
394
- };
395
- }
396
- }
397
- text(n) {
398
- const t = this.rules.block.text.exec(n);
399
- if (t)
400
- return {
401
- type: "text",
402
- raw: t[0],
403
- text: t[0],
404
- tokens: this.lexer.inline(t[0])
405
- };
406
- }
407
- escape(n) {
408
- const t = this.rules.inline.escape.exec(n);
409
- if (t)
410
- return {
411
- type: "escape",
412
- raw: t[0],
413
- text: b(t[1])
414
- };
415
- }
416
- tag(n) {
417
- const t = this.rules.inline.tag.exec(n);
418
- if (t)
419
- return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
420
- type: this.options.sanitize ? "text" : "html",
421
- raw: t[0],
422
- inLink: this.lexer.state.inLink,
423
- inRawBlock: this.lexer.state.inRawBlock,
424
- text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(t[0]) : b(t[0]) : t[0]
425
- };
426
- }
427
- link(n) {
428
- const t = this.rules.inline.link.exec(n);
429
- if (t) {
430
- const e = t[2].trim();
431
- if (!this.options.pedantic && /^</.test(e)) {
432
- if (!/>$/.test(e))
433
- return;
434
- const r = B(e.slice(0, -1), "\\");
435
- if ((e.length - r.length) % 2 === 0)
436
- return;
437
- } else {
438
- const r = we(t[2], "()");
439
- if (r > -1) {
440
- const c = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + r;
441
- t[2] = t[2].substring(0, r), t[0] = t[0].substring(0, c).trim(), t[3] = "";
442
- }
443
- }
444
- let i = t[2], s = "";
445
- if (this.options.pedantic) {
446
- const r = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);
447
- r && (i = r[1], s = r[3]);
448
- } else
449
- s = t[3] ? t[3].slice(1, -1) : "";
450
- return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(e) ? i = i.slice(1) : i = i.slice(1, -1)), N(t, {
451
- href: i && i.replace(this.rules.inline._escapes, "$1"),
452
- title: s && s.replace(this.rules.inline._escapes, "$1")
453
- }, t[0], this.lexer);
454
- }
455
- }
456
- reflink(n, t) {
457
- let e;
458
- if ((e = this.rules.inline.reflink.exec(n)) || (e = this.rules.inline.nolink.exec(n))) {
459
- let i = (e[2] || e[1]).replace(/\s+/g, " ");
460
- if (i = t[i.toLowerCase()], !i) {
461
- const s = e[0].charAt(0);
462
- return {
463
- type: "text",
464
- raw: s,
465
- text: s
466
- };
467
- }
468
- return N(e, i, e[0], this.lexer);
469
- }
470
- }
471
- emStrong(n, t, e = "") {
472
- let i = this.rules.inline.emStrong.lDelim.exec(n);
473
- if (!i || i[3] && e.match(/[\p{L}\p{N}]/u))
474
- return;
475
- const s = i[1] || i[2] || "";
476
- if (!s || s && (e === "" || this.rules.inline.punctuation.exec(e))) {
477
- const r = i[0].length - 1;
478
- let l, c, d = r, f = 0;
479
- const g = i[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
480
- for (g.lastIndex = 0, t = t.slice(-1 * n.length + r); (i = g.exec(t)) != null; ) {
481
- if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l)
482
- continue;
483
- if (c = l.length, i[3] || i[4]) {
484
- d += c;
485
- continue;
486
- } else if ((i[5] || i[6]) && r % 3 && !((r + c) % 3)) {
487
- f += c;
488
- continue;
489
- }
490
- if (d -= c, d > 0)
491
- continue;
492
- c = Math.min(c, c + d + f);
493
- const k = n.slice(0, r + i.index + (i[0].length - l.length) + c);
494
- if (Math.min(r, c) % 2) {
495
- const z = k.slice(1, -1);
496
- return {
497
- type: "em",
498
- raw: k,
499
- text: z,
500
- tokens: this.lexer.inlineTokens(z)
501
- };
502
- }
503
- const h = k.slice(2, -2);
504
- return {
505
- type: "strong",
506
- raw: k,
507
- text: h,
508
- tokens: this.lexer.inlineTokens(h)
509
- };
510
- }
511
- }
512
- }
513
- codespan(n) {
514
- const t = this.rules.inline.code.exec(n);
515
- if (t) {
516
- let e = t[2].replace(/\n/g, " ");
517
- const i = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e);
518
- return i && s && (e = e.substring(1, e.length - 1)), e = b(e, !0), {
519
- type: "codespan",
520
- raw: t[0],
521
- text: e
522
- };
523
- }
524
- }
525
- br(n) {
526
- const t = this.rules.inline.br.exec(n);
527
- if (t)
528
- return {
529
- type: "br",
530
- raw: t[0]
531
- };
532
- }
533
- del(n) {
534
- const t = this.rules.inline.del.exec(n);
535
- if (t)
536
- return {
537
- type: "del",
538
- raw: t[0],
539
- text: t[2],
540
- tokens: this.lexer.inlineTokens(t[2])
541
- };
542
- }
543
- autolink(n, t) {
544
- const e = this.rules.inline.autolink.exec(n);
545
- if (e) {
546
- let i, s;
547
- return e[2] === "@" ? (i = b(this.options.mangle ? t(e[1]) : e[1]), s = "mailto:" + i) : (i = b(e[1]), s = i), {
548
- type: "link",
549
- raw: e[0],
550
- text: i,
551
- href: s,
552
- tokens: [
553
- {
554
- type: "text",
555
- raw: i,
556
- text: i
557
- }
558
- ]
559
- };
560
- }
561
- }
562
- url(n, t) {
563
- let e;
564
- if (e = this.rules.inline.url.exec(n)) {
565
- let i, s;
566
- if (e[2] === "@")
567
- i = b(this.options.mangle ? t(e[0]) : e[0]), s = "mailto:" + i;
568
- else {
569
- let r;
570
- do
571
- r = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])[0];
572
- while (r !== e[0]);
573
- i = b(e[0]), e[1] === "www." ? s = "http://" + e[0] : s = e[0];
574
- }
575
- return {
576
- type: "link",
577
- raw: e[0],
578
- text: i,
579
- href: s,
580
- tokens: [
581
- {
582
- type: "text",
583
- raw: i,
584
- text: i
585
- }
586
- ]
587
- };
588
- }
589
- }
590
- inlineText(n, t) {
591
- const e = this.rules.inline.text.exec(n);
592
- if (e) {
593
- let i;
594
- return this.lexer.state.inRawBlock ? i = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(e[0]) : b(e[0]) : e[0] : i = b(this.options.smartypants ? t(e[0]) : e[0]), {
595
- type: "text",
596
- raw: e[0],
597
- text: i
598
- };
599
- }
600
- }
601
- }
602
- const u = {
603
- newline: /^(?: *(?:\n|$))+/,
604
- code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
605
- fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
606
- hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
607
- heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
608
- blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
609
- list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
610
- html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
611
- def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
612
- table: Z,
613
- lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
614
- // regex template, placeholders will be replaced according to different paragraph
615
- // interruption rules of commonmark and the original markdown spec:
616
- _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
617
- text: /^[^\n]+/
618
- };
619
- u._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
620
- u._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
621
- u.def = m(u.def).replace("label", u._label).replace("title", u._title).getRegex();
622
- u.bullet = /(?:[*+-]|\d{1,9}[.)])/;
623
- u.listItemStart = m(/^( *)(bull) */).replace("bull", u.bullet).getRegex();
624
- u.list = m(u.list).replace(/bull/g, u.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + u.def.source + ")").getRegex();
625
- u._tag = "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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
626
- u._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
627
- u.html = m(u.html, "i").replace("comment", u._comment).replace("tag", u._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
628
- u.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
629
- u.blockquote = m(u.blockquote).replace("paragraph", u.paragraph).getRegex();
630
- u.normal = { ...u };
631
- u.gfm = {
632
- ...u.normal,
633
- table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
634
- // Cells
635
- };
636
- u.gfm.table = m(u.gfm.table).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
637
- u.gfm.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", u.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
638
- u.pedantic = {
639
- ...u.normal,
640
- html: m(
641
- `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
642
- ).replace("comment", u._comment).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(),
643
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
644
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
645
- fences: Z,
646
- // fences not supported
647
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
648
- paragraph: m(u.normal._paragraph).replace("hr", u.hr).replace("heading", ` *#{1,6} *[^
649
- ]`).replace("lheading", u.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
650
- };
651
- const a = {
652
- escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
653
- autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
654
- url: Z,
655
- tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
656
- // CDATA section
657
- link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
658
- reflink: /^!?\[(label)\]\[(ref)\]/,
659
- nolink: /^!?\[(ref)\](?:\[\])?/,
660
- reflinkSearch: "reflink|nolink(?!\\()",
661
- emStrong: {
662
- lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
663
- // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
664
- // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
665
- rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,
666
- rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/
667
- // ^- Not allowed for _
668
- },
669
- code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
670
- br: /^( {2,}|\\)\n(?!\s*$)/,
671
- del: Z,
672
- text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
673
- punctuation: /^([\spunctuation])/
674
- };
675
- a._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
676
- a.punctuation = m(a.punctuation).replace(/punctuation/g, a._punctuation).getRegex();
677
- a.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
678
- a.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
679
- a._comment = m(u._comment).replace("(?:-->|$)", "-->").getRegex();
680
- a.emStrong.lDelim = m(a.emStrong.lDelim).replace(/punct/g, a._punctuation).getRegex();
681
- a.emStrong.rDelimAst = m(a.emStrong.rDelimAst, "g").replace(/punct/g, a._punctuation).getRegex();
682
- a.emStrong.rDelimUnd = m(a.emStrong.rDelimUnd, "g").replace(/punct/g, a._punctuation).getRegex();
683
- a._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
684
- a._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
685
- a._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])?)+(?![-_])/;
686
- a.autolink = m(a.autolink).replace("scheme", a._scheme).replace("email", a._email).getRegex();
687
- a._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
688
- a.tag = m(a.tag).replace("comment", a._comment).replace("attribute", a._attribute).getRegex();
689
- a._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
690
- a._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
691
- a._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
692
- a.link = m(a.link).replace("label", a._label).replace("href", a._href).replace("title", a._title).getRegex();
693
- a.reflink = m(a.reflink).replace("label", a._label).replace("ref", u._label).getRegex();
694
- a.nolink = m(a.nolink).replace("ref", u._label).getRegex();
695
- a.reflinkSearch = m(a.reflinkSearch, "g").replace("reflink", a.reflink).replace("nolink", a.nolink).getRegex();
696
- a.normal = { ...a };
697
- a.pedantic = {
698
- ...a.normal,
699
- strong: {
700
- start: /^__|\*\*/,
701
- middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
702
- endAst: /\*\*(?!\*)/g,
703
- endUnd: /__(?!_)/g
704
- },
705
- em: {
706
- start: /^_|\*/,
707
- middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
708
- endAst: /\*(?!\*)/g,
709
- endUnd: /_(?!_)/g
710
- },
711
- link: m(/^!?\[(label)\]\((.*?)\)/).replace("label", a._label).getRegex(),
712
- reflink: m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", a._label).getRegex()
713
- };
714
- a.gfm = {
715
- ...a.normal,
716
- escape: m(a.escape).replace("])", "~|])").getRegex(),
717
- _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
718
- url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
719
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
720
- del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
721
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
722
- };
723
- a.gfm.url = m(a.gfm.url, "i").replace("email", a.gfm._extended_email).getRegex();
724
- a.breaks = {
725
- ...a.gfm,
726
- br: m(a.br).replace("{2,}", "*").getRegex(),
727
- text: m(a.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
728
- };
729
- function ye(o) {
730
- return o.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
731
- }
732
- function H(o) {
733
- let n = "", t, e;
734
- const i = o.length;
735
- for (t = 0; t < i; t++)
736
- e = o.charCodeAt(t), Math.random() > 0.5 && (e = "x" + e.toString(16)), n += "&#" + e + ";";
737
- return n;
738
- }
739
- class R {
740
- constructor(n) {
741
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = n || I, 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 = {
742
- inLink: !1,
743
- inRawBlock: !1,
744
- top: !0
745
- };
746
- const t = {
747
- block: u.normal,
748
- inline: a.normal
749
- };
750
- this.options.pedantic ? (t.block = u.pedantic, t.inline = a.pedantic) : this.options.gfm && (t.block = u.gfm, this.options.breaks ? t.inline = a.breaks : t.inline = a.gfm), this.tokenizer.rules = t;
751
- }
752
- /**
753
- * Expose Rules
754
- */
755
- static get rules() {
756
- return {
757
- block: u,
758
- inline: a
759
- };
760
- }
761
- /**
762
- * Static Lex Method
763
- */
764
- static lex(n, t) {
765
- return new R(t).lex(n);
766
- }
767
- /**
768
- * Static Lex Inline Method
769
- */
770
- static lexInline(n, t) {
771
- return new R(t).inlineTokens(n);
772
- }
773
- /**
774
- * Preprocessing
775
- */
776
- lex(n) {
777
- n = n.replace(/\r\n|\r/g, `
778
- `), this.blockTokens(n, this.tokens);
779
- let t;
780
- for (; t = this.inlineQueue.shift(); )
781
- this.inlineTokens(t.src, t.tokens);
782
- return this.tokens;
783
- }
784
- /**
785
- * Lexing
786
- */
787
- blockTokens(n, t = []) {
788
- this.options.pedantic ? n = n.replace(/\t/g, " ").replace(/^ +$/gm, "") : n = n.replace(/^( *)(\t+)/gm, (l, c, d) => c + " ".repeat(d.length));
789
- let e, i, s, r;
790
- for (; n; )
791
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (e = l.call({ lexer: this }, n, t)) ? (n = n.substring(e.raw.length), t.push(e), !0) : !1))) {
792
- if (e = this.tokenizer.space(n)) {
793
- n = n.substring(e.raw.length), e.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
794
- ` : t.push(e);
795
- continue;
796
- }
797
- if (e = this.tokenizer.code(n)) {
798
- n = n.substring(e.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
799
- ` + e.raw, i.text += `
800
- ` + e.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e);
801
- continue;
802
- }
803
- if (e = this.tokenizer.fences(n)) {
804
- n = n.substring(e.raw.length), t.push(e);
805
- continue;
806
- }
807
- if (e = this.tokenizer.heading(n)) {
808
- n = n.substring(e.raw.length), t.push(e);
809
- continue;
810
- }
811
- if (e = this.tokenizer.hr(n)) {
812
- n = n.substring(e.raw.length), t.push(e);
813
- continue;
814
- }
815
- if (e = this.tokenizer.blockquote(n)) {
816
- n = n.substring(e.raw.length), t.push(e);
817
- continue;
818
- }
819
- if (e = this.tokenizer.list(n)) {
820
- n = n.substring(e.raw.length), t.push(e);
821
- continue;
822
- }
823
- if (e = this.tokenizer.html(n)) {
824
- n = n.substring(e.raw.length), t.push(e);
825
- continue;
826
- }
827
- if (e = this.tokenizer.def(n)) {
828
- n = n.substring(e.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
829
- ` + e.raw, i.text += `
830
- ` + e.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[e.tag] || (this.tokens.links[e.tag] = {
831
- href: e.href,
832
- title: e.title
833
- });
834
- continue;
835
- }
836
- if (e = this.tokenizer.table(n)) {
837
- n = n.substring(e.raw.length), t.push(e);
838
- continue;
839
- }
840
- if (e = this.tokenizer.lheading(n)) {
841
- n = n.substring(e.raw.length), t.push(e);
842
- continue;
843
- }
844
- if (s = n, this.options.extensions && this.options.extensions.startBlock) {
845
- let l = 1 / 0;
846
- const c = n.slice(1);
847
- let d;
848
- this.options.extensions.startBlock.forEach(function(f) {
849
- d = f.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
850
- }), l < 1 / 0 && l >= 0 && (s = n.substring(0, l + 1));
851
- }
852
- if (this.state.top && (e = this.tokenizer.paragraph(s))) {
853
- i = t[t.length - 1], r && i.type === "paragraph" ? (i.raw += `
854
- ` + e.raw, i.text += `
855
- ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e), r = s.length !== n.length, n = n.substring(e.raw.length);
856
- continue;
857
- }
858
- if (e = this.tokenizer.text(n)) {
859
- n = n.substring(e.raw.length), i = t[t.length - 1], i && i.type === "text" ? (i.raw += `
860
- ` + e.raw, i.text += `
861
- ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e);
862
- continue;
863
- }
864
- if (n) {
865
- const l = "Infinite loop on byte: " + n.charCodeAt(0);
866
- if (this.options.silent) {
867
- console.error(l);
868
- break;
869
- } else
870
- throw new Error(l);
871
- }
872
- }
873
- return this.state.top = !0, t;
874
- }
875
- inline(n, t = []) {
876
- return this.inlineQueue.push({ src: n, tokens: t }), t;
877
- }
878
- /**
879
- * Lexing/Compiling
880
- */
881
- inlineTokens(n, t = []) {
882
- let e, i, s, r = n, l, c, d;
883
- if (this.tokens.links) {
884
- const f = Object.keys(this.tokens.links);
885
- if (f.length > 0)
886
- for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
887
- f.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, l.index) + "[" + j("a", l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
888
- }
889
- for (; (l = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
890
- r = r.slice(0, l.index) + "[" + j("a", l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
891
- for (; (l = this.tokenizer.rules.inline.escapedEmSt.exec(r)) != null; )
892
- r = r.slice(0, l.index + l[0].length - 2) + "++" + r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex), this.tokenizer.rules.inline.escapedEmSt.lastIndex--;
893
- for (; n; )
894
- if (c || (d = ""), c = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (e = f.call({ lexer: this }, n, t)) ? (n = n.substring(e.raw.length), t.push(e), !0) : !1))) {
895
- if (e = this.tokenizer.escape(n)) {
896
- n = n.substring(e.raw.length), t.push(e);
897
- continue;
898
- }
899
- if (e = this.tokenizer.tag(n)) {
900
- n = n.substring(e.raw.length), i = t[t.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
901
- continue;
902
- }
903
- if (e = this.tokenizer.link(n)) {
904
- n = n.substring(e.raw.length), t.push(e);
905
- continue;
906
- }
907
- if (e = this.tokenizer.reflink(n, this.tokens.links)) {
908
- n = n.substring(e.raw.length), i = t[t.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
909
- continue;
910
- }
911
- if (e = this.tokenizer.emStrong(n, r, d)) {
912
- n = n.substring(e.raw.length), t.push(e);
913
- continue;
914
- }
915
- if (e = this.tokenizer.codespan(n)) {
916
- n = n.substring(e.raw.length), t.push(e);
917
- continue;
918
- }
919
- if (e = this.tokenizer.br(n)) {
920
- n = n.substring(e.raw.length), t.push(e);
921
- continue;
922
- }
923
- if (e = this.tokenizer.del(n)) {
924
- n = n.substring(e.raw.length), t.push(e);
925
- continue;
926
- }
927
- if (e = this.tokenizer.autolink(n, H)) {
928
- n = n.substring(e.raw.length), t.push(e);
929
- continue;
930
- }
931
- if (!this.state.inLink && (e = this.tokenizer.url(n, H))) {
932
- n = n.substring(e.raw.length), t.push(e);
933
- continue;
934
- }
935
- if (s = n, this.options.extensions && this.options.extensions.startInline) {
936
- let f = 1 / 0;
937
- const g = n.slice(1);
938
- let k;
939
- this.options.extensions.startInline.forEach(function(h) {
940
- k = h.call({ lexer: this }, g), typeof k == "number" && k >= 0 && (f = Math.min(f, k));
941
- }), f < 1 / 0 && f >= 0 && (s = n.substring(0, f + 1));
942
- }
943
- if (e = this.tokenizer.inlineText(s, ye)) {
944
- n = n.substring(e.raw.length), e.raw.slice(-1) !== "_" && (d = e.raw.slice(-1)), c = !0, i = t[t.length - 1], i && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
945
- continue;
946
- }
947
- if (n) {
948
- const f = "Infinite loop on byte: " + n.charCodeAt(0);
949
- if (this.options.silent) {
950
- console.error(f);
951
- break;
952
- } else
953
- throw new Error(f);
954
- }
955
- }
956
- return t;
957
- }
958
- }
959
- class D {
960
- constructor(n) {
961
- this.options = n || I;
962
- }
963
- code(n, t, e) {
964
- const i = (t || "").match(/\S*/)[0];
965
- if (this.options.highlight) {
966
- const s = this.options.highlight(n, i);
967
- s != null && s !== n && (e = !0, n = s);
968
- }
969
- return n = n.replace(/\n$/, "") + `
970
- `, i ? '<pre><code class="' + this.options.langPrefix + b(i) + '">' + (e ? n : b(n, !0)) + `</code></pre>
971
- ` : "<pre><code>" + (e ? n : b(n, !0)) + `</code></pre>
972
- `;
973
- }
974
- /**
975
- * @param {string} quote
976
- */
977
- blockquote(n) {
978
- return `<blockquote>
979
- ${n}</blockquote>
980
- `;
981
- }
982
- html(n) {
983
- return n;
984
- }
985
- /**
986
- * @param {string} text
987
- * @param {string} level
988
- * @param {string} raw
989
- * @param {any} slugger
990
- */
991
- heading(n, t, e, i) {
992
- if (this.options.headerIds) {
993
- const s = this.options.headerPrefix + i.slug(e);
994
- return `<h${t} id="${s}">${n}</h${t}>
995
- `;
996
- }
997
- return `<h${t}>${n}</h${t}>
998
- `;
999
- }
1000
- hr() {
1001
- return this.options.xhtml ? `<hr/>
1002
- ` : `<hr>
269
+ var K = class {
270
+ constructor(e) {
271
+ t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || _;
272
+ }
273
+ space(e) {
274
+ let t = this.rules.block.newline.exec(e);
275
+ if (t && t[0].length > 0) return {
276
+ type: "space",
277
+ raw: t[0]
278
+ };
279
+ }
280
+ code(e) {
281
+ let t = this.rules.block.code.exec(e);
282
+ if (t) {
283
+ let e = this.options.pedantic ? t[0] : Je(t[0]);
284
+ return {
285
+ type: "code",
286
+ raw: e,
287
+ codeBlockStyle: "indented",
288
+ text: e.replace(this.rules.other.codeRemoveIndent, "")
289
+ };
290
+ }
291
+ }
292
+ fences(e) {
293
+ let t = this.rules.block.fences.exec(e);
294
+ if (t) {
295
+ let e = t[0], n = Qe(e, t[3] || "", this.rules);
296
+ return {
297
+ type: "code",
298
+ raw: e,
299
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
300
+ text: n
301
+ };
302
+ }
303
+ }
304
+ heading(e) {
305
+ let t = this.rules.block.heading.exec(e);
306
+ if (t) {
307
+ let e = t[2].trim();
308
+ if (this.rules.other.endingHash.test(e)) {
309
+ let t = G(e, "#");
310
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
311
+ }
312
+ return {
313
+ type: "heading",
314
+ raw: G(t[0], "\n"),
315
+ depth: t[1].length,
316
+ text: e,
317
+ tokens: this.lexer.inline(e)
318
+ };
319
+ }
320
+ }
321
+ hr(e) {
322
+ let t = this.rules.block.hr.exec(e);
323
+ if (t) return {
324
+ type: "hr",
325
+ raw: G(t[0], "\n")
326
+ };
327
+ }
328
+ blockquote(e) {
329
+ let t = this.rules.block.blockquote.exec(e);
330
+ if (t) {
331
+ let e = G(t[0], "\n").split("\n"), n = "", r = "", i = [];
332
+ for (; e.length > 0;) {
333
+ let t = !1, a = [], o;
334
+ for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
335
+ else if (!t) a.push(e[o]);
336
+ else break;
337
+ e = e.slice(o);
338
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
339
+ n = n ? `${n}
340
+ ${s}` : s, r = r ? `${r}
341
+ ${c}` : c;
342
+ let l = this.lexer.state.top;
343
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
344
+ let u = i.at(-1);
345
+ if ((u == null ? void 0 : u.type) === "code") break;
346
+ if ((u == null ? void 0 : u.type) === "blockquote") {
347
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
348
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
349
+ break;
350
+ } else if ((u == null ? void 0 : u.type) === "list") {
351
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
352
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
353
+ continue;
354
+ }
355
+ }
356
+ return {
357
+ type: "blockquote",
358
+ raw: n,
359
+ tokens: i,
360
+ text: r
361
+ };
362
+ }
363
+ }
364
+ list(e) {
365
+ let t = this.rules.block.list.exec(e);
366
+ if (t) {
367
+ let n = t[1].trim(), r = n.length > 1, i = {
368
+ type: "list",
369
+ raw: "",
370
+ ordered: r,
371
+ start: r ? +n.slice(0, -1) : "",
372
+ loose: !1,
373
+ items: []
374
+ };
375
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
376
+ let a = this.rules.other.listItemRegex(n), o = !1;
377
+ for (; e;) {
378
+ let n = !1, r = "", s = "";
379
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
380
+ r = t[0], e = e.substring(r.length);
381
+ let c = Xe(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
382
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
383
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
384
+ for (; e;) {
385
+ let p = e.split("\n", 1)[0], m;
386
+ if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
387
+ if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
388
+ else {
389
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
390
+ s += "\n" + l;
391
+ }
392
+ u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
393
+ }
394
+ }
395
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
396
+ type: "list_item",
397
+ raw: r,
398
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
399
+ loose: !1,
400
+ text: s,
401
+ tokens: []
402
+ }), i.raw += r;
403
+ }
404
+ let s = i.items.at(-1);
405
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
406
+ else return;
407
+ i.raw = i.raw.trimEnd();
408
+ for (let e of i.items) {
409
+ this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []);
410
+ let t = e.tokens[0];
411
+ if (e.task && ((t == null ? void 0 : t.type) === "text" || (t == null ? void 0 : t.type) === "paragraph")) {
412
+ e.text = e.text.replace(this.rules.other.listReplaceTask, ""), t.raw = t.raw.replace(this.rules.other.listReplaceTask, ""), t.text = t.text.replace(this.rules.other.listReplaceTask, "");
413
+ for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
414
+ this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
415
+ break;
416
+ }
417
+ let n = this.rules.other.listTaskCheckbox.exec(e.raw);
418
+ if (n) {
419
+ let t = {
420
+ type: "checkbox",
421
+ raw: n[0] + " ",
422
+ checked: n[0] !== "[ ]"
423
+ };
424
+ e.checked = t.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = t.raw + e.tokens[0].raw, e.tokens[0].text = t.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(t)) : e.tokens.unshift({
425
+ type: "paragraph",
426
+ raw: t.raw,
427
+ text: t.raw,
428
+ tokens: [t]
429
+ }) : e.tokens.unshift(t);
430
+ }
431
+ } else e.task && (e.task = !1);
432
+ if (!i.loose) {
433
+ let t = e.tokens.filter((e) => e.type === "space");
434
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
435
+ }
436
+ }
437
+ if (i.loose) for (let e of i.items) {
438
+ e.loose = !0;
439
+ for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
440
+ }
441
+ return i;
442
+ }
443
+ }
444
+ html(e) {
445
+ let t = this.rules.block.html.exec(e);
446
+ if (t) {
447
+ let e = Je(t[0]);
448
+ return {
449
+ type: "html",
450
+ block: !0,
451
+ raw: e,
452
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
453
+ text: e
454
+ };
455
+ }
456
+ }
457
+ def(e) {
458
+ let t = this.rules.block.def.exec(e);
459
+ if (t) {
460
+ let e = t[1].toLowerCase().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];
461
+ return {
462
+ type: "def",
463
+ tag: e,
464
+ raw: G(t[0], "\n"),
465
+ href: n,
466
+ title: r
467
+ };
468
+ }
469
+ }
470
+ table(e) {
471
+ var t;
472
+ let n = this.rules.block.table.exec(e);
473
+ if (!n || !this.rules.other.tableDelimiter.test(n[2])) return;
474
+ let r = qe(n[1]), i = n[2].replace(this.rules.other.tableAlignChars, "").split("|"), a = (t = n[3]) != null && t.trim() ? n[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], o = {
475
+ type: "table",
476
+ raw: G(n[0], "\n"),
477
+ header: [],
478
+ align: [],
479
+ rows: []
480
+ };
481
+ if (r.length === i.length) {
482
+ for (let e of i) this.rules.other.tableAlignRight.test(e) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? o.align.push("left") : o.align.push(null);
483
+ for (let e = 0; e < r.length; e++) o.header.push({
484
+ text: r[e],
485
+ tokens: this.lexer.inline(r[e]),
486
+ header: !0,
487
+ align: o.align[e]
488
+ });
489
+ for (let e of a) o.rows.push(qe(e, o.header.length).map((e, t) => ({
490
+ text: e,
491
+ tokens: this.lexer.inline(e),
492
+ header: !1,
493
+ align: o.align[t]
494
+ })));
495
+ return o;
496
+ }
497
+ }
498
+ lheading(e) {
499
+ let t = this.rules.block.lheading.exec(e);
500
+ if (t) {
501
+ let e = t[1].trim();
502
+ return {
503
+ type: "heading",
504
+ raw: G(t[0], "\n"),
505
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
506
+ text: e,
507
+ tokens: this.lexer.inline(e)
508
+ };
509
+ }
510
+ }
511
+ paragraph(e) {
512
+ let t = this.rules.block.paragraph.exec(e);
513
+ if (t) {
514
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
515
+ return {
516
+ type: "paragraph",
517
+ raw: t[0],
518
+ text: e,
519
+ tokens: this.lexer.inline(e)
520
+ };
521
+ }
522
+ }
523
+ text(e) {
524
+ let t = this.rules.block.text.exec(e);
525
+ if (t) return {
526
+ type: "text",
527
+ raw: t[0],
528
+ text: t[0],
529
+ tokens: this.lexer.inline(t[0])
530
+ };
531
+ }
532
+ escape(e) {
533
+ let t = this.rules.inline.escape.exec(e);
534
+ if (t) return {
535
+ type: "escape",
536
+ raw: t[0],
537
+ text: t[1]
538
+ };
539
+ }
540
+ tag(e) {
541
+ let t = this.rules.inline.tag.exec(e);
542
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
543
+ type: "html",
544
+ raw: t[0],
545
+ inLink: this.lexer.state.inLink,
546
+ inRawBlock: this.lexer.state.inRawBlock,
547
+ block: !1,
548
+ text: t[0]
549
+ };
550
+ }
551
+ link(e) {
552
+ let t = this.rules.inline.link.exec(e);
553
+ if (t) {
554
+ let e = t[2].trim();
555
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
556
+ if (!this.rules.other.endAngleBracket.test(e)) return;
557
+ let t = G(e.slice(0, -1), "\\");
558
+ if ((e.length - t.length) % 2 == 0) return;
559
+ } else {
560
+ let e = Ye(t[2], "()");
561
+ if (e === -2) return;
562
+ if (e > -1) {
563
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
564
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
565
+ }
566
+ }
567
+ let n = t[2], r = "";
568
+ if (this.options.pedantic) {
569
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
570
+ e && (n = e[1], r = e[3]);
571
+ } else r = t[3] ? t[3].slice(1, -1) : "";
572
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Ze(t, {
573
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
574
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
575
+ }, t[0], this.lexer, this.rules);
576
+ }
577
+ }
578
+ reflink(e, t) {
579
+ let n;
580
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
581
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
582
+ if (!e) {
583
+ let e = n[0].charAt(0);
584
+ return {
585
+ type: "text",
586
+ raw: e,
587
+ text: e
588
+ };
589
+ }
590
+ return Ze(n, e, n[0], this.lexer, this.rules);
591
+ }
592
+ }
593
+ emStrong(e, t, n = "") {
594
+ let r = this.rules.inline.emStrongLDelim.exec(e);
595
+ if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
596
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
597
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) !== null;) {
598
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
599
+ if (a = [...i].length, r[3] || r[4]) {
600
+ o += a;
601
+ continue;
602
+ } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
603
+ s += a;
604
+ continue;
605
+ }
606
+ if (o -= a, o > 0) continue;
607
+ a = Math.min(a, a + o + s);
608
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
609
+ if (Math.min(n, a) % 2) {
610
+ let e = c.slice(1, -1);
611
+ return {
612
+ type: "em",
613
+ raw: c,
614
+ text: e,
615
+ tokens: this.lexer.inlineTokens(e)
616
+ };
617
+ }
618
+ let l = c.slice(2, -2);
619
+ return {
620
+ type: "strong",
621
+ raw: c,
622
+ text: l,
623
+ tokens: this.lexer.inlineTokens(l)
624
+ };
625
+ }
626
+ }
627
+ }
628
+ codespan(e) {
629
+ let t = this.rules.inline.code.exec(e);
630
+ if (t) {
631
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
632
+ return n && r && (e = e.substring(1, e.length - 1)), {
633
+ type: "codespan",
634
+ raw: t[0],
635
+ text: e
636
+ };
637
+ }
638
+ }
639
+ br(e) {
640
+ let t = this.rules.inline.br.exec(e);
641
+ if (t) return {
642
+ type: "br",
643
+ raw: t[0]
644
+ };
645
+ }
646
+ del(e, t, n = "") {
647
+ let r = this.rules.inline.delLDelim.exec(e);
648
+ if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
649
+ let n = [...r[0]].length - 1, i, a, o = n, s = this.rules.inline.delRDelim;
650
+ for (s.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = s.exec(t)) !== null;) {
651
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i || (a = [...i].length, a !== n)) continue;
652
+ if (r[3] || r[4]) {
653
+ o += a;
654
+ continue;
655
+ }
656
+ if (o -= a, o > 0) continue;
657
+ a = Math.min(a, a + o);
658
+ let t = [...r[0]][0].length, s = e.slice(0, n + r.index + t + a), c = s.slice(n, -n);
659
+ return {
660
+ type: "del",
661
+ raw: s,
662
+ text: c,
663
+ tokens: this.lexer.inlineTokens(c)
664
+ };
665
+ }
666
+ }
667
+ }
668
+ autolink(e) {
669
+ let t = this.rules.inline.autolink.exec(e);
670
+ if (t) {
671
+ let e, n;
672
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
673
+ type: "link",
674
+ raw: t[0],
675
+ text: e,
676
+ href: n,
677
+ tokens: [{
678
+ type: "text",
679
+ raw: e,
680
+ text: e
681
+ }]
682
+ };
683
+ }
684
+ }
685
+ url(e) {
686
+ let t;
687
+ if (t = this.rules.inline.url.exec(e)) {
688
+ let e, i;
689
+ if (t[2] === "@") e = t[0], i = "mailto:" + e;
690
+ else {
691
+ var n, r;
692
+ let a;
693
+ do
694
+ a = t[0], t[0] = (n = (r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) == null ? "" : n;
695
+ while (a !== t[0]);
696
+ e = t[0], i = t[1] === "www." ? "http://" + t[0] : t[0];
697
+ }
698
+ return {
699
+ type: "link",
700
+ raw: t[0],
701
+ text: e,
702
+ href: i,
703
+ tokens: [{
704
+ type: "text",
705
+ raw: e,
706
+ text: e
707
+ }]
708
+ };
709
+ }
710
+ }
711
+ inlineText(e) {
712
+ let t = this.rules.inline.text.exec(e);
713
+ if (t) {
714
+ let e = this.lexer.state.inRawBlock;
715
+ return {
716
+ type: "text",
717
+ raw: t[0],
718
+ text: t[0],
719
+ escaped: e
720
+ };
721
+ }
722
+ }
723
+ }, q = class e {
724
+ constructor(e) {
725
+ t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || _, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
726
+ inLink: !1,
727
+ inRawBlock: !1,
728
+ top: !0
729
+ };
730
+ let n = {
731
+ other: x,
732
+ block: H.normal,
733
+ inline: U.normal
734
+ };
735
+ this.options.pedantic ? (n.block = H.pedantic, n.inline = U.pedantic) : this.options.gfm && (n.block = H.gfm, this.options.breaks ? n.inline = U.breaks : n.inline = U.gfm), this.tokenizer.rules = n;
736
+ }
737
+ static get rules() {
738
+ return {
739
+ block: H,
740
+ inline: U
741
+ };
742
+ }
743
+ static lex(t, n) {
744
+ return new e(n).lex(t);
745
+ }
746
+ static lexInline(t, n) {
747
+ return new e(n).inlineTokens(t);
748
+ }
749
+ lex(e) {
750
+ e = e.replace(x.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
751
+ for (let e = 0; e < this.inlineQueue.length; e++) {
752
+ let t = this.inlineQueue[e];
753
+ this.inlineTokens(t.src, t.tokens);
754
+ }
755
+ return this.inlineQueue = [], this.tokens;
756
+ }
757
+ blockTokens(e, t = [], n = !1) {
758
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
759
+ let r = Infinity;
760
+ for (; e;) {
761
+ var i, a;
762
+ if (e.length < r) r = e.length;
763
+ else {
764
+ this.infiniteLoopError(e.charCodeAt(0));
765
+ break;
766
+ }
767
+ let o;
768
+ if (!((i = this.options.extensions) == null || (i = i.block) == null) && i.some((n) => (o = n.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue;
769
+ if (o = this.tokenizer.space(e)) {
770
+ e = e.substring(o.raw.length);
771
+ let n = t.at(-1);
772
+ o.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(o);
773
+ continue;
774
+ }
775
+ if (o = this.tokenizer.code(e)) {
776
+ e = e.substring(o.raw.length);
777
+ let n = t.at(-1);
778
+ (n == null ? void 0 : n.type) === "paragraph" || (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + o.raw, n.text += "\n" + o.text, this.inlineQueue.at(-1).src = n.text) : t.push(o);
779
+ continue;
780
+ }
781
+ if (o = this.tokenizer.fences(e)) {
782
+ e = e.substring(o.raw.length), t.push(o);
783
+ continue;
784
+ }
785
+ if (o = this.tokenizer.heading(e)) {
786
+ e = e.substring(o.raw.length), t.push(o);
787
+ continue;
788
+ }
789
+ if (o = this.tokenizer.hr(e)) {
790
+ e = e.substring(o.raw.length), t.push(o);
791
+ continue;
792
+ }
793
+ if (o = this.tokenizer.blockquote(e)) {
794
+ e = e.substring(o.raw.length), t.push(o);
795
+ continue;
796
+ }
797
+ if (o = this.tokenizer.list(e)) {
798
+ e = e.substring(o.raw.length), t.push(o);
799
+ continue;
800
+ }
801
+ if (o = this.tokenizer.html(e)) {
802
+ e = e.substring(o.raw.length), t.push(o);
803
+ continue;
804
+ }
805
+ if (o = this.tokenizer.def(e)) {
806
+ e = e.substring(o.raw.length);
807
+ let n = t.at(-1);
808
+ (n == null ? void 0 : n.type) === "paragraph" || (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + o.raw, n.text += "\n" + o.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[o.tag] || (this.tokens.links[o.tag] = {
809
+ href: o.href,
810
+ title: o.title
811
+ }, t.push(o));
812
+ continue;
813
+ }
814
+ if (o = this.tokenizer.table(e)) {
815
+ e = e.substring(o.raw.length), t.push(o);
816
+ continue;
817
+ }
818
+ if (o = this.tokenizer.lheading(e)) {
819
+ e = e.substring(o.raw.length), t.push(o);
820
+ continue;
821
+ }
822
+ let s = e;
823
+ if ((a = this.options.extensions) != null && a.startBlock) {
824
+ let t = Infinity, n = e.slice(1), r;
825
+ this.options.extensions.startBlock.forEach((e) => {
826
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
827
+ }), t < Infinity && t >= 0 && (s = e.substring(0, t + 1));
828
+ }
829
+ if (this.state.top && (o = this.tokenizer.paragraph(s))) {
830
+ let r = t.at(-1);
831
+ n && (r == null ? void 0 : r.type) === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + o.raw, r.text += "\n" + o.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(o), n = s.length !== e.length, e = e.substring(o.raw.length);
832
+ continue;
833
+ }
834
+ if (o = this.tokenizer.text(e)) {
835
+ e = e.substring(o.raw.length);
836
+ let n = t.at(-1);
837
+ (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + o.raw, n.text += "\n" + o.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(o);
838
+ continue;
839
+ }
840
+ if (e) {
841
+ this.infiniteLoopError(e.charCodeAt(0));
842
+ break;
843
+ }
844
+ }
845
+ return this.state.top = !0, t;
846
+ }
847
+ inline(e, t = []) {
848
+ return this.inlineQueue.push({
849
+ src: e,
850
+ tokens: t
851
+ }), t;
852
+ }
853
+ inlineTokens(e, t = []) {
854
+ var n, r;
855
+ this.tokenizer.lexer = this;
856
+ let i = e, a = null;
857
+ if (this.tokens.links) {
858
+ let e = Object.keys(this.tokens.links);
859
+ if (e.length > 0) for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(i)) !== null;) e.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (i = i.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
860
+ }
861
+ for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(i)) !== null;) i = i.slice(0, a.index) + "++" + i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
862
+ let o;
863
+ for (; (a = this.tokenizer.rules.inline.blockSkip.exec(i)) !== null;) o = a[2] ? a[2].length : 0, i = i.slice(0, a.index + o) + "[" + "a".repeat(a[0].length - o - 2) + "]" + i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
864
+ i = (n = (r = this.options.hooks) == null || (r = r.emStrongMask) == null ? void 0 : r.call({ lexer: this }, i)) == null ? i : n;
865
+ let s = !1, c = "", l = Infinity;
866
+ for (; e;) {
867
+ var u, d;
868
+ if (e.length < l) l = e.length;
869
+ else {
870
+ this.infiniteLoopError(e.charCodeAt(0));
871
+ break;
872
+ }
873
+ s || (c = ""), s = !1;
874
+ let n;
875
+ if (!((u = this.options.extensions) == null || (u = u.inline) == null) && u.some((r) => (n = r.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1)) continue;
876
+ if (n = this.tokenizer.escape(e)) {
877
+ e = e.substring(n.raw.length), t.push(n);
878
+ continue;
879
+ }
880
+ if (n = this.tokenizer.tag(e)) {
881
+ e = e.substring(n.raw.length), t.push(n);
882
+ continue;
883
+ }
884
+ if (n = this.tokenizer.link(e)) {
885
+ e = e.substring(n.raw.length), t.push(n);
886
+ continue;
887
+ }
888
+ if (n = this.tokenizer.reflink(e, this.tokens.links)) {
889
+ e = e.substring(n.raw.length);
890
+ let r = t.at(-1);
891
+ n.type === "text" && (r == null ? void 0 : r.type) === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
892
+ continue;
893
+ }
894
+ if (n = this.tokenizer.emStrong(e, i, c)) {
895
+ e = e.substring(n.raw.length), t.push(n);
896
+ continue;
897
+ }
898
+ if (n = this.tokenizer.codespan(e)) {
899
+ e = e.substring(n.raw.length), t.push(n);
900
+ continue;
901
+ }
902
+ if (n = this.tokenizer.br(e)) {
903
+ e = e.substring(n.raw.length), t.push(n);
904
+ continue;
905
+ }
906
+ if (n = this.tokenizer.del(e, i, c)) {
907
+ e = e.substring(n.raw.length), t.push(n);
908
+ continue;
909
+ }
910
+ if (n = this.tokenizer.autolink(e)) {
911
+ e = e.substring(n.raw.length), t.push(n);
912
+ continue;
913
+ }
914
+ if (!this.state.inLink && (n = this.tokenizer.url(e))) {
915
+ e = e.substring(n.raw.length), t.push(n);
916
+ continue;
917
+ }
918
+ let r = e;
919
+ if ((d = this.options.extensions) != null && d.startInline) {
920
+ let t = Infinity, n = e.slice(1), i;
921
+ this.options.extensions.startInline.forEach((e) => {
922
+ i = e.call({ lexer: this }, n), typeof i == "number" && i >= 0 && (t = Math.min(t, i));
923
+ }), t < Infinity && t >= 0 && (r = e.substring(0, t + 1));
924
+ }
925
+ if (n = this.tokenizer.inlineText(r)) {
926
+ e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (c = n.raw.slice(-1)), s = !0;
927
+ let r = t.at(-1);
928
+ (r == null ? void 0 : r.type) === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
929
+ continue;
930
+ }
931
+ if (e) {
932
+ this.infiniteLoopError(e.charCodeAt(0));
933
+ break;
934
+ }
935
+ }
936
+ return t;
937
+ }
938
+ infiniteLoopError(e) {
939
+ let t = "Infinite loop on byte: " + e;
940
+ if (this.options.silent) console.error(t);
941
+ else throw Error(t);
942
+ }
943
+ }, J = class {
944
+ constructor(e) {
945
+ t(this, "options", void 0), t(this, "parser", void 0), this.options = e || _;
946
+ }
947
+ space(e) {
948
+ return "";
949
+ }
950
+ code({ text: e, lang: t, escaped: n }) {
951
+ var r;
952
+ let i = (r = (t || "").match(x.notSpaceStart)) == null ? void 0 : r[0], a = e.replace(x.endingNewline, "") + "\n";
953
+ return i ? "<pre><code class=\"language-" + W(i) + "\">" + (n ? a : W(a, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? a : W(a, !0)) + "</code></pre>\n";
954
+ }
955
+ blockquote({ tokens: e }) {
956
+ return `<blockquote>
957
+ ${this.parser.parse(e)}</blockquote>
1003
958
  `;
1004
- }
1005
- list(n, t, e) {
1006
- const i = t ? "ol" : "ul", s = t && e !== 1 ? ' start="' + e + '"' : "";
1007
- return "<" + i + s + `>
1008
- ` + n + "</" + i + `>
959
+ }
960
+ html({ text: e }) {
961
+ return e;
962
+ }
963
+ def(e) {
964
+ return "";
965
+ }
966
+ heading({ tokens: e, depth: t }) {
967
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
1009
968
  `;
1010
- }
1011
- /**
1012
- * @param {string} text
1013
- */
1014
- listitem(n) {
1015
- return `<li>${n}</li>
969
+ }
970
+ hr(e) {
971
+ return "<hr>\n";
972
+ }
973
+ list(e) {
974
+ let t = e.ordered, n = e.start, r = "";
975
+ for (let t = 0; t < e.items.length; t++) {
976
+ let n = e.items[t];
977
+ r += this.listitem(n);
978
+ }
979
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
980
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
981
+ }
982
+ listitem(e) {
983
+ return `<li>${this.parser.parse(e.tokens)}</li>
1016
984
  `;
1017
- }
1018
- checkbox(n) {
1019
- return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
1020
- }
1021
- /**
1022
- * @param {string} text
1023
- */
1024
- paragraph(n) {
1025
- return `<p>${n}</p>
985
+ }
986
+ checkbox({ checked: e }) {
987
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
988
+ }
989
+ paragraph({ tokens: e }) {
990
+ return `<p>${this.parser.parseInline(e)}</p>
1026
991
  `;
1027
- }
1028
- /**
1029
- * @param {string} header
1030
- * @param {string} body
1031
- */
1032
- table(n, t) {
1033
- return t && (t = `<tbody>${t}</tbody>`), `<table>
1034
- <thead>
1035
- ` + n + `</thead>
1036
- ` + t + `</table>
992
+ }
993
+ table(e) {
994
+ let t = "", n = "";
995
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
996
+ t += this.tablerow({ text: n });
997
+ let r = "";
998
+ for (let t = 0; t < e.rows.length; t++) {
999
+ let i = e.rows[t];
1000
+ n = "";
1001
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
1002
+ r += this.tablerow({ text: n });
1003
+ }
1004
+ return r && (r = `<tbody>${r}</tbody>`), "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
1005
+ }
1006
+ tablerow({ text: e }) {
1007
+ return `<tr>
1008
+ ${e}</tr>
1037
1009
  `;
1038
- }
1039
- /**
1040
- * @param {string} content
1041
- */
1042
- tablerow(n) {
1043
- return `<tr>
1044
- ${n}</tr>
1010
+ }
1011
+ tablecell(e) {
1012
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1013
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1045
1014
  `;
1046
- }
1047
- tablecell(n, t) {
1048
- const e = t.header ? "th" : "td";
1049
- return (t.align ? `<${e} align="${t.align}">` : `<${e}>`) + n + `</${e}>
1050
- `;
1051
- }
1052
- /**
1053
- * span level renderer
1054
- * @param {string} text
1055
- */
1056
- strong(n) {
1057
- return `<strong>${n}</strong>`;
1058
- }
1059
- /**
1060
- * @param {string} text
1061
- */
1062
- em(n) {
1063
- return `<em>${n}</em>`;
1064
- }
1065
- /**
1066
- * @param {string} text
1067
- */
1068
- codespan(n) {
1069
- return `<code>${n}</code>`;
1070
- }
1071
- br() {
1072
- return this.options.xhtml ? "<br/>" : "<br>";
1073
- }
1074
- /**
1075
- * @param {string} text
1076
- */
1077
- del(n) {
1078
- return `<del>${n}</del>`;
1079
- }
1080
- /**
1081
- * @param {string} href
1082
- * @param {string} title
1083
- * @param {string} text
1084
- */
1085
- link(n, t, e) {
1086
- if (n = P(this.options.sanitize, this.options.baseUrl, n), n === null)
1087
- return e;
1088
- let i = '<a href="' + n + '"';
1089
- return t && (i += ' title="' + t + '"'), i += ">" + e + "</a>", i;
1090
- }
1091
- /**
1092
- * @param {string} href
1093
- * @param {string} title
1094
- * @param {string} text
1095
- */
1096
- image(n, t, e) {
1097
- if (n = P(this.options.sanitize, this.options.baseUrl, n), n === null)
1098
- return e;
1099
- let i = `<img src="${n}" alt="${e}"`;
1100
- return t && (i += ` title="${t}"`), i += this.options.xhtml ? "/>" : ">", i;
1101
- }
1102
- text(n) {
1103
- return n;
1104
- }
1105
- }
1106
- class G {
1107
- // no need for block level renderers
1108
- strong(n) {
1109
- return n;
1110
- }
1111
- em(n) {
1112
- return n;
1113
- }
1114
- codespan(n) {
1115
- return n;
1116
- }
1117
- del(n) {
1118
- return n;
1119
- }
1120
- html(n) {
1121
- return n;
1122
- }
1123
- text(n) {
1124
- return n;
1125
- }
1126
- link(n, t, e) {
1127
- return "" + e;
1128
- }
1129
- image(n, t, e) {
1130
- return "" + e;
1131
- }
1132
- br() {
1133
- return "";
1134
- }
1135
- }
1136
- class J {
1137
- constructor() {
1138
- this.seen = {};
1139
- }
1140
- /**
1141
- * @param {string} value
1142
- */
1143
- serialize(n) {
1144
- return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
1145
- }
1146
- /**
1147
- * Finds the next safe (unique) slug to use
1148
- * @param {string} originalSlug
1149
- * @param {boolean} isDryRun
1150
- */
1151
- getNextSafeSlug(n, t) {
1152
- let e = n, i = 0;
1153
- if (this.seen.hasOwnProperty(e)) {
1154
- i = this.seen[n];
1155
- do
1156
- i++, e = n + "-" + i;
1157
- while (this.seen.hasOwnProperty(e));
1158
- }
1159
- return t || (this.seen[n] = i, this.seen[e] = 0), e;
1160
- }
1161
- /**
1162
- * Convert string to unique id
1163
- * @param {object} [options]
1164
- * @param {boolean} [options.dryrun] Generates the next unique slug without
1165
- * updating the internal accumulator.
1166
- */
1167
- slug(n, t = {}) {
1168
- const e = this.serialize(n);
1169
- return this.getNextSafeSlug(e, t.dryrun);
1170
- }
1171
- }
1172
- class A {
1173
- constructor(n) {
1174
- this.options = n || I, this.options.renderer = this.options.renderer || new D(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new G(), this.slugger = new J();
1175
- }
1176
- /**
1177
- * Static Parse Method
1178
- */
1179
- static parse(n, t) {
1180
- return new A(t).parse(n);
1181
- }
1182
- /**
1183
- * Static Parse Inline Method
1184
- */
1185
- static parseInline(n, t) {
1186
- return new A(t).parseInline(n);
1187
- }
1188
- /**
1189
- * Parse Loop
1190
- */
1191
- parse(n, t = !0) {
1192
- let e = "", i, s, r, l, c, d, f, g, k, h, z, _, T, x, w, E, S, y, $;
1193
- const C = n.length;
1194
- for (i = 0; i < C; i++) {
1195
- if (h = n[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[h.type] && ($ = this.options.extensions.renderers[h.type].call({ parser: this }, h), $ !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(h.type))) {
1196
- e += $ || "";
1197
- continue;
1198
- }
1199
- switch (h.type) {
1200
- case "space":
1201
- continue;
1202
- case "hr": {
1203
- e += this.renderer.hr();
1204
- continue;
1205
- }
1206
- case "heading": {
1207
- e += this.renderer.heading(
1208
- this.parseInline(h.tokens),
1209
- h.depth,
1210
- W(this.parseInline(h.tokens, this.textRenderer)),
1211
- this.slugger
1212
- );
1213
- continue;
1214
- }
1215
- case "code": {
1216
- e += this.renderer.code(
1217
- h.text,
1218
- h.lang,
1219
- h.escaped
1220
- );
1221
- continue;
1222
- }
1223
- case "table": {
1224
- for (g = "", f = "", l = h.header.length, s = 0; s < l; s++)
1225
- f += this.renderer.tablecell(
1226
- this.parseInline(h.header[s].tokens),
1227
- { header: !0, align: h.align[s] }
1228
- );
1229
- for (g += this.renderer.tablerow(f), k = "", l = h.rows.length, s = 0; s < l; s++) {
1230
- for (d = h.rows[s], f = "", c = d.length, r = 0; r < c; r++)
1231
- f += this.renderer.tablecell(
1232
- this.parseInline(d[r].tokens),
1233
- { header: !1, align: h.align[r] }
1234
- );
1235
- k += this.renderer.tablerow(f);
1236
- }
1237
- e += this.renderer.table(g, k);
1238
- continue;
1239
- }
1240
- case "blockquote": {
1241
- k = this.parse(h.tokens), e += this.renderer.blockquote(k);
1242
- continue;
1243
- }
1244
- case "list": {
1245
- for (z = h.ordered, _ = h.start, T = h.loose, l = h.items.length, k = "", s = 0; s < l; s++)
1246
- w = h.items[s], E = w.checked, S = w.task, x = "", w.task && (y = this.renderer.checkbox(E), T ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = y + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = y + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
1247
- type: "text",
1248
- text: y
1249
- }) : x += y), x += this.parse(w.tokens, T), k += this.renderer.listitem(x, S, E);
1250
- e += this.renderer.list(k, z, _);
1251
- continue;
1252
- }
1253
- case "html": {
1254
- e += this.renderer.html(h.text);
1255
- continue;
1256
- }
1257
- case "paragraph": {
1258
- e += this.renderer.paragraph(this.parseInline(h.tokens));
1259
- continue;
1260
- }
1261
- case "text": {
1262
- for (k = h.tokens ? this.parseInline(h.tokens) : h.text; i + 1 < C && n[i + 1].type === "text"; )
1263
- h = n[++i], k += `
1264
- ` + (h.tokens ? this.parseInline(h.tokens) : h.text);
1265
- e += t ? this.renderer.paragraph(k) : k;
1266
- continue;
1267
- }
1268
- default: {
1269
- const M = 'Token with "' + h.type + '" type was not found.';
1270
- if (this.options.silent) {
1271
- console.error(M);
1272
- return;
1273
- } else
1274
- throw new Error(M);
1275
- }
1276
- }
1277
- }
1278
- return e;
1279
- }
1280
- /**
1281
- * Parse Inline Tokens
1282
- */
1283
- parseInline(n, t) {
1284
- t = t || this.renderer;
1285
- let e = "", i, s, r;
1286
- const l = n.length;
1287
- for (i = 0; i < l; i++) {
1288
- if (s = n[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type] && (r = this.options.extensions.renderers[s.type].call({ parser: this }, s), r !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type))) {
1289
- e += r || "";
1290
- continue;
1291
- }
1292
- switch (s.type) {
1293
- case "escape": {
1294
- e += t.text(s.text);
1295
- break;
1296
- }
1297
- case "html": {
1298
- e += t.html(s.text);
1299
- break;
1300
- }
1301
- case "link": {
1302
- e += t.link(s.href, s.title, this.parseInline(s.tokens, t));
1303
- break;
1304
- }
1305
- case "image": {
1306
- e += t.image(s.href, s.title, s.text);
1307
- break;
1308
- }
1309
- case "strong": {
1310
- e += t.strong(this.parseInline(s.tokens, t));
1311
- break;
1312
- }
1313
- case "em": {
1314
- e += t.em(this.parseInline(s.tokens, t));
1315
- break;
1316
- }
1317
- case "codespan": {
1318
- e += t.codespan(s.text);
1319
- break;
1320
- }
1321
- case "br": {
1322
- e += t.br();
1323
- break;
1324
- }
1325
- case "del": {
1326
- e += t.del(this.parseInline(s.tokens, t));
1327
- break;
1328
- }
1329
- case "text": {
1330
- e += t.text(s.text);
1331
- break;
1332
- }
1333
- default: {
1334
- const c = 'Token with "' + s.type + '" type was not found.';
1335
- if (this.options.silent) {
1336
- console.error(c);
1337
- return;
1338
- } else
1339
- throw new Error(c);
1340
- }
1341
- }
1342
- }
1343
- return e;
1344
- }
1345
- }
1346
- class v {
1347
- constructor(n) {
1348
- this.options = n || I;
1349
- }
1350
- /**
1351
- * Process markdown before marked
1352
- */
1353
- preprocess(n) {
1354
- return n;
1355
- }
1356
- /**
1357
- * Process HTML after marked is finished
1358
- */
1359
- postprocess(n) {
1360
- return n;
1361
- }
1362
- }
1363
- O(v, "passThroughHooks", /* @__PURE__ */ new Set([
1364
- "preprocess",
1365
- "postprocess"
1366
- ]));
1367
- function $e(o, n, t) {
1368
- return (e) => {
1369
- if (e.message += `
1370
- Please report this to https://github.com/markedjs/marked.`, o) {
1371
- const i = "<p>An error occurred:</p><pre>" + b(e.message + "", !0) + "</pre>";
1372
- if (n)
1373
- return Promise.resolve(i);
1374
- if (t) {
1375
- t(null, i);
1376
- return;
1377
- }
1378
- return i;
1379
- }
1380
- if (n)
1381
- return Promise.reject(e);
1382
- if (t) {
1383
- t(e);
1384
- return;
1385
- }
1386
- throw e;
1387
- };
1388
- }
1389
- function K(o, n) {
1390
- return (t, e, i) => {
1391
- typeof e == "function" && (i = e, e = null);
1392
- const s = { ...e };
1393
- e = { ...p.defaults, ...s };
1394
- const r = $e(e.silent, e.async, i);
1395
- if (typeof t > "u" || t === null)
1396
- return r(new Error("marked(): input parameter is undefined or null"));
1397
- if (typeof t != "string")
1398
- return r(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1399
- if (be(e), e.hooks && (e.hooks.options = e), i) {
1400
- const l = e.highlight;
1401
- let c;
1402
- try {
1403
- e.hooks && (t = e.hooks.preprocess(t)), c = o(t, e);
1404
- } catch (g) {
1405
- return r(g);
1406
- }
1407
- const d = function(g) {
1408
- let k;
1409
- if (!g)
1410
- try {
1411
- e.walkTokens && p.walkTokens(c, e.walkTokens), k = n(c, e), e.hooks && (k = e.hooks.postprocess(k));
1412
- } catch (h) {
1413
- g = h;
1414
- }
1415
- return e.highlight = l, g ? r(g) : i(null, k);
1416
- };
1417
- if (!l || l.length < 3 || (delete e.highlight, !c.length))
1418
- return d();
1419
- let f = 0;
1420
- p.walkTokens(c, function(g) {
1421
- g.type === "code" && (f++, setTimeout(() => {
1422
- l(g.text, g.lang, function(k, h) {
1423
- if (k)
1424
- return d(k);
1425
- h != null && h !== g.text && (g.text = h, g.escaped = !0), f--, f === 0 && d();
1426
- });
1427
- }, 0));
1428
- }), f === 0 && d();
1429
- return;
1430
- }
1431
- if (e.async)
1432
- return Promise.resolve(e.hooks ? e.hooks.preprocess(t) : t).then((l) => o(l, e)).then((l) => e.walkTokens ? Promise.all(p.walkTokens(l, e.walkTokens)).then(() => l) : l).then((l) => n(l, e)).then((l) => e.hooks ? e.hooks.postprocess(l) : l).catch(r);
1433
- try {
1434
- e.hooks && (t = e.hooks.preprocess(t));
1435
- const l = o(t, e);
1436
- e.walkTokens && p.walkTokens(l, e.walkTokens);
1437
- let c = n(l, e);
1438
- return e.hooks && (c = e.hooks.postprocess(c)), c;
1439
- } catch (l) {
1440
- return r(l);
1441
- }
1442
- };
1443
- }
1444
- function p(o, n, t) {
1445
- return K(R.lex, A.parse)(o, n, t);
1015
+ }
1016
+ strong({ tokens: e }) {
1017
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1018
+ }
1019
+ em({ tokens: e }) {
1020
+ return `<em>${this.parser.parseInline(e)}</em>`;
1021
+ }
1022
+ codespan({ text: e }) {
1023
+ return `<code>${W(e, !0)}</code>`;
1024
+ }
1025
+ br(e) {
1026
+ return "<br>";
1027
+ }
1028
+ del({ tokens: e }) {
1029
+ return `<del>${this.parser.parseInline(e)}</del>`;
1030
+ }
1031
+ link({ href: e, title: t, tokens: n }) {
1032
+ let r = this.parser.parseInline(n), i = Ke(e);
1033
+ if (i === null) return r;
1034
+ e = i;
1035
+ let a = "<a href=\"" + e + "\"";
1036
+ return t && (a += " title=\"" + W(t) + "\""), a += ">" + r + "</a>", a;
1037
+ }
1038
+ image({ href: e, title: t, text: n, tokens: r }) {
1039
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1040
+ let i = Ke(e);
1041
+ if (i === null) return W(n);
1042
+ e = i;
1043
+ let a = `<img src="${e}" alt="${W(n)}"`;
1044
+ return t && (a += ` title="${W(t)}"`), a += ">", a;
1045
+ }
1046
+ text(e) {
1047
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : W(e.text);
1048
+ }
1049
+ }, Y = class {
1050
+ strong({ text: e }) {
1051
+ return e;
1052
+ }
1053
+ em({ text: e }) {
1054
+ return e;
1055
+ }
1056
+ codespan({ text: e }) {
1057
+ return e;
1058
+ }
1059
+ del({ text: e }) {
1060
+ return e;
1061
+ }
1062
+ html({ text: e }) {
1063
+ return e;
1064
+ }
1065
+ text({ text: e }) {
1066
+ return e;
1067
+ }
1068
+ link({ text: e }) {
1069
+ return "" + e;
1070
+ }
1071
+ image({ text: e }) {
1072
+ return "" + e;
1073
+ }
1074
+ br() {
1075
+ return "";
1076
+ }
1077
+ checkbox({ raw: e }) {
1078
+ return e;
1079
+ }
1080
+ }, X = class e {
1081
+ constructor(e) {
1082
+ t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || _, this.options.renderer = this.options.renderer || new J(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
1083
+ }
1084
+ static parse(t, n) {
1085
+ return new e(n).parse(t);
1086
+ }
1087
+ static parseInline(t, n) {
1088
+ return new e(n).parseInline(t);
1089
+ }
1090
+ parse(e) {
1091
+ this.renderer.parser = this;
1092
+ let t = "";
1093
+ for (let r = 0; r < e.length; r++) {
1094
+ var n;
1095
+ let i = e[r];
1096
+ if (!((n = this.options.extensions) == null || (n = n.renderers) == null) && n[i.type]) {
1097
+ let e = i, n = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1098
+ if (n !== !1 || ![
1099
+ "space",
1100
+ "hr",
1101
+ "heading",
1102
+ "code",
1103
+ "table",
1104
+ "blockquote",
1105
+ "list",
1106
+ "html",
1107
+ "def",
1108
+ "paragraph",
1109
+ "text"
1110
+ ].includes(e.type)) {
1111
+ t += n || "";
1112
+ continue;
1113
+ }
1114
+ }
1115
+ let a = i;
1116
+ switch (a.type) {
1117
+ case "space":
1118
+ t += this.renderer.space(a);
1119
+ break;
1120
+ case "hr":
1121
+ t += this.renderer.hr(a);
1122
+ break;
1123
+ case "heading":
1124
+ t += this.renderer.heading(a);
1125
+ break;
1126
+ case "code":
1127
+ t += this.renderer.code(a);
1128
+ break;
1129
+ case "table":
1130
+ t += this.renderer.table(a);
1131
+ break;
1132
+ case "blockquote":
1133
+ t += this.renderer.blockquote(a);
1134
+ break;
1135
+ case "list":
1136
+ t += this.renderer.list(a);
1137
+ break;
1138
+ case "checkbox":
1139
+ t += this.renderer.checkbox(a);
1140
+ break;
1141
+ case "html":
1142
+ t += this.renderer.html(a);
1143
+ break;
1144
+ case "def":
1145
+ t += this.renderer.def(a);
1146
+ break;
1147
+ case "paragraph":
1148
+ t += this.renderer.paragraph(a);
1149
+ break;
1150
+ case "text":
1151
+ t += this.renderer.text(a);
1152
+ break;
1153
+ default: {
1154
+ let e = "Token with \"" + a.type + "\" type was not found.";
1155
+ if (this.options.silent) return console.error(e), "";
1156
+ throw Error(e);
1157
+ }
1158
+ }
1159
+ }
1160
+ return t;
1161
+ }
1162
+ parseInline(e, t = this.renderer) {
1163
+ this.renderer.parser = this;
1164
+ let n = "";
1165
+ for (let i = 0; i < e.length; i++) {
1166
+ var r;
1167
+ let a = e[i];
1168
+ if (!((r = this.options.extensions) == null || (r = r.renderers) == null) && r[a.type]) {
1169
+ let e = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1170
+ if (e !== !1 || ![
1171
+ "escape",
1172
+ "html",
1173
+ "link",
1174
+ "image",
1175
+ "strong",
1176
+ "em",
1177
+ "codespan",
1178
+ "br",
1179
+ "del",
1180
+ "text"
1181
+ ].includes(a.type)) {
1182
+ n += e || "";
1183
+ continue;
1184
+ }
1185
+ }
1186
+ let o = a;
1187
+ switch (o.type) {
1188
+ case "escape":
1189
+ n += t.text(o);
1190
+ break;
1191
+ case "html":
1192
+ n += t.html(o);
1193
+ break;
1194
+ case "link":
1195
+ n += t.link(o);
1196
+ break;
1197
+ case "image":
1198
+ n += t.image(o);
1199
+ break;
1200
+ case "checkbox":
1201
+ n += t.checkbox(o);
1202
+ break;
1203
+ case "strong":
1204
+ n += t.strong(o);
1205
+ break;
1206
+ case "em":
1207
+ n += t.em(o);
1208
+ break;
1209
+ case "codespan":
1210
+ n += t.codespan(o);
1211
+ break;
1212
+ case "br":
1213
+ n += t.br(o);
1214
+ break;
1215
+ case "del":
1216
+ n += t.del(o);
1217
+ break;
1218
+ case "text":
1219
+ n += t.text(o);
1220
+ break;
1221
+ default: {
1222
+ let e = "Token with \"" + o.type + "\" type was not found.";
1223
+ if (this.options.silent) return console.error(e), "";
1224
+ throw Error(e);
1225
+ }
1226
+ }
1227
+ }
1228
+ return n;
1229
+ }
1230
+ }, Z = (h = class {
1231
+ constructor(e) {
1232
+ t(this, "options", void 0), t(this, "block", void 0), this.options = e || _;
1233
+ }
1234
+ preprocess(e) {
1235
+ return e;
1236
+ }
1237
+ postprocess(e) {
1238
+ return e;
1239
+ }
1240
+ processAllTokens(e) {
1241
+ return e;
1242
+ }
1243
+ emStrongMask(e) {
1244
+ return e;
1245
+ }
1246
+ provideLexer(e = this.block) {
1247
+ return e ? q.lex : q.lexInline;
1248
+ }
1249
+ provideParser(e = this.block) {
1250
+ return e ? X.parse : X.parseInline;
1251
+ }
1252
+ }, t(h, "passThroughHooks", new Set([
1253
+ "preprocess",
1254
+ "postprocess",
1255
+ "processAllTokens",
1256
+ "emStrongMask"
1257
+ ])), t(h, "passThroughHooksRespectAsync", new Set([
1258
+ "preprocess",
1259
+ "postprocess",
1260
+ "processAllTokens"
1261
+ ])), h), Q = new class {
1262
+ constructor(...e) {
1263
+ t(this, "defaults", g()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", X), t(this, "Renderer", J), t(this, "TextRenderer", Y), t(this, "Lexer", q), t(this, "Tokenizer", K), t(this, "Hooks", Z), this.use(...e);
1264
+ }
1265
+ walkTokens(e, t) {
1266
+ let n = [];
1267
+ for (let i of e) switch (n = n.concat(t.call(this, i)), i.type) {
1268
+ case "table": {
1269
+ let e = i;
1270
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1271
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1272
+ break;
1273
+ }
1274
+ case "list": {
1275
+ let e = i;
1276
+ n = n.concat(this.walkTokens(e.items, t));
1277
+ break;
1278
+ }
1279
+ default: {
1280
+ var r;
1281
+ let e = i;
1282
+ !((r = this.defaults.extensions) == null || (r = r.childTokens) == null) && r[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1283
+ let i = e[r].flat(Infinity);
1284
+ n = n.concat(this.walkTokens(i, t));
1285
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1286
+ }
1287
+ }
1288
+ return n;
1289
+ }
1290
+ use(...e) {
1291
+ let t = this.defaults.extensions || {
1292
+ renderers: {},
1293
+ childTokens: {}
1294
+ };
1295
+ return e.forEach((e) => {
1296
+ let n = r({}, e);
1297
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1298
+ if (!e.name) throw Error("extension name required");
1299
+ if ("renderer" in e) {
1300
+ let n = t.renderers[e.name];
1301
+ n ? t.renderers[e.name] = function(...t) {
1302
+ let r = e.renderer.apply(this, t);
1303
+ return r === !1 && (r = n.apply(this, t)), r;
1304
+ } : t.renderers[e.name] = e.renderer;
1305
+ }
1306
+ if ("tokenizer" in e) {
1307
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1308
+ let n = t[e.level];
1309
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1310
+ }
1311
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1312
+ }), n.extensions = t), e.renderer) {
1313
+ let t = this.defaults.renderer || new J(this.defaults);
1314
+ for (let n in e.renderer) {
1315
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1316
+ if (["options", "parser"].includes(n)) continue;
1317
+ let r = n, i = e.renderer[r], a = t[r];
1318
+ t[r] = (...e) => {
1319
+ let n = i.apply(t, e);
1320
+ return n === !1 && (n = a.apply(t, e)), n || "";
1321
+ };
1322
+ }
1323
+ n.renderer = t;
1324
+ }
1325
+ if (e.tokenizer) {
1326
+ let t = this.defaults.tokenizer || new K(this.defaults);
1327
+ for (let n in e.tokenizer) {
1328
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1329
+ if ([
1330
+ "options",
1331
+ "rules",
1332
+ "lexer"
1333
+ ].includes(n)) continue;
1334
+ let r = n, i = e.tokenizer[r], a = t[r];
1335
+ t[r] = (...e) => {
1336
+ let n = i.apply(t, e);
1337
+ return n === !1 && (n = a.apply(t, e)), n;
1338
+ };
1339
+ }
1340
+ n.tokenizer = t;
1341
+ }
1342
+ if (e.hooks) {
1343
+ let t = this.defaults.hooks || new Z();
1344
+ for (let n in e.hooks) {
1345
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1346
+ if (["options", "block"].includes(n)) continue;
1347
+ let r = n, i = e.hooks[r], o = t[r];
1348
+ Z.passThroughHooks.has(n) ? t[r] = (e) => {
1349
+ if (this.defaults.async && Z.passThroughHooksRespectAsync.has(n)) return a(function* () {
1350
+ let n = yield i.call(t, e);
1351
+ return o.call(t, n);
1352
+ })();
1353
+ let r = i.call(t, e);
1354
+ return o.call(t, r);
1355
+ } : t[r] = (...e) => {
1356
+ if (this.defaults.async) return a(function* () {
1357
+ let n = yield i.apply(t, e);
1358
+ return n === !1 && (n = yield o.apply(t, e)), n;
1359
+ })();
1360
+ let n = i.apply(t, e);
1361
+ return n === !1 && (n = o.apply(t, e)), n;
1362
+ };
1363
+ }
1364
+ n.hooks = t;
1365
+ }
1366
+ if (e.walkTokens) {
1367
+ let t = this.defaults.walkTokens, r = e.walkTokens;
1368
+ n.walkTokens = function(e) {
1369
+ let n = [];
1370
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1371
+ };
1372
+ }
1373
+ this.defaults = r(r({}, this.defaults), n);
1374
+ }), this;
1375
+ }
1376
+ setOptions(e) {
1377
+ return this.defaults = r(r({}, this.defaults), e), this;
1378
+ }
1379
+ lexer(e, t) {
1380
+ return q.lex(e, t == null ? this.defaults : t);
1381
+ }
1382
+ parser(e, t) {
1383
+ return X.parse(e, t == null ? this.defaults : t);
1384
+ }
1385
+ parseMarkdown(e) {
1386
+ var t = this;
1387
+ return (n, i) => {
1388
+ let o = r({}, i), s = r(r({}, this.defaults), o), c = this.onError(!!s.silent, !!s.async);
1389
+ if (this.defaults.async === !0 && o.async === !1) return c(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1390
+ if (typeof n > "u" || n === null) return c(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1391
+ if (typeof n != "string") return c(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1392
+ if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return a(function* () {
1393
+ let r = s.hooks ? yield s.hooks.preprocess(n) : n, i = yield (s.hooks ? yield s.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(r, s), a = s.hooks ? yield s.hooks.processAllTokens(i) : i;
1394
+ s.walkTokens && (yield Promise.all(t.walkTokens(a, s.walkTokens)));
1395
+ let o = yield (s.hooks ? yield s.hooks.provideParser(e) : e ? X.parse : X.parseInline)(a, s);
1396
+ return s.hooks ? yield s.hooks.postprocess(o) : o;
1397
+ })().catch(c);
1398
+ try {
1399
+ s.hooks && (n = s.hooks.preprocess(n));
1400
+ let t = (s.hooks ? s.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(n, s);
1401
+ s.hooks && (t = s.hooks.processAllTokens(t)), s.walkTokens && this.walkTokens(t, s.walkTokens);
1402
+ let r = (s.hooks ? s.hooks.provideParser(e) : e ? X.parse : X.parseInline)(t, s);
1403
+ return s.hooks && (r = s.hooks.postprocess(r)), r;
1404
+ } catch (e) {
1405
+ return c(e);
1406
+ }
1407
+ };
1408
+ }
1409
+ onError(e, t) {
1410
+ return (n) => {
1411
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1412
+ let e = "<p>An error occurred:</p><pre>" + W(n.message + "", !0) + "</pre>";
1413
+ return t ? Promise.resolve(e) : e;
1414
+ }
1415
+ if (t) return Promise.reject(n);
1416
+ throw n;
1417
+ };
1418
+ }
1419
+ }();
1420
+ function $(e, t) {
1421
+ return Q.parse(e, t);
1446
1422
  }
1447
- p.options = p.setOptions = function(o) {
1448
- return p.defaults = { ...p.defaults, ...o }, oe(p.defaults), p;
1449
- };
1450
- p.getDefaults = F;
1451
- p.defaults = I;
1452
- p.use = function(...o) {
1453
- const n = p.defaults.extensions || { renderers: {}, childTokens: {} };
1454
- o.forEach((t) => {
1455
- const e = { ...t };
1456
- if (e.async = p.defaults.async || e.async || !1, t.extensions && (t.extensions.forEach((i) => {
1457
- if (!i.name)
1458
- throw new Error("extension name required");
1459
- if (i.renderer) {
1460
- const s = n.renderers[i.name];
1461
- s ? n.renderers[i.name] = function(...r) {
1462
- let l = i.renderer.apply(this, r);
1463
- return l === !1 && (l = s.apply(this, r)), l;
1464
- } : n.renderers[i.name] = i.renderer;
1465
- }
1466
- if (i.tokenizer) {
1467
- if (!i.level || i.level !== "block" && i.level !== "inline")
1468
- throw new Error("extension level must be 'block' or 'inline'");
1469
- n[i.level] ? n[i.level].unshift(i.tokenizer) : n[i.level] = [i.tokenizer], i.start && (i.level === "block" ? n.startBlock ? n.startBlock.push(i.start) : n.startBlock = [i.start] : i.level === "inline" && (n.startInline ? n.startInline.push(i.start) : n.startInline = [i.start]));
1470
- }
1471
- i.childTokens && (n.childTokens[i.name] = i.childTokens);
1472
- }), e.extensions = n), t.renderer) {
1473
- const i = p.defaults.renderer || new D();
1474
- for (const s in t.renderer) {
1475
- const r = i[s];
1476
- i[s] = (...l) => {
1477
- let c = t.renderer[s].apply(i, l);
1478
- return c === !1 && (c = r.apply(i, l)), c;
1479
- };
1480
- }
1481
- e.renderer = i;
1482
- }
1483
- if (t.tokenizer) {
1484
- const i = p.defaults.tokenizer || new q();
1485
- for (const s in t.tokenizer) {
1486
- const r = i[s];
1487
- i[s] = (...l) => {
1488
- let c = t.tokenizer[s].apply(i, l);
1489
- return c === !1 && (c = r.apply(i, l)), c;
1490
- };
1491
- }
1492
- e.tokenizer = i;
1493
- }
1494
- if (t.hooks) {
1495
- const i = p.defaults.hooks || new v();
1496
- for (const s in t.hooks) {
1497
- const r = i[s];
1498
- v.passThroughHooks.has(s) ? i[s] = (l) => {
1499
- if (p.defaults.async)
1500
- return Promise.resolve(t.hooks[s].call(i, l)).then((d) => r.call(i, d));
1501
- const c = t.hooks[s].call(i, l);
1502
- return r.call(i, c);
1503
- } : i[s] = (...l) => {
1504
- let c = t.hooks[s].apply(i, l);
1505
- return c === !1 && (c = r.apply(i, l)), c;
1506
- };
1507
- }
1508
- e.hooks = i;
1509
- }
1510
- if (t.walkTokens) {
1511
- const i = p.defaults.walkTokens;
1512
- e.walkTokens = function(s) {
1513
- let r = [];
1514
- return r.push(t.walkTokens.call(this, s)), i && (r = r.concat(i.call(this, s))), r;
1515
- };
1516
- }
1517
- p.setOptions(e);
1518
- });
1519
- };
1520
- p.walkTokens = function(o, n) {
1521
- let t = [];
1522
- for (const e of o)
1523
- switch (t = t.concat(n.call(p, e)), e.type) {
1524
- case "table": {
1525
- for (const i of e.header)
1526
- t = t.concat(p.walkTokens(i.tokens, n));
1527
- for (const i of e.rows)
1528
- for (const s of i)
1529
- t = t.concat(p.walkTokens(s.tokens, n));
1530
- break;
1531
- }
1532
- case "list": {
1533
- t = t.concat(p.walkTokens(e.items, n));
1534
- break;
1535
- }
1536
- default:
1537
- p.defaults.extensions && p.defaults.extensions.childTokens && p.defaults.extensions.childTokens[e.type] ? p.defaults.extensions.childTokens[e.type].forEach(function(i) {
1538
- t = t.concat(p.walkTokens(e[i], n));
1539
- }) : e.tokens && (t = t.concat(p.walkTokens(e.tokens, n)));
1540
- }
1541
- return t;
1542
- };
1543
- p.parseInline = K(R.lexInline, A.parseInline);
1544
- p.Parser = A;
1545
- p.parser = A.parse;
1546
- p.Renderer = D;
1547
- p.TextRenderer = G;
1548
- p.Lexer = R;
1549
- p.lexer = R.lex;
1550
- p.Tokenizer = q;
1551
- p.Slugger = J;
1552
- p.Hooks = v;
1553
- p.parse = p;
1554
- p.options;
1555
- p.setOptions;
1556
- p.use;
1557
- p.walkTokens;
1558
- p.parseInline;
1559
- A.parse;
1560
- R.lex;
1561
- const ze = ["innerHTML"], Se = /* @__PURE__ */ te({
1562
- __name: "MarkdownViewer",
1563
- props: {
1564
- data: null
1565
- },
1566
- setup(o) {
1567
- const n = o, t = ne(() => p(n.data));
1568
- return (e, i) => (ie(), se("div", {
1569
- class: "markdown-body",
1570
- innerHTML: re(t)
1571
- }, null, 8, ze));
1572
- }
1573
- });
1574
- const Ie = /* @__PURE__ */ le(Se, [["__scopeId", "data-v-e0bd8a5a"]]);
1575
- export {
1576
- Ie as default
1577
- };
1423
+ $.options = $.setOptions = function(e) {
1424
+ return Q.setOptions(e), $.defaults = Q.defaults, ae($.defaults), $;
1425
+ }, $.getDefaults = g, $.defaults = _, $.use = function(...e) {
1426
+ return Q.use(...e), $.defaults = Q.defaults, ae($.defaults), $;
1427
+ }, $.walkTokens = function(e, t) {
1428
+ return Q.walkTokens(e, t);
1429
+ }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, X.parse, q.lex;
1430
+ //#endregion
1431
+ //#region src/package/vendors/md/MarkdownViewer.vue?vue&type=script&setup=true&lang.ts
1432
+ var $e = ["innerHTML"], et = /*#__PURE__*/ l(/* @__PURE__ */ p({
1433
+ __name: "MarkdownViewer",
1434
+ props: { data: {} },
1435
+ setup(e) {
1436
+ let t = e, n = re(null), r = re(1), i = c(), a = u(() => $(t.data)), l = u(() => ({
1437
+ "--markdown-max-width": `${980 * r.value}px`,
1438
+ "--markdown-padding": `${45 * r.value}px`,
1439
+ "--markdown-font-size": `${16 * r.value}px`
1440
+ })), p = (e) => Math.min(2.4, Math.max(.6, Number(e.toFixed(2)))), h = () => ({
1441
+ scale: r.value,
1442
+ label: `${Math.round(r.value * 100)}%`,
1443
+ canZoomIn: r.value < 2.4,
1444
+ canZoomOut: r.value > .6,
1445
+ canReset: r.value !== 1,
1446
+ minScale: .6,
1447
+ maxScale: 2.4
1448
+ });
1449
+ return ie(r, () => {
1450
+ i.emit();
1451
+ }), te(() => {
1452
+ let e = n.value;
1453
+ e && o(e, {
1454
+ zoomIn: () => (r.value = p(r.value + .1), h()),
1455
+ zoomOut: () => (r.value = p(r.value - .1), h()),
1456
+ resetZoom: () => (r.value = 1, h()),
1457
+ setZoom: (e) => (r.value = p(e), h()),
1458
+ getState: h,
1459
+ subscribe: i.subscribe
1460
+ });
1461
+ }), ee(() => {
1462
+ s(n.value);
1463
+ }), (e, t) => (ne(), d("div", {
1464
+ ref_key: "root",
1465
+ ref: n,
1466
+ class: "markdown-viewer",
1467
+ "data-viewer-zoom-provider": "markdown",
1468
+ style: m(l.value)
1469
+ }, [f("article", {
1470
+ class: "markdown-body",
1471
+ innerHTML: a.value
1472
+ }, null, 8, $e)], 4));
1473
+ }
1474
+ }), [["__scopeId", "data-v-13eb47fd"]]);
1475
+ //#endregion
1476
+ export { et as default };