@dotss/tictoccroc 0.4.2 → 0.5.0

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 (204) hide show
  1. package/dist/Calendar-BOLCHnjh.js +97 -0
  2. package/dist/TimePicker-BwACyeBR.js +120 -0
  3. package/dist/convertMdToHtml-Bmk0brLK.js +1431 -0
  4. package/dist/index.mjs +105 -200
  5. package/dist/parent/b2b/components/ActionButtons/ActionButtons.mjs +26 -29
  6. package/dist/parent/b2b/components/ActionButtons/index.mjs +5 -4
  7. package/dist/parent/b2b/components/BottomNotes/BottomNotes.mjs +37 -35
  8. package/dist/parent/b2b/components/BottomNotes/index.mjs +5 -4
  9. package/dist/parent/b2b/components/EmployeeNumberField/EmployeeNumberField.mjs +12 -15
  10. package/dist/parent/b2b/components/EmployeeNumberField/index.mjs +5 -4
  11. package/dist/parent/b2b/components/NameField/NameField.mjs +12 -7
  12. package/dist/parent/b2b/components/NameField/index.mjs +5 -4
  13. package/dist/parent/b2b/components/PhoneNumberField/PhoneNumberField.mjs +27 -30
  14. package/dist/parent/b2b/components/PhoneNumberField/PhoneNumberField.utils.mjs +7 -8
  15. package/dist/parent/b2b/components/PhoneNumberField/index.mjs +6 -7
  16. package/dist/parent/b2b/components/Title/Title.mjs +22 -16
  17. package/dist/parent/b2b/components/Title/index.mjs +4 -3
  18. package/dist/parent/b2b/components/TopLogo/TopLogo.mjs +55 -93
  19. package/dist/parent/b2b/components/TopLogo/index.mjs +5 -4
  20. package/dist/parent/b2b/components/index.mjs +9 -19
  21. package/dist/parent/b2b/utils/convertMdToHtml/convertMdToHtml.mjs +2 -1143
  22. package/dist/parent/b2b/utils/index.mjs +2 -4
  23. package/dist/parent/notification/components/NotificationCard/NotificationCard.mjs +90 -108
  24. package/dist/parent/notification/components/NotificationCard/index.mjs +5 -4
  25. package/dist/parent/notification/components/index.mjs +2 -4
  26. package/dist/parent/notification/utils/index.mjs +2 -4
  27. package/dist/parent/notification/utils/sanitize/sanitize.mjs +6 -6
  28. package/dist/purify.es-D3W4zDrg.js +549 -0
  29. package/dist/shared/components/Calendar/Calendar.mjs +2 -80
  30. package/dist/shared/components/Calendar/index.mjs +5 -4
  31. package/dist/shared/components/Carousel/Carousel.mjs +184 -210
  32. package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.mjs +10 -7
  33. package/dist/shared/components/Carousel/CarouselSlide/index.mjs +5 -4
  34. package/dist/shared/components/Carousel/index.mjs +6 -6
  35. package/dist/shared/components/ChatKit/BotMessage/BotMessage.mjs +151 -183
  36. package/dist/shared/components/ChatKit/BotMessage/BotMessage.utils.mjs +30 -50
  37. package/dist/shared/components/ChatKit/BotMessage/index.mjs +6 -8
  38. package/dist/shared/components/ChatKit/InputBar/InputBar.fallback.mjs +64 -84
  39. package/dist/shared/components/ChatKit/InputBar/InputBar.mjs +105 -130
  40. package/dist/shared/components/ChatKit/InputBar/index.mjs +6 -6
  41. package/dist/shared/components/ChatKit/Message/Message.fallback.mjs +50 -66
  42. package/dist/shared/components/ChatKit/Message/Message.mjs +178 -276
  43. package/dist/shared/components/ChatKit/Message/Message.utils.mjs +20 -31
  44. package/dist/shared/components/ChatKit/Message/index.mjs +7 -9
  45. package/dist/shared/components/ChatKit/Seperator/Seperator.mjs +31 -27
  46. package/dist/shared/components/ChatKit/Seperator/index.mjs +4 -3
  47. package/dist/shared/components/ChatKit/SystemMessage/(Actions)/DirectTrageRiskInfoBottomSheet/DirectTrageRiskInfoBottomSheet.mjs +183 -153
  48. package/dist/shared/components/ChatKit/SystemMessage/SystemMessage.mjs +83 -108
  49. package/dist/shared/components/ChatKit/SystemMessage/SystemMessage.utils.mjs +5 -5
  50. package/dist/shared/components/ChatKit/SystemMessage/index.mjs +7 -8
  51. package/dist/shared/components/ChatKit/UnreadMessagePill/UnreadMessagePill.mjs +49 -54
  52. package/dist/shared/components/ChatKit/UnreadMessagePill/index.mjs +5 -4
  53. package/dist/shared/components/ChatKit/index.mjs +13 -29
  54. package/dist/shared/components/Image/Image.d.ts +2 -0
  55. package/dist/shared/components/Image/Image.error.mjs +34 -40
  56. package/dist/shared/components/Image/Image.mjs +247 -289
  57. package/dist/shared/components/Image/index.mjs +6 -6
  58. package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.mjs +19 -18
  59. package/dist/shared/components/LoadingAnnouncer/index.mjs +5 -4
  60. package/dist/shared/components/Masonry/Masonry.mjs +240 -276
  61. package/dist/shared/components/Masonry/Masonry.utils.mjs +62 -81
  62. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +111 -144
  63. package/dist/shared/components/Masonry/MasonryBlock/index.mjs +5 -4
  64. package/dist/shared/components/Masonry/index.mjs +6 -6
  65. package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.mjs +54 -69
  66. package/dist/shared/components/MediaDialog/MediaBlock/index.mjs +5 -4
  67. package/dist/shared/components/MediaDialog/MediaDialog.mjs +216 -330
  68. package/dist/shared/components/MediaDialog/MediaDialogContent/MediaDialogContent.mjs +18 -21
  69. package/dist/shared/components/MediaDialog/MediaDialogContent/index.mjs +5 -4
  70. package/dist/shared/components/MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs +22 -27
  71. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.mjs +5 -4
  72. package/dist/shared/components/MediaDialog/MediaDialogToolbar/MediaDialogToolbar.mjs +15 -21
  73. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.mjs +5 -4
  74. package/dist/shared/components/MediaDialog/index.mjs +9 -12
  75. package/dist/shared/components/Roller/Roller.mjs +99 -132
  76. package/dist/shared/components/Roller/RollerBlock/RollerBlock.mjs +9 -6
  77. package/dist/shared/components/Roller/RollerBlock/index.mjs +5 -4
  78. package/dist/shared/components/Roller/index.mjs +6 -6
  79. package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs +22 -30
  80. package/dist/shared/components/Scheduler/ScheduleBlock/index.mjs +5 -4
  81. package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +25 -35
  82. package/dist/shared/components/Scheduler/ScheduleEvent/index.mjs +5 -4
  83. package/dist/shared/components/Scheduler/Scheduler.mjs +472 -567
  84. package/dist/shared/components/Scheduler/Scheduler.utils.mjs +78 -101
  85. package/dist/shared/components/Scheduler/index.mjs +8 -10
  86. package/dist/shared/components/Swiper/Swiper.mjs +238 -283
  87. package/dist/shared/components/Swiper/Swiper.utils.mjs +19 -24
  88. package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.mjs +14 -17
  89. package/dist/shared/components/Swiper/SwiperBlock/index.mjs +5 -4
  90. package/dist/shared/components/Swiper/index.mjs +6 -6
  91. package/dist/shared/components/TextField/TextField.mjs +44 -55
  92. package/dist/shared/components/TextField/index.mjs +5 -4
  93. package/dist/shared/components/TimePicker/TimePicker.mjs +2 -120
  94. package/dist/shared/components/TimePicker/index.mjs +5 -4
  95. package/dist/shared/components/index.mjs +36 -75
  96. package/dist/shared/hooks/index.mjs +4 -8
  97. package/dist/shared/hooks/useCombineRef/index.mjs +5 -4
  98. package/dist/shared/hooks/useCombineRef/useCombineRef.mjs +7 -7
  99. package/dist/shared/hooks/useInView/index.mjs +5 -4
  100. package/dist/shared/hooks/useInView/useInView.d.ts +2 -1
  101. package/dist/shared/hooks/useInView/useInView.mjs +37 -47
  102. package/dist/shared/hooks/useIsomorphicLayoutEffect/index.mjs +5 -4
  103. package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +6 -6
  104. package/dist/shared/typings/common.mjs +6 -4
  105. package/dist/shared/typings/index.mjs +2 -4
  106. package/dist/shared/utils/ageToBirthDate/ageToBirthDate.mjs +17 -9
  107. package/dist/shared/utils/ageToBirthDate/index.mjs +5 -4
  108. package/dist/shared/utils/birthDateToAge/birthDateToAge.mjs +9 -10
  109. package/dist/shared/utils/birthDateToAge/index.mjs +4 -3
  110. package/dist/shared/utils/combineRef/combineRef.mjs +20 -23
  111. package/dist/shared/utils/combineRef/index.mjs +5 -4
  112. package/dist/shared/utils/dayFlagToDay/dayFlagToDay.mjs +15 -23
  113. package/dist/shared/utils/dayFlagToDay/index.mjs +5 -4
  114. package/dist/shared/utils/getCareTypeLabel/getCareTypeLabel.mjs +13 -20
  115. package/dist/shared/utils/getCareTypeLabel/index.mjs +5 -4
  116. package/dist/shared/utils/getDateRange/getDateRange.mjs +15 -20
  117. package/dist/shared/utils/getDateRange/index.mjs +5 -4
  118. package/dist/shared/utils/getImageUrl/getImageUrl.mjs +7 -17
  119. package/dist/shared/utils/getImageUrl/index.mjs +5 -6
  120. package/dist/shared/utils/getTimeRange/getTimeRange.mjs +19 -21
  121. package/dist/shared/utils/getTimeRange/index.mjs +5 -4
  122. package/dist/shared/utils/getVimeoId/getVimeoId.mjs +11 -11
  123. package/dist/shared/utils/getVimeoId/index.mjs +5 -4
  124. package/dist/shared/utils/index.mjs +18 -36
  125. package/dist/shared/utils/isAndroid/index.mjs +5 -4
  126. package/dist/shared/utils/isAndroid/isAndroid.mjs +5 -5
  127. package/dist/shared/utils/isApp/index.mjs +5 -4
  128. package/dist/shared/utils/isApp/isApp.mjs +4 -4
  129. package/dist/shared/utils/isDesktop/index.mjs +5 -4
  130. package/dist/shared/utils/isDesktop/isDesktop.mjs +15 -15
  131. package/dist/shared/utils/isIos/index.mjs +5 -4
  132. package/dist/shared/utils/isIos/isIos.mjs +5 -5
  133. package/dist/shared/utils/isServer/index.mjs +4 -3
  134. package/dist/shared/utils/isServer/isServer.mjs +4 -4
  135. package/dist/shared/utils/objectToQueryString/index.mjs +5 -4
  136. package/dist/shared/utils/objectToQueryString/objectToQueryString.mjs +7 -8
  137. package/dist/shared/utils/parseQueryString/index.mjs +4 -3
  138. package/dist/shared/utils/parseQueryString/parseQueryString.mjs +5 -5
  139. package/dist/shared/utils/share/index.mjs +5 -4
  140. package/dist/shared/utils/share/share.mjs +12 -14
  141. package/dist/teacher/home/components/BannerAccount/BannerAccount.fallback.mjs +19 -11
  142. package/dist/teacher/home/components/BannerAccount/BannerAccount.mjs +83 -99
  143. package/dist/teacher/home/components/BannerAccount/index.mjs +6 -7
  144. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.fallback.mjs +127 -67
  145. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.mjs +68 -82
  146. package/dist/teacher/home/components/Carousel1Account/index.mjs +6 -7
  147. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.fallback.mjs +112 -94
  148. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.mjs +79 -85
  149. package/dist/teacher/home/components/Carousel2Account/index.mjs +6 -7
  150. package/dist/teacher/home/components/TextAccount/TextAccount.fallback.mjs +119 -108
  151. package/dist/teacher/home/components/TextAccount/TextAccount.mjs +91 -111
  152. package/dist/teacher/home/components/TextAccount/index.mjs +6 -7
  153. package/dist/teacher/home/components/index.mjs +9 -18
  154. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs +345 -442
  155. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.mjs +5 -5
  156. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.mjs +106 -109
  157. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs +54 -58
  158. package/dist/teacher/profile/components/AbilityCollection/index.mjs +7 -8
  159. package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +73 -104
  160. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +81 -95
  161. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.mjs +4 -3
  162. package/dist/teacher/profile/components/ActivityGallery/index.mjs +6 -6
  163. package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +148 -194
  164. package/dist/teacher/profile/components/AvailableScheduleSection/index.mjs +5 -4
  165. package/dist/teacher/profile/components/CareNoteSection/CareNote/CareNote.mjs +61 -53
  166. package/dist/teacher/profile/components/CareNoteSection/CareNote/index.mjs +5 -4
  167. package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.mjs +72 -81
  168. package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.utils.mjs +17 -12
  169. package/dist/teacher/profile/components/CareNoteSection/index.mjs +6 -6
  170. package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs +108 -134
  171. package/dist/teacher/profile/components/CareerSection/CareerItem/index.mjs +5 -4
  172. package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +133 -176
  173. package/dist/teacher/profile/components/CareerSection/index.mjs +6 -6
  174. package/dist/teacher/profile/components/CertificateSection/CertificateItem/CertificateItem.mjs +82 -88
  175. package/dist/teacher/profile/components/CertificateSection/CertificateItem/index.mjs +4 -3
  176. package/dist/teacher/profile/components/CertificateSection/CertificateSection.mjs +112 -141
  177. package/dist/teacher/profile/components/CertificateSection/index.mjs +6 -6
  178. package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +96 -111
  179. package/dist/teacher/profile/components/EducationSection/EducationItem/index.mjs +5 -4
  180. package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +112 -141
  181. package/dist/teacher/profile/components/EducationSection/index.mjs +6 -6
  182. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs +107 -102
  183. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.mjs +5 -4
  184. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +85 -81
  185. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.mjs +17 -12
  186. package/dist/teacher/profile/components/ParentReviewSection/index.mjs +7 -8
  187. package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs +43 -36
  188. package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.mjs +4 -3
  189. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.mjs +44 -31
  190. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +11 -12
  191. package/dist/teacher/profile/components/PreferredAgeGroup/index.mjs +5 -5
  192. package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +348 -433
  193. package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.utils.mjs +7 -7
  194. package/dist/teacher/profile/components/ProfileSummary/index.mjs +5 -4
  195. package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs +80 -105
  196. package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.mjs +5 -4
  197. package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.mjs +34 -27
  198. package/dist/teacher/profile/components/StatBadgeCollection/index.mjs +6 -6
  199. package/dist/teacher/profile/components/index.mjs +24 -48
  200. package/dist/teacher/profile/utils/index.mjs +2 -4
  201. package/dist/teacher/profile/utils/sortItems/index.mjs +5 -4
  202. package/dist/teacher/profile/utils/sortItems/sortItems.mjs +48 -48
  203. package/package.json +1 -1
  204. package/dist/purify.es-BGaRrCfO.js +0 -553
