@yinuo-ngm/server 1.0.15 → 1.0.17

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 (349) hide show
  1. package/lib/app.js +3 -15
  2. package/lib/common/editor.js +2 -2
  3. package/lib/env.d.ts +1 -0
  4. package/lib/env.js +1 -0
  5. package/lib/plugins/error-handler.plugin.d.ts +2 -2
  6. package/lib/plugins/error-handler.plugin.js +97 -88
  7. package/lib/plugins/ws/topics/nginx.ws.js +2 -1
  8. package/lib/plugins/ws/topics/svn.ws.d.ts +2 -1
  9. package/lib/plugins/ws/topics/svn.ws.js +3 -2
  10. package/lib/plugins/ws/topics/syslog.ws.d.ts +1 -1
  11. package/lib/plugins/ws/topics/task.ws.d.ts +2 -1
  12. package/lib/plugins/ws/topics/task.ws.js +2 -1
  13. package/lib/plugins/ws/ws.context.d.ts +1 -1
  14. package/lib/plugins/ws/ws.plugin.js +4 -3
  15. package/lib/plugins/ws/ws.router.d.ts +2 -2
  16. package/lib/plugins/ws/ws.router.js +8 -7
  17. package/lib/routes/api-client/collection.routes.js +8 -6
  18. package/lib/routes/api-client/env.routes.js +4 -3
  19. package/lib/routes/api-client/history.routes.js +3 -2
  20. package/lib/routes/api-client/hub-token.routes.js +32 -10
  21. package/lib/routes/api-client/request.routes.js +7 -6
  22. package/lib/routes/api-client/send.routes.js +3 -2
  23. package/lib/routes/config.routes.js +5 -5
  24. package/lib/routes/hub.routes.js +10 -10
  25. package/lib/routes/index.js +2 -0
  26. package/lib/routes/nginx/nginx-lifecycle.routes.js +4 -0
  27. package/lib/routes/nginx/nginx-route.context.js +23 -7
  28. package/lib/routes/nginx/nginx-server.routes.js +158 -6
  29. package/lib/routes/node-version.routes.d.ts +2 -0
  30. package/lib/routes/node-version.routes.js +56 -0
  31. package/lib/routes/project.routes.js +14 -9
  32. package/lib/routes/rss.routes.js +3 -3
  33. package/lib/routes/sprite-browse.routes.js +21 -6
  34. package/lib/routes/sprite.routes.js +18 -12
  35. package/lib/routes/static-files.routes.js +21 -5
  36. package/lib/routes/svn.routes.js +5 -3
  37. package/lib/routes/system.routes.js +20 -1
  38. package/lib/routes/task.routes.js +10 -3
  39. package/package.json +13 -6
  40. package/www/3rdpartylicenses.txt +66 -118
  41. package/www/browser/chunk-2L7NUOMX.js +2 -0
  42. package/www/browser/chunk-2NZJ7CN2.js +20 -0
  43. package/www/browser/chunk-3CM4SKDO.js +15 -0
  44. package/www/browser/chunk-3I7BQCXS.js +1 -0
  45. package/www/browser/chunk-3M56F2S2.js +1 -0
  46. package/www/browser/chunk-3OHBKMAA.js +1 -0
  47. package/www/browser/chunk-3XNNQFWR.js +1 -0
  48. package/www/browser/chunk-4BRW6LCZ.js +4 -0
  49. package/www/browser/chunk-4LBSLURA.js +1 -0
  50. package/www/browser/chunk-4X42HB6N.js +2 -0
  51. package/www/browser/chunk-5DYX4DUX.js +11 -0
  52. package/www/browser/chunk-6SYVDN5L.js +1 -0
  53. package/www/browser/chunk-6YYNHZ2A.js +1 -0
  54. package/www/browser/chunk-75W3GVSO.js +1 -0
  55. package/www/browser/chunk-7U44RF5F.js +63 -0
  56. package/www/browser/chunk-AELTP6YN.js +1 -0
  57. package/www/browser/chunk-AMXRL4GR.js +1 -0
  58. package/www/browser/chunk-AV2ZODEH.js +1 -0
  59. package/www/browser/chunk-AZ6SIMYH.js +1 -0
  60. package/www/browser/chunk-B3C35ET3.js +2 -0
  61. package/www/browser/chunk-BTQIUVTQ.js +1 -0
  62. package/www/browser/chunk-CN5J4WNO.js +1 -0
  63. package/www/browser/chunk-D2ODDESN.js +1 -0
  64. package/www/browser/chunk-DE6E23ET.js +1 -0
  65. package/www/browser/chunk-DIJPUYIA.js +1 -0
  66. package/www/browser/chunk-DLGJD6YU.js +4 -0
  67. package/www/browser/chunk-EEDA5U4V.js +1 -0
  68. package/www/browser/chunk-FK6Z4HLL.js +1 -0
  69. package/www/browser/chunk-FL6GDGHW.js +1 -0
  70. package/www/browser/chunk-FXCG34QS.js +1 -0
  71. package/www/browser/chunk-H2USFIYR.js +1 -0
  72. package/www/browser/chunk-H5HGMOE6.js +1 -0
  73. package/www/browser/chunk-HB3HECPD.js +1 -0
  74. package/www/browser/chunk-HDNG236Q.js +1 -0
  75. package/www/browser/chunk-HFZLJHYR.js +1 -0
  76. package/www/browser/chunk-HJTXXSMC.js +1 -0
  77. package/www/browser/chunk-HUMCWAKJ.js +3 -0
  78. package/www/browser/chunk-IKB3EQCP.js +2 -0
  79. package/www/browser/chunk-K7PESFPY.js +1 -0
  80. package/www/browser/chunk-KRYMOHYF.js +2 -0
  81. package/www/browser/chunk-M4QRBV3K.js +1 -0
  82. package/www/browser/chunk-N2PELLMM.js +30 -0
  83. package/www/browser/chunk-ONXBYGIG.js +1 -0
  84. package/www/browser/chunk-OSBDR36P.js +1 -0
  85. package/www/browser/chunk-OZCK4XVV.js +1 -0
  86. package/www/browser/chunk-QJP5F735.js +1 -0
  87. package/www/browser/chunk-RGOYDY7H.js +1 -0
  88. package/www/browser/chunk-UJKK4A7Y.js +1 -0
  89. package/www/browser/chunk-WD2EKZQC.js +1 -0
  90. package/www/browser/chunk-WUA5JFDD.js +1 -0
  91. package/www/browser/chunk-XLFHB7RS.js +3 -0
  92. package/www/browser/chunk-YNW4HEJO.js +37 -0
  93. package/www/browser/chunk-ZTDLWBW5.js +1 -0
  94. package/www/browser/dark.css +1 -30433
  95. package/www/browser/default.css +1 -30149
  96. package/www/browser/index.html +3 -3
  97. package/www/browser/main-N64WJCHX.js +34 -0
  98. package/www/browser/scripts-U25HCVEI.js +6 -0
  99. package/www/browser/styles-ROAHD7MY.css +1 -0
  100. package/www/browser/add-widget-drawer.component.css.map +0 -7
  101. package/www/browser/advanced-editor.component.css.map +0 -7
  102. package/www/browser/api-client.component.css.map +0 -7
  103. package/www/browser/api-history-drawer.component.css.map +0 -7
  104. package/www/browser/app.css.map +0 -7
  105. package/www/browser/attachment-viewer.component.css.map +0 -7
  106. package/www/browser/auth-editor.component.css.map +0 -7
  107. package/www/browser/body-editor.component.css.map +0 -7
  108. package/www/browser/chunk-2YSUXBGC.js +0 -627
  109. package/www/browser/chunk-2YSUXBGC.js.map +0 -1
  110. package/www/browser/chunk-3G2GEOPV.js +0 -456
  111. package/www/browser/chunk-3G2GEOPV.js.map +0 -1
  112. package/www/browser/chunk-3L72DF3R.js +0 -1683
  113. package/www/browser/chunk-3L72DF3R.js.map +0 -1
  114. package/www/browser/chunk-3MCIETCQ.js +0 -8279
  115. package/www/browser/chunk-3MCIETCQ.js.map +0 -1
  116. package/www/browser/chunk-665WC4RU.js +0 -5383
  117. package/www/browser/chunk-665WC4RU.js.map +0 -1
  118. package/www/browser/chunk-6QMSEZPT.js +0 -10044
  119. package/www/browser/chunk-6QMSEZPT.js.map +0 -1
  120. package/www/browser/chunk-6TBQERYX.js +0 -280
  121. package/www/browser/chunk-6TBQERYX.js.map +0 -1
  122. package/www/browser/chunk-6UW4MRJZ.js +0 -43
  123. package/www/browser/chunk-6UW4MRJZ.js.map +0 -7
  124. package/www/browser/chunk-6XUMIL3W.js +0 -5495
  125. package/www/browser/chunk-6XUMIL3W.js.map +0 -1
  126. package/www/browser/chunk-724YOJI3.js +0 -903
  127. package/www/browser/chunk-724YOJI3.js.map +0 -1
  128. package/www/browser/chunk-766T7YES.js +0 -437
  129. package/www/browser/chunk-766T7YES.js.map +0 -1
  130. package/www/browser/chunk-7FC7DN65.js +0 -728
  131. package/www/browser/chunk-7FC7DN65.js.map +0 -1
  132. package/www/browser/chunk-APGQRYWX.js +0 -156
  133. package/www/browser/chunk-APGQRYWX.js.map +0 -7
  134. package/www/browser/chunk-AQHSGTHS.js +0 -1960
  135. package/www/browser/chunk-AQHSGTHS.js.map +0 -1
  136. package/www/browser/chunk-CTOEAJQK.js +0 -40
  137. package/www/browser/chunk-CTOEAJQK.js.map +0 -7
  138. package/www/browser/chunk-DEGQJKKZ.js +0 -409
  139. package/www/browser/chunk-DEGQJKKZ.js.map +0 -1
  140. package/www/browser/chunk-DIJX2663.js +0 -1166
  141. package/www/browser/chunk-DIJX2663.js.map +0 -1
  142. package/www/browser/chunk-E4XD4GLT.js +0 -427
  143. package/www/browser/chunk-E4XD4GLT.js.map +0 -1
  144. package/www/browser/chunk-EQOY6A3M.js +0 -212
  145. package/www/browser/chunk-EQOY6A3M.js.map +0 -1
  146. package/www/browser/chunk-ETTBRXVA.js +0 -2643
  147. package/www/browser/chunk-ETTBRXVA.js.map +0 -1
  148. package/www/browser/chunk-FLSUSPBD.js +0 -5569
  149. package/www/browser/chunk-FLSUSPBD.js.map +0 -1
  150. package/www/browser/chunk-FZNHBEAZ.js +0 -102
  151. package/www/browser/chunk-FZNHBEAZ.js.map +0 -1
  152. package/www/browser/chunk-GJC7CZIJ.js +0 -361
  153. package/www/browser/chunk-GJC7CZIJ.js.map +0 -7
  154. package/www/browser/chunk-GMCNMOTD.js +0 -844
  155. package/www/browser/chunk-GMCNMOTD.js.map +0 -7
  156. package/www/browser/chunk-H43HGCRW.js +0 -198
  157. package/www/browser/chunk-H43HGCRW.js.map +0 -7
  158. package/www/browser/chunk-J447GBHM.js +0 -160
  159. package/www/browser/chunk-J447GBHM.js.map +0 -1
  160. package/www/browser/chunk-JN3VOWP7.js +0 -384
  161. package/www/browser/chunk-JN3VOWP7.js.map +0 -1
  162. package/www/browser/chunk-KSHAGY2M.js +0 -399
  163. package/www/browser/chunk-KSHAGY2M.js.map +0 -7
  164. package/www/browser/chunk-KV72AKOD.js +0 -59
  165. package/www/browser/chunk-KV72AKOD.js.map +0 -7
  166. package/www/browser/chunk-LAVMY2SJ.js +0 -26
  167. package/www/browser/chunk-LAVMY2SJ.js.map +0 -7
  168. package/www/browser/chunk-LLRVGHG5.js +0 -73
  169. package/www/browser/chunk-LLRVGHG5.js.map +0 -7
  170. package/www/browser/chunk-LPME4AJ3.js +0 -196
  171. package/www/browser/chunk-LPME4AJ3.js.map +0 -1
  172. package/www/browser/chunk-LVPSURVU.js +0 -4615
  173. package/www/browser/chunk-LVPSURVU.js.map +0 -1
  174. package/www/browser/chunk-MMPO7QLO.js +0 -4146
  175. package/www/browser/chunk-MMPO7QLO.js.map +0 -7
  176. package/www/browser/chunk-O7LB6VFM.js +0 -1953
  177. package/www/browser/chunk-O7LB6VFM.js.map +0 -1
  178. package/www/browser/chunk-P5CWA4FO.js +0 -685
  179. package/www/browser/chunk-P5CWA4FO.js.map +0 -1
  180. package/www/browser/chunk-RBWIWNTL.js +0 -203
  181. package/www/browser/chunk-RBWIWNTL.js.map +0 -7
  182. package/www/browser/chunk-RUXJCM3V.js +0 -26199
  183. package/www/browser/chunk-RUXJCM3V.js.map +0 -1
  184. package/www/browser/chunk-S77VVYUZ.js +0 -168
  185. package/www/browser/chunk-S77VVYUZ.js.map +0 -1
  186. package/www/browser/chunk-SCXPYFOB.js +0 -4316
  187. package/www/browser/chunk-SCXPYFOB.js.map +0 -1
  188. package/www/browser/chunk-SS73S33S.js +0 -471
  189. package/www/browser/chunk-SS73S33S.js.map +0 -7
  190. package/www/browser/chunk-T6UAOWNP.js +0 -600
  191. package/www/browser/chunk-T6UAOWNP.js.map +0 -1
  192. package/www/browser/chunk-TEW4MY4J.js +0 -148
  193. package/www/browser/chunk-TEW4MY4J.js.map +0 -7
  194. package/www/browser/chunk-TVORF3SF.js +0 -82
  195. package/www/browser/chunk-TVORF3SF.js.map +0 -7
  196. package/www/browser/chunk-UAN42EUZ.js +0 -2147
  197. package/www/browser/chunk-UAN42EUZ.js.map +0 -1
  198. package/www/browser/chunk-ULOHDK7Y.js +0 -1
  199. package/www/browser/chunk-ULOHDK7Y.js.map +0 -7
  200. package/www/browser/chunk-UYJ3FVRV.js +0 -3978
  201. package/www/browser/chunk-UYJ3FVRV.js.map +0 -1
  202. package/www/browser/chunk-VXHZMSDM.js +0 -5509
  203. package/www/browser/chunk-VXHZMSDM.js.map +0 -1
  204. package/www/browser/chunk-VYNQPZQO.js +0 -281
  205. package/www/browser/chunk-VYNQPZQO.js.map +0 -1
  206. package/www/browser/chunk-W3J23PZI.js +0 -9213
  207. package/www/browser/chunk-W3J23PZI.js.map +0 -1
  208. package/www/browser/chunk-W5HGHCQT.js +0 -1642
  209. package/www/browser/chunk-W5HGHCQT.js.map +0 -7
  210. package/www/browser/chunk-XF5H7E4L.js +0 -4723
  211. package/www/browser/chunk-XF5H7E4L.js.map +0 -1
  212. package/www/browser/chunk-XNFNEBMY.js +0 -398
  213. package/www/browser/chunk-XNFNEBMY.js.map +0 -7
  214. package/www/browser/chunk-XQY5SPGI.js +0 -30811
  215. package/www/browser/chunk-XQY5SPGI.js.map +0 -1
  216. package/www/browser/chunk-Y7JBZHNK.js +0 -514
  217. package/www/browser/chunk-Y7JBZHNK.js.map +0 -1
  218. package/www/browser/chunk-YWHRP4X3.js +0 -406
  219. package/www/browser/chunk-YWHRP4X3.js.map +0 -1
  220. package/www/browser/chunk-Z7FJIV62.js +0 -95
  221. package/www/browser/chunk-Z7FJIV62.js.map +0 -7
  222. package/www/browser/chunk-ZBZHXS46.js +0 -1674
  223. package/www/browser/chunk-ZBZHXS46.js.map +0 -1
  224. package/www/browser/chunk-ZZA5NVAI.js +0 -735
  225. package/www/browser/chunk-ZZA5NVAI.js.map +0 -1
  226. package/www/browser/collection-modal.component.css.map +0 -7
  227. package/www/browser/collection-tree-item.component.css.map +0 -7
  228. package/www/browser/collection-tree.component.css.map +0 -7
  229. package/www/browser/config-change-bar-component.css.map +0 -7
  230. package/www/browser/config-item-component.css.map +0 -7
  231. package/www/browser/config-nav-component.css.map +0 -7
  232. package/www/browser/config-section-component.css.map +0 -7
  233. package/www/browser/create-summary-aside.component.css.map +0 -7
  234. package/www/browser/curl-actions.component.css.map +0 -7
  235. package/www/browser/dark.css.map +0 -7
  236. package/www/browser/dashboard-canvas.component.css.map +0 -7
  237. package/www/browser/dashboard.component.css.map +0 -7
  238. package/www/browser/default.css.map +0 -7
  239. package/www/browser/detail-item-card.component.css.map +0 -7
  240. package/www/browser/ellipsis-text.component.css.map +0 -7
  241. package/www/browser/env-modal.component.css.map +0 -7
  242. package/www/browser/env-picker.component.css.map +0 -7
  243. package/www/browser/feedback.component.css.map +0 -7
  244. package/www/browser/fs-explorer.component.css.map +0 -7
  245. package/www/browser/git-import-modal.component.css.map +0 -7
  246. package/www/browser/hub-v2-personal-token-modal.component.css.map +0 -7
  247. package/www/browser/issue-action-area.component.css.map +0 -7
  248. package/www/browser/issue-add-participants-dialog.component.css.map +0 -7
  249. package/www/browser/issue-assign-dialog.component.css.map +0 -7
  250. package/www/browser/issue-attachment-area.component.css.map +0 -7
  251. package/www/browser/issue-base-info-area.component.css.map +0 -7
  252. package/www/browser/issue-branches.component.css.map +0 -7
  253. package/www/browser/issue-close-dialog.component.css.map +0 -7
  254. package/www/browser/issue-collaborators-panel.component.css.map +0 -7
  255. package/www/browser/issue-comment-editor.component.css.map +0 -7
  256. package/www/browser/issue-create-branch-dialog.component.css.map +0 -7
  257. package/www/browser/issue-description-area.component.css.map +0 -7
  258. package/www/browser/issue-detail.component.css.map +0 -7
  259. package/www/browser/issue-resolve-dialog.component.css.map +0 -7
  260. package/www/browser/issue-start-own-branch-dialog.component.css.map +0 -7
  261. package/www/browser/issues-list-table.component.css.map +0 -7
  262. package/www/browser/issues.component.css.map +0 -7
  263. package/www/browser/kill-port-widget.component.css.map +0 -7
  264. package/www/browser/kv-table.component.css.map +0 -7
  265. package/www/browser/layout-footer.component.css.map +0 -7
  266. package/www/browser/layout-header.component.css.map +0 -7
  267. package/www/browser/layout-menu.component.css.map +0 -7
  268. package/www/browser/layout-project-nav.component.css.map +0 -7
  269. package/www/browser/layout-sidebar.component.css.map +0 -7
  270. package/www/browser/layout.component.css.map +0 -7
  271. package/www/browser/less-viewport-component.css.map +0 -7
  272. package/www/browser/main.js +0 -1872
  273. package/www/browser/main.js.map +0 -1
  274. package/www/browser/markdown-viewer.component.css.map +0 -7
  275. package/www/browser/news-feed-widget.component.css.map +0 -7
  276. package/www/browser/ng-devtool.component.css.map +0 -7
  277. package/www/browser/nginx-config-editor.component.css.map +0 -7
  278. package/www/browser/nginx-log-viewer.component.css.map +0 -7
  279. package/www/browser/nginx-secondary-logs-tab.component.css.map +0 -7
  280. package/www/browser/nginx-secondary-perf-tab.component.css.map +0 -7
  281. package/www/browser/nginx-secondary-settings-tab.component.css.map +0 -7
  282. package/www/browser/nginx-secondary-ssl-tab.component.css.map +0 -7
  283. package/www/browser/nginx-secondary-test-tab.component.css.map +0 -7
  284. package/www/browser/nginx-secondary-traffic-tab.component.css.map +0 -7
  285. package/www/browser/nginx-secondary-upstream-tab.component.css.map +0 -7
  286. package/www/browser/nginx-section-card.component.css.map +0 -7
  287. package/www/browser/nginx-server-drawer.component.css.map +0 -7
  288. package/www/browser/nginx-server-list.component.css.map +0 -7
  289. package/www/browser/nginx-stat-card.component.css.map +0 -7
  290. package/www/browser/nginx.component.css.map +0 -7
  291. package/www/browser/page-layout.component.css.map +0 -7
  292. package/www/browser/pick-workspace-modal.component.css.map +0 -7
  293. package/www/browser/polyfills.js +0 -26584
  294. package/www/browser/polyfills.js.map +0 -7
  295. package/www/browser/project-conf.component.css.map +0 -7
  296. package/www/browser/project-create-modal.component.css.map +0 -7
  297. package/www/browser/project-create.component.css.map +0 -7
  298. package/www/browser/project-deps.component.css.map +0 -7
  299. package/www/browser/project-edit-modal.component.css.map +0 -7
  300. package/www/browser/project-import.component.css.map +0 -7
  301. package/www/browser/project-item-popover.component.css.map +0 -7
  302. package/www/browser/project-item.component.css.map +0 -7
  303. package/www/browser/project-list.component.css.map +0 -7
  304. package/www/browser/projects.component.css.map +0 -7
  305. package/www/browser/quick-task-widget.component.css.map +0 -7
  306. package/www/browser/rd-action-area.component.css.map +0 -7
  307. package/www/browser/rd-advance-stage-dialog.component.css.map +0 -7
  308. package/www/browser/rd-block-dialog.component.css.map +0 -7
  309. package/www/browser/rd-create-dialog.component.css.map +0 -7
  310. package/www/browser/rd-detail.component.css.map +0 -7
  311. package/www/browser/rd-item-card.component.css.map +0 -7
  312. package/www/browser/rd-list-board.component.css.map +0 -7
  313. package/www/browser/rd-list-table.component.css.map +0 -7
  314. package/www/browser/rd.component.css.map +0 -7
  315. package/www/browser/request-collections.component.css.map +0 -7
  316. package/www/browser/request-editor.component.css.map +0 -7
  317. package/www/browser/request-list-item.component.css.map +0 -7
  318. package/www/browser/request-list.component.css.map +0 -7
  319. package/www/browser/request-tabs-bar.component.css.map +0 -7
  320. package/www/browser/request-tabs.component.css.map +0 -7
  321. package/www/browser/request-urlbar.component.css.map +0 -7
  322. package/www/browser/response-viewer.component.css.map +0 -7
  323. package/www/browser/scripts.js +0 -245
  324. package/www/browser/scripts.js.map +0 -7
  325. package/www/browser/setting.component.css.map +0 -7
  326. package/www/browser/sprite-conf-modal.component.css.map +0 -7
  327. package/www/browser/sprite-icons-panel-component.css.map +0 -7
  328. package/www/browser/sprite-images-panel-component.css.map +0 -7
  329. package/www/browser/sprite-result-tabs.component.css.map +0 -7
  330. package/www/browser/sprite-viewport-component.css.map +0 -7
  331. package/www/browser/sprite.component.css.map +0 -7
  332. package/www/browser/step-advance.component.css.map +0 -7
  333. package/www/browser/step-basic.component.css.map +0 -7
  334. package/www/browser/step-config.component.css.map +0 -7
  335. package/www/browser/step-features.component.css.map +0 -7
  336. package/www/browser/step-preset.component.css.map +0 -7
  337. package/www/browser/step-summary-aside.component.css.map +0 -7
  338. package/www/browser/styles.css +0 -258
  339. package/www/browser/styles.css.map +0 -7
  340. package/www/browser/system-log.component.css.map +0 -7
  341. package/www/browser/task-actions.component.css.map +0 -7
  342. package/www/browser/task-console.component.css.map +0 -7
  343. package/www/browser/task-header.component.css.map +0 -7
  344. package/www/browser/task-list.component.css.map +0 -7
  345. package/www/browser/tasks.component.css.map +0 -7
  346. package/www/browser/terminal-view.component.css.map +0 -7
  347. package/www/browser/welcome-widget.component.css.map +0 -7
  348. package/www/browser/widget-base.component.css.map +0 -7
  349. package/www/browser/widget-host.component.css.map +0 -7
@@ -1,1960 +0,0 @@
1
- import {
2
- toSignal
3
- } from "./chunk-RUXJCM3V.js";
4
- import {
5
- DomSanitizer,
6
- HttpClient,
7
- isPlatformBrowser
8
- } from "./chunk-3MCIETCQ.js";
9
- import {
10
- ChangeDetectionStrategy,
11
- Component,
12
- ElementRef,
13
- EventEmitter,
14
- FactoryTarget,
15
- Inject,
16
- Injectable,
17
- InjectionToken,
18
- Input,
19
- NgModule,
20
- NgZone,
21
- Optional,
22
- Output,
23
- PLATFORM_ID,
24
- Pipe,
25
- SecurityContext,
26
- Subject,
27
- ViewContainerRef,
28
- __spreadProps,
29
- __spreadValues,
30
- computed,
31
- core_exports,
32
- distinctUntilChanged,
33
- first,
34
- map,
35
- mapTo,
36
- merge,
37
- of,
38
- shareReplay,
39
- switchMap,
40
- takeUntil,
41
- timer,
42
- ɵɵngDeclareClassMetadata,
43
- ɵɵngDeclareComponent,
44
- ɵɵngDeclareFactory,
45
- ɵɵngDeclareInjectable,
46
- ɵɵngDeclareInjector,
47
- ɵɵngDeclareNgModule,
48
- ɵɵngDeclarePipe
49
- } from "./chunk-XQY5SPGI.js";
50
-
51
- // node_modules/marked/lib/marked.esm.js
52
- function L() {
53
- return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
54
- }
55
- var T = L();
56
- function G(l3) {
57
- T = l3;
58
- }
59
- var E = { exec: () => null };
60
- function d(l3, e = "") {
61
- let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (r, i) => {
62
- let s = typeof i == "string" ? i : i.source;
63
- return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
64
- }, getRegex: () => new RegExp(t, e) };
65
- return n;
66
- }
67
- var be = (() => {
68
- try {
69
- return !!new RegExp("(?<=1)(?<!1)");
70
- } catch {
71
- return false;
72
- }
73
- })();
74
- var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}#`), htmlBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}<(?:[a-z].*>|!--)`, "i") };
75
- var Re = /^(?:[ \t]*(?:\n|$))+/;
76
- var Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
77
- var Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
78
- var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
79
- var we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
80
- var F = /(?:[*+-]|\d{1,9}[.)])/;
81
- var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
82
- var oe = d(ie).replace(/bull/g, F).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();
83
- var ye = d(ie).replace(/bull/g, F).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();
84
- var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
85
- var Pe = /^[^\n]+/;
86
- var Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
87
- var Se = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
88
- var $e = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex();
89
- var v = "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";
90
- var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
91
- var _e = d("^ {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", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
92
- var ae = d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
93
- var Le = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
94
- var K = { blockquote: Le, code: Te, def: Se, fences: Oe, heading: we, hr: I, html: _e, lheading: oe, list: $e, newline: Re, paragraph: ae, table: E, text: Pe };
95
- var re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
96
- var Me = __spreadProps(__spreadValues({}, K), { lheading: ye, table: re, paragraph: d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).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", v).getRegex() });
97
- var ze = __spreadProps(__spreadValues({}, K), { html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(j).replace("hr", I).replace("heading", ` *#{1,6} *[^
98
- ]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() });
99
- var Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
100
- var Ee = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
101
- var le = /^( {2,}|\\)\n(?!\s*$)/;
102
- var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
103
- var D = /[\p{P}\p{S}]/u;
104
- var W = /[\s\p{P}\p{S}]/u;
105
- var ue = /[^\s\p{P}\p{S}]/u;
106
- var Ce = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
107
- var pe = /(?!~)[\p{P}\p{S}]/u;
108
- var Be = /(?!~)[\s\p{P}\p{S}]/u;
109
- var qe = /(?:[^\s\p{P}\p{S}]|~)/u;
110
- var ve = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
111
- var ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
112
- var De = d(ce, "u").replace(/punct/g, D).getRegex();
113
- var He = d(ce, "u").replace(/punct/g, pe).getRegex();
114
- var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
115
- var Ze = d(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
116
- var Ge = d(he, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex();
117
- var Ne = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
118
- var Fe = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
119
- var je = d(/^<(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();
120
- var Qe = d(U).replace("(?:-->|$)", "-->").getRegex();
121
- var Ue = d("^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", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
122
- var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
123
- var Ke = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
124
- var de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
125
- var ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
126
- var We = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
127
- var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
128
- var X = { _backpedal: E, anyPunctuation: Fe, autolink: je, blockSkip: ve, br: le, code: Ee, del: E, emStrongLDelim: De, emStrongRDelimAst: Ze, emStrongRDelimUnd: Ne, escape: Ae, link: Ke, nolink: ke, punctuation: Ce, reflink: de, reflinkSearch: We, tag: Ue, text: Ie, url: E };
129
- var Xe = __spreadProps(__spreadValues({}, X), { link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() });
130
- var N = __spreadProps(__spreadValues({}, X), { emStrongRDelimAst: Ge, emStrongLDelim: He, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() });
131
- var Je = __spreadProps(__spreadValues({}, N), { br: d(le).replace("{2,}", "*").getRegex(), text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() });
132
- var C = { normal: K, gfm: Me, pedantic: ze };
133
- var M = { normal: X, gfm: N, breaks: Je, pedantic: Xe };
134
- var Ve = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
135
- var ge = (l3) => Ve[l3];
136
- function w(l3, e) {
137
- if (e) {
138
- if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ge);
139
- } else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ge);
140
- return l3;
141
- }
142
- function J(l3) {
143
- try {
144
- l3 = encodeURI(l3).replace(m.percentDecode, "%");
145
- } catch {
146
- return null;
147
- }
148
- return l3;
149
- }
150
- function V(l3, e) {
151
- let t = l3.replace(m.findPipe, (i, s, a) => {
152
- let o = false, p = s;
153
- for (; --p >= 0 && a[p] === "\\"; ) o = !o;
154
- return o ? "|" : " |";
155
- }), n = t.split(m.splitPipe), r = 0;
156
- if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
157
- else for (; n.length < e; ) n.push("");
158
- for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
159
- return n;
160
- }
161
- function z(l3, e, t) {
162
- let n = l3.length;
163
- if (n === 0) return "";
164
- let r = 0;
165
- for (; r < n; ) {
166
- let i = l3.charAt(n - r - 1);
167
- if (i === e && !t) r++;
168
- else if (i !== e && t) r++;
169
- else break;
170
- }
171
- return l3.slice(0, n - r);
172
- }
173
- function fe(l3, e) {
174
- if (l3.indexOf(e[1]) === -1) return -1;
175
- let t = 0;
176
- for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
177
- else if (l3[n] === e[0]) t++;
178
- else if (l3[n] === e[1] && (t--, t < 0)) return n;
179
- return t > 0 ? -2 : -1;
180
- }
181
- function me(l3, e, t, n, r) {
182
- let i = e.href, s = e.title || null, a = l3[1].replace(r.other.outputLinkReplace, "$1");
183
- n.state.inLink = true;
184
- let o = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
185
- return n.state.inLink = false, o;
186
- }
187
- function Ye(l3, e, t) {
188
- let n = l3.match(t.other.indentCodeCompensation);
189
- if (n === null) return e;
190
- let r = n[1];
191
- return e.split(`
192
- `).map((i) => {
193
- let s = i.match(t.other.beginningSpace);
194
- if (s === null) return i;
195
- let [a] = s;
196
- return a.length >= r.length ? i.slice(r.length) : i;
197
- }).join(`
198
- `);
199
- }
200
- var y = class {
201
- options;
202
- rules;
203
- lexer;
204
- constructor(e) {
205
- this.options = e || T;
206
- }
207
- space(e) {
208
- let t = this.rules.block.newline.exec(e);
209
- if (t && t[0].length > 0) return { type: "space", raw: t[0] };
210
- }
211
- code(e) {
212
- let t = this.rules.block.code.exec(e);
213
- if (t) {
214
- let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
215
- return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
216
- `) };
217
- }
218
- }
219
- fences(e) {
220
- let t = this.rules.block.fences.exec(e);
221
- if (t) {
222
- let n = t[0], r = Ye(n, t[3] || "", this.rules);
223
- return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
224
- }
225
- }
226
- heading(e) {
227
- let t = this.rules.block.heading.exec(e);
228
- if (t) {
229
- let n = t[2].trim();
230
- if (this.rules.other.endingHash.test(n)) {
231
- let r = z(n, "#");
232
- (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
233
- }
234
- return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
235
- }
236
- }
237
- hr(e) {
238
- let t = this.rules.block.hr.exec(e);
239
- if (t) return { type: "hr", raw: z(t[0], `
240
- `) };
241
- }
242
- blockquote(e) {
243
- let t = this.rules.block.blockquote.exec(e);
244
- if (t) {
245
- let n = z(t[0], `
246
- `).split(`
247
- `), r = "", i = "", s = [];
248
- for (; n.length > 0; ) {
249
- let a = false, o = [], p;
250
- for (p = 0; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) o.push(n[p]), a = true;
251
- else if (!a) o.push(n[p]);
252
- else break;
253
- n = n.slice(p);
254
- let u = o.join(`
255
- `), c = u.replace(this.rules.other.blockquoteSetextReplace, `
256
- $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
257
- r = r ? `${r}
258
- ${u}` : u, i = i ? `${i}
259
- ${c}` : c;
260
- let g = this.lexer.state.top;
261
- if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
262
- let h = s.at(-1);
263
- if (h?.type === "code") break;
264
- if (h?.type === "blockquote") {
265
- let R = h, f = R.raw + `
266
- ` + n.join(`
267
- `), O = this.blockquote(f);
268
- s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
269
- break;
270
- } else if (h?.type === "list") {
271
- let R = h, f = R.raw + `
272
- ` + n.join(`
273
- `), O = this.list(f);
274
- s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
275
- `);
276
- continue;
277
- }
278
- }
279
- return { type: "blockquote", raw: r, tokens: s, text: i };
280
- }
281
- }
282
- list(e) {
283
- let t = this.rules.block.list.exec(e);
284
- if (t) {
285
- let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
286
- n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
287
- let s = this.rules.other.listItemRegex(n), a = false;
288
- for (; e; ) {
289
- let p = false, u = "", c = "";
290
- if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
291
- u = t[0], e = e.substring(u.length);
292
- let g = t[2].split(`
293
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), h = e.split(`
294
- `, 1)[0], R = !g.trim(), f = 0;
295
- if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (u += h + `
296
- `, e = e.substring(h.length + 1), p = true), !p) {
297
- let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
298
- for (; e; ) {
299
- let Z = e.split(`
300
- `, 1)[0], A;
301
- if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), te.test(h) || ne.test(h) || xe.test(h) || H.test(h) || ee.test(h)) break;
302
- if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
303
- ` + A.slice(f);
304
- else {
305
- if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
306
- c += `
307
- ` + h;
308
- }
309
- !R && !h.trim() && (R = true), u += Z + `
310
- `, e = e.substring(Z.length + 1), g = A.slice(f);
311
- }
312
- }
313
- i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(u) && (a = true));
314
- let O = null, Y;
315
- this.options.gfm && (O = this.rules.other.listIsTask.exec(c), O && (Y = O[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: u, task: !!O, checked: Y, loose: false, text: c, tokens: [] }), i.raw += u;
316
- }
317
- let o = i.items.at(-1);
318
- if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
319
- else return;
320
- i.raw = i.raw.trimEnd();
321
- for (let p = 0; p < i.items.length; p++) if (this.lexer.state.top = false, i.items[p].tokens = this.lexer.blockTokens(i.items[p].text, []), !i.loose) {
322
- let u = i.items[p].tokens.filter((g) => g.type === "space"), c = u.length > 0 && u.some((g) => this.rules.other.anyLine.test(g.raw));
323
- i.loose = c;
324
- }
325
- if (i.loose) for (let p = 0; p < i.items.length; p++) i.items[p].loose = true;
326
- return i;
327
- }
328
- }
329
- html(e) {
330
- let t = this.rules.block.html.exec(e);
331
- if (t) return { type: "html", block: true, raw: t[0], pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: t[0] };
332
- }
333
- def(e) {
334
- let t = this.rules.block.def.exec(e);
335
- if (t) {
336
- let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
337
- return { type: "def", tag: n, raw: t[0], href: r, title: i };
338
- }
339
- }
340
- table(e) {
341
- let t = this.rules.block.table.exec(e);
342
- if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
343
- let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
344
- `) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
345
- if (n.length === r.length) {
346
- for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
347
- for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
348
- for (let a of i) s.rows.push(V(a, s.header.length).map((o, p) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[p] })));
349
- return s;
350
- }
351
- }
352
- lheading(e) {
353
- let t = this.rules.block.lheading.exec(e);
354
- if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
355
- }
356
- paragraph(e) {
357
- let t = this.rules.block.paragraph.exec(e);
358
- if (t) {
359
- let n = t[1].charAt(t[1].length - 1) === `
360
- ` ? t[1].slice(0, -1) : t[1];
361
- return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
362
- }
363
- }
364
- text(e) {
365
- let t = this.rules.block.text.exec(e);
366
- if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
367
- }
368
- escape(e) {
369
- let t = this.rules.inline.escape.exec(e);
370
- if (t) return { type: "escape", raw: t[0], text: t[1] };
371
- }
372
- tag(e) {
373
- let t = this.rules.inline.tag.exec(e);
374
- if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
375
- }
376
- link(e) {
377
- let t = this.rules.inline.link.exec(e);
378
- if (t) {
379
- let n = t[2].trim();
380
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
381
- if (!this.rules.other.endAngleBracket.test(n)) return;
382
- let s = z(n.slice(0, -1), "\\");
383
- if ((n.length - s.length) % 2 === 0) return;
384
- } else {
385
- let s = fe(t[2], "()");
386
- if (s === -2) return;
387
- if (s > -1) {
388
- let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
389
- t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
390
- }
391
- }
392
- let r = t[2], i = "";
393
- if (this.options.pedantic) {
394
- let s = this.rules.other.pedanticHrefTitle.exec(r);
395
- s && (r = s[1], i = s[3]);
396
- } else i = t[3] ? t[3].slice(1, -1) : "";
397
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
398
- }
399
- }
400
- reflink(e, t) {
401
- let n;
402
- if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
403
- let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[r.toLowerCase()];
404
- if (!i) {
405
- let s = n[0].charAt(0);
406
- return { type: "text", raw: s, text: s };
407
- }
408
- return me(n, i, n[0], this.lexer, this.rules);
409
- }
410
- }
411
- emStrong(e, t, n = "") {
412
- let r = this.rules.inline.emStrongLDelim.exec(e);
413
- if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
414
- if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
415
- let s = [...r[0]].length - 1, a, o, p = s, u = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
416
- for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
417
- if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
418
- if (o = [...a].length, r[3] || r[4]) {
419
- p += o;
420
- continue;
421
- } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
422
- u += o;
423
- continue;
424
- }
425
- if (p -= o, p > 0) continue;
426
- o = Math.min(o, o + p + u);
427
- let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
428
- if (Math.min(s, o) % 2) {
429
- let f = h.slice(1, -1);
430
- return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
431
- }
432
- let R = h.slice(2, -2);
433
- return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
434
- }
435
- }
436
- }
437
- codespan(e) {
438
- let t = this.rules.inline.code.exec(e);
439
- if (t) {
440
- let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
441
- return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
442
- }
443
- }
444
- br(e) {
445
- let t = this.rules.inline.br.exec(e);
446
- if (t) return { type: "br", raw: t[0] };
447
- }
448
- del(e) {
449
- let t = this.rules.inline.del.exec(e);
450
- if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
451
- }
452
- autolink(e) {
453
- let t = this.rules.inline.autolink.exec(e);
454
- if (t) {
455
- let n, r;
456
- return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
457
- }
458
- }
459
- url(e) {
460
- let t;
461
- if (t = this.rules.inline.url.exec(e)) {
462
- let n, r;
463
- if (t[2] === "@") n = t[0], r = "mailto:" + n;
464
- else {
465
- let i;
466
- do
467
- i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
468
- while (i !== t[0]);
469
- n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
470
- }
471
- return { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
472
- }
473
- }
474
- inlineText(e) {
475
- let t = this.rules.inline.text.exec(e);
476
- if (t) {
477
- let n = this.lexer.state.inRawBlock;
478
- return { type: "text", raw: t[0], text: t[0], escaped: n };
479
- }
480
- }
481
- };
482
- var x = class l {
483
- tokens;
484
- options;
485
- state;
486
- tokenizer;
487
- inlineQueue;
488
- constructor(e) {
489
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
490
- let t = { other: m, block: C.normal, inline: M.normal };
491
- this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
492
- }
493
- static get rules() {
494
- return { block: C, inline: M };
495
- }
496
- static lex(e, t) {
497
- return new l(t).lex(e);
498
- }
499
- static lexInline(e, t) {
500
- return new l(t).inlineTokens(e);
501
- }
502
- lex(e) {
503
- e = e.replace(m.carriageReturn, `
504
- `), this.blockTokens(e, this.tokens);
505
- for (let t = 0; t < this.inlineQueue.length; t++) {
506
- let n = this.inlineQueue[t];
507
- this.inlineTokens(n.src, n.tokens);
508
- }
509
- return this.inlineQueue = [], this.tokens;
510
- }
511
- blockTokens(e, t = [], n = false) {
512
- for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
513
- let r;
514
- if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
515
- if (r = this.tokenizer.space(e)) {
516
- e = e.substring(r.raw.length);
517
- let s = t.at(-1);
518
- r.raw.length === 1 && s !== void 0 ? s.raw += `
519
- ` : t.push(r);
520
- continue;
521
- }
522
- if (r = this.tokenizer.code(e)) {
523
- e = e.substring(r.raw.length);
524
- let s = t.at(-1);
525
- s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
526
- `) ? "" : `
527
- `) + r.raw, s.text += `
528
- ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
529
- continue;
530
- }
531
- if (r = this.tokenizer.fences(e)) {
532
- e = e.substring(r.raw.length), t.push(r);
533
- continue;
534
- }
535
- if (r = this.tokenizer.heading(e)) {
536
- e = e.substring(r.raw.length), t.push(r);
537
- continue;
538
- }
539
- if (r = this.tokenizer.hr(e)) {
540
- e = e.substring(r.raw.length), t.push(r);
541
- continue;
542
- }
543
- if (r = this.tokenizer.blockquote(e)) {
544
- e = e.substring(r.raw.length), t.push(r);
545
- continue;
546
- }
547
- if (r = this.tokenizer.list(e)) {
548
- e = e.substring(r.raw.length), t.push(r);
549
- continue;
550
- }
551
- if (r = this.tokenizer.html(e)) {
552
- e = e.substring(r.raw.length), t.push(r);
553
- continue;
554
- }
555
- if (r = this.tokenizer.def(e)) {
556
- e = e.substring(r.raw.length);
557
- let s = t.at(-1);
558
- s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
559
- `) ? "" : `
560
- `) + r.raw, s.text += `
561
- ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
562
- continue;
563
- }
564
- if (r = this.tokenizer.table(e)) {
565
- e = e.substring(r.raw.length), t.push(r);
566
- continue;
567
- }
568
- if (r = this.tokenizer.lheading(e)) {
569
- e = e.substring(r.raw.length), t.push(r);
570
- continue;
571
- }
572
- let i = e;
573
- if (this.options.extensions?.startBlock) {
574
- let s = 1 / 0, a = e.slice(1), o;
575
- this.options.extensions.startBlock.forEach((p) => {
576
- o = p.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
577
- }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
578
- }
579
- if (this.state.top && (r = this.tokenizer.paragraph(i))) {
580
- let s = t.at(-1);
581
- n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
582
- `) ? "" : `
583
- `) + r.raw, s.text += `
584
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
585
- continue;
586
- }
587
- if (r = this.tokenizer.text(e)) {
588
- e = e.substring(r.raw.length);
589
- let s = t.at(-1);
590
- s?.type === "text" ? (s.raw += (s.raw.endsWith(`
591
- `) ? "" : `
592
- `) + r.raw, s.text += `
593
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
594
- continue;
595
- }
596
- if (e) {
597
- let s = "Infinite loop on byte: " + e.charCodeAt(0);
598
- if (this.options.silent) {
599
- console.error(s);
600
- break;
601
- } else throw new Error(s);
602
- }
603
- }
604
- return this.state.top = true, t;
605
- }
606
- inline(e, t = []) {
607
- return this.inlineQueue.push({ src: e, tokens: t }), t;
608
- }
609
- inlineTokens(e, t = []) {
610
- let n = e, r = null;
611
- if (this.tokens.links) {
612
- let o = Object.keys(this.tokens.links);
613
- if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
614
- }
615
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
616
- let i;
617
- for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
618
- n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
619
- let s = false, a = "";
620
- for (; e; ) {
621
- s || (a = ""), s = false;
622
- let o;
623
- if (this.options.extensions?.inline?.some((u) => (o = u.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
624
- if (o = this.tokenizer.escape(e)) {
625
- e = e.substring(o.raw.length), t.push(o);
626
- continue;
627
- }
628
- if (o = this.tokenizer.tag(e)) {
629
- e = e.substring(o.raw.length), t.push(o);
630
- continue;
631
- }
632
- if (o = this.tokenizer.link(e)) {
633
- e = e.substring(o.raw.length), t.push(o);
634
- continue;
635
- }
636
- if (o = this.tokenizer.reflink(e, this.tokens.links)) {
637
- e = e.substring(o.raw.length);
638
- let u = t.at(-1);
639
- o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
640
- continue;
641
- }
642
- if (o = this.tokenizer.emStrong(e, n, a)) {
643
- e = e.substring(o.raw.length), t.push(o);
644
- continue;
645
- }
646
- if (o = this.tokenizer.codespan(e)) {
647
- e = e.substring(o.raw.length), t.push(o);
648
- continue;
649
- }
650
- if (o = this.tokenizer.br(e)) {
651
- e = e.substring(o.raw.length), t.push(o);
652
- continue;
653
- }
654
- if (o = this.tokenizer.del(e)) {
655
- e = e.substring(o.raw.length), t.push(o);
656
- continue;
657
- }
658
- if (o = this.tokenizer.autolink(e)) {
659
- e = e.substring(o.raw.length), t.push(o);
660
- continue;
661
- }
662
- if (!this.state.inLink && (o = this.tokenizer.url(e))) {
663
- e = e.substring(o.raw.length), t.push(o);
664
- continue;
665
- }
666
- let p = e;
667
- if (this.options.extensions?.startInline) {
668
- let u = 1 / 0, c = e.slice(1), g;
669
- this.options.extensions.startInline.forEach((h) => {
670
- g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (u = Math.min(u, g));
671
- }), u < 1 / 0 && u >= 0 && (p = e.substring(0, u + 1));
672
- }
673
- if (o = this.tokenizer.inlineText(p)) {
674
- e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
675
- let u = t.at(-1);
676
- u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
677
- continue;
678
- }
679
- if (e) {
680
- let u = "Infinite loop on byte: " + e.charCodeAt(0);
681
- if (this.options.silent) {
682
- console.error(u);
683
- break;
684
- } else throw new Error(u);
685
- }
686
- }
687
- return t;
688
- }
689
- };
690
- var P = class {
691
- options;
692
- parser;
693
- constructor(e) {
694
- this.options = e || T;
695
- }
696
- space(e) {
697
- return "";
698
- }
699
- code({ text: e, lang: t, escaped: n }) {
700
- let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
701
- `;
702
- return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
703
- ` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
704
- `;
705
- }
706
- blockquote({ tokens: e }) {
707
- return `<blockquote>
708
- ${this.parser.parse(e)}</blockquote>
709
- `;
710
- }
711
- html({ text: e }) {
712
- return e;
713
- }
714
- def(e) {
715
- return "";
716
- }
717
- heading({ tokens: e, depth: t }) {
718
- return `<h${t}>${this.parser.parseInline(e)}</h${t}>
719
- `;
720
- }
721
- hr(e) {
722
- return `<hr>
723
- `;
724
- }
725
- list(e) {
726
- let t = e.ordered, n = e.start, r = "";
727
- for (let a = 0; a < e.items.length; a++) {
728
- let o = e.items[a];
729
- r += this.listitem(o);
730
- }
731
- let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
732
- return "<" + i + s + `>
733
- ` + r + "</" + i + `>
734
- `;
735
- }
736
- listitem(e) {
737
- let t = "";
738
- if (e.task) {
739
- let n = this.checkbox({ checked: !!e.checked });
740
- e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " ", escaped: true }) : t += n + " ";
741
- }
742
- return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
743
- `;
744
- }
745
- checkbox({ checked: e }) {
746
- return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
747
- }
748
- paragraph({ tokens: e }) {
749
- return `<p>${this.parser.parseInline(e)}</p>
750
- `;
751
- }
752
- table(e) {
753
- let t = "", n = "";
754
- for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
755
- t += this.tablerow({ text: n });
756
- let r = "";
757
- for (let i = 0; i < e.rows.length; i++) {
758
- let s = e.rows[i];
759
- n = "";
760
- for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
761
- r += this.tablerow({ text: n });
762
- }
763
- return r && (r = `<tbody>${r}</tbody>`), `<table>
764
- <thead>
765
- ` + t + `</thead>
766
- ` + r + `</table>
767
- `;
768
- }
769
- tablerow({ text: e }) {
770
- return `<tr>
771
- ${e}</tr>
772
- `;
773
- }
774
- tablecell(e) {
775
- let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
776
- return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
777
- `;
778
- }
779
- strong({ tokens: e }) {
780
- return `<strong>${this.parser.parseInline(e)}</strong>`;
781
- }
782
- em({ tokens: e }) {
783
- return `<em>${this.parser.parseInline(e)}</em>`;
784
- }
785
- codespan({ text: e }) {
786
- return `<code>${w(e, true)}</code>`;
787
- }
788
- br(e) {
789
- return "<br>";
790
- }
791
- del({ tokens: e }) {
792
- return `<del>${this.parser.parseInline(e)}</del>`;
793
- }
794
- link({ href: e, title: t, tokens: n }) {
795
- let r = this.parser.parseInline(n), i = J(e);
796
- if (i === null) return r;
797
- e = i;
798
- let s = '<a href="' + e + '"';
799
- return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
800
- }
801
- image({ href: e, title: t, text: n, tokens: r }) {
802
- r && (n = this.parser.parseInline(r, this.parser.textRenderer));
803
- let i = J(e);
804
- if (i === null) return w(n);
805
- e = i;
806
- let s = `<img src="${e}" alt="${n}"`;
807
- return t && (s += ` title="${w(t)}"`), s += ">", s;
808
- }
809
- text(e) {
810
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
811
- }
812
- };
813
- var $ = class {
814
- strong({ text: e }) {
815
- return e;
816
- }
817
- em({ text: e }) {
818
- return e;
819
- }
820
- codespan({ text: e }) {
821
- return e;
822
- }
823
- del({ text: e }) {
824
- return e;
825
- }
826
- html({ text: e }) {
827
- return e;
828
- }
829
- text({ text: e }) {
830
- return e;
831
- }
832
- link({ text: e }) {
833
- return "" + e;
834
- }
835
- image({ text: e }) {
836
- return "" + e;
837
- }
838
- br() {
839
- return "";
840
- }
841
- };
842
- var b = class l2 {
843
- options;
844
- renderer;
845
- textRenderer;
846
- constructor(e) {
847
- this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
848
- }
849
- static parse(e, t) {
850
- return new l2(t).parse(e);
851
- }
852
- static parseInline(e, t) {
853
- return new l2(t).parseInline(e);
854
- }
855
- parse(e, t = true) {
856
- let n = "";
857
- for (let r = 0; r < e.length; r++) {
858
- let i = e[r];
859
- if (this.options.extensions?.renderers?.[i.type]) {
860
- let a = i, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
861
- if (o !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(a.type)) {
862
- n += o || "";
863
- continue;
864
- }
865
- }
866
- let s = i;
867
- switch (s.type) {
868
- case "space": {
869
- n += this.renderer.space(s);
870
- continue;
871
- }
872
- case "hr": {
873
- n += this.renderer.hr(s);
874
- continue;
875
- }
876
- case "heading": {
877
- n += this.renderer.heading(s);
878
- continue;
879
- }
880
- case "code": {
881
- n += this.renderer.code(s);
882
- continue;
883
- }
884
- case "table": {
885
- n += this.renderer.table(s);
886
- continue;
887
- }
888
- case "blockquote": {
889
- n += this.renderer.blockquote(s);
890
- continue;
891
- }
892
- case "list": {
893
- n += this.renderer.list(s);
894
- continue;
895
- }
896
- case "html": {
897
- n += this.renderer.html(s);
898
- continue;
899
- }
900
- case "def": {
901
- n += this.renderer.def(s);
902
- continue;
903
- }
904
- case "paragraph": {
905
- n += this.renderer.paragraph(s);
906
- continue;
907
- }
908
- case "text": {
909
- let a = s, o = this.renderer.text(a);
910
- for (; r + 1 < e.length && e[r + 1].type === "text"; ) a = e[++r], o += `
911
- ` + this.renderer.text(a);
912
- t ? n += this.renderer.paragraph({ type: "paragraph", raw: o, text: o, tokens: [{ type: "text", raw: o, text: o, escaped: true }] }) : n += o;
913
- continue;
914
- }
915
- default: {
916
- let a = 'Token with "' + s.type + '" type was not found.';
917
- if (this.options.silent) return console.error(a), "";
918
- throw new Error(a);
919
- }
920
- }
921
- }
922
- return n;
923
- }
924
- parseInline(e, t = this.renderer) {
925
- let n = "";
926
- for (let r = 0; r < e.length; r++) {
927
- let i = e[r];
928
- if (this.options.extensions?.renderers?.[i.type]) {
929
- let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
930
- if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
931
- n += a || "";
932
- continue;
933
- }
934
- }
935
- let s = i;
936
- switch (s.type) {
937
- case "escape": {
938
- n += t.text(s);
939
- break;
940
- }
941
- case "html": {
942
- n += t.html(s);
943
- break;
944
- }
945
- case "link": {
946
- n += t.link(s);
947
- break;
948
- }
949
- case "image": {
950
- n += t.image(s);
951
- break;
952
- }
953
- case "strong": {
954
- n += t.strong(s);
955
- break;
956
- }
957
- case "em": {
958
- n += t.em(s);
959
- break;
960
- }
961
- case "codespan": {
962
- n += t.codespan(s);
963
- break;
964
- }
965
- case "br": {
966
- n += t.br(s);
967
- break;
968
- }
969
- case "del": {
970
- n += t.del(s);
971
- break;
972
- }
973
- case "text": {
974
- n += t.text(s);
975
- break;
976
- }
977
- default: {
978
- let a = 'Token with "' + s.type + '" type was not found.';
979
- if (this.options.silent) return console.error(a), "";
980
- throw new Error(a);
981
- }
982
- }
983
- }
984
- return n;
985
- }
986
- };
987
- var S = class {
988
- options;
989
- block;
990
- constructor(e) {
991
- this.options = e || T;
992
- }
993
- static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
994
- static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
995
- preprocess(e) {
996
- return e;
997
- }
998
- postprocess(e) {
999
- return e;
1000
- }
1001
- processAllTokens(e) {
1002
- return e;
1003
- }
1004
- emStrongMask(e) {
1005
- return e;
1006
- }
1007
- provideLexer() {
1008
- return this.block ? x.lex : x.lexInline;
1009
- }
1010
- provideParser() {
1011
- return this.block ? b.parse : b.parseInline;
1012
- }
1013
- };
1014
- var B = class {
1015
- defaults = L();
1016
- options = this.setOptions;
1017
- parse = this.parseMarkdown(true);
1018
- parseInline = this.parseMarkdown(false);
1019
- Parser = b;
1020
- Renderer = P;
1021
- TextRenderer = $;
1022
- Lexer = x;
1023
- Tokenizer = y;
1024
- Hooks = S;
1025
- constructor(...e) {
1026
- this.use(...e);
1027
- }
1028
- walkTokens(e, t) {
1029
- let n = [];
1030
- for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1031
- case "table": {
1032
- let i = r;
1033
- for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
1034
- for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
1035
- break;
1036
- }
1037
- case "list": {
1038
- let i = r;
1039
- n = n.concat(this.walkTokens(i.items, t));
1040
- break;
1041
- }
1042
- default: {
1043
- let i = r;
1044
- this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1045
- let a = i[s].flat(1 / 0);
1046
- n = n.concat(this.walkTokens(a, t));
1047
- }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
1048
- }
1049
- }
1050
- return n;
1051
- }
1052
- use(...e) {
1053
- let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
1054
- return e.forEach((n) => {
1055
- let r = __spreadValues({}, n);
1056
- if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
1057
- if (!i.name) throw new Error("extension name required");
1058
- if ("renderer" in i) {
1059
- let s = t.renderers[i.name];
1060
- s ? t.renderers[i.name] = function(...a) {
1061
- let o = i.renderer.apply(this, a);
1062
- return o === false && (o = s.apply(this, a)), o;
1063
- } : t.renderers[i.name] = i.renderer;
1064
- }
1065
- if ("tokenizer" in i) {
1066
- if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1067
- let s = t[i.level];
1068
- s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1069
- }
1070
- "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1071
- }), r.extensions = t), n.renderer) {
1072
- let i = this.defaults.renderer || new P(this.defaults);
1073
- for (let s in n.renderer) {
1074
- if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1075
- if (["options", "parser"].includes(s)) continue;
1076
- let a = s, o = n.renderer[a], p = i[a];
1077
- i[a] = (...u) => {
1078
- let c = o.apply(i, u);
1079
- return c === false && (c = p.apply(i, u)), c || "";
1080
- };
1081
- }
1082
- r.renderer = i;
1083
- }
1084
- if (n.tokenizer) {
1085
- let i = this.defaults.tokenizer || new y(this.defaults);
1086
- for (let s in n.tokenizer) {
1087
- if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1088
- if (["options", "rules", "lexer"].includes(s)) continue;
1089
- let a = s, o = n.tokenizer[a], p = i[a];
1090
- i[a] = (...u) => {
1091
- let c = o.apply(i, u);
1092
- return c === false && (c = p.apply(i, u)), c;
1093
- };
1094
- }
1095
- r.tokenizer = i;
1096
- }
1097
- if (n.hooks) {
1098
- let i = this.defaults.hooks || new S();
1099
- for (let s in n.hooks) {
1100
- if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1101
- if (["options", "block"].includes(s)) continue;
1102
- let a = s, o = n.hooks[a], p = i[a];
1103
- S.passThroughHooks.has(s) ? i[a] = (u) => {
1104
- if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
1105
- let g = await o.call(i, u);
1106
- return p.call(i, g);
1107
- })();
1108
- let c = o.call(i, u);
1109
- return p.call(i, c);
1110
- } : i[a] = (...u) => {
1111
- if (this.defaults.async) return (async () => {
1112
- let g = await o.apply(i, u);
1113
- return g === false && (g = await p.apply(i, u)), g;
1114
- })();
1115
- let c = o.apply(i, u);
1116
- return c === false && (c = p.apply(i, u)), c;
1117
- };
1118
- }
1119
- r.hooks = i;
1120
- }
1121
- if (n.walkTokens) {
1122
- let i = this.defaults.walkTokens, s = n.walkTokens;
1123
- r.walkTokens = function(a) {
1124
- let o = [];
1125
- return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1126
- };
1127
- }
1128
- this.defaults = __spreadValues(__spreadValues({}, this.defaults), r);
1129
- }), this;
1130
- }
1131
- setOptions(e) {
1132
- return this.defaults = __spreadValues(__spreadValues({}, this.defaults), e), this;
1133
- }
1134
- lexer(e, t) {
1135
- return x.lex(e, t ?? this.defaults);
1136
- }
1137
- parser(e, t) {
1138
- return b.parse(e, t ?? this.defaults);
1139
- }
1140
- parseMarkdown(e) {
1141
- return (n, r) => {
1142
- let i = __spreadValues({}, r), s = __spreadValues(__spreadValues({}, this.defaults), i), a = this.onError(!!s.silent, !!s.async);
1143
- if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1144
- if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1145
- if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1146
- if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1147
- let o = s.hooks ? await s.hooks.preprocess(n) : n, u = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(u) : u;
1148
- s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1149
- let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
1150
- return s.hooks ? await s.hooks.postprocess(h) : h;
1151
- })().catch(a);
1152
- try {
1153
- s.hooks && (n = s.hooks.preprocess(n));
1154
- let p = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
1155
- s.hooks && (p = s.hooks.processAllTokens(p)), s.walkTokens && this.walkTokens(p, s.walkTokens);
1156
- let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
1157
- return s.hooks && (c = s.hooks.postprocess(c)), c;
1158
- } catch (o) {
1159
- return a(o);
1160
- }
1161
- };
1162
- }
1163
- onError(e, t) {
1164
- return (n) => {
1165
- if (n.message += `
1166
- Please report this to https://github.com/markedjs/marked.`, e) {
1167
- let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
1168
- return t ? Promise.resolve(r) : r;
1169
- }
1170
- if (t) return Promise.reject(n);
1171
- throw n;
1172
- };
1173
- }
1174
- };
1175
- var _ = new B();
1176
- function k(l3, e) {
1177
- return _.parse(l3, e);
1178
- }
1179
- k.options = k.setOptions = function(l3) {
1180
- return _.setOptions(l3), k.defaults = _.defaults, G(k.defaults), k;
1181
- };
1182
- k.getDefaults = L;
1183
- k.defaults = T;
1184
- k.use = function(...l3) {
1185
- return _.use(...l3), k.defaults = _.defaults, G(k.defaults), k;
1186
- };
1187
- k.walkTokens = function(l3, e) {
1188
- return _.walkTokens(l3, e);
1189
- };
1190
- k.parseInline = _.parseInline;
1191
- k.Parser = b;
1192
- k.parser = b.parse;
1193
- k.Renderer = P;
1194
- k.TextRenderer = $;
1195
- k.Lexer = x;
1196
- k.lexer = x.lex;
1197
- k.Tokenizer = y;
1198
- k.Hooks = S;
1199
- k.parse = k;
1200
- var Zt = k.options;
1201
- var Gt = k.setOptions;
1202
- var Nt = k.use;
1203
- var Ft = k.walkTokens;
1204
- var jt = k.parseInline;
1205
- var Ut = b.parse;
1206
- var Kt = x.lex;
1207
-
1208
- // node_modules/ngx-markdown/fesm2022/ngx-markdown.mjs
1209
- var BUTTON_TEXT_COPY = "Copy";
1210
- var BUTTON_TEXT_COPIED = "Copied";
1211
- var _ClipboardButtonComponent = class _ClipboardButtonComponent {
1212
- constructor() {
1213
- this._buttonClick$ = new Subject();
1214
- this.copied = toSignal(this._buttonClick$.pipe(switchMap(() => merge(of(true), timer(3e3).pipe(mapTo(false)))), distinctUntilChanged(), shareReplay(1)));
1215
- this.copiedText = computed(() => this.copied() ? BUTTON_TEXT_COPIED : BUTTON_TEXT_COPY);
1216
- }
1217
- onCopyToClipboardClick() {
1218
- this._buttonClick$.next();
1219
- }
1220
- };
1221
- _ClipboardButtonComponent.\u0275fac = \u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _ClipboardButtonComponent, deps: [], target: FactoryTarget.Component });
1222
- _ClipboardButtonComponent.\u0275cmp = \u0275\u0275ngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: _ClipboardButtonComponent, isStandalone: true, selector: "markdown-clipboard", ngImport: core_exports, template: `
1223
- <button
1224
- class="markdown-clipboard-button"
1225
- [class.copied]="copied()"
1226
- (click)="onCopyToClipboardClick()"
1227
- >{{ copiedText() }}</button>
1228
- `, isInline: true, changeDetection: ChangeDetectionStrategy.OnPush });
1229
- var ClipboardButtonComponent = _ClipboardButtonComponent;
1230
- \u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: ClipboardButtonComponent, decorators: [{
1231
- type: Component,
1232
- args: [{
1233
- selector: "markdown-clipboard",
1234
- template: `
1235
- <button
1236
- class="markdown-clipboard-button"
1237
- [class.copied]="copied()"
1238
- (click)="onCopyToClipboardClick()"
1239
- >{{ copiedText() }}</button>
1240
- `,
1241
- changeDetection: ChangeDetectionStrategy.OnPush
1242
- }]
1243
- }] });
1244
- var CLIPBOARD_OPTIONS = new InjectionToken("CLIPBOARD_OPTIONS");
1245
- var _LanguagePipe = class _LanguagePipe {
1246
- transform(value, language) {
1247
- if (value == null) {
1248
- value = "";
1249
- }
1250
- if (language == null) {
1251
- language = "";
1252
- }
1253
- if (typeof value !== "string") {
1254
- console.error(`LanguagePipe has been invoked with an invalid value type [${typeof value}]`);
1255
- return value;
1256
- }
1257
- if (typeof language !== "string") {
1258
- console.error(`LanguagePipe has been invoked with an invalid parameter [${typeof language}]`);
1259
- return value;
1260
- }
1261
- return "```" + language + "\n" + value + "\n```";
1262
- }
1263
- };
1264
- _LanguagePipe.\u0275fac = \u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _LanguagePipe, deps: [], target: FactoryTarget.Pipe });
1265
- _LanguagePipe.\u0275pipe = \u0275\u0275ngDeclarePipe({ minVersion: "14.0.0", version: "20.0.0", ngImport: core_exports, type: _LanguagePipe, isStandalone: true, name: "language" });
1266
- var LanguagePipe = _LanguagePipe;
1267
- \u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: LanguagePipe, decorators: [{
1268
- type: Pipe,
1269
- args: [{
1270
- name: "language"
1271
- }]
1272
- }] });
1273
- var PrismPlugin;
1274
- (function(PrismPlugin2) {
1275
- PrismPlugin2["CommandLine"] = "command-line";
1276
- PrismPlugin2["LineHighlight"] = "line-highlight";
1277
- PrismPlugin2["LineNumbers"] = "line-numbers";
1278
- })(PrismPlugin || (PrismPlugin = {}));
1279
- var MARKED_EXTENSIONS = new InjectionToken("MARKED_EXTENSIONS");
1280
- var MARKED_OPTIONS = new InjectionToken("MARKED_OPTIONS");
1281
- var MERMAID_OPTIONS = new InjectionToken("MERMAID_OPTIONS");
1282
- var SANITIZE = new InjectionToken("SANITIZE");
1283
- function isSanitizeFunction(sanitize) {
1284
- return typeof sanitize === "function";
1285
- }
1286
- var errorJoyPixelsNotLoaded = "[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information";
1287
- var errorKatexNotLoaded = "[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information";
1288
- var errorMermaidNotLoaded = "[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information";
1289
- var errorClipboardNotLoaded = "[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information";
1290
- var errorClipboardViewContainerRequired = "[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function";
1291
- var errorSrcWithoutHttpClient = "[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information";
1292
- var _MarkdownService = class _MarkdownService {
1293
- get options() {
1294
- return this._options;
1295
- }
1296
- set options(value) {
1297
- this._options = __spreadValues(__spreadValues({}, this.DEFAULT_MARKED_OPTIONS), value);
1298
- }
1299
- get renderer() {
1300
- return this.options.renderer;
1301
- }
1302
- set renderer(value) {
1303
- this.options.renderer = value;
1304
- }
1305
- constructor(clipboardOptions, extensions, options, mermaidOptions, platform, sanitize, http, sanitizer) {
1306
- this.clipboardOptions = clipboardOptions;
1307
- this.extensions = extensions;
1308
- this.mermaidOptions = mermaidOptions;
1309
- this.platform = platform;
1310
- this.sanitize = sanitize;
1311
- this.http = http;
1312
- this.sanitizer = sanitizer;
1313
- this.DEFAULT_MARKED_OPTIONS = {
1314
- renderer: new P()
1315
- };
1316
- this.DEFAULT_KATEX_OPTIONS = {
1317
- delimiters: [
1318
- { left: "$$", right: "$$", display: true },
1319
- { left: "$", right: "$", display: false },
1320
- { left: "\\(", right: "\\)", display: false },
1321
- { left: "\\begin{equation}", right: "\\end{equation}", display: true },
1322
- { left: "\\begin{align}", right: "\\end{align}", display: true },
1323
- { left: "\\begin{alignat}", right: "\\end{alignat}", display: true },
1324
- { left: "\\begin{gather}", right: "\\end{gather}", display: true },
1325
- { left: "\\begin{CD}", right: "\\end{CD}", display: true },
1326
- { left: "\\[", right: "\\]", display: true }
1327
- ]
1328
- };
1329
- this.DEFAULT_MERMAID_OPTIONS = {
1330
- startOnLoad: false
1331
- };
1332
- this.DEFAULT_CLIPBOARD_OPTIONS = {
1333
- buttonComponent: void 0
1334
- };
1335
- this.DEFAULT_PARSE_OPTIONS = {
1336
- decodeHtml: false,
1337
- inline: false,
1338
- emoji: false,
1339
- mermaid: false,
1340
- markedOptions: void 0,
1341
- disableSanitizer: false
1342
- };
1343
- this.DEFAULT_RENDER_OPTIONS = {
1344
- clipboard: false,
1345
- clipboardOptions: void 0,
1346
- katex: false,
1347
- katexOptions: void 0,
1348
- mermaid: false,
1349
- mermaidOptions: void 0
1350
- };
1351
- this._reload$ = new Subject();
1352
- this.reload$ = this._reload$.asObservable();
1353
- this.options = options;
1354
- }
1355
- parse(markdown, parseOptions = this.DEFAULT_PARSE_OPTIONS) {
1356
- const { decodeHtml, inline, emoji, mermaid: mermaid2, disableSanitizer } = parseOptions;
1357
- const markedOptions = __spreadValues(__spreadValues({}, this.options), parseOptions.markedOptions);
1358
- const renderer = markedOptions.renderer || this.renderer || new P();
1359
- if (this.extensions) {
1360
- this.renderer = this.extendsRendererForExtensions(renderer);
1361
- }
1362
- if (mermaid2) {
1363
- this.renderer = this.extendsRendererForMermaid(renderer);
1364
- }
1365
- const trimmed = this.trimIndentation(markdown);
1366
- const decoded = decodeHtml ? this.decodeHtml(trimmed) : trimmed;
1367
- const emojified = emoji ? this.parseEmoji(decoded) : decoded;
1368
- const marked = this.parseMarked(emojified, markedOptions, inline);
1369
- const sanitized = disableSanitizer ? marked : this.sanitizeHtml(marked);
1370
- return sanitized;
1371
- }
1372
- render(element, options = this.DEFAULT_RENDER_OPTIONS, viewContainerRef) {
1373
- const { clipboard, clipboardOptions, katex: katex2, katexOptions, mermaid: mermaid2, mermaidOptions } = options;
1374
- if (katex2) {
1375
- this.renderKatex(element, __spreadValues(__spreadValues({}, this.DEFAULT_KATEX_OPTIONS), katexOptions));
1376
- }
1377
- if (mermaid2) {
1378
- this.renderMermaid(element, __spreadValues(__spreadValues(__spreadValues({}, this.DEFAULT_MERMAID_OPTIONS), this.mermaidOptions), mermaidOptions));
1379
- }
1380
- if (clipboard) {
1381
- this.renderClipboard(element, viewContainerRef, __spreadValues(__spreadValues(__spreadValues({}, this.DEFAULT_CLIPBOARD_OPTIONS), this.clipboardOptions), clipboardOptions));
1382
- }
1383
- this.highlight(element);
1384
- }
1385
- reload() {
1386
- this._reload$.next();
1387
- }
1388
- getSource(src) {
1389
- if (!this.http) {
1390
- throw new Error(errorSrcWithoutHttpClient);
1391
- }
1392
- return this.http.get(src, { responseType: "text" }).pipe(map((markdown) => this.handleExtension(src, markdown)));
1393
- }
1394
- highlight(element) {
1395
- if (!isPlatformBrowser(this.platform)) {
1396
- return;
1397
- }
1398
- if (typeof Prism === "undefined" || typeof Prism.highlightAllUnder === "undefined") {
1399
- return;
1400
- }
1401
- if (!element) {
1402
- element = document;
1403
- }
1404
- const noLanguageElements = element.querySelectorAll('pre code:not([class*="language-"])');
1405
- Array.prototype.forEach.call(noLanguageElements, (x2) => x2.classList.add("language-none"));
1406
- Prism.highlightAllUnder(element);
1407
- }
1408
- decodeHtml(html) {
1409
- if (!isPlatformBrowser(this.platform)) {
1410
- return html;
1411
- }
1412
- const textarea = document.createElement("textarea");
1413
- textarea.innerHTML = html;
1414
- return textarea.value;
1415
- }
1416
- extendsRendererForExtensions(renderer) {
1417
- const extendedRenderer = renderer;
1418
- if (extendedRenderer.\u0275NgxMarkdownRendererExtendedForExtensions === true) {
1419
- return renderer;
1420
- }
1421
- if (this.extensions?.length > 0) {
1422
- k.use(...this.extensions);
1423
- }
1424
- extendedRenderer.\u0275NgxMarkdownRendererExtendedForExtensions = true;
1425
- return renderer;
1426
- }
1427
- extendsRendererForMermaid(renderer) {
1428
- const extendedRenderer = renderer;
1429
- if (extendedRenderer.\u0275NgxMarkdownRendererExtendedForMermaid === true) {
1430
- return renderer;
1431
- }
1432
- const defaultCode = renderer.code;
1433
- renderer.code = (token) => {
1434
- return token.lang === "mermaid" ? `<div class="mermaid">${token.text}</div>` : defaultCode(token);
1435
- };
1436
- extendedRenderer.\u0275NgxMarkdownRendererExtendedForMermaid = true;
1437
- return renderer;
1438
- }
1439
- handleExtension(src, markdown) {
1440
- const urlProtocolIndex = src.lastIndexOf("://");
1441
- const urlWithoutProtocol = urlProtocolIndex > -1 ? src.substring(urlProtocolIndex + 4) : src;
1442
- const lastSlashIndex = urlWithoutProtocol.lastIndexOf("/");
1443
- const lastUrlSegment = lastSlashIndex > -1 ? urlWithoutProtocol.substring(lastSlashIndex + 1).split("?")[0] : "";
1444
- const lastDotIndex = lastUrlSegment.lastIndexOf(".");
1445
- const extension = lastDotIndex > -1 ? lastUrlSegment.substring(lastDotIndex + 1) : "";
1446
- return !!extension && extension !== "md" ? "```" + extension + "\n" + markdown + "\n```" : markdown;
1447
- }
1448
- parseMarked(html, markedOptions, inline = false) {
1449
- if (markedOptions.renderer) {
1450
- const renderer = __spreadValues({}, markedOptions.renderer);
1451
- delete renderer.\u0275NgxMarkdownRendererExtendedForExtensions;
1452
- delete renderer.\u0275NgxMarkdownRendererExtendedForMermaid;
1453
- delete markedOptions.renderer;
1454
- k.use({ renderer });
1455
- }
1456
- return inline ? k.parseInline(html, markedOptions) : k.parse(html, markedOptions);
1457
- }
1458
- parseEmoji(html) {
1459
- if (!isPlatformBrowser(this.platform)) {
1460
- return html;
1461
- }
1462
- if (typeof joypixels === "undefined" || typeof joypixels.shortnameToUnicode === "undefined") {
1463
- throw new Error(errorJoyPixelsNotLoaded);
1464
- }
1465
- return joypixels.shortnameToUnicode(html);
1466
- }
1467
- renderKatex(element, options) {
1468
- if (!isPlatformBrowser(this.platform)) {
1469
- return;
1470
- }
1471
- if (typeof katex === "undefined" || typeof renderMathInElement === "undefined") {
1472
- throw new Error(errorKatexNotLoaded);
1473
- }
1474
- renderMathInElement(element, options);
1475
- }
1476
- renderClipboard(element, viewContainerRef, options) {
1477
- if (!isPlatformBrowser(this.platform)) {
1478
- return;
1479
- }
1480
- if (typeof ClipboardJS === "undefined") {
1481
- throw new Error(errorClipboardNotLoaded);
1482
- }
1483
- if (!viewContainerRef) {
1484
- throw new Error(errorClipboardViewContainerRequired);
1485
- }
1486
- const { buttonComponent, buttonTemplate } = options;
1487
- const preElements = element.querySelectorAll("pre");
1488
- for (let i = 0; i < preElements.length; i++) {
1489
- const preElement = preElements.item(i);
1490
- const preWrapperElement = document.createElement("div");
1491
- preWrapperElement.style.position = "relative";
1492
- preElement.parentNode.insertBefore(preWrapperElement, preElement);
1493
- preWrapperElement.appendChild(preElement);
1494
- const toolbarWrapperElement = document.createElement("div");
1495
- toolbarWrapperElement.classList.add("markdown-clipboard-toolbar");
1496
- toolbarWrapperElement.style.position = "absolute";
1497
- toolbarWrapperElement.style.top = ".5em";
1498
- toolbarWrapperElement.style.right = ".5em";
1499
- toolbarWrapperElement.style.zIndex = "1";
1500
- preWrapperElement.insertAdjacentElement("beforeend", toolbarWrapperElement);
1501
- preWrapperElement.onmouseenter = () => toolbarWrapperElement.classList.add("hover");
1502
- preWrapperElement.onmouseleave = () => toolbarWrapperElement.classList.remove("hover");
1503
- let embeddedViewRef;
1504
- if (buttonComponent) {
1505
- const componentRef = viewContainerRef.createComponent(buttonComponent);
1506
- embeddedViewRef = componentRef.hostView;
1507
- componentRef.changeDetectorRef.markForCheck();
1508
- } else if (buttonTemplate) {
1509
- embeddedViewRef = viewContainerRef.createEmbeddedView(buttonTemplate);
1510
- } else {
1511
- const componentRef = viewContainerRef.createComponent(ClipboardButtonComponent);
1512
- embeddedViewRef = componentRef.hostView;
1513
- componentRef.changeDetectorRef.markForCheck();
1514
- }
1515
- let clipboardInstance;
1516
- embeddedViewRef.rootNodes.forEach((node) => {
1517
- toolbarWrapperElement.appendChild(node);
1518
- clipboardInstance = new ClipboardJS(node, { text: () => preElement.innerText });
1519
- });
1520
- embeddedViewRef.onDestroy(() => clipboardInstance.destroy());
1521
- }
1522
- }
1523
- renderMermaid(element, options = this.DEFAULT_MERMAID_OPTIONS) {
1524
- if (!isPlatformBrowser(this.platform)) {
1525
- return;
1526
- }
1527
- if (typeof mermaid === "undefined" || typeof mermaid.initialize === "undefined") {
1528
- throw new Error(errorMermaidNotLoaded);
1529
- }
1530
- const mermaidElements = element.querySelectorAll(".mermaid");
1531
- if (mermaidElements.length === 0) {
1532
- return;
1533
- }
1534
- mermaid.initialize(options);
1535
- mermaid.run({ nodes: mermaidElements });
1536
- }
1537
- trimIndentation(markdown) {
1538
- if (!markdown) {
1539
- return "";
1540
- }
1541
- let indentStart;
1542
- return markdown.split("\n").map((line) => {
1543
- let lineIdentStart = indentStart;
1544
- if (line.length > 0) {
1545
- lineIdentStart = isNaN(lineIdentStart) ? line.search(/\S|$/) : Math.min(line.search(/\S|$/), lineIdentStart);
1546
- }
1547
- if (isNaN(indentStart)) {
1548
- indentStart = lineIdentStart;
1549
- }
1550
- return lineIdentStart ? line.substring(lineIdentStart) : line;
1551
- }).join("\n");
1552
- }
1553
- async sanitizeHtml(html) {
1554
- if (isSanitizeFunction(this.sanitize)) {
1555
- return this.sanitize(await html);
1556
- }
1557
- if (this.sanitize !== SecurityContext.NONE) {
1558
- return this.sanitizer.sanitize(this.sanitize, html) ?? "";
1559
- }
1560
- return html;
1561
- }
1562
- };
1563
- _MarkdownService.\u0275fac = \u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownService, deps: [{ token: CLIPBOARD_OPTIONS, optional: true }, { token: MARKED_EXTENSIONS, optional: true }, { token: MARKED_OPTIONS, optional: true }, { token: MERMAID_OPTIONS, optional: true }, { token: PLATFORM_ID }, { token: SANITIZE }, { token: HttpClient, optional: true }, { token: DomSanitizer }], target: FactoryTarget.Injectable });
1564
- _MarkdownService.\u0275prov = \u0275\u0275ngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownService });
1565
- var MarkdownService = _MarkdownService;
1566
- \u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: MarkdownService, decorators: [{
1567
- type: Injectable
1568
- }], ctorParameters: () => [{ type: void 0, decorators: [{
1569
- type: Inject,
1570
- args: [CLIPBOARD_OPTIONS]
1571
- }, {
1572
- type: Optional
1573
- }] }, { type: void 0, decorators: [{
1574
- type: Inject,
1575
- args: [MARKED_EXTENSIONS]
1576
- }, {
1577
- type: Optional
1578
- }] }, { type: void 0, decorators: [{
1579
- type: Inject,
1580
- args: [MARKED_OPTIONS]
1581
- }, {
1582
- type: Optional
1583
- }] }, { type: void 0, decorators: [{
1584
- type: Inject,
1585
- args: [MERMAID_OPTIONS]
1586
- }, {
1587
- type: Optional
1588
- }] }, { type: Object, decorators: [{
1589
- type: Inject,
1590
- args: [PLATFORM_ID]
1591
- }] }, { type: void 0, decorators: [{
1592
- type: Inject,
1593
- args: [SANITIZE]
1594
- }] }, { type: HttpClient, decorators: [{
1595
- type: Optional
1596
- }] }, { type: DomSanitizer }] });
1597
- var _MarkdownComponent = class _MarkdownComponent {
1598
- get disableSanitizer() {
1599
- return this._disableSanitizer;
1600
- }
1601
- set disableSanitizer(value) {
1602
- this._disableSanitizer = this.coerceBooleanProperty(value);
1603
- }
1604
- get inline() {
1605
- return this._inline;
1606
- }
1607
- set inline(value) {
1608
- this._inline = this.coerceBooleanProperty(value);
1609
- }
1610
- // Plugin - clipboard
1611
- get clipboard() {
1612
- return this._clipboard;
1613
- }
1614
- set clipboard(value) {
1615
- this._clipboard = this.coerceBooleanProperty(value);
1616
- }
1617
- // Plugin - emoji
1618
- get emoji() {
1619
- return this._emoji;
1620
- }
1621
- set emoji(value) {
1622
- this._emoji = this.coerceBooleanProperty(value);
1623
- }
1624
- // Plugin - katex
1625
- get katex() {
1626
- return this._katex;
1627
- }
1628
- set katex(value) {
1629
- this._katex = this.coerceBooleanProperty(value);
1630
- }
1631
- // Plugin - mermaid
1632
- get mermaid() {
1633
- return this._mermaid;
1634
- }
1635
- set mermaid(value) {
1636
- this._mermaid = this.coerceBooleanProperty(value);
1637
- }
1638
- // Plugin - lineHighlight
1639
- get lineHighlight() {
1640
- return this._lineHighlight;
1641
- }
1642
- set lineHighlight(value) {
1643
- this._lineHighlight = this.coerceBooleanProperty(value);
1644
- }
1645
- // Plugin - lineNumbers
1646
- get lineNumbers() {
1647
- return this._lineNumbers;
1648
- }
1649
- set lineNumbers(value) {
1650
- this._lineNumbers = this.coerceBooleanProperty(value);
1651
- }
1652
- // Plugin - commandLine
1653
- get commandLine() {
1654
- return this._commandLine;
1655
- }
1656
- set commandLine(value) {
1657
- this._commandLine = this.coerceBooleanProperty(value);
1658
- }
1659
- constructor(element, markdownService, viewContainerRef) {
1660
- this.element = element;
1661
- this.markdownService = markdownService;
1662
- this.viewContainerRef = viewContainerRef;
1663
- this.error = new EventEmitter();
1664
- this.load = new EventEmitter();
1665
- this.ready = new EventEmitter();
1666
- this._clipboard = false;
1667
- this._commandLine = false;
1668
- this._disableSanitizer = false;
1669
- this._emoji = false;
1670
- this._inline = false;
1671
- this._katex = false;
1672
- this._lineHighlight = false;
1673
- this._lineNumbers = false;
1674
- this._mermaid = false;
1675
- this.destroyed$ = new Subject();
1676
- }
1677
- ngOnChanges() {
1678
- this.loadContent();
1679
- }
1680
- loadContent() {
1681
- if (this.data != null) {
1682
- this.handleData();
1683
- return;
1684
- }
1685
- if (this.src != null) {
1686
- this.handleSrc();
1687
- return;
1688
- }
1689
- }
1690
- ngAfterViewInit() {
1691
- if (!this.data && !this.src) {
1692
- this.handleTransclusion();
1693
- }
1694
- this.markdownService.reload$.pipe(takeUntil(this.destroyed$)).subscribe(() => this.loadContent());
1695
- }
1696
- ngOnDestroy() {
1697
- this.destroyed$.next();
1698
- this.destroyed$.complete();
1699
- }
1700
- async render(markdown, decodeHtml = false) {
1701
- const parsedOptions = {
1702
- decodeHtml,
1703
- inline: this.inline,
1704
- emoji: this.emoji,
1705
- mermaid: this.mermaid,
1706
- disableSanitizer: this.disableSanitizer
1707
- };
1708
- const renderOptions = {
1709
- clipboard: this.clipboard,
1710
- clipboardOptions: this.getClipboardOptions(),
1711
- katex: this.katex,
1712
- katexOptions: this.katexOptions,
1713
- mermaid: this.mermaid,
1714
- mermaidOptions: this.mermaidOptions
1715
- };
1716
- const parsed = await this.markdownService.parse(markdown, parsedOptions);
1717
- this.element.nativeElement.innerHTML = parsed;
1718
- this.handlePlugins();
1719
- this.markdownService.render(this.element.nativeElement, renderOptions, this.viewContainerRef);
1720
- this.ready.emit();
1721
- }
1722
- coerceBooleanProperty(value) {
1723
- return value != null && `${String(value)}` !== "false";
1724
- }
1725
- getClipboardOptions() {
1726
- if (this.clipboardButtonComponent || this.clipboardButtonTemplate) {
1727
- return {
1728
- buttonComponent: this.clipboardButtonComponent,
1729
- buttonTemplate: this.clipboardButtonTemplate
1730
- };
1731
- }
1732
- return void 0;
1733
- }
1734
- handleData() {
1735
- this.render(this.data);
1736
- }
1737
- handleSrc() {
1738
- this.markdownService.getSource(this.src).subscribe({
1739
- next: (markdown) => {
1740
- this.render(markdown).then(() => {
1741
- this.load.emit(markdown);
1742
- });
1743
- },
1744
- error: (error) => this.error.emit(error)
1745
- });
1746
- }
1747
- handleTransclusion() {
1748
- this.render(this.element.nativeElement.innerHTML, true);
1749
- }
1750
- handlePlugins() {
1751
- if (this.commandLine) {
1752
- this.setPluginClass(this.element.nativeElement, PrismPlugin.CommandLine);
1753
- this.setPluginOptions(this.element.nativeElement, {
1754
- dataFilterOutput: this.filterOutput,
1755
- dataHost: this.host,
1756
- dataPrompt: this.prompt,
1757
- dataOutput: this.output,
1758
- dataUser: this.user
1759
- });
1760
- }
1761
- if (this.lineHighlight) {
1762
- this.setPluginOptions(this.element.nativeElement, { dataLine: this.line, dataLineOffset: this.lineOffset });
1763
- }
1764
- if (this.lineNumbers) {
1765
- this.setPluginClass(this.element.nativeElement, PrismPlugin.LineNumbers);
1766
- this.setPluginOptions(this.element.nativeElement, { dataStart: this.start });
1767
- }
1768
- }
1769
- setPluginClass(element, plugin) {
1770
- const preElements = element.querySelectorAll("pre");
1771
- for (let i = 0; i < preElements.length; i++) {
1772
- const classes = plugin instanceof Array ? plugin : [plugin];
1773
- preElements.item(i).classList.add(...classes);
1774
- }
1775
- }
1776
- setPluginOptions(element, options) {
1777
- const preElements = element.querySelectorAll("pre");
1778
- for (let i = 0; i < preElements.length; i++) {
1779
- Object.keys(options).forEach((option) => {
1780
- const attributeValue = options[option];
1781
- if (attributeValue) {
1782
- const attributeName = this.toLispCase(option);
1783
- preElements.item(i).setAttribute(attributeName, attributeValue.toString());
1784
- }
1785
- });
1786
- }
1787
- }
1788
- toLispCase(value) {
1789
- const upperChars = value.match(/([A-Z])/g);
1790
- if (!upperChars) {
1791
- return value;
1792
- }
1793
- let str = value.toString();
1794
- for (let i = 0, n = upperChars.length; i < n; i++) {
1795
- str = str.replace(new RegExp(upperChars[i]), "-" + upperChars[i].toLowerCase());
1796
- }
1797
- if (str.slice(0, 1) === "-") {
1798
- str = str.slice(1);
1799
- }
1800
- return str;
1801
- }
1802
- };
1803
- _MarkdownComponent.\u0275fac = \u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownComponent, deps: [{ token: ElementRef }, { token: MarkdownService }, { token: ViewContainerRef }], target: FactoryTarget.Component });
1804
- _MarkdownComponent.\u0275cmp = \u0275\u0275ngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: _MarkdownComponent, isStandalone: true, selector: "markdown, [markdown]", inputs: { data: "data", src: "src", disableSanitizer: "disableSanitizer", inline: "inline", clipboard: "clipboard", clipboardButtonComponent: "clipboardButtonComponent", clipboardButtonTemplate: "clipboardButtonTemplate", emoji: "emoji", katex: "katex", katexOptions: "katexOptions", mermaid: "mermaid", mermaidOptions: "mermaidOptions", lineHighlight: "lineHighlight", line: "line", lineOffset: "lineOffset", lineNumbers: "lineNumbers", start: "start", commandLine: "commandLine", filterOutput: "filterOutput", host: "host", prompt: "prompt", output: "output", user: "user" }, outputs: { error: "error", load: "load", ready: "ready" }, usesOnChanges: true, ngImport: core_exports, template: "<ng-content></ng-content>", isInline: true });
1805
- var MarkdownComponent = _MarkdownComponent;
1806
- \u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: MarkdownComponent, decorators: [{
1807
- type: Component,
1808
- args: [{
1809
- // eslint-disable-next-line @angular-eslint/component-selector
1810
- selector: "markdown, [markdown]",
1811
- template: "<ng-content></ng-content>"
1812
- }]
1813
- }], ctorParameters: () => [{ type: ElementRef }, { type: MarkdownService }, { type: ViewContainerRef }], propDecorators: { data: [{
1814
- type: Input
1815
- }], src: [{
1816
- type: Input
1817
- }], disableSanitizer: [{
1818
- type: Input
1819
- }], inline: [{
1820
- type: Input
1821
- }], clipboard: [{
1822
- type: Input
1823
- }], clipboardButtonComponent: [{
1824
- type: Input
1825
- }], clipboardButtonTemplate: [{
1826
- type: Input
1827
- }], emoji: [{
1828
- type: Input
1829
- }], katex: [{
1830
- type: Input
1831
- }], katexOptions: [{
1832
- type: Input
1833
- }], mermaid: [{
1834
- type: Input
1835
- }], mermaidOptions: [{
1836
- type: Input
1837
- }], lineHighlight: [{
1838
- type: Input
1839
- }], line: [{
1840
- type: Input
1841
- }], lineOffset: [{
1842
- type: Input
1843
- }], lineNumbers: [{
1844
- type: Input
1845
- }], start: [{
1846
- type: Input
1847
- }], commandLine: [{
1848
- type: Input
1849
- }], filterOutput: [{
1850
- type: Input
1851
- }], host: [{
1852
- type: Input
1853
- }], prompt: [{
1854
- type: Input
1855
- }], output: [{
1856
- type: Input
1857
- }], user: [{
1858
- type: Input
1859
- }], error: [{
1860
- type: Output
1861
- }], load: [{
1862
- type: Output
1863
- }], ready: [{
1864
- type: Output
1865
- }] } });
1866
- var _MarkdownPipe = class _MarkdownPipe {
1867
- constructor(domSanitizer, elementRef, markdownService, viewContainerRef, zone) {
1868
- this.domSanitizer = domSanitizer;
1869
- this.elementRef = elementRef;
1870
- this.markdownService = markdownService;
1871
- this.viewContainerRef = viewContainerRef;
1872
- this.zone = zone;
1873
- }
1874
- async transform(value, options) {
1875
- if (value == null) {
1876
- return "";
1877
- }
1878
- if (typeof value !== "string") {
1879
- console.error(`MarkdownPipe has been invoked with an invalid value type [${typeof value}]`);
1880
- return value;
1881
- }
1882
- const markdown = await this.markdownService.parse(value, options);
1883
- this.zone.onStable.pipe(first()).subscribe(() => this.markdownService.render(this.elementRef.nativeElement, options, this.viewContainerRef));
1884
- return this.domSanitizer.bypassSecurityTrustHtml(markdown);
1885
- }
1886
- };
1887
- _MarkdownPipe.\u0275fac = \u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownPipe, deps: [{ token: DomSanitizer }, { token: ElementRef }, { token: MarkdownService }, { token: ViewContainerRef }, { token: NgZone }], target: FactoryTarget.Pipe });
1888
- _MarkdownPipe.\u0275pipe = \u0275\u0275ngDeclarePipe({ minVersion: "14.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownPipe, isStandalone: true, name: "markdown" });
1889
- var MarkdownPipe = _MarkdownPipe;
1890
- \u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: MarkdownPipe, decorators: [{
1891
- type: Pipe,
1892
- args: [{
1893
- name: "markdown"
1894
- }]
1895
- }], ctorParameters: () => [{ type: DomSanitizer }, { type: ElementRef }, { type: MarkdownService }, { type: ViewContainerRef }, { type: NgZone }] });
1896
- function provideMarkdown(markdownModuleConfig) {
1897
- return [
1898
- MarkdownService,
1899
- markdownModuleConfig?.loader ?? [],
1900
- markdownModuleConfig?.clipboardOptions ?? [],
1901
- markdownModuleConfig?.markedOptions ?? [],
1902
- markdownModuleConfig?.mermaidOptions ?? [],
1903
- markdownModuleConfig?.markedExtensions ?? [],
1904
- getSanitizeProvider(markdownModuleConfig?.sanitize) ?? []
1905
- ];
1906
- }
1907
- function isTypedProvider(provider) {
1908
- return provider != null && provider.provide != null;
1909
- }
1910
- function getSanitizeProvider(sanitize) {
1911
- return isTypedProvider(sanitize) ? sanitize : { provide: SANITIZE, useValue: sanitize ?? SecurityContext.HTML };
1912
- }
1913
- var sharedDeclarations = [
1914
- ClipboardButtonComponent,
1915
- LanguagePipe,
1916
- MarkdownComponent,
1917
- MarkdownPipe
1918
- ];
1919
- var _MarkdownModule = class _MarkdownModule {
1920
- static forRoot(markdownModuleConfig) {
1921
- return {
1922
- ngModule: _MarkdownModule,
1923
- providers: [
1924
- provideMarkdown(markdownModuleConfig)
1925
- ]
1926
- };
1927
- }
1928
- static forChild() {
1929
- return {
1930
- ngModule: _MarkdownModule
1931
- };
1932
- }
1933
- };
1934
- _MarkdownModule.\u0275fac = \u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownModule, deps: [], target: FactoryTarget.NgModule });
1935
- _MarkdownModule.\u0275mod = \u0275\u0275ngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownModule, imports: [
1936
- ClipboardButtonComponent,
1937
- LanguagePipe,
1938
- MarkdownComponent,
1939
- MarkdownPipe
1940
- ], exports: [
1941
- ClipboardButtonComponent,
1942
- LanguagePipe,
1943
- MarkdownComponent,
1944
- MarkdownPipe
1945
- ] });
1946
- _MarkdownModule.\u0275inj = \u0275\u0275ngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: _MarkdownModule });
1947
- var MarkdownModule = _MarkdownModule;
1948
- \u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: core_exports, type: MarkdownModule, decorators: [{
1949
- type: NgModule,
1950
- args: [{
1951
- imports: sharedDeclarations,
1952
- exports: sharedDeclarations
1953
- }]
1954
- }] });
1955
-
1956
- export {
1957
- provideMarkdown,
1958
- MarkdownModule
1959
- };
1960
- //# sourceMappingURL=chunk-AQHSGTHS.js.map