@@ -0,0 +1,1431 @@
1
+ import { t as e } from "./purify.es-D3W4zDrg.js";
2
+ //#region ../../node_modules/.pnpm/marked@17.0.3/node_modules/marked/lib/marked.esm.js
3
+ function t() {
4
+ return {
5
+ async: !1,
6
+ breaks: !1,
7
+ extensions: null,
8
+ gfm: !0,
9
+ hooks: null,
10
+ pedantic: !1,
11
+ renderer: null,
12
+ silent: !1,
13
+ tokenizer: null,
14
+ walkTokens: null
15
+ };
16
+ }
17
+ var n = t();
18
+ function r(e) {
19
+ n = e;
20
+ }
21
+ var i = { exec: () => null };
22
+ function a(e, t = "") {
23
+ let n = typeof e == "string" ? e : e.source, r = {
24
+ replace: (e, t) => {
25
+ let i = typeof t == "string" ? t : t.source;
26
+ return i = i.replace(s.caret, "$1"), n = n.replace(e, i), r;
27
+ },
28
+ getRegex: () => new RegExp(n, t)
29
+ };
30
+ return r;
31
+ }
32
+ var o = (() => {
33
+ try {
34
+ return !0;
35
+ } catch {
36
+ return !1;
37
+ }
38
+ })(), s = {
39
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
40
+ outputLinkReplace: /\\([\[\]])/g,
41
+ indentCodeCompensation: /^(\s+)(?:```)/,
42
+ beginningSpace: /^\s+/,
43
+ endingHash: /#$/,
44
+ startingSpaceChar: /^ /,
45
+ endingSpaceChar: / $/,
46
+ nonSpaceChar: /[^ ]/,
47
+ newLineCharGlobal: /\n/g,
48
+ tabCharGlobal: /\t/g,
49
+ multipleSpaceGlobal: /\s+/g,
50
+ blankLine: /^[ \t]*$/,
51
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
52
+ blockquoteStart: /^ {0,3}>/,
53
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
54
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
55
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
56
+ listIsTask: /^\[[ xX]\] +\S/,
57
+ listReplaceTask: /^\[[ xX]\] +/,
58
+ listTaskCheckbox: /\[[ xX]\]/,
59
+ anyLine: /\n.*\n/,
60
+ hrefBrackets: /^<(.*)>$/,
61
+ tableDelimiter: /[:|]/,
62
+ tableAlignChars: /^\||\| *$/g,
63
+ tableRowBlankLine: /\n[ \t]*$/,
64
+ tableAlignRight: /^ *-+: *$/,
65
+ tableAlignCenter: /^ *:-+: *$/,
66
+ tableAlignLeft: /^ *:-+ *$/,
67
+ startATag: /^<a /i,
68
+ endATag: /^<\/a>/i,
69
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
70
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
71
+ startAngleBracket: /^</,
72
+ endAngleBracket: />$/,
73
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
74
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
75
+ escapeTest: /[&<>"']/,
76
+ escapeReplace: /[&<>"']/g,
77
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
78
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
79
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
80
+ caret: /(^|[^\[])\^/g,
81
+ percentDecode: /%25/g,
82
+ findPipe: /\|/g,
83
+ splitPipe: / \|/,
84
+ slashPipe: /\\\|/g,
85
+ carriageReturn: /\r\n|\r/g,
86
+ spaceLine: /^ +$/gm,
87
+ notSpaceStart: /^\S*/,
88
+ endingNewline: /\n$/,
89
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
90
+ nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
91
+ hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
92
+ fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
93
+ headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
94
+ htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i"),
95
+ blockquoteBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}>`)
96
+ }, c = /^(?:[ \t]*(?:\n|$))+/, l = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, u = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, d = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, f = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, p = / {0,3}(?:[*+-]|\d{1,9}[.)])/, m = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, h = a(m).replace(/bull/g, p).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(), ee = a(m).replace(/bull/g, p).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(), g = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, te = /^[^\n]+/, _ = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ne = a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), re = a(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, p).getRegex(), 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", y = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ie = a("^ {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", y).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), b = a(g).replace("hr", d).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), x = {
97
+ blockquote: a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", b).getRegex(),
98
+ code: l,
99
+ def: ne,
100
+ fences: u,
101
+ heading: f,
102
+ hr: d,
103
+ html: ie,
104
+ lheading: h,
105
+ list: re,
106
+ newline: c,
107
+ paragraph: b,
108
+ table: i,
109
+ text: te
110
+ }, S = a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", d).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), ae = {
111
+ ...x,
112
+ lheading: ee,
113
+ table: S,
114
+ paragraph: a(g).replace("hr", d).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", S).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex()
115
+ }, oe = {
116
+ ...x,
117
+ html: a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", y).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(),
118
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
119
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
120
+ fences: i,
121
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
122
+ paragraph: a(g).replace("hr", d).replace("heading", " *#{1,6} *[^\n]").replace("lheading", h).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
123
+ }, se = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, C = /^( {2,}|\\)\n(?!\s*$)/, le = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, w = /[\p{P}\p{S}]/u, T = /[\s\p{P}\p{S}]/u, E = /[^\s\p{P}\p{S}]/u, ue = a(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, T).getRegex(), D = /(?!~)[\p{P}\p{S}]/u, de = /(?!~)[\s\p{P}\p{S}]/u, fe = /(?:[^\s\p{P}\p{S}]|~)/u, O = /(?![*_])[\p{P}\p{S}]/u, pe = /(?![*_])[\s\p{P}\p{S}]/u, me = /(?:[^\s\p{P}\p{S}]|[*_])/u, he = a(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", o ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), k = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, ge = a(k, "u").replace(/punct/g, w).getRegex(), _e = a(k, "u").replace(/punct/g, D).getRegex(), A = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ve = a(A, "gu").replace(/notPunctSpace/g, E).replace(/punctSpace/g, T).replace(/punct/g, w).getRegex(), ye = a(A, "gu").replace(/notPunctSpace/g, fe).replace(/punctSpace/g, de).replace(/punct/g, D).getRegex(), be = a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, E).replace(/punctSpace/g, T).replace(/punct/g, w).getRegex(), xe = a(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, O).getRegex(), Se = a("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, me).replace(/punctSpace/g, pe).replace(/punct/g, O).getRegex(), Ce = a(/\\(punct)/, "gu").replace(/punct/g, w).getRegex(), we = a(/^<(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(), Te = a(y).replace("(?:-->|$)", "-->").getRegex(), j = a("^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", Te).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), M = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ee = a(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", M).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), N = a(/^!?\[(label)\]\[(ref)\]/).replace("label", M).replace("ref", _).getRegex(), P = a(/^!?\[(ref)\](?:\[\])?/).replace("ref", _).getRegex(), De = a("reflink|nolink(?!\\()", "g").replace("reflink", N).replace("nolink", P).getRegex(), F = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, I = {
124
+ _backpedal: i,
125
+ anyPunctuation: Ce,
126
+ autolink: we,
127
+ blockSkip: he,
128
+ br: C,
129
+ code: ce,
130
+ del: i,
131
+ delLDelim: i,
132
+ delRDelim: i,
133
+ emStrongLDelim: ge,
134
+ emStrongRDelimAst: ve,
135
+ emStrongRDelimUnd: be,
136
+ escape: se,
137
+ link: Ee,
138
+ nolink: P,
139
+ punctuation: ue,
140
+ reflink: N,
141
+ reflinkSearch: De,
142
+ tag: j,
143
+ text: le,
144
+ url: i
145
+ }, Oe = {
146
+ ...I,
147
+ link: a(/^!?\[(label)\]\((.*?)\)/).replace("label", M).getRegex(),
148
+ reflink: a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", M).getRegex()
149
+ }, L = {
150
+ ...I,
151
+ emStrongRDelimAst: ye,
152
+ emStrongLDelim: _e,
153
+ delLDelim: xe,
154
+ delRDelim: Se,
155
+ url: a(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", F).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
156
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
157
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
158
+ text: a(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", F).getRegex()
159
+ }, ke = {
160
+ ...L,
161
+ br: a(C).replace("{2,}", "*").getRegex(),
162
+ text: a(L.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
163
+ }, R = {
164
+ normal: x,
165
+ gfm: ae,
166
+ pedantic: oe
167
+ }, z = {
168
+ normal: I,
169
+ gfm: L,
170
+ breaks: ke,
171
+ pedantic: Oe
172
+ }, Ae = {
173
+ "&": "&amp;",
174
+ "<": "&lt;",
175
+ ">": "&gt;",
176
+ "\"": "&quot;",
177
+ "'": "&#39;"
178
+ }, B = (e) => Ae[e];
179
+ function V(e, t) {
180
+ if (t) {
181
+ if (s.escapeTest.test(e)) return e.replace(s.escapeReplace, B);
182
+ } else if (s.escapeTestNoEncode.test(e)) return e.replace(s.escapeReplaceNoEncode, B);
183
+ return e;
184
+ }
185
+ function H(e) {
186
+ try {
187
+ e = encodeURI(e).replace(s.percentDecode, "%");
188
+ } catch {
189
+ return null;
190
+ }
191
+ return e;
192
+ }
193
+ function U(e, t) {
194
+ let n = e.replace(s.findPipe, (e, t, n) => {
195
+ let r = !1, i = t;
196
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
197
+ return r ? "|" : " |";
198
+ }).split(s.splitPipe), r = 0;
199
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
200
+ else for (; n.length < t;) n.push("");
201
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(s.slashPipe, "|");
202
+ return n;
203
+ }
204
+ function W(e, t, n) {
205
+ let r = e.length;
206
+ if (r === 0) return "";
207
+ let i = 0;
208
+ for (; i < r;) {
209
+ let a = e.charAt(r - i - 1);
210
+ if (a === t && !n) i++;
211
+ else if (a !== t && n) i++;
212
+ else break;
213
+ }
214
+ return e.slice(0, r - i);
215
+ }
216
+ function je(e, t) {
217
+ if (e.indexOf(t[1]) === -1) return -1;
218
+ let n = 0;
219
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
220
+ else if (e[r] === t[0]) n++;
221
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
222
+ return n > 0 ? -2 : -1;
223
+ }
224
+ function Me(e, t = 0) {
225
+ let n = t, r = "";
226
+ for (let t of e) if (t === " ") {
227
+ let e = 4 - n % 4;
228
+ r += " ".repeat(e), n += e;
229
+ } else r += t, n++;
230
+ return r;
231
+ }
232
+ function G(e, t, n, r, i) {
233
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
234
+ r.state.inLink = !0;
235
+ let c = {
236
+ type: e[0].charAt(0) === "!" ? "image" : "link",
237
+ raw: n,
238
+ href: a,
239
+ title: o,
240
+ text: s,
241
+ tokens: r.inlineTokens(s)
242
+ };
243
+ return r.state.inLink = !1, c;
244
+ }
245
+ function Ne(e, t, n) {
246
+ let r = e.match(n.other.indentCodeCompensation);
247
+ if (r === null) return t;
248
+ let i = r[1];
249
+ return t.split("\n").map((e) => {
250
+ let t = e.match(n.other.beginningSpace);
251
+ if (t === null) return e;
252
+ let [r] = t;
253
+ return r.length >= i.length ? e.slice(i.length) : e;
254
+ }).join("\n");
255
+ }
256
+ var K = class {
257
+ options;
258
+ rules;
259
+ lexer;
260
+ constructor(e) {
261
+ this.options = e || n;
262
+ }
263
+ space(e) {
264
+ let t = this.rules.block.newline.exec(e);
265
+ if (t && t[0].length > 0) return {
266
+ type: "space",
267
+ raw: t[0]
268
+ };
269
+ }
270
+ code(e) {
271
+ let t = this.rules.block.code.exec(e);
272
+ if (t) {
273
+ let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
274
+ return {
275
+ type: "code",
276
+ raw: t[0],
277
+ codeBlockStyle: "indented",
278
+ text: this.options.pedantic ? e : W(e, "\n")
279
+ };
280
+ }
281
+ }
282
+ fences(e) {
283
+ let t = this.rules.block.fences.exec(e);
284
+ if (t) {
285
+ let e = t[0], n = Ne(e, t[3] || "", this.rules);
286
+ return {
287
+ type: "code",
288
+ raw: e,
289
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
290
+ text: n
291
+ };
292
+ }
293
+ }
294
+ heading(e) {
295
+ let t = this.rules.block.heading.exec(e);
296
+ if (t) {
297
+ let e = t[2].trim();
298
+ if (this.rules.other.endingHash.test(e)) {
299
+ let t = W(e, "#");
300
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
301
+ }
302
+ return {
303
+ type: "heading",
304
+ raw: t[0],
305
+ depth: t[1].length,
306
+ text: e,
307
+ tokens: this.lexer.inline(e)
308
+ };
309
+ }
310
+ }
311
+ hr(e) {
312
+ let t = this.rules.block.hr.exec(e);
313
+ if (t) return {
314
+ type: "hr",
315
+ raw: W(t[0], "\n")
316
+ };
317
+ }
318
+ blockquote(e) {
319
+ let t = this.rules.block.blockquote.exec(e);
320
+ if (t) {
321
+ let e = W(t[0], "\n").split("\n"), n = "", r = "", i = [];
322
+ for (; e.length > 0;) {
323
+ let t = !1, a = [], o;
324
+ for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
325
+ else if (!t) a.push(e[o]);
326
+ else break;
327
+ e = e.slice(o);
328
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
329
+ n = n ? `${n}
330
+ ${s}` : s, r = r ? `${r}
331
+ ${c}` : c;
332
+ let l = this.lexer.state.top;
333
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
334
+ let u = i.at(-1);
335
+ if (u?.type === "code") break;
336
+ if (u?.type === "blockquote") {
337
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
338
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
339
+ break;
340
+ } else if (u?.type === "list") {
341
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
342
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
343
+ continue;
344
+ }
345
+ }
346
+ return {
347
+ type: "blockquote",
348
+ raw: n,
349
+ tokens: i,
350
+ text: r
351
+ };
352
+ }
353
+ }
354
+ list(e) {
355
+ let t = this.rules.block.list.exec(e);
356
+ if (t) {
357
+ let n = t[1].trim(), r = n.length > 1, i = {
358
+ type: "list",
359
+ raw: "",
360
+ ordered: r,
361
+ start: r ? +n.slice(0, -1) : "",
362
+ loose: !1,
363
+ items: []
364
+ };
365
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
366
+ let a = this.rules.other.listItemRegex(n), o = !1;
367
+ for (; e;) {
368
+ let n = !1, r = "", s = "";
369
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
370
+ r = t[0], e = e.substring(r.length);
371
+ let c = Me(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
372
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
373
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
374
+ for (; e;) {
375
+ let p = e.split("\n", 1)[0], m;
376
+ if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
377
+ if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
378
+ else {
379
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
380
+ s += "\n" + l;
381
+ }
382
+ u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
383
+ }
384
+ }
385
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
386
+ type: "list_item",
387
+ raw: r,
388
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
389
+ loose: !1,
390
+ text: s,
391
+ tokens: []
392
+ }), i.raw += r;
393
+ }
394
+ let s = i.items.at(-1);
395
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
396
+ else return;
397
+ i.raw = i.raw.trimEnd();
398
+ for (let e of i.items) {
399
+ if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), e.task) {
400
+ if (e.text = e.text.replace(this.rules.other.listReplaceTask, ""), e.tokens[0]?.type === "text" || e.tokens[0]?.type === "paragraph") {
401
+ e.tokens[0].raw = e.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), e.tokens[0].text = e.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
402
+ for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
403
+ this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
404
+ break;
405
+ }
406
+ }
407
+ let t = this.rules.other.listTaskCheckbox.exec(e.raw);
408
+ if (t) {
409
+ let n = {
410
+ type: "checkbox",
411
+ raw: t[0] + " ",
412
+ checked: t[0] !== "[ ]"
413
+ };
414
+ e.checked = n.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = n.raw + e.tokens[0].raw, e.tokens[0].text = n.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(n)) : e.tokens.unshift({
415
+ type: "paragraph",
416
+ raw: n.raw,
417
+ text: n.raw,
418
+ tokens: [n]
419
+ }) : e.tokens.unshift(n);
420
+ }
421
+ }
422
+ if (!i.loose) {
423
+ let t = e.tokens.filter((e) => e.type === "space");
424
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
425
+ }
426
+ }
427
+ if (i.loose) for (let e of i.items) {
428
+ e.loose = !0;
429
+ for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
430
+ }
431
+ return i;
432
+ }
433
+ }
434
+ html(e) {
435
+ let t = this.rules.block.html.exec(e);
436
+ if (t) return {
437
+ type: "html",
438
+ block: !0,
439
+ raw: t[0],
440
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
441
+ text: t[0]
442
+ };
443
+ }
444
+ def(e) {
445
+ let t = this.rules.block.def.exec(e);
446
+ if (t) {
447
+ let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
448
+ return {
449
+ type: "def",
450
+ tag: e,
451
+ raw: t[0],
452
+ href: n,
453
+ title: r
454
+ };
455
+ }
456
+ }
457
+ table(e) {
458
+ let t = this.rules.block.table.exec(e);
459
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
460
+ let n = U(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
461
+ type: "table",
462
+ raw: t[0],
463
+ header: [],
464
+ align: [],
465
+ rows: []
466
+ };
467
+ if (n.length === r.length) {
468
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
469
+ for (let e = 0; e < n.length; e++) a.header.push({
470
+ text: n[e],
471
+ tokens: this.lexer.inline(n[e]),
472
+ header: !0,
473
+ align: a.align[e]
474
+ });
475
+ for (let e of i) a.rows.push(U(e, a.header.length).map((e, t) => ({
476
+ text: e,
477
+ tokens: this.lexer.inline(e),
478
+ header: !1,
479
+ align: a.align[t]
480
+ })));
481
+ return a;
482
+ }
483
+ }
484
+ lheading(e) {
485
+ let t = this.rules.block.lheading.exec(e);
486
+ if (t) return {
487
+ type: "heading",
488
+ raw: t[0],
489
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
490
+ text: t[1],
491
+ tokens: this.lexer.inline(t[1])
492
+ };
493
+ }
494
+ paragraph(e) {
495
+ let t = this.rules.block.paragraph.exec(e);
496
+ if (t) {
497
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
498
+ return {
499
+ type: "paragraph",
500
+ raw: t[0],
501
+ text: e,
502
+ tokens: this.lexer.inline(e)
503
+ };
504
+ }
505
+ }
506
+ text(e) {
507
+ let t = this.rules.block.text.exec(e);
508
+ if (t) return {
509
+ type: "text",
510
+ raw: t[0],
511
+ text: t[0],
512
+ tokens: this.lexer.inline(t[0])
513
+ };
514
+ }
515
+ escape(e) {
516
+ let t = this.rules.inline.escape.exec(e);
517
+ if (t) return {
518
+ type: "escape",
519
+ raw: t[0],
520
+ text: t[1]
521
+ };
522
+ }
523
+ tag(e) {
524
+ let t = this.rules.inline.tag.exec(e);
525
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
526
+ type: "html",
527
+ raw: t[0],
528
+ inLink: this.lexer.state.inLink,
529
+ inRawBlock: this.lexer.state.inRawBlock,
530
+ block: !1,
531
+ text: t[0]
532
+ };
533
+ }
534
+ link(e) {
535
+ let t = this.rules.inline.link.exec(e);
536
+ if (t) {
537
+ let e = t[2].trim();
538
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
539
+ if (!this.rules.other.endAngleBracket.test(e)) return;
540
+ let t = W(e.slice(0, -1), "\\");
541
+ if ((e.length - t.length) % 2 == 0) return;
542
+ } else {
543
+ let e = je(t[2], "()");
544
+ if (e === -2) return;
545
+ if (e > -1) {
546
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
547
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
548
+ }
549
+ }
550
+ let n = t[2], r = "";
551
+ if (this.options.pedantic) {
552
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
553
+ e && (n = e[1], r = e[3]);
554
+ } else r = t[3] ? t[3].slice(1, -1) : "";
555
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), G(t, {
556
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
557
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
558
+ }, t[0], this.lexer, this.rules);
559
+ }
560
+ }
561
+ reflink(e, t) {
562
+ let n;
563
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
564
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
565
+ if (!e) {
566
+ let e = n[0].charAt(0);
567
+ return {
568
+ type: "text",
569
+ raw: e,
570
+ text: e
571
+ };
572
+ }
573
+ return G(n, e, n[0], this.lexer, this.rules);
574
+ }
575
+ }
576
+ emStrong(e, t, n = "") {
577
+ let r = this.rules.inline.emStrongLDelim.exec(e);
578
+ if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
579
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
580
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
581
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
582
+ if (a = [...i].length, r[3] || r[4]) {
583
+ o += a;
584
+ continue;
585
+ } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
586
+ s += a;
587
+ continue;
588
+ }
589
+ if (o -= a, o > 0) continue;
590
+ a = Math.min(a, a + o + s);
591
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
592
+ if (Math.min(n, a) % 2) {
593
+ let e = c.slice(1, -1);
594
+ return {
595
+ type: "em",
596
+ raw: c,
597
+ text: e,
598
+ tokens: this.lexer.inlineTokens(e)
599
+ };
600
+ }
601
+ let l = c.slice(2, -2);
602
+ return {
603
+ type: "strong",
604
+ raw: c,
605
+ text: l,
606
+ tokens: this.lexer.inlineTokens(l)
607
+ };
608
+ }
609
+ }
610
+ }
611
+ codespan(e) {
612
+ let t = this.rules.inline.code.exec(e);
613
+ if (t) {
614
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
615
+ return n && r && (e = e.substring(1, e.length - 1)), {
616
+ type: "codespan",
617
+ raw: t[0],
618
+ text: e
619
+ };
620
+ }
621
+ }
622
+ br(e) {
623
+ let t = this.rules.inline.br.exec(e);
624
+ if (t) return {
625
+ type: "br",
626
+ raw: t[0]
627
+ };
628
+ }
629
+ del(e, t, n = "") {
630
+ let r = this.rules.inline.delLDelim.exec(e);
631
+ if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
632
+ let n = [...r[0]].length - 1, i, a, o = n, s = this.rules.inline.delRDelim;
633
+ for (s.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = s.exec(t)) != null;) {
634
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i || (a = [...i].length, a !== n)) continue;
635
+ if (r[3] || r[4]) {
636
+ o += a;
637
+ continue;
638
+ }
639
+ if (o -= a, o > 0) continue;
640
+ a = Math.min(a, a + o);
641
+ let t = [...r[0]][0].length, s = e.slice(0, n + r.index + t + a), c = s.slice(n, -n);
642
+ return {
643
+ type: "del",
644
+ raw: s,
645
+ text: c,
646
+ tokens: this.lexer.inlineTokens(c)
647
+ };
648
+ }
649
+ }
650
+ }
651
+ autolink(e) {
652
+ let t = this.rules.inline.autolink.exec(e);
653
+ if (t) {
654
+ let e, n;
655
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
656
+ type: "link",
657
+ raw: t[0],
658
+ text: e,
659
+ href: n,
660
+ tokens: [{
661
+ type: "text",
662
+ raw: e,
663
+ text: e
664
+ }]
665
+ };
666
+ }
667
+ }
668
+ url(e) {
669
+ let t;
670
+ if (t = this.rules.inline.url.exec(e)) {
671
+ let e, n;
672
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
673
+ else {
674
+ let r;
675
+ do
676
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
677
+ while (r !== t[0]);
678
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
679
+ }
680
+ return {
681
+ type: "link",
682
+ raw: t[0],
683
+ text: e,
684
+ href: n,
685
+ tokens: [{
686
+ type: "text",
687
+ raw: e,
688
+ text: e
689
+ }]
690
+ };
691
+ }
692
+ }
693
+ inlineText(e) {
694
+ let t = this.rules.inline.text.exec(e);
695
+ if (t) {
696
+ let e = this.lexer.state.inRawBlock;
697
+ return {
698
+ type: "text",
699
+ raw: t[0],
700
+ text: t[0],
701
+ escaped: e
702
+ };
703
+ }
704
+ }
705
+ }, q = class e {
706
+ tokens;
707
+ options;
708
+ state;
709
+ inlineQueue;
710
+ tokenizer;
711
+ constructor(e) {
712
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || n, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
713
+ inLink: !1,
714
+ inRawBlock: !1,
715
+ top: !0
716
+ };
717
+ let t = {
718
+ other: s,
719
+ block: R.normal,
720
+ inline: z.normal
721
+ };
722
+ this.options.pedantic ? (t.block = R.pedantic, t.inline = z.pedantic) : this.options.gfm && (t.block = R.gfm, this.options.breaks ? t.inline = z.breaks : t.inline = z.gfm), this.tokenizer.rules = t;
723
+ }
724
+ static get rules() {
725
+ return {
726
+ block: R,
727
+ inline: z
728
+ };
729
+ }
730
+ static lex(t, n) {
731
+ return new e(n).lex(t);
732
+ }
733
+ static lexInline(t, n) {
734
+ return new e(n).inlineTokens(t);
735
+ }
736
+ lex(e) {
737
+ e = e.replace(s.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
738
+ for (let e = 0; e < this.inlineQueue.length; e++) {
739
+ let t = this.inlineQueue[e];
740
+ this.inlineTokens(t.src, t.tokens);
741
+ }
742
+ return this.inlineQueue = [], this.tokens;
743
+ }
744
+ blockTokens(e, t = [], n = !1) {
745
+ for (this.options.pedantic && (e = e.replace(s.tabCharGlobal, " ").replace(s.spaceLine, "")); e;) {
746
+ let r;
747
+ if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
748
+ if (r = this.tokenizer.space(e)) {
749
+ e = e.substring(r.raw.length);
750
+ let n = t.at(-1);
751
+ r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
752
+ continue;
753
+ }
754
+ if (r = this.tokenizer.code(e)) {
755
+ e = e.substring(r.raw.length);
756
+ let n = t.at(-1);
757
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
758
+ continue;
759
+ }
760
+ if (r = this.tokenizer.fences(e)) {
761
+ e = e.substring(r.raw.length), t.push(r);
762
+ continue;
763
+ }
764
+ if (r = this.tokenizer.heading(e)) {
765
+ e = e.substring(r.raw.length), t.push(r);
766
+ continue;
767
+ }
768
+ if (r = this.tokenizer.hr(e)) {
769
+ e = e.substring(r.raw.length), t.push(r);
770
+ continue;
771
+ }
772
+ if (r = this.tokenizer.blockquote(e)) {
773
+ e = e.substring(r.raw.length), t.push(r);
774
+ continue;
775
+ }
776
+ if (r = this.tokenizer.list(e)) {
777
+ e = e.substring(r.raw.length), t.push(r);
778
+ continue;
779
+ }
780
+ if (r = this.tokenizer.html(e)) {
781
+ e = e.substring(r.raw.length), t.push(r);
782
+ continue;
783
+ }
784
+ if (r = this.tokenizer.def(e)) {
785
+ e = e.substring(r.raw.length);
786
+ let n = t.at(-1);
787
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
788
+ href: r.href,
789
+ title: r.title
790
+ }, t.push(r));
791
+ continue;
792
+ }
793
+ if (r = this.tokenizer.table(e)) {
794
+ e = e.substring(r.raw.length), t.push(r);
795
+ continue;
796
+ }
797
+ if (r = this.tokenizer.lheading(e)) {
798
+ e = e.substring(r.raw.length), t.push(r);
799
+ continue;
800
+ }
801
+ let i = e;
802
+ if (this.options.extensions?.startBlock) {
803
+ let t = Infinity, n = e.slice(1), r;
804
+ this.options.extensions.startBlock.forEach((e) => {
805
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
806
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
807
+ }
808
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
809
+ let a = t.at(-1);
810
+ n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith("\n") ? "" : "\n") + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
811
+ continue;
812
+ }
813
+ if (r = this.tokenizer.text(e)) {
814
+ e = e.substring(r.raw.length);
815
+ let n = t.at(-1);
816
+ n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
817
+ continue;
818
+ }
819
+ if (e) {
820
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
821
+ if (this.options.silent) {
822
+ console.error(t);
823
+ break;
824
+ } else throw Error(t);
825
+ }
826
+ }
827
+ return this.state.top = !0, t;
828
+ }
829
+ inline(e, t = []) {
830
+ return this.inlineQueue.push({
831
+ src: e,
832
+ tokens: t
833
+ }), t;
834
+ }
835
+ inlineTokens(e, t = []) {
836
+ let n = e, r = null;
837
+ if (this.tokens.links) {
838
+ let e = Object.keys(this.tokens.links);
839
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.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));
840
+ }
841
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
842
+ let i;
843
+ 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);
844
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
845
+ let a = !1, o = "";
846
+ for (; e;) {
847
+ a || (o = ""), a = !1;
848
+ let r;
849
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
850
+ if (r = this.tokenizer.escape(e)) {
851
+ e = e.substring(r.raw.length), t.push(r);
852
+ continue;
853
+ }
854
+ if (r = this.tokenizer.tag(e)) {
855
+ e = e.substring(r.raw.length), t.push(r);
856
+ continue;
857
+ }
858
+ if (r = this.tokenizer.link(e)) {
859
+ e = e.substring(r.raw.length), t.push(r);
860
+ continue;
861
+ }
862
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
863
+ e = e.substring(r.raw.length);
864
+ let n = t.at(-1);
865
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
866
+ continue;
867
+ }
868
+ if (r = this.tokenizer.emStrong(e, n, o)) {
869
+ e = e.substring(r.raw.length), t.push(r);
870
+ continue;
871
+ }
872
+ if (r = this.tokenizer.codespan(e)) {
873
+ e = e.substring(r.raw.length), t.push(r);
874
+ continue;
875
+ }
876
+ if (r = this.tokenizer.br(e)) {
877
+ e = e.substring(r.raw.length), t.push(r);
878
+ continue;
879
+ }
880
+ if (r = this.tokenizer.del(e, n, o)) {
881
+ e = e.substring(r.raw.length), t.push(r);
882
+ continue;
883
+ }
884
+ if (r = this.tokenizer.autolink(e)) {
885
+ e = e.substring(r.raw.length), t.push(r);
886
+ continue;
887
+ }
888
+ if (!this.state.inLink && (r = this.tokenizer.url(e))) {
889
+ e = e.substring(r.raw.length), t.push(r);
890
+ continue;
891
+ }
892
+ let i = e;
893
+ if (this.options.extensions?.startInline) {
894
+ let t = Infinity, n = e.slice(1), r;
895
+ this.options.extensions.startInline.forEach((e) => {
896
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
897
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
898
+ }
899
+ if (r = this.tokenizer.inlineText(i)) {
900
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
901
+ let n = t.at(-1);
902
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
903
+ continue;
904
+ }
905
+ if (e) {
906
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
907
+ if (this.options.silent) {
908
+ console.error(t);
909
+ break;
910
+ } else throw Error(t);
911
+ }
912
+ }
913
+ return t;
914
+ }
915
+ }, J = class {
916
+ options;
917
+ parser;
918
+ constructor(e) {
919
+ this.options = e || n;
920
+ }
921
+ space(e) {
922
+ return "";
923
+ }
924
+ code({ text: e, lang: t, escaped: n }) {
925
+ let r = (t || "").match(s.notSpaceStart)?.[0], i = e.replace(s.endingNewline, "") + "\n";
926
+ return r ? "<pre><code class=\"language-" + V(r) + "\">" + (n ? i : V(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : V(i, !0)) + "</code></pre>\n";
927
+ }
928
+ blockquote({ tokens: e }) {
929
+ return `<blockquote>
930
+ ${this.parser.parse(e)}</blockquote>
931
+ `;
932
+ }
933
+ html({ text: e }) {
934
+ return e;
935
+ }
936
+ def(e) {
937
+ return "";
938
+ }
939
+ heading({ tokens: e, depth: t }) {
940
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
941
+ `;
942
+ }
943
+ hr(e) {
944
+ return "<hr>\n";
945
+ }
946
+ list(e) {
947
+ let t = e.ordered, n = e.start, r = "";
948
+ for (let t = 0; t < e.items.length; t++) {
949
+ let n = e.items[t];
950
+ r += this.listitem(n);
951
+ }
952
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
953
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
954
+ }
955
+ listitem(e) {
956
+ return `<li>${this.parser.parse(e.tokens)}</li>
957
+ `;
958
+ }
959
+ checkbox({ checked: e }) {
960
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
961
+ }
962
+ paragraph({ tokens: e }) {
963
+ return `<p>${this.parser.parseInline(e)}</p>
964
+ `;
965
+ }
966
+ table(e) {
967
+ let t = "", n = "";
968
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
969
+ t += this.tablerow({ text: n });
970
+ let r = "";
971
+ for (let t = 0; t < e.rows.length; t++) {
972
+ let i = e.rows[t];
973
+ n = "";
974
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
975
+ r += this.tablerow({ text: n });
976
+ }
977
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
978
+ }
979
+ tablerow({ text: e }) {
980
+ return `<tr>
981
+ ${e}</tr>
982
+ `;
983
+ }
984
+ tablecell(e) {
985
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
986
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
987
+ `;
988
+ }
989
+ strong({ tokens: e }) {
990
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
991
+ }
992
+ em({ tokens: e }) {
993
+ return `<em>${this.parser.parseInline(e)}</em>`;
994
+ }
995
+ codespan({ text: e }) {
996
+ return `<code>${V(e, !0)}</code>`;
997
+ }
998
+ br(e) {
999
+ return "<br>";
1000
+ }
1001
+ del({ tokens: e }) {
1002
+ return `<del>${this.parser.parseInline(e)}</del>`;
1003
+ }
1004
+ link({ href: e, title: t, tokens: n }) {
1005
+ let r = this.parser.parseInline(n), i = H(e);
1006
+ if (i === null) return r;
1007
+ e = i;
1008
+ let a = "<a href=\"" + e + "\"";
1009
+ return t && (a += " title=\"" + V(t) + "\""), a += ">" + r + "</a>", a;
1010
+ }
1011
+ image({ href: e, title: t, text: n, tokens: r }) {
1012
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1013
+ let i = H(e);
1014
+ if (i === null) return V(n);
1015
+ e = i;
1016
+ let a = `<img src="${e}" alt="${V(n)}"`;
1017
+ return t && (a += ` title="${V(t)}"`), a += ">", a;
1018
+ }
1019
+ text(e) {
1020
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
1021
+ }
1022
+ }, Y = class {
1023
+ strong({ text: e }) {
1024
+ return e;
1025
+ }
1026
+ em({ text: e }) {
1027
+ return e;
1028
+ }
1029
+ codespan({ text: e }) {
1030
+ return e;
1031
+ }
1032
+ del({ text: e }) {
1033
+ return e;
1034
+ }
1035
+ html({ text: e }) {
1036
+ return e;
1037
+ }
1038
+ text({ text: e }) {
1039
+ return e;
1040
+ }
1041
+ link({ text: e }) {
1042
+ return "" + e;
1043
+ }
1044
+ image({ text: e }) {
1045
+ return "" + e;
1046
+ }
1047
+ br() {
1048
+ return "";
1049
+ }
1050
+ checkbox({ raw: e }) {
1051
+ return e;
1052
+ }
1053
+ }, X = class e {
1054
+ options;
1055
+ renderer;
1056
+ textRenderer;
1057
+ constructor(e) {
1058
+ this.options = e || n, this.options.renderer = this.options.renderer || new J(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
1059
+ }
1060
+ static parse(t, n) {
1061
+ return new e(n).parse(t);
1062
+ }
1063
+ static parseInline(t, n) {
1064
+ return new e(n).parseInline(t);
1065
+ }
1066
+ parse(e) {
1067
+ let t = "";
1068
+ for (let n = 0; n < e.length; n++) {
1069
+ let r = e[n];
1070
+ if (this.options.extensions?.renderers?.[r.type]) {
1071
+ let e = r, n = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1072
+ if (n !== !1 || ![
1073
+ "space",
1074
+ "hr",
1075
+ "heading",
1076
+ "code",
1077
+ "table",
1078
+ "blockquote",
1079
+ "list",
1080
+ "html",
1081
+ "def",
1082
+ "paragraph",
1083
+ "text"
1084
+ ].includes(e.type)) {
1085
+ t += n || "";
1086
+ continue;
1087
+ }
1088
+ }
1089
+ let i = r;
1090
+ switch (i.type) {
1091
+ case "space":
1092
+ t += this.renderer.space(i);
1093
+ break;
1094
+ case "hr":
1095
+ t += this.renderer.hr(i);
1096
+ break;
1097
+ case "heading":
1098
+ t += this.renderer.heading(i);
1099
+ break;
1100
+ case "code":
1101
+ t += this.renderer.code(i);
1102
+ break;
1103
+ case "table":
1104
+ t += this.renderer.table(i);
1105
+ break;
1106
+ case "blockquote":
1107
+ t += this.renderer.blockquote(i);
1108
+ break;
1109
+ case "list":
1110
+ t += this.renderer.list(i);
1111
+ break;
1112
+ case "checkbox":
1113
+ t += this.renderer.checkbox(i);
1114
+ break;
1115
+ case "html":
1116
+ t += this.renderer.html(i);
1117
+ break;
1118
+ case "def":
1119
+ t += this.renderer.def(i);
1120
+ break;
1121
+ case "paragraph":
1122
+ t += this.renderer.paragraph(i);
1123
+ break;
1124
+ case "text":
1125
+ t += this.renderer.text(i);
1126
+ break;
1127
+ default: {
1128
+ let e = "Token with \"" + i.type + "\" type was not found.";
1129
+ if (this.options.silent) return console.error(e), "";
1130
+ throw Error(e);
1131
+ }
1132
+ }
1133
+ }
1134
+ return t;
1135
+ }
1136
+ parseInline(e, t = this.renderer) {
1137
+ let n = "";
1138
+ for (let r = 0; r < e.length; r++) {
1139
+ let i = e[r];
1140
+ if (this.options.extensions?.renderers?.[i.type]) {
1141
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1142
+ if (e !== !1 || ![
1143
+ "escape",
1144
+ "html",
1145
+ "link",
1146
+ "image",
1147
+ "strong",
1148
+ "em",
1149
+ "codespan",
1150
+ "br",
1151
+ "del",
1152
+ "text"
1153
+ ].includes(i.type)) {
1154
+ n += e || "";
1155
+ continue;
1156
+ }
1157
+ }
1158
+ let a = i;
1159
+ switch (a.type) {
1160
+ case "escape":
1161
+ n += t.text(a);
1162
+ break;
1163
+ case "html":
1164
+ n += t.html(a);
1165
+ break;
1166
+ case "link":
1167
+ n += t.link(a);
1168
+ break;
1169
+ case "image":
1170
+ n += t.image(a);
1171
+ break;
1172
+ case "checkbox":
1173
+ n += t.checkbox(a);
1174
+ break;
1175
+ case "strong":
1176
+ n += t.strong(a);
1177
+ break;
1178
+ case "em":
1179
+ n += t.em(a);
1180
+ break;
1181
+ case "codespan":
1182
+ n += t.codespan(a);
1183
+ break;
1184
+ case "br":
1185
+ n += t.br(a);
1186
+ break;
1187
+ case "del":
1188
+ n += t.del(a);
1189
+ break;
1190
+ case "text":
1191
+ n += t.text(a);
1192
+ break;
1193
+ default: {
1194
+ let e = "Token with \"" + a.type + "\" type was not found.";
1195
+ if (this.options.silent) return console.error(e), "";
1196
+ throw Error(e);
1197
+ }
1198
+ }
1199
+ }
1200
+ return n;
1201
+ }
1202
+ }, Z = class {
1203
+ options;
1204
+ block;
1205
+ constructor(e) {
1206
+ this.options = e || n;
1207
+ }
1208
+ static passThroughHooks = new Set([
1209
+ "preprocess",
1210
+ "postprocess",
1211
+ "processAllTokens",
1212
+ "emStrongMask"
1213
+ ]);
1214
+ static passThroughHooksRespectAsync = new Set([
1215
+ "preprocess",
1216
+ "postprocess",
1217
+ "processAllTokens"
1218
+ ]);
1219
+ preprocess(e) {
1220
+ return e;
1221
+ }
1222
+ postprocess(e) {
1223
+ return e;
1224
+ }
1225
+ processAllTokens(e) {
1226
+ return e;
1227
+ }
1228
+ emStrongMask(e) {
1229
+ return e;
1230
+ }
1231
+ provideLexer() {
1232
+ return this.block ? q.lex : q.lexInline;
1233
+ }
1234
+ provideParser() {
1235
+ return this.block ? X.parse : X.parseInline;
1236
+ }
1237
+ }, Q = new class {
1238
+ defaults = t();
1239
+ options = this.setOptions;
1240
+ parse = this.parseMarkdown(!0);
1241
+ parseInline = this.parseMarkdown(!1);
1242
+ Parser = X;
1243
+ Renderer = J;
1244
+ TextRenderer = Y;
1245
+ Lexer = q;
1246
+ Tokenizer = K;
1247
+ Hooks = Z;
1248
+ constructor(...e) {
1249
+ this.use(...e);
1250
+ }
1251
+ walkTokens(e, t) {
1252
+ let n = [];
1253
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1254
+ case "table": {
1255
+ let e = r;
1256
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1257
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1258
+ break;
1259
+ }
1260
+ case "list": {
1261
+ let e = r;
1262
+ n = n.concat(this.walkTokens(e.items, t));
1263
+ break;
1264
+ }
1265
+ default: {
1266
+ let e = r;
1267
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1268
+ let i = e[r].flat(Infinity);
1269
+ n = n.concat(this.walkTokens(i, t));
1270
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1271
+ }
1272
+ }
1273
+ return n;
1274
+ }
1275
+ use(...e) {
1276
+ let t = this.defaults.extensions || {
1277
+ renderers: {},
1278
+ childTokens: {}
1279
+ };
1280
+ return e.forEach((e) => {
1281
+ let n = { ...e };
1282
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1283
+ if (!e.name) throw Error("extension name required");
1284
+ if ("renderer" in e) {
1285
+ let n = t.renderers[e.name];
1286
+ n ? t.renderers[e.name] = function(...t) {
1287
+ let r = e.renderer.apply(this, t);
1288
+ return r === !1 && (r = n.apply(this, t)), r;
1289
+ } : t.renderers[e.name] = e.renderer;
1290
+ }
1291
+ if ("tokenizer" in e) {
1292
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1293
+ let n = t[e.level];
1294
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1295
+ }
1296
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1297
+ }), n.extensions = t), e.renderer) {
1298
+ let t = this.defaults.renderer || new J(this.defaults);
1299
+ for (let n in e.renderer) {
1300
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1301
+ if (["options", "parser"].includes(n)) continue;
1302
+ let r = n, i = e.renderer[r], a = t[r];
1303
+ t[r] = (...e) => {
1304
+ let n = i.apply(t, e);
1305
+ return n === !1 && (n = a.apply(t, e)), n || "";
1306
+ };
1307
+ }
1308
+ n.renderer = t;
1309
+ }
1310
+ if (e.tokenizer) {
1311
+ let t = this.defaults.tokenizer || new K(this.defaults);
1312
+ for (let n in e.tokenizer) {
1313
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1314
+ if ([
1315
+ "options",
1316
+ "rules",
1317
+ "lexer"
1318
+ ].includes(n)) continue;
1319
+ let r = n, i = e.tokenizer[r], a = t[r];
1320
+ t[r] = (...e) => {
1321
+ let n = i.apply(t, e);
1322
+ return n === !1 && (n = a.apply(t, e)), n;
1323
+ };
1324
+ }
1325
+ n.tokenizer = t;
1326
+ }
1327
+ if (e.hooks) {
1328
+ let t = this.defaults.hooks || new Z();
1329
+ for (let n in e.hooks) {
1330
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1331
+ if (["options", "block"].includes(n)) continue;
1332
+ let r = n, i = e.hooks[r], a = t[r];
1333
+ Z.passThroughHooks.has(n) ? t[r] = (e) => {
1334
+ if (this.defaults.async && Z.passThroughHooksRespectAsync.has(n)) return (async () => {
1335
+ let n = await i.call(t, e);
1336
+ return a.call(t, n);
1337
+ })();
1338
+ let r = i.call(t, e);
1339
+ return a.call(t, r);
1340
+ } : t[r] = (...e) => {
1341
+ if (this.defaults.async) return (async () => {
1342
+ let n = await i.apply(t, e);
1343
+ return n === !1 && (n = await a.apply(t, e)), n;
1344
+ })();
1345
+ let n = i.apply(t, e);
1346
+ return n === !1 && (n = a.apply(t, e)), n;
1347
+ };
1348
+ }
1349
+ n.hooks = t;
1350
+ }
1351
+ if (e.walkTokens) {
1352
+ let t = this.defaults.walkTokens, r = e.walkTokens;
1353
+ n.walkTokens = function(e) {
1354
+ let n = [];
1355
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1356
+ };
1357
+ }
1358
+ this.defaults = {
1359
+ ...this.defaults,
1360
+ ...n
1361
+ };
1362
+ }), this;
1363
+ }
1364
+ setOptions(e) {
1365
+ return this.defaults = {
1366
+ ...this.defaults,
1367
+ ...e
1368
+ }, this;
1369
+ }
1370
+ lexer(e, t) {
1371
+ return q.lex(e, t ?? this.defaults);
1372
+ }
1373
+ parser(e, t) {
1374
+ return X.parse(e, t ?? this.defaults);
1375
+ }
1376
+ parseMarkdown(e) {
1377
+ return (t, n) => {
1378
+ let r = { ...n }, i = {
1379
+ ...this.defaults,
1380
+ ...r
1381
+ }, a = this.onError(!!i.silent, !!i.async);
1382
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1383
+ if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1384
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1385
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1386
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer() : e ? q.lex : q.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1387
+ i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1388
+ let o = await (i.hooks ? await i.hooks.provideParser() : e ? X.parse : X.parseInline)(a, i);
1389
+ return i.hooks ? await i.hooks.postprocess(o) : o;
1390
+ })().catch(a);
1391
+ try {
1392
+ i.hooks && (t = i.hooks.preprocess(t));
1393
+ let n = (i.hooks ? i.hooks.provideLexer() : e ? q.lex : q.lexInline)(t, i);
1394
+ i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1395
+ let r = (i.hooks ? i.hooks.provideParser() : e ? X.parse : X.parseInline)(n, i);
1396
+ return i.hooks && (r = i.hooks.postprocess(r)), r;
1397
+ } catch (e) {
1398
+ return a(e);
1399
+ }
1400
+ };
1401
+ }
1402
+ onError(e, t) {
1403
+ return (n) => {
1404
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1405
+ let e = "<p>An error occurred:</p><pre>" + V(n.message + "", !0) + "</pre>";
1406
+ return t ? Promise.resolve(e) : e;
1407
+ }
1408
+ if (t) return Promise.reject(n);
1409
+ throw n;
1410
+ };
1411
+ }
1412
+ }();
1413
+ function $(e, t) {
1414
+ return Q.parse(e, t);
1415
+ }
1416
+ $.options = $.setOptions = function(e) {
1417
+ return Q.setOptions(e), $.defaults = Q.defaults, r($.defaults), $;
1418
+ }, $.getDefaults = t, $.defaults = n, $.use = function(...e) {
1419
+ return Q.use(...e), $.defaults = Q.defaults, r($.defaults), $;
1420
+ }, $.walkTokens = function(e, t) {
1421
+ return Q.walkTokens(e, t);
1422
+ }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, X.parse, q.lex;
1423
+ //#endregion
1424
+ //#region parent/b2b/utils/convertMdToHtml/convertMdToHtml.ts
1425
+ function Pe(t) {
1426
+ if (!t) return "";
1427
+ let n = $.parse(t);
1428
+ return e.sanitize(n);
1429
+ }
1430
+ //#endregion
1431
+ export { Pe as t };