@fewangsit/wangsvue 1.5.219-alpha.0 → 1.5.219-alpha.2

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 (598) hide show
  1. package/animation/index.es.js +54 -37
  2. package/assets/lottiejs/loading-page.es.js +14 -9
  3. package/assets/lottiejs/loading-plane.es.js +2 -2
  4. package/assets/lottiejs/loading-table.es.js +14 -9
  5. package/assets/lottiejs/no-data.es.js +14 -9
  6. package/backgroundimagecropper/index.es.js +61 -37
  7. package/badge/index.es.js +77 -67
  8. package/badgegroup/index.es.js +62 -50
  9. package/basecalendar/index.es.js +1258 -735
  10. package/basetree/index.es.js +213 -113
  11. package/breadcrumb/index.es.js +46 -38
  12. package/button/index.es.js +60 -54
  13. package/buttonbulkaction/index.es.js +168 -117
  14. package/buttoncopy/index.es.js +25 -22
  15. package/buttondownload/index.es.js +125 -76
  16. package/buttonfilter/index.es.js +21 -15
  17. package/buttonradio/index.es.js +91 -67
  18. package/buttonsearch/index.es.js +62 -46
  19. package/buttonselecttree/index.es.js +233 -172
  20. package/buttontoggle/index.es.js +8 -6
  21. package/calendar/index.es.js +113 -58
  22. package/card/index.es.js +44 -42
  23. package/checkbox/index.es.js +105 -74
  24. package/codesnippet/index.es.js +91 -71
  25. package/codesnippetadapter/index.es.js +25 -21
  26. package/columnlist/index.es.js +249 -171
  27. package/components.d.ts +0 -21
  28. package/config/defaultProps.es.js +9 -9
  29. package/config/index.es.js +11 -10
  30. package/config/locale.es.js +2 -2
  31. package/customcolumn/index.es.js +95 -78
  32. package/datatable/index.es.js +1071 -732
  33. package/dialog/index.es.js +54 -54
  34. package/dialogconfirm/index.es.js +90 -75
  35. package/dialogform/index.es.js +170 -133
  36. package/dialogselecttree/index.es.js +242 -194
  37. package/directives/focus.es.js +13 -8
  38. package/dropdown/index.es.js +250 -196
  39. package/editor/index.es.js +694 -498
  40. package/editorbutton/index.es.js +21 -19
  41. package/event-bus/index.es.js +3 -3
  42. package/event-bus/mitt.es.js +37 -20
  43. package/fieldwrapper/index.es.js +30 -25
  44. package/fileupload/index.es.js +230 -140
  45. package/filtercontainer/index.es.js +299 -222
  46. package/form/index.es.js +176 -126
  47. package/gallerypreview/index.es.js +138 -101
  48. package/icon/index.es.js +38 -36
  49. package/image/index.es.js +161 -108
  50. package/imagecompressor/index.es.js +616 -449
  51. package/imageinputinfo/index.es.js +26 -22
  52. package/inlinemessage/index.es.js +77 -65
  53. package/inputbadge/index.es.js +230 -156
  54. package/inputcurrency/index.es.js +146 -109
  55. package/inputemail/index.es.js +18 -16
  56. package/inputgroup/index.es.js +19 -16
  57. package/inputnumber/index.es.js +252 -182
  58. package/inputpassword/index.es.js +120 -94
  59. package/inputphonenumber/index.es.js +1017 -550
  60. package/inputrangenumber/index.es.js +129 -98
  61. package/inputtext/index.es.js +264 -189
  62. package/inputurl/index.es.js +31 -29
  63. package/invisiblefield/index.es.js +24 -16
  64. package/litedropdown/index.es.js +87 -81
  65. package/loading/index.es.js +21 -19
  66. package/loading-page-BXZ4fLOS.js +8 -0
  67. package/loading-page-BuLpsb_1.js +8 -0
  68. package/loading-page-CNqVBg__.js +4 -0
  69. package/loading-page-DbhhZih2.js +4 -0
  70. package/loading-page-DjfWXoOy.js +8 -0
  71. package/loading-page-S-KRY5zm.js +4 -0
  72. package/loading-plane-C1mi7Whv.js +4 -0
  73. package/loading-plane-CWq1hz_l.js +8 -0
  74. package/loading-table-B7LAXzAp.js +4 -0
  75. package/loading-table-BLmgKUsR.js +4 -0
  76. package/loading-table-CG7-cuhv.js +8 -0
  77. package/loading-table-CUPS49ta.js +4 -0
  78. package/loading-table-CuWWrTbv.js +8 -0
  79. package/loading-table-DbBzVwaZ.js +8 -0
  80. package/mentionlist/index.es.js +77 -44
  81. package/mentionsection/index.es.js +53 -43
  82. package/menu/index.es.js +65 -51
  83. package/menuitem/index.es.js +39 -37
  84. package/multirow/index.es.js +29 -28
  85. package/multiselect/index.es.js +184 -152
  86. package/no-data-B781skt3.js +4 -0
  87. package/no-data-CAksOnDl.js +4 -0
  88. package/no-data-DCsjBXQR.js +4 -0
  89. package/no-data-Dz0QOe7Q.js +8 -0
  90. package/no-data-_Huxiv9q.js +8 -0
  91. package/no-data-ybRQontJ.js +8 -0
  92. package/overlaypanel/index.es.js +49 -36
  93. package/package.json +1 -1
  94. package/paginator/index.es.js +36 -33
  95. package/plugins/WangsVue.es.js +63 -45
  96. package/plugins/formValidation.es.js +15 -11
  97. package/progressbar/index.es.js +39 -32
  98. package/quickfilter/index.es.js +94 -81
  99. package/stats.html +1 -1
  100. package/style.css +2 -2
  101. package/tabmenu/index.es.js +18 -16
  102. package/textarea/index.es.js +94 -72
  103. package/timeline/index.es.js +124 -102
  104. package/timelinecontentbytype/index.es.js +114 -92
  105. package/toast/index.es.js +67 -54
  106. package/toggleswitch/index.es.js +83 -66
  107. package/tree/index.es.js +306 -198
  108. package/treenode/index.es.js +464 -339
  109. package/treesearchinput/index.es.js +32 -26
  110. package/usergroup/index.es.js +83 -67
  111. package/username/index.es.js +99 -85
  112. package/utils/addAttachment.util.es.js +47 -21
  113. package/utils/baseToast.util.es.js +41 -33
  114. package/utils/convertJsonImage.util.es.js +24 -24
  115. package/utils/date.util.es.js +131 -106
  116. package/utils/exportToExcel.util.es.js +81 -47
  117. package/utils/filterOptions.util.es.js +8 -2
  118. package/utils/genPlaceholder.util.es.js +30 -16
  119. package/utils/getProjectPermission.util.es.js +15 -12
  120. package/utils/getSalesRole.util.es.js +4 -4
  121. package/utils/getUser.util.es.js +2 -2
  122. package/utils/getUserType.util.es.js +13 -8
  123. package/utils/isIntersect.es.js +4 -2
  124. package/utils/mergePropsWithDefaults.util.es.js +7 -6
  125. package/utils/object.util.es.js +88 -54
  126. package/utils/queryParamsStringfy.util.es.js +19 -11
  127. package/utils/role.util.es.js +5 -4
  128. package/utils/statusSeverity.util.es.js +20 -5
  129. package/utils/textFormatter.util.es.js +28 -50
  130. package/utils/toast.util.es.js +8 -5
  131. package/utils/xlsx.util.es.js +12 -6
  132. package/validatormessage/index.es.js +9 -9
  133. package/vendor/@popperjs/core/lib/createPopper.es.js +110 -83
  134. package/vendor/@popperjs/core/lib/dom-utils/contains.es.js +14 -13
  135. package/vendor/@popperjs/core/lib/dom-utils/getBoundingClientRect.es.js +33 -18
  136. package/vendor/@popperjs/core/lib/dom-utils/getClippingRect.es.js +55 -31
  137. package/vendor/@popperjs/core/lib/dom-utils/getCompositeRect.es.js +43 -22
  138. package/vendor/@popperjs/core/lib/dom-utils/getComputedStyle.es.js +4 -4
  139. package/vendor/@popperjs/core/lib/dom-utils/getDocumentElement.es.js +5 -5
  140. package/vendor/@popperjs/core/lib/dom-utils/getDocumentRect.es.js +23 -13
  141. package/vendor/@popperjs/core/lib/dom-utils/getHTMLElementScroll.es.js +4 -4
  142. package/vendor/@popperjs/core/lib/dom-utils/getLayoutRect.es.js +17 -9
  143. package/vendor/@popperjs/core/lib/dom-utils/getNodeName.es.js +3 -3
  144. package/vendor/@popperjs/core/lib/dom-utils/getNodeScroll.es.js +11 -7
  145. package/vendor/@popperjs/core/lib/dom-utils/getOffsetParent.es.js +42 -26
  146. package/vendor/@popperjs/core/lib/dom-utils/getParentNode.es.js +13 -10
  147. package/vendor/@popperjs/core/lib/dom-utils/getScrollParent.es.js +13 -7
  148. package/vendor/@popperjs/core/lib/dom-utils/getViewportRect.es.js +25 -15
  149. package/vendor/@popperjs/core/lib/dom-utils/getWindow.es.js +8 -7
  150. package/vendor/@popperjs/core/lib/dom-utils/getWindowScroll.es.js +8 -6
  151. package/vendor/@popperjs/core/lib/dom-utils/getWindowScrollBarX.es.js +6 -6
  152. package/vendor/@popperjs/core/lib/dom-utils/instanceOf.es.js +16 -15
  153. package/vendor/@popperjs/core/lib/dom-utils/isLayoutViewport.es.js +4 -4
  154. package/vendor/@popperjs/core/lib/dom-utils/isScrollParent.es.js +5 -5
  155. package/vendor/@popperjs/core/lib/dom-utils/isTableElement.es.js +4 -4
  156. package/vendor/@popperjs/core/lib/dom-utils/listScrollParents.es.js +17 -11
  157. package/vendor/@popperjs/core/lib/enums.es.js +43 -20
  158. package/vendor/@popperjs/core/lib/modifiers/applyStyles.es.js +49 -25
  159. package/vendor/@popperjs/core/lib/modifiers/arrow.es.js +61 -26
  160. package/vendor/@popperjs/core/lib/modifiers/computeStyles.es.js +101 -69
  161. package/vendor/@popperjs/core/lib/modifiers/eventListeners.es.js +30 -16
  162. package/vendor/@popperjs/core/lib/modifiers/flip.es.js +99 -60
  163. package/vendor/@popperjs/core/lib/modifiers/hide.es.js +44 -31
  164. package/vendor/@popperjs/core/lib/modifiers/offset.es.js +32 -20
  165. package/vendor/@popperjs/core/lib/modifiers/popperOffsets.es.js +11 -11
  166. package/vendor/@popperjs/core/lib/modifiers/preventOverflow.es.js +91 -40
  167. package/vendor/@popperjs/core/lib/popper.es.js +14 -13
  168. package/vendor/@popperjs/core/lib/utils/computeAutoPlacement.es.js +29 -21
  169. package/vendor/@popperjs/core/lib/utils/computeOffsets.es.js +41 -36
  170. package/vendor/@popperjs/core/lib/utils/debounce.es.js +11 -7
  171. package/vendor/@popperjs/core/lib/utils/detectOverflow.es.js +42 -28
  172. package/vendor/@popperjs/core/lib/utils/expandToHashMap.es.js +5 -4
  173. package/vendor/@popperjs/core/lib/utils/getAltAxis.es.js +3 -3
  174. package/vendor/@popperjs/core/lib/utils/getBasePlacement.es.js +3 -3
  175. package/vendor/@popperjs/core/lib/utils/getFreshSideObject.es.js +2 -2
  176. package/vendor/@popperjs/core/lib/utils/getMainAxisFromPlacement.es.js +3 -3
  177. package/vendor/@popperjs/core/lib/utils/getOppositePlacement.es.js +5 -5
  178. package/vendor/@popperjs/core/lib/utils/getOppositeVariationPlacement.es.js +5 -5
  179. package/vendor/@popperjs/core/lib/utils/getVariation.es.js +3 -3
  180. package/vendor/@popperjs/core/lib/utils/math.es.js +6 -4
  181. package/vendor/@popperjs/core/lib/utils/mergeByName.es.js +11 -10
  182. package/vendor/@popperjs/core/lib/utils/mergePaddingObject.es.js +4 -4
  183. package/vendor/@popperjs/core/lib/utils/orderModifiers.es.js +30 -22
  184. package/vendor/@popperjs/core/lib/utils/rectToClientRect.es.js +7 -7
  185. package/vendor/@popperjs/core/lib/utils/userAgent.es.js +9 -6
  186. package/vendor/@popperjs/core/lib/utils/within.es.js +8 -8
  187. package/vendor/@tiptap/core/dist/index.es.js +3494 -2000
  188. package/vendor/@tiptap/extension-bold/dist/index.es.js +29 -19
  189. package/vendor/@tiptap/extension-bubble-menu/dist/index.es.js +145 -71
  190. package/vendor/@tiptap/extension-bullet-list/dist/index.es.js +32 -19
  191. package/vendor/@tiptap/extension-code/dist/index.es.js +22 -14
  192. package/vendor/@tiptap/extension-document/dist/index.es.js +4 -4
  193. package/vendor/@tiptap/extension-floating-menu/dist/index.es.js +106 -51
  194. package/vendor/@tiptap/extension-heading/dist/index.es.js +38 -22
  195. package/vendor/@tiptap/extension-history/dist/index.es.js +11 -7
  196. package/vendor/@tiptap/extension-image/dist/index.es.js +20 -17
  197. package/vendor/@tiptap/extension-italic/dist/index.es.js +28 -18
  198. package/vendor/@tiptap/extension-link/dist/index.es.js +236 -147
  199. package/vendor/@tiptap/extension-list-item/dist/index.es.js +6 -6
  200. package/vendor/@tiptap/extension-mention/dist/index.es.js +98 -63
  201. package/vendor/@tiptap/extension-ordered-list/dist/index.es.js +38 -25
  202. package/vendor/@tiptap/extension-paragraph/dist/index.es.js +8 -6
  203. package/vendor/@tiptap/extension-placeholder/dist/index.es.js +34 -27
  204. package/vendor/@tiptap/extension-text/dist/index.es.js +3 -3
  205. package/vendor/@tiptap/extension-underline/dist/index.es.js +16 -10
  206. package/vendor/@tiptap/suggestion/dist/index.es.js +174 -90
  207. package/vendor/@tiptap/vue-3/dist/index.es.js +287 -188
  208. package/vendor/@wangs-ui/core/components/p-BU8h34na.es.js +17 -14
  209. package/vendor/@wangs-ui/core/components/p-C5lMEBcj.es.js +69 -55
  210. package/vendor/@wangs-ui/core/components/p-CKYwZoTo.es.js +26 -22
  211. package/vendor/@wangs-ui/core/components/p-CsoK-EWG.es.js +147 -102
  212. package/vendor/@wangs-ui/core/components/p-DPHEi31J.es.js +102 -77
  213. package/vendor/@wangs-ui/core/components/p-DTTCzifR.es.js +1298 -551
  214. package/vendor/@wangs-ui/core/components/p-Duri5p90.es.js +60 -49
  215. package/vendor/@wangs-ui/core/components/wangs-button.es.js +19 -15
  216. package/vendor/@wangs-ui/core/components/wangs-icon.es.js +3 -3
  217. package/vendor/@wangs-ui/core/components/wangs-input-otp.es.js +3 -3
  218. package/vendor/@wangs-ui/core/components/wangs-tab-menu.es.js +3 -3
  219. package/vendor/@wangs-ui/core/dist/esm/index-DCkh3cGv.es.js +116 -102
  220. package/vendor/@wangs-ui/vue/dist/index.es.js +77 -77
  221. package/vendor/base64toblob/base64toblob.es.js +31 -15
  222. package/vendor/highlight.js/es/core.es.js +5 -5
  223. package/vendor/highlight.js/es/languages/javascript.es.js +237 -193
  224. package/vendor/highlight.js/es/languages/json.es.js +18 -15
  225. package/vendor/highlight.js/es/languages/typescript.es.js +288 -228
  226. package/vendor/highlight.js/es/languages/vbscript-html.es.js +2 -2
  227. package/vendor/highlight.js/lib/core.es.js +1144 -666
  228. package/vendor/linkifyjs/dist/linkify.es.es.js +858 -405
  229. package/vendor/lodash/_Symbol.es.js +11 -8
  230. package/vendor/lodash/_baseGetTag.es.js +19 -12
  231. package/vendor/lodash/_baseTrim.es.js +13 -10
  232. package/vendor/lodash/_freeGlobal.es.js +10 -8
  233. package/vendor/lodash/_getRawTag.es.js +28 -15
  234. package/vendor/lodash/_objectToString.es.js +12 -9
  235. package/vendor/lodash/_root.es.js +12 -8
  236. package/vendor/lodash/_trimmedEndIndex.es.js +14 -11
  237. package/vendor/lodash/debounce.es.js +92 -54
  238. package/vendor/lodash/isObject.es.js +11 -9
  239. package/vendor/lodash/isObjectLike.es.js +10 -8
  240. package/vendor/lodash/isSymbol.es.js +14 -11
  241. package/vendor/lodash/now.es.js +12 -9
  242. package/vendor/lodash/throttle.es.js +25 -17
  243. package/vendor/lodash/toNumber.es.js +33 -23
  244. package/vendor/lodash-es/_DataView.es.js +4 -4
  245. package/vendor/lodash-es/_Hash.es.js +17 -16
  246. package/vendor/lodash-es/_ListCache.es.js +17 -16
  247. package/vendor/lodash-es/_Map.es.js +4 -4
  248. package/vendor/lodash-es/_MapCache.es.js +17 -16
  249. package/vendor/lodash-es/_Promise.es.js +4 -4
  250. package/vendor/lodash-es/_Set.es.js +4 -4
  251. package/vendor/lodash-es/_SetCache.es.js +12 -10
  252. package/vendor/lodash-es/_Stack.es.js +15 -15
  253. package/vendor/lodash-es/_Symbol.es.js +3 -3
  254. package/vendor/lodash-es/_Uint8Array.es.js +3 -3
  255. package/vendor/lodash-es/_WeakMap.es.js +4 -4
  256. package/vendor/lodash-es/_arrayEach.es.js +9 -5
  257. package/vendor/lodash-es/_arrayFilter.es.js +9 -6
  258. package/vendor/lodash-es/_arrayLikeKeys.es.js +21 -17
  259. package/vendor/lodash-es/_arrayPush.es.js +7 -5
  260. package/vendor/lodash-es/_arraySome.es.js +9 -6
  261. package/vendor/lodash-es/_assignValue.es.js +10 -7
  262. package/vendor/lodash-es/_assocIndexOf.es.js +9 -6
  263. package/vendor/lodash-es/_baseAssignValue.es.js +13 -9
  264. package/vendor/lodash-es/_baseClone.es.js +67 -49
  265. package/vendor/lodash-es/_baseCreate.es.js +15 -11
  266. package/vendor/lodash-es/_baseGetAllKeys.es.js +6 -6
  267. package/vendor/lodash-es/_baseGetTag.es.js +11 -7
  268. package/vendor/lodash-es/_baseIsArguments.es.js +6 -6
  269. package/vendor/lodash-es/_baseIsEqual.es.js +11 -5
  270. package/vendor/lodash-es/_baseIsEqualDeep.es.js +39 -26
  271. package/vendor/lodash-es/_baseIsMap.es.js +6 -6
  272. package/vendor/lodash-es/_baseIsNative.es.js +18 -12
  273. package/vendor/lodash-es/_baseIsSet.es.js +6 -6
  274. package/vendor/lodash-es/_baseIsTypedArray.es.js +11 -9
  275. package/vendor/lodash-es/_baseKeys.es.js +16 -11
  276. package/vendor/lodash-es/_baseTimes.es.js +7 -5
  277. package/vendor/lodash-es/_baseTrim.es.js +5 -5
  278. package/vendor/lodash-es/_baseUnary.es.js +4 -4
  279. package/vendor/lodash-es/_cacheHas.es.js +3 -3
  280. package/vendor/lodash-es/_cloneArrayBuffer.es.js +6 -5
  281. package/vendor/lodash-es/_cloneBuffer.es.js +11 -6
  282. package/vendor/lodash-es/_cloneDataView.es.js +5 -5
  283. package/vendor/lodash-es/_cloneRegExp.es.js +6 -5
  284. package/vendor/lodash-es/_cloneSymbol.es.js +5 -5
  285. package/vendor/lodash-es/_cloneTypedArray.es.js +5 -5
  286. package/vendor/lodash-es/_coreJsData.es.js +3 -3
  287. package/vendor/lodash-es/_defineProperty.es.js +7 -6
  288. package/vendor/lodash-es/_equalArrays.es.js +38 -28
  289. package/vendor/lodash-es/_equalByTag.es.js +55 -41
  290. package/vendor/lodash-es/_equalObjects.es.js +42 -28
  291. package/vendor/lodash-es/_freeGlobal.es.js +2 -2
  292. package/vendor/lodash-es/_getAllKeys.es.js +6 -6
  293. package/vendor/lodash-es/_getMapData.es.js +5 -5
  294. package/vendor/lodash-es/_getNative.es.js +6 -6
  295. package/vendor/lodash-es/_getPrototype.es.js +3 -3
  296. package/vendor/lodash-es/_getRawTag.es.js +20 -10
  297. package/vendor/lodash-es/_getSymbols.es.js +15 -8
  298. package/vendor/lodash-es/_getTag.es.js +31 -25
  299. package/vendor/lodash-es/_getValue.es.js +3 -3
  300. package/vendor/lodash-es/_hashClear.es.js +5 -4
  301. package/vendor/lodash-es/_hashDelete.es.js +5 -4
  302. package/vendor/lodash-es/_hashGet.es.js +11 -9
  303. package/vendor/lodash-es/_hashHas.es.js +7 -6
  304. package/vendor/lodash-es/_hashSet.es.js +8 -6
  305. package/vendor/lodash-es/_initCloneArray.es.js +10 -5
  306. package/vendor/lodash-es/_initCloneByTag.es.js +39 -38
  307. package/vendor/lodash-es/_initCloneObject.es.js +6 -6
  308. package/vendor/lodash-es/_isIndex.es.js +7 -5
  309. package/vendor/lodash-es/_isKeyable.es.js +4 -4
  310. package/vendor/lodash-es/_isMasked.es.js +7 -7
  311. package/vendor/lodash-es/_isPrototype.es.js +5 -5
  312. package/vendor/lodash-es/_listCacheClear.es.js +4 -3
  313. package/vendor/lodash-es/_listCacheDelete.es.js +17 -9
  314. package/vendor/lodash-es/_listCacheGet.es.js +5 -5
  315. package/vendor/lodash-es/_listCacheHas.es.js +4 -4
  316. package/vendor/lodash-es/_listCacheSet.es.js +11 -5
  317. package/vendor/lodash-es/_mapCacheClear.es.js +10 -9
  318. package/vendor/lodash-es/_mapCacheDelete.es.js +6 -5
  319. package/vendor/lodash-es/_mapCacheGet.es.js +4 -4
  320. package/vendor/lodash-es/_mapCacheHas.es.js +4 -4
  321. package/vendor/lodash-es/_mapCacheSet.es.js +7 -5
  322. package/vendor/lodash-es/_mapToArray.es.js +7 -6
  323. package/vendor/lodash-es/_nativeCreate.es.js +3 -3
  324. package/vendor/lodash-es/_nativeKeys.es.js +3 -3
  325. package/vendor/lodash-es/_nodeUtil.es.js +13 -6
  326. package/vendor/lodash-es/_objectToString.es.js +5 -4
  327. package/vendor/lodash-es/_overArg.es.js +4 -4
  328. package/vendor/lodash-es/_root.es.js +4 -3
  329. package/vendor/lodash-es/_setCacheAdd.es.js +5 -4
  330. package/vendor/lodash-es/_setCacheHas.es.js +3 -3
  331. package/vendor/lodash-es/_setToArray.es.js +7 -6
  332. package/vendor/lodash-es/_stackClear.es.js +5 -4
  333. package/vendor/lodash-es/_stackDelete.es.js +5 -4
  334. package/vendor/lodash-es/_stackGet.es.js +3 -3
  335. package/vendor/lodash-es/_stackHas.es.js +3 -3
  336. package/vendor/lodash-es/_stackSet.es.js +18 -13
  337. package/vendor/lodash-es/_toSource.es.js +9 -8
  338. package/vendor/lodash-es/_trimmedEndIndex.es.js +7 -6
  339. package/vendor/lodash-es/cloneDeep.es.js +5 -5
  340. package/vendor/lodash-es/debounce.es.js +84 -49
  341. package/vendor/lodash-es/eq.es.js +3 -3
  342. package/vendor/lodash-es/isArguments.es.js +9 -6
  343. package/vendor/lodash-es/isArray.es.js +2 -2
  344. package/vendor/lodash-es/isArrayLike.es.js +5 -5
  345. package/vendor/lodash-es/isBuffer.es.js +9 -4
  346. package/vendor/lodash-es/isEqual.es.js +4 -4
  347. package/vendor/lodash-es/isFunction.es.js +10 -9
  348. package/vendor/lodash-es/isLength.es.js +4 -4
  349. package/vendor/lodash-es/isMap.es.js +6 -5
  350. package/vendor/lodash-es/isObject.es.js +4 -4
  351. package/vendor/lodash-es/isObjectLike.es.js +3 -3
  352. package/vendor/lodash-es/isSet.es.js +6 -5
  353. package/vendor/lodash-es/isSymbol.es.js +6 -6
  354. package/vendor/lodash-es/isTypedArray.es.js +6 -5
  355. package/vendor/lodash-es/keys.es.js +6 -6
  356. package/vendor/lodash-es/now.es.js +4 -4
  357. package/vendor/lodash-es/stubArray.es.js +2 -2
  358. package/vendor/lodash-es/stubFalse.es.js +3 -3
  359. package/vendor/lodash-es/toNumber.es.js +25 -18
  360. package/vendor/lodash-es/toString.es.js +2 -2
  361. package/vendor/lodash-es/uniqueId.es.js +6 -6
  362. package/vendor/orderedmap/dist/index.es.js +65 -49
  363. package/vendor/primevue/api/api.esm.es.js +214 -121
  364. package/vendor/primevue/avatar/avatar.esm.es.js +44 -41
  365. package/vendor/primevue/avatar/style/avatarstyle.esm.es.js +12 -11
  366. package/vendor/primevue/avatargroup/avatargroup.esm.es.js +17 -16
  367. package/vendor/primevue/avatargroup/style/avatargroupstyle.esm.es.js +6 -5
  368. package/vendor/primevue/badge/badge.esm.es.js +21 -20
  369. package/vendor/primevue/badge/style/badgestyle.esm.es.js +19 -18
  370. package/vendor/primevue/base/style/basestyle.esm.es.js +88 -99
  371. package/vendor/primevue/basecomponent/basecomponent.esm.es.js +327 -261
  372. package/vendor/primevue/basedirective/basedirective.esm.es.js +257 -186
  373. package/vendor/primevue/baseicon/baseicon.esm.es.js +55 -49
  374. package/vendor/primevue/baseicon/style/baseiconstyle.esm.es.js +5 -35
  375. package/vendor/primevue/button/button.esm.es.js +76 -72
  376. package/vendor/primevue/button/style/buttonstyle.esm.es.js +46 -39
  377. package/vendor/primevue/card/card.esm.es.js +30 -29
  378. package/vendor/primevue/card/style/cardstyle.esm.es.js +6 -5
  379. package/vendor/primevue/checkbox/checkbox.esm.es.js +109 -101
  380. package/vendor/primevue/checkbox/style/checkboxstyle.esm.es.js +12 -11
  381. package/vendor/primevue/config/config.esm.es.js +76 -58
  382. package/vendor/primevue/dialog/dialog.esm.es.js +421 -281
  383. package/vendor/primevue/dialog/style/dialogstyle.esm.es.js +26 -22
  384. package/vendor/primevue/dropdown/dropdown.esm.es.js +956 -742
  385. package/vendor/primevue/dropdown/style/dropdownstyle.esm.es.js +33 -31
  386. package/vendor/primevue/fileupload/fileupload.esm.es.js +559 -450
  387. package/vendor/primevue/fileupload/style/fileuploadstyle.esm.es.js +14 -13
  388. package/vendor/primevue/focustrap/focustrap.esm.es.js +128 -90
  389. package/vendor/primevue/focustrap/style/focustrapstyle.esm.es.js +2 -2
  390. package/vendor/primevue/icons/angledoubleleft/index.esm.es.js +13 -11
  391. package/vendor/primevue/icons/angledoubleright/index.esm.es.js +13 -11
  392. package/vendor/primevue/icons/angledown/index.esm.es.js +13 -11
  393. package/vendor/primevue/icons/angleleft/index.esm.es.js +13 -11
  394. package/vendor/primevue/icons/angleright/index.esm.es.js +13 -11
  395. package/vendor/primevue/icons/angleup/index.esm.es.js +13 -11
  396. package/vendor/primevue/icons/blank/index.esm.es.js +13 -11
  397. package/vendor/primevue/icons/check/index.esm.es.js +13 -11
  398. package/vendor/primevue/icons/chevrondown/index.esm.es.js +13 -11
  399. package/vendor/primevue/icons/exclamationtriangle/index.esm.es.js +17 -13
  400. package/vendor/primevue/icons/eye/index.esm.es.js +13 -11
  401. package/vendor/primevue/icons/eyeslash/index.esm.es.js +13 -11
  402. package/vendor/primevue/icons/infocircle/index.esm.es.js +13 -11
  403. package/vendor/primevue/icons/plus/index.esm.es.js +13 -11
  404. package/vendor/primevue/icons/refresh/index.esm.es.js +13 -11
  405. package/vendor/primevue/icons/search/index.esm.es.js +13 -11
  406. package/vendor/primevue/icons/searchminus/index.esm.es.js +13 -11
  407. package/vendor/primevue/icons/searchplus/index.esm.es.js +13 -11
  408. package/vendor/primevue/icons/spinner/index.esm.es.js +13 -11
  409. package/vendor/primevue/icons/times/index.esm.es.js +13 -11
  410. package/vendor/primevue/icons/timescircle/index.esm.es.js +13 -11
  411. package/vendor/primevue/icons/undo/index.esm.es.js +13 -11
  412. package/vendor/primevue/icons/upload/index.esm.es.js +13 -11
  413. package/vendor/primevue/icons/windowmaximize/index.esm.es.js +13 -11
  414. package/vendor/primevue/icons/windowminimize/index.esm.es.js +13 -11
  415. package/vendor/primevue/image/image.esm.es.js +280 -235
  416. package/vendor/primevue/image/style/imagestyle.esm.es.js +18 -17
  417. package/vendor/primevue/inputgroup/inputgroup.esm.es.js +17 -16
  418. package/vendor/primevue/inputgroup/style/inputgroupstyle.esm.es.js +6 -5
  419. package/vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js +17 -16
  420. package/vendor/primevue/inputgroupaddon/style/inputgroupaddonstyle.esm.es.js +6 -5
  421. package/vendor/primevue/inputnumber/inputnumber.esm.es.js +834 -566
  422. package/vendor/primevue/inputnumber/style/inputnumberstyle.esm.es.js +23 -22
  423. package/vendor/primevue/inputtext/inputtext.esm.es.js +32 -30
  424. package/vendor/primevue/inputtext/style/inputtextstyle.esm.es.js +13 -12
  425. package/vendor/primevue/menu/menu.esm.es.js +402 -304
  426. package/vendor/primevue/menu/style/menustyle.esm.es.js +14 -13
  427. package/vendor/primevue/message/message.esm.es.js +126 -112
  428. package/vendor/primevue/message/style/messagestyle.esm.es.js +9 -8
  429. package/vendor/primevue/multiselect/multiselect.esm.es.js +1083 -835
  430. package/vendor/primevue/multiselect/style/multiselectstyle.esm.es.js +38 -36
  431. package/vendor/primevue/overlayeventbus/overlayeventbus.esm.es.js +3 -3
  432. package/vendor/primevue/overlaypanel/overlaypanel.esm.es.js +275 -169
  433. package/vendor/primevue/overlaypanel/style/overlaypanelstyle.esm.es.js +9 -8
  434. package/vendor/primevue/paginator/paginator.esm.es.js +513 -469
  435. package/vendor/primevue/paginator/style/paginatorstyle.esm.es.js +50 -43
  436. package/vendor/primevue/password/password.esm.es.js +306 -233
  437. package/vendor/primevue/password/style/passwordstyle.esm.es.js +26 -24
  438. package/vendor/primevue/portal/portal.esm.es.js +17 -17
  439. package/vendor/primevue/progressbar/progressbar.esm.es.js +37 -35
  440. package/vendor/primevue/progressbar/style/progressbarstyle.esm.es.js +10 -9
  441. package/vendor/primevue/ripple/ripple.esm.es.js +90 -62
  442. package/vendor/primevue/ripple/style/ripplestyle.esm.es.js +6 -5
  443. package/vendor/primevue/selectbutton/selectbutton.esm.es.js +213 -167
  444. package/vendor/primevue/selectbutton/style/selectbuttonstyle.esm.es.js +14 -13
  445. package/vendor/primevue/skeleton/skeleton.esm.es.js +28 -26
  446. package/vendor/primevue/skeleton/style/skeletonstyle.esm.es.js +13 -11
  447. package/vendor/primevue/textarea/style/textareastyle.esm.es.js +12 -11
  448. package/vendor/primevue/textarea/textarea.esm.es.js +49 -33
  449. package/vendor/primevue/timeline/style/timelinestyle.esm.es.js +9 -8
  450. package/vendor/primevue/timeline/timeline.esm.es.js +53 -52
  451. package/vendor/primevue/toast/style/toaststyle.esm.es.js +54 -46
  452. package/vendor/primevue/toast/toast.esm.es.js +309 -260
  453. package/vendor/primevue/toasteventbus/toasteventbus.esm.es.js +3 -3
  454. package/vendor/primevue/toastservice/toastservice.esm.es.js +16 -15
  455. package/vendor/primevue/tooltip/style/tooltipstyle.esm.es.js +6 -5
  456. package/vendor/primevue/tooltip/tooltip.esm.es.js +383 -186
  457. package/vendor/primevue/usestyle/usestyle.esm.es.js +94 -64
  458. package/vendor/primevue/usetoast/usetoast.esm.es.js +9 -8
  459. package/vendor/primevue/utils/utils.esm.es.js +1078 -772
  460. package/vendor/primevue/virtualscroller/style/virtualscrollerstyle.esm.es.js +5 -67
  461. package/vendor/primevue/virtualscroller/virtualscroller.esm.es.js +655 -428
  462. package/vendor/prosemirror-commands/dist/index.es.js +454 -316
  463. package/vendor/prosemirror-history/dist/index.es.js +286 -178
  464. package/vendor/prosemirror-keymap/dist/index.es.js +68 -48
  465. package/vendor/prosemirror-model/dist/index.es.js +1905 -1436
  466. package/vendor/prosemirror-schema-list/dist/index.es.js +115 -73
  467. package/vendor/prosemirror-state/dist/index.es.js +467 -353
  468. package/vendor/prosemirror-transform/dist/index.es.js +1146 -829
  469. package/vendor/prosemirror-view/dist/index.es.js +4127 -2719
  470. package/vendor/rope-sequence/dist/index.es.js +165 -82
  471. package/vendor/simplebar-core/dist/index.es.js +670 -242
  472. package/vendor/simplebar-vue/dist/simplebar-vue.esm.es.js +73 -60
  473. package/vendor/single-spa/lib/es2015/esm/single-spa.min.es.js +511 -510
  474. package/vendor/tippy.js/dist/tippy.esm.es.js +971 -525
  475. package/vendor/vee-validate/dist/vee-validate.esm.es.js +1830 -1097
  476. package/vendor/vue-advanced-cropper/dist/index.esm-bundler.es.js +740 -738
  477. package/vendor/w3c-keyname/index.es.js +25 -13
  478. package/wangsvue.es.js +167 -208
  479. package/wangsvue.esm.browser.js +49417 -48026
  480. package/wangsvue.system.js +67600 -234
  481. package/api/index.es.js +0 -149
  482. package/apiitem/index.es.js +0 -611
  483. package/assignmember/index.es.js +0 -434
  484. package/attachment/index.es.js +0 -118
  485. package/attachmentchangelog/index.es.js +0 -79
  486. package/attachmentitem/index.es.js +0 -231
  487. package/attachmentthumbnail/index.es.js +0 -83
  488. package/changelog/index.d.ts +0 -164
  489. package/changelog/index.es.js +0 -85
  490. package/changelogfilter/index.es.js +0 -113
  491. package/changelogpage/index.d.ts +0 -184
  492. package/changelogpage/index.es.js +0 -176
  493. package/checklist/index.es.js +0 -571
  494. package/checklistchangelog/index.es.js +0 -85
  495. package/comment/index.d.ts +0 -187
  496. package/comment/index.es.js +0 -267
  497. package/commentblock/index.es.js +0 -337
  498. package/confirmdeploy/index.es.js +0 -64
  499. package/dependencycol/index.es.js +0 -32
  500. package/description/index.es.js +0 -135
  501. package/descriptiontab/index.es.js +0 -30
  502. package/detailmember/index.d.ts +0 -77
  503. package/detailmember/index.es.js +0 -32
  504. package/detailmemberadmin/index.es.js +0 -210
  505. package/detailmemberleader/index.es.js +0 -164
  506. package/detailmemberlog/index.es.js +0 -117
  507. package/detailsprint/index.d.ts +0 -86
  508. package/detailsprint/index.es.js +0 -414
  509. package/dialogaddattachment/index.es.js +0 -273
  510. package/dialogaddchecklist/index.es.js +0 -120
  511. package/dialogaddeditapi/index.es.js +0 -87
  512. package/dialogaddpbi/index.es.js +0 -197
  513. package/dialogadjustmenttask/index.es.js +0 -484
  514. package/dialogadjustmenttaskheader/index.es.js +0 -193
  515. package/dialogapichangelog/index.es.js +0 -83
  516. package/dialogassignmember/index.es.js +0 -171
  517. package/dialogconfirmapproval/index.es.js +0 -54
  518. package/dialogconfirmchecklist/index.es.js +0 -189
  519. package/dialogconfirmdeletetask/index.es.js +0 -70
  520. package/dialogconfirmdeletetaskpermanently/index.es.js +0 -50
  521. package/dialogconfirmedit/index.es.js +0 -50
  522. package/dialogconfirmfinishtask/index.es.js +0 -50
  523. package/dialogconfirmrestoretask/index.es.js +0 -46
  524. package/dialogconfirmsprint/index.es.js +0 -42
  525. package/dialogcopyapi/index.es.js +0 -130
  526. package/dialogcustomdependency/index.es.js +0 -55
  527. package/dialogdetailchecklisttemplate/index.es.js +0 -214
  528. package/dialogdetailcomponent/index.es.js +0 -121
  529. package/dialogdetailpbi/index.es.js +0 -192
  530. package/dialogfinishreview/index.es.js +0 -126
  531. package/dialogimprovementtask/index.es.js +0 -191
  532. package/dialogmemberadmin/index.es.js +0 -93
  533. package/dialogpreparepbi/index.es.js +0 -93
  534. package/dialogpriorityvalue/index.es.js +0 -85
  535. package/dialogreportbug/index.es.js +0 -207
  536. package/dialogreviewleader/index.es.js +0 -280
  537. package/dialogsavechecklisttemplate/index.es.js +0 -127
  538. package/dialogselectproject/index.es.js +0 -69
  539. package/dialogsetduration/index.es.js +0 -109
  540. package/dialogsettasklink/index.es.js +0 -153
  541. package/dialogtestapi/index.es.js +0 -389
  542. package/eventlogtab/index.es.js +0 -50
  543. package/infotasktab/index.es.js +0 -186
  544. package/inputadditional/index.es.js +0 -62
  545. package/inputinitialname/index.d.ts +0 -118
  546. package/inputinitialname/index.es.js +0 -95
  547. package/inputrepositoryname/index.d.ts +0 -86
  548. package/inputrepositoryname/index.es.js +0 -41
  549. package/isrequiredtext/index.es.js +0 -16
  550. package/legend/index.es.js +0 -727
  551. package/legendlist/index.es.js +0 -33
  552. package/loading-page-BrQattYE.js +0 -1
  553. package/loading-page-CgfbWppy.js +0 -1
  554. package/loading-page-CoC9UhfC.js +0 -4
  555. package/loading-page-CoXtqoc9.js +0 -4
  556. package/loading-page-DbLuqCHa.js +0 -1
  557. package/loading-page-f8D03l3G.js +0 -4
  558. package/loading-plane-CgfbWppy.js +0 -1
  559. package/loading-plane-CoXtqoc9.js +0 -4
  560. package/loading-table-Bdr9ZhtP.js +0 -1
  561. package/loading-table-ByUoWqUo.js +0 -4
  562. package/loading-table-BygEMzFM.js +0 -4
  563. package/loading-table-BzrSQlA0.js +0 -1
  564. package/loading-table-D9bw9OcI.js +0 -4
  565. package/loading-table-chOgXi94.js +0 -1
  566. package/no-data-CTKux8RI.js +0 -4
  567. package/no-data-Cgze_Rvp.js +0 -1
  568. package/no-data-DLHO1L_u.js +0 -4
  569. package/no-data-Dep79CBh.js +0 -1
  570. package/no-data-g0dJCy2p.js +0 -4
  571. package/no-data-y1X5WtcQ.js +0 -1
  572. package/notificationitem/index.d.ts +0 -107
  573. package/notificationitem/index.es.js +0 -333
  574. package/reviewitem/index.es.js +0 -65
  575. package/reviewtab/index.es.js +0 -44
  576. package/services/calendar.service.es.js +0 -32
  577. package/sonarqubesummary/index.es.js +0 -234
  578. package/sprintsummary/index.es.js +0 -73
  579. package/summaryaccordion/index.d.ts +0 -121
  580. package/summaryaccordion/index.es.js +0 -365
  581. package/taskdependency/index.es.js +0 -686
  582. package/taskdetail/index.d.ts +0 -82
  583. package/taskdetail/index.es.js +0 -491
  584. package/taskdetailpbi/index.d.ts +0 -35
  585. package/taskdetailpbi/index.es.js +0 -172
  586. package/taskdetailunassignedpbi/index.es.js +0 -261
  587. package/tasklink/index.es.js +0 -257
  588. package/tasklinkchangelog/index.es.js +0 -93
  589. package/tasklist/index.es.js +0 -92
  590. package/taskmore/index.es.js +0 -52
  591. package/taskstatusbadge/index.es.js +0 -18
  592. package/tasktable/index.d.ts +0 -87
  593. package/tasktable/index.es.js +0 -832
  594. package/ticket/index.es.js +0 -151
  595. package/tooltipspan/index.es.js +0 -30
  596. package/utils/updateSprintStatus.util.es.js +0 -17
  597. package/valueformdatainput/index.es.js +0 -70
  598. package/workcalendar/index.es.js +0 -351
@@ -1,88 +1,114 @@
1
- var re, De;
2
- function Ft() {
3
- if (De) return re;
4
- De = 1;
5
- function ce(e) {
6
- return e instanceof Map ? e.clear = e.delete = e.set = function() {
7
- throw new Error("map is read-only");
8
- } : e instanceof Set && (e.add = e.clear = e.delete = function() {
9
- throw new Error("set is read-only");
10
- }), Object.freeze(e), Object.getOwnPropertyNames(e).forEach((t) => {
11
- const i = e[t], u = typeof i;
12
- (u === "object" || u === "function") && !Object.isFrozen(i) && ce(i);
13
- }), e;
1
+ var core;
2
+ var hasRequiredCore;
3
+ function requireCore() {
4
+ if (hasRequiredCore) return core;
5
+ hasRequiredCore = 1;
6
+ function deepFreeze(obj) {
7
+ if (obj instanceof Map) {
8
+ obj.clear = obj.delete = obj.set = function() {
9
+ throw new Error("map is read-only");
10
+ };
11
+ } else if (obj instanceof Set) {
12
+ obj.add = obj.clear = obj.delete = function() {
13
+ throw new Error("set is read-only");
14
+ };
15
+ }
16
+ Object.freeze(obj);
17
+ Object.getOwnPropertyNames(obj).forEach((name) => {
18
+ const prop = obj[name];
19
+ const type = typeof prop;
20
+ if ((type === "object" || type === "function") && !Object.isFrozen(prop)) {
21
+ deepFreeze(prop);
22
+ }
23
+ });
24
+ return obj;
14
25
  }
15
- class oe {
26
+ class Response {
16
27
  /**
17
28
  * @param {CompiledMode} mode
18
29
  */
19
- constructor(t) {
20
- t.data === void 0 && (t.data = {}), this.data = t.data, this.isMatchIgnored = !1;
30
+ constructor(mode) {
31
+ if (mode.data === void 0) mode.data = {};
32
+ this.data = mode.data;
33
+ this.isMatchIgnored = false;
21
34
  }
22
35
  ignoreMatch() {
23
- this.isMatchIgnored = !0;
36
+ this.isMatchIgnored = true;
24
37
  }
25
38
  }
26
- function ae(e) {
27
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
39
+ function escapeHTML(value) {
40
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
28
41
  }
29
- function T(e, ...t) {
30
- const i = /* @__PURE__ */ Object.create(null);
31
- for (const u in e)
32
- i[u] = e[u];
33
- return t.forEach(function(u) {
34
- for (const b in u)
35
- i[b] = u[b];
36
- }), /** @type {T} */
37
- i;
42
+ function inherit$1(original, ...objects) {
43
+ const result = /* @__PURE__ */ Object.create(null);
44
+ for (const key in original) {
45
+ result[key] = original[key];
46
+ }
47
+ objects.forEach(function(obj) {
48
+ for (const key in obj) {
49
+ result[key] = obj[key];
50
+ }
51
+ });
52
+ return (
53
+ /** @type {T} */
54
+ result
55
+ );
38
56
  }
39
- const Ce = "</span>", le = (e) => !!e.scope, Le = (e, { prefix: t }) => {
40
- if (e.startsWith("language:"))
41
- return e.replace("language:", "language-");
42
- if (e.includes(".")) {
43
- const i = e.split(".");
57
+ const SPAN_CLOSE = "</span>";
58
+ const emitsWrappingTags = (node) => {
59
+ return !!node.scope;
60
+ };
61
+ const scopeToCSSClass = (name, { prefix }) => {
62
+ if (name.startsWith("language:")) {
63
+ return name.replace("language:", "language-");
64
+ }
65
+ if (name.includes(".")) {
66
+ const pieces = name.split(".");
44
67
  return [
45
- `${t}${i.shift()}`,
46
- ...i.map((u, b) => `${u}${"_".repeat(b + 1)}`)
68
+ `${prefix}${pieces.shift()}`,
69
+ ...pieces.map((x, i) => `${x}${"_".repeat(i + 1)}`)
47
70
  ].join(" ");
48
71
  }
49
- return `${t}${e}`;
72
+ return `${prefix}${name}`;
50
73
  };
51
- class He {
74
+ class HTMLRenderer {
52
75
  /**
53
76
  * Creates a new HTMLRenderer
54
77
  *
55
78
  * @param {Tree} parseTree - the parse tree (must support `walk` API)
56
79
  * @param {{classPrefix: string}} options
57
80
  */
58
- constructor(t, i) {
59
- this.buffer = "", this.classPrefix = i.classPrefix, t.walk(this);
81
+ constructor(parseTree, options) {
82
+ this.buffer = "";
83
+ this.classPrefix = options.classPrefix;
84
+ parseTree.walk(this);
60
85
  }
61
86
  /**
62
87
  * Adds texts to the output stream
63
88
  *
64
89
  * @param {string} text */
65
- addText(t) {
66
- this.buffer += ae(t);
90
+ addText(text) {
91
+ this.buffer += escapeHTML(text);
67
92
  }
68
93
  /**
69
94
  * Adds a node open to the output stream (if needed)
70
95
  *
71
96
  * @param {Node} node */
72
- openNode(t) {
73
- if (!le(t)) return;
74
- const i = Le(
75
- t.scope,
97
+ openNode(node) {
98
+ if (!emitsWrappingTags(node)) return;
99
+ const className = scopeToCSSClass(
100
+ node.scope,
76
101
  { prefix: this.classPrefix }
77
102
  );
78
- this.span(i);
103
+ this.span(className);
79
104
  }
80
105
  /**
81
106
  * Adds a node close to the output stream (if needed)
82
107
  *
83
108
  * @param {Node} node */
84
- closeNode(t) {
85
- le(t) && (this.buffer += Ce);
109
+ closeNode(node) {
110
+ if (!emitsWrappingTags(node)) return;
111
+ this.buffer += SPAN_CLOSE;
86
112
  }
87
113
  /**
88
114
  * returns the accumulated buffer
@@ -95,17 +121,19 @@ function Ft() {
95
121
  * Builds a span element
96
122
  *
97
123
  * @param {string} className */
98
- span(t) {
99
- this.buffer += `<span class="${t}">`;
124
+ span(className) {
125
+ this.buffer += `<span class="${className}">`;
100
126
  }
101
127
  }
102
- const ue = (e = {}) => {
103
- const t = { children: [] };
104
- return Object.assign(t, e), t;
128
+ const newNode = (opts = {}) => {
129
+ const result = { children: [] };
130
+ Object.assign(result, opts);
131
+ return result;
105
132
  };
106
- class Z {
133
+ class TokenTree {
107
134
  constructor() {
108
- this.rootNode = ue(), this.stack = [this.rootNode];
135
+ this.rootNode = newNode();
136
+ this.stack = [this.rootNode];
109
137
  }
110
138
  get top() {
111
139
  return this.stack[this.stack.length - 1];
@@ -114,20 +142,23 @@ function Ft() {
114
142
  return this.rootNode;
115
143
  }
116
144
  /** @param {Node} node */
117
- add(t) {
118
- this.top.children.push(t);
145
+ add(node) {
146
+ this.top.children.push(node);
119
147
  }
120
148
  /** @param {string} scope */
121
- openNode(t) {
122
- const i = ue({ scope: t });
123
- this.add(i), this.stack.push(i);
149
+ openNode(scope) {
150
+ const node = newNode({ scope });
151
+ this.add(node);
152
+ this.stack.push(node);
124
153
  }
125
154
  closeNode() {
126
- if (this.stack.length > 1)
155
+ if (this.stack.length > 1) {
127
156
  return this.stack.pop();
157
+ }
158
+ return void 0;
128
159
  }
129
160
  closeAllNodes() {
130
- for (; this.closeNode(); ) ;
161
+ while (this.closeNode()) ;
131
162
  }
132
163
  toJSON() {
133
164
  return JSON.stringify(this.rootNode, null, 4);
@@ -136,41 +167,58 @@ function Ft() {
136
167
  * @typedef { import("./html_renderer").Renderer } Renderer
137
168
  * @param {Renderer} builder
138
169
  */
139
- walk(t) {
140
- return this.constructor._walk(t, this.rootNode);
170
+ walk(builder) {
171
+ return this.constructor._walk(builder, this.rootNode);
141
172
  }
142
173
  /**
143
174
  * @param {Renderer} builder
144
175
  * @param {Node} node
145
176
  */
146
- static _walk(t, i) {
147
- return typeof i == "string" ? t.addText(i) : i.children && (t.openNode(i), i.children.forEach((u) => this._walk(t, u)), t.closeNode(i)), t;
177
+ static _walk(builder, node) {
178
+ if (typeof node === "string") {
179
+ builder.addText(node);
180
+ } else if (node.children) {
181
+ builder.openNode(node);
182
+ node.children.forEach((child) => this._walk(builder, child));
183
+ builder.closeNode(node);
184
+ }
185
+ return builder;
148
186
  }
149
187
  /**
150
188
  * @param {Node} node
151
189
  */
152
- static _collapse(t) {
153
- typeof t != "string" && t.children && (t.children.every((i) => typeof i == "string") ? t.children = [t.children.join("")] : t.children.forEach((i) => {
154
- Z._collapse(i);
155
- }));
190
+ static _collapse(node) {
191
+ if (typeof node === "string") return;
192
+ if (!node.children) return;
193
+ if (node.children.every((el) => typeof el === "string")) {
194
+ node.children = [node.children.join("")];
195
+ } else {
196
+ node.children.forEach((child) => {
197
+ TokenTree._collapse(child);
198
+ });
199
+ }
156
200
  }
157
201
  }
158
- class Pe extends Z {
202
+ class TokenTreeEmitter extends TokenTree {
159
203
  /**
160
204
  * @param {*} options
161
205
  */
162
- constructor(t) {
163
- super(), this.options = t;
206
+ constructor(options) {
207
+ super();
208
+ this.options = options;
164
209
  }
165
210
  /**
166
211
  * @param {string} text
167
212
  */
168
- addText(t) {
169
- t !== "" && this.add(t);
213
+ addText(text) {
214
+ if (text === "") {
215
+ return;
216
+ }
217
+ this.add(text);
170
218
  }
171
219
  /** @param {string} scope */
172
- startScope(t) {
173
- this.openNode(t);
220
+ startScope(scope) {
221
+ this.openNode(scope);
174
222
  }
175
223
  endScope() {
176
224
  this.closeNode();
@@ -179,118 +227,156 @@ function Ft() {
179
227
  * @param {Emitter & {root: DataNode}} emitter
180
228
  * @param {string} name
181
229
  */
182
- __addSublanguage(t, i) {
183
- const u = t.root;
184
- i && (u.scope = `language:${i}`), this.add(u);
230
+ __addSublanguage(emitter, name) {
231
+ const node = emitter.root;
232
+ if (name) node.scope = `language:${name}`;
233
+ this.add(node);
185
234
  }
186
235
  toHTML() {
187
- return new He(this, this.options).value();
236
+ const renderer = new HTMLRenderer(this, this.options);
237
+ return renderer.value();
188
238
  }
189
239
  finalize() {
190
- return this.closeAllNodes(), !0;
240
+ this.closeAllNodes();
241
+ return true;
191
242
  }
192
243
  }
193
- function P(e) {
194
- return e ? typeof e == "string" ? e : e.source : null;
244
+ function source(re) {
245
+ if (!re) return null;
246
+ if (typeof re === "string") return re;
247
+ return re.source;
195
248
  }
196
- function fe(e) {
197
- return v("(?=", e, ")");
249
+ function lookahead(re) {
250
+ return concat("(?=", re, ")");
198
251
  }
199
- function je(e) {
200
- return v("(?:", e, ")*");
252
+ function anyNumberOfTimes(re) {
253
+ return concat("(?:", re, ")*");
201
254
  }
202
- function Ue(e) {
203
- return v("(?:", e, ")?");
255
+ function optional(re) {
256
+ return concat("(?:", re, ")?");
204
257
  }
205
- function v(...e) {
206
- return e.map((i) => P(i)).join("");
258
+ function concat(...args) {
259
+ const joined = args.map((x) => source(x)).join("");
260
+ return joined;
207
261
  }
208
- function $e(e) {
209
- const t = e[e.length - 1];
210
- return typeof t == "object" && t.constructor === Object ? (e.splice(e.length - 1, 1), t) : {};
262
+ function stripOptionsFromArgs(args) {
263
+ const opts = args[args.length - 1];
264
+ if (typeof opts === "object" && opts.constructor === Object) {
265
+ args.splice(args.length - 1, 1);
266
+ return opts;
267
+ } else {
268
+ return {};
269
+ }
211
270
  }
212
- function q(...e) {
213
- return "(" + ($e(e).capture ? "" : "?:") + e.map((u) => P(u)).join("|") + ")";
271
+ function either(...args) {
272
+ const opts = stripOptionsFromArgs(args);
273
+ const joined = "(" + (opts.capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")";
274
+ return joined;
214
275
  }
215
- function ge(e) {
216
- return new RegExp(e.toString() + "|").exec("").length - 1;
276
+ function countMatchGroups(re) {
277
+ return new RegExp(re.toString() + "|").exec("").length - 1;
217
278
  }
218
- function Ge(e, t) {
219
- const i = e && e.exec(t);
220
- return i && i.index === 0;
279
+ function startsWith(re, lexeme) {
280
+ const match = re && re.exec(lexeme);
281
+ return match && match.index === 0;
221
282
  }
222
- const We = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
223
- function J(e, { joinWith: t }) {
224
- let i = 0;
225
- return e.map((u) => {
226
- i += 1;
227
- const b = i;
228
- let _ = P(u), c = "";
229
- for (; _.length > 0; ) {
230
- const r = We.exec(_);
231
- if (!r) {
232
- c += _;
283
+ const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
284
+ function _rewriteBackreferences(regexps, { joinWith }) {
285
+ let numCaptures = 0;
286
+ return regexps.map((regex) => {
287
+ numCaptures += 1;
288
+ const offset = numCaptures;
289
+ let re = source(regex);
290
+ let out = "";
291
+ while (re.length > 0) {
292
+ const match = BACKREF_RE.exec(re);
293
+ if (!match) {
294
+ out += re;
233
295
  break;
234
296
  }
235
- c += _.substring(0, r.index), _ = _.substring(r.index + r[0].length), r[0][0] === "\\" && r[1] ? c += "\\" + String(Number(r[1]) + b) : (c += r[0], r[0] === "(" && i++);
297
+ out += re.substring(0, match.index);
298
+ re = re.substring(match.index + match[0].length);
299
+ if (match[0][0] === "\\" && match[1]) {
300
+ out += "\\" + String(Number(match[1]) + offset);
301
+ } else {
302
+ out += match[0];
303
+ if (match[0] === "(") {
304
+ numCaptures++;
305
+ }
306
+ }
236
307
  }
237
- return c;
238
- }).map((u) => `(${u})`).join(t);
308
+ return out;
309
+ }).map((re) => `(${re})`).join(joinWith);
239
310
  }
240
- const Ke = /\b\B/, he = "[a-zA-Z]\\w*", V = "[a-zA-Z_]\\w*", de = "\\b\\d+(\\.\\d+)?", pe = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", Ee = "\\b(0b[01]+)", ze = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", Fe = (e = {}) => {
241
- const t = /^#![ ]*\//;
242
- return e.binary && (e.begin = v(
243
- t,
244
- /.*\b/,
245
- e.binary,
246
- /\b.*/
247
- )), T({
311
+ const MATCH_NOTHING_RE = /\b\B/;
312
+ const IDENT_RE = "[a-zA-Z]\\w*";
313
+ const UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*";
314
+ const NUMBER_RE = "\\b\\d+(\\.\\d+)?";
315
+ const C_NUMBER_RE = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";
316
+ const BINARY_NUMBER_RE = "\\b(0b[01]+)";
317
+ const RE_STARTERS_RE = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";
318
+ const SHEBANG = (opts = {}) => {
319
+ const beginShebang = /^#![ ]*\//;
320
+ if (opts.binary) {
321
+ opts.begin = concat(
322
+ beginShebang,
323
+ /.*\b/,
324
+ opts.binary,
325
+ /\b.*/
326
+ );
327
+ }
328
+ return inherit$1({
248
329
  scope: "meta",
249
- begin: t,
330
+ begin: beginShebang,
250
331
  end: /$/,
251
332
  relevance: 0,
252
333
  /** @type {ModeCallback} */
253
- "on:begin": (i, u) => {
254
- i.index !== 0 && u.ignoreMatch();
334
+ "on:begin": (m, resp) => {
335
+ if (m.index !== 0) resp.ignoreMatch();
255
336
  }
256
- }, e);
257
- }, j = {
337
+ }, opts);
338
+ };
339
+ const BACKSLASH_ESCAPE = {
258
340
  begin: "\\\\[\\s\\S]",
259
341
  relevance: 0
260
- }, Xe = {
342
+ };
343
+ const APOS_STRING_MODE = {
261
344
  scope: "string",
262
345
  begin: "'",
263
346
  end: "'",
264
347
  illegal: "\\n",
265
- contains: [j]
266
- }, Ye = {
348
+ contains: [BACKSLASH_ESCAPE]
349
+ };
350
+ const QUOTE_STRING_MODE = {
267
351
  scope: "string",
268
352
  begin: '"',
269
353
  end: '"',
270
354
  illegal: "\\n",
271
- contains: [j]
272
- }, Ze = {
355
+ contains: [BACKSLASH_ESCAPE]
356
+ };
357
+ const PHRASAL_WORDS_MODE = {
273
358
  begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
274
- }, $ = function(e, t, i = {}) {
275
- const u = T(
359
+ };
360
+ const COMMENT = function(begin, end, modeOptions = {}) {
361
+ const mode = inherit$1(
276
362
  {
277
363
  scope: "comment",
278
- begin: e,
279
- end: t,
364
+ begin,
365
+ end,
280
366
  contains: []
281
367
  },
282
- i
368
+ modeOptions
283
369
  );
284
- u.contains.push({
370
+ mode.contains.push({
285
371
  scope: "doctag",
286
372
  // hack to avoid the space from being included. the space is necessary to
287
373
  // match here to prevent the plain text rule below from gobbling up doctags
288
374
  begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
289
375
  end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
290
- excludeBegin: !0,
376
+ excludeBegin: true,
291
377
  relevance: 0
292
378
  });
293
- const b = q(
379
+ const ENGLISH_WORD = either(
294
380
  // list of common 1 and 2 letter words in English
295
381
  "I",
296
382
  "a",
@@ -311,7 +397,7 @@ function Ft() {
311
397
  /[A-Za-z][a-z]{2,}/
312
398
  // allow capitalized words at beginning of sentences
313
399
  );
314
- return u.contains.push(
400
+ mode.contains.push(
315
401
  {
316
402
  // TODO: how to include ", (, ) without breaking grammars that use these for
317
403
  // comment delimiters?
@@ -326,130 +412,161 @@ function Ft() {
326
412
  //
327
413
  // for a visual example please see:
328
414
  // https://github.com/highlightjs/highlight.js/issues/2827
329
- begin: v(
415
+ begin: concat(
330
416
  /[ ]+/,
331
417
  // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
332
418
  "(",
333
- b,
419
+ ENGLISH_WORD,
334
420
  /[.]?[:]?([.][ ]|[ ])/,
335
421
  "){3}"
336
422
  )
337
423
  // look for 3 words in a row
338
424
  }
339
- ), u;
340
- }, qe = $("//", "$"), Je = $("/\\*", "\\*/"), Ve = $("#", "$"), Qe = {
425
+ );
426
+ return mode;
427
+ };
428
+ const C_LINE_COMMENT_MODE = COMMENT("//", "$");
429
+ const C_BLOCK_COMMENT_MODE = COMMENT("/\\*", "\\*/");
430
+ const HASH_COMMENT_MODE = COMMENT("#", "$");
431
+ const NUMBER_MODE = {
341
432
  scope: "number",
342
- begin: de,
433
+ begin: NUMBER_RE,
343
434
  relevance: 0
344
- }, me = {
435
+ };
436
+ const C_NUMBER_MODE = {
345
437
  scope: "number",
346
- begin: pe,
438
+ begin: C_NUMBER_RE,
347
439
  relevance: 0
348
- }, et = {
440
+ };
441
+ const BINARY_NUMBER_MODE = {
349
442
  scope: "number",
350
- begin: Ee,
443
+ begin: BINARY_NUMBER_RE,
351
444
  relevance: 0
352
- }, tt = {
445
+ };
446
+ const REGEXP_MODE = {
353
447
  scope: "regexp",
354
448
  begin: /\/(?=[^/\n]*\/)/,
355
449
  end: /\/[gimuy]*/,
356
450
  contains: [
357
- j,
451
+ BACKSLASH_ESCAPE,
358
452
  {
359
453
  begin: /\[/,
360
454
  end: /\]/,
361
455
  relevance: 0,
362
- contains: [j]
456
+ contains: [BACKSLASH_ESCAPE]
363
457
  }
364
458
  ]
365
- }, nt = {
459
+ };
460
+ const TITLE_MODE = {
366
461
  scope: "title",
367
- begin: he,
462
+ begin: IDENT_RE,
368
463
  relevance: 0
369
- }, it = {
464
+ };
465
+ const UNDERSCORE_TITLE_MODE = {
370
466
  scope: "title",
371
- begin: V,
467
+ begin: UNDERSCORE_IDENT_RE,
372
468
  relevance: 0
373
- }, st = {
469
+ };
470
+ const METHOD_GUARD = {
374
471
  // excludes method names from keyword processing
375
- begin: "\\.\\s*" + V,
472
+ begin: "\\.\\s*" + UNDERSCORE_IDENT_RE,
376
473
  relevance: 0
377
474
  };
378
- var G = /* @__PURE__ */ Object.freeze({
379
- __proto__: null,
380
- APOS_STRING_MODE: Xe,
381
- BACKSLASH_ESCAPE: j,
382
- BINARY_NUMBER_MODE: et,
383
- BINARY_NUMBER_RE: Ee,
384
- COMMENT: $,
385
- C_BLOCK_COMMENT_MODE: Je,
386
- C_LINE_COMMENT_MODE: qe,
387
- C_NUMBER_MODE: me,
388
- C_NUMBER_RE: pe,
389
- END_SAME_AS_BEGIN: function(e) {
390
- return Object.assign(
391
- e,
392
- {
393
- /** @type {ModeCallback} */
394
- "on:begin": (t, i) => {
395
- i.data._beginMatch = t[1];
396
- },
397
- /** @type {ModeCallback} */
398
- "on:end": (t, i) => {
399
- i.data._beginMatch !== t[1] && i.ignoreMatch();
400
- }
475
+ const END_SAME_AS_BEGIN = function(mode) {
476
+ return Object.assign(
477
+ mode,
478
+ {
479
+ /** @type {ModeCallback} */
480
+ "on:begin": (m, resp) => {
481
+ resp.data._beginMatch = m[1];
482
+ },
483
+ /** @type {ModeCallback} */
484
+ "on:end": (m, resp) => {
485
+ if (resp.data._beginMatch !== m[1]) resp.ignoreMatch();
401
486
  }
402
- );
403
- },
404
- HASH_COMMENT_MODE: Ve,
405
- IDENT_RE: he,
406
- MATCH_NOTHING_RE: Ke,
407
- METHOD_GUARD: st,
408
- NUMBER_MODE: Qe,
409
- NUMBER_RE: de,
410
- PHRASAL_WORDS_MODE: Ze,
411
- QUOTE_STRING_MODE: Ye,
412
- REGEXP_MODE: tt,
413
- RE_STARTERS_RE: ze,
414
- SHEBANG: Fe,
415
- TITLE_MODE: nt,
416
- UNDERSCORE_IDENT_RE: V,
417
- UNDERSCORE_TITLE_MODE: it
487
+ }
488
+ );
489
+ };
490
+ var MODES = /* @__PURE__ */ Object.freeze({
491
+ __proto__: null,
492
+ APOS_STRING_MODE,
493
+ BACKSLASH_ESCAPE,
494
+ BINARY_NUMBER_MODE,
495
+ BINARY_NUMBER_RE,
496
+ COMMENT,
497
+ C_BLOCK_COMMENT_MODE,
498
+ C_LINE_COMMENT_MODE,
499
+ C_NUMBER_MODE,
500
+ C_NUMBER_RE,
501
+ END_SAME_AS_BEGIN,
502
+ HASH_COMMENT_MODE,
503
+ IDENT_RE,
504
+ MATCH_NOTHING_RE,
505
+ METHOD_GUARD,
506
+ NUMBER_MODE,
507
+ NUMBER_RE,
508
+ PHRASAL_WORDS_MODE,
509
+ QUOTE_STRING_MODE,
510
+ REGEXP_MODE,
511
+ RE_STARTERS_RE,
512
+ SHEBANG,
513
+ TITLE_MODE,
514
+ UNDERSCORE_IDENT_RE,
515
+ UNDERSCORE_TITLE_MODE
418
516
  });
419
- function rt(e, t) {
420
- e.input[e.index - 1] === "." && t.ignoreMatch();
517
+ function skipIfHasPrecedingDot(match, response) {
518
+ const before = match.input[match.index - 1];
519
+ if (before === ".") {
520
+ response.ignoreMatch();
521
+ }
421
522
  }
422
- function ct(e, t) {
423
- e.className !== void 0 && (e.scope = e.className, delete e.className);
523
+ function scopeClassName(mode, _parent) {
524
+ if (mode.className !== void 0) {
525
+ mode.scope = mode.className;
526
+ delete mode.className;
527
+ }
424
528
  }
425
- function ot(e, t) {
426
- t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = rt, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
529
+ function beginKeywords(mode, parent) {
530
+ if (!parent) return;
531
+ if (!mode.beginKeywords) return;
532
+ mode.begin = "\\b(" + mode.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)";
533
+ mode.__beforeBegin = skipIfHasPrecedingDot;
534
+ mode.keywords = mode.keywords || mode.beginKeywords;
535
+ delete mode.beginKeywords;
536
+ if (mode.relevance === void 0) mode.relevance = 0;
427
537
  }
428
- function at(e, t) {
429
- Array.isArray(e.illegal) && (e.illegal = q(...e.illegal));
538
+ function compileIllegal(mode, _parent) {
539
+ if (!Array.isArray(mode.illegal)) return;
540
+ mode.illegal = either(...mode.illegal);
430
541
  }
431
- function lt(e, t) {
432
- if (e.match) {
433
- if (e.begin || e.end) throw new Error("begin & end are not supported with match");
434
- e.begin = e.match, delete e.match;
435
- }
542
+ function compileMatch(mode, _parent) {
543
+ if (!mode.match) return;
544
+ if (mode.begin || mode.end) throw new Error("begin & end are not supported with match");
545
+ mode.begin = mode.match;
546
+ delete mode.match;
436
547
  }
437
- function ut(e, t) {
438
- e.relevance === void 0 && (e.relevance = 1);
548
+ function compileRelevance(mode, _parent) {
549
+ if (mode.relevance === void 0) mode.relevance = 1;
439
550
  }
440
- const ft = (e, t) => {
441
- if (!e.beforeMatch) return;
442
- if (e.starts) throw new Error("beforeMatch cannot be used with starts");
443
- const i = Object.assign({}, e);
444
- Object.keys(e).forEach((u) => {
445
- delete e[u];
446
- }), e.keywords = i.keywords, e.begin = v(i.beforeMatch, fe(i.begin)), e.starts = {
551
+ const beforeMatchExt = (mode, parent) => {
552
+ if (!mode.beforeMatch) return;
553
+ if (mode.starts) throw new Error("beforeMatch cannot be used with starts");
554
+ const originalMode = Object.assign({}, mode);
555
+ Object.keys(mode).forEach((key) => {
556
+ delete mode[key];
557
+ });
558
+ mode.keywords = originalMode.keywords;
559
+ mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));
560
+ mode.starts = {
447
561
  relevance: 0,
448
562
  contains: [
449
- Object.assign(i, { endsParent: !0 })
563
+ Object.assign(originalMode, { endsParent: true })
450
564
  ]
451
- }, e.relevance = 0, delete i.beforeMatch;
452
- }, gt = [
565
+ };
566
+ mode.relevance = 0;
567
+ delete originalMode.beforeMatch;
568
+ };
569
+ const COMMON_KEYWORDS = [
453
570
  "of",
454
571
  "and",
455
572
  "for",
@@ -464,105 +581,170 @@ function Ft() {
464
581
  // common variable name
465
582
  "value"
466
583
  // common variable name
467
- ], ht = "keyword";
468
- function be(e, t, i = ht) {
469
- const u = /* @__PURE__ */ Object.create(null);
470
- return typeof e == "string" ? b(i, e.split(" ")) : Array.isArray(e) ? b(i, e) : Object.keys(e).forEach(function(_) {
471
- Object.assign(
472
- u,
473
- be(e[_], t, _)
474
- );
475
- }), u;
476
- function b(_, c) {
477
- t && (c = c.map((r) => r.toLowerCase())), c.forEach(function(r) {
478
- const l = r.split("|");
479
- u[l[0]] = [_, dt(l[0], l[1])];
584
+ ];
585
+ const DEFAULT_KEYWORD_SCOPE = "keyword";
586
+ function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {
587
+ const compiledKeywords = /* @__PURE__ */ Object.create(null);
588
+ if (typeof rawKeywords === "string") {
589
+ compileList(scopeName, rawKeywords.split(" "));
590
+ } else if (Array.isArray(rawKeywords)) {
591
+ compileList(scopeName, rawKeywords);
592
+ } else {
593
+ Object.keys(rawKeywords).forEach(function(scopeName2) {
594
+ Object.assign(
595
+ compiledKeywords,
596
+ compileKeywords(rawKeywords[scopeName2], caseInsensitive, scopeName2)
597
+ );
598
+ });
599
+ }
600
+ return compiledKeywords;
601
+ function compileList(scopeName2, keywordList) {
602
+ if (caseInsensitive) {
603
+ keywordList = keywordList.map((x) => x.toLowerCase());
604
+ }
605
+ keywordList.forEach(function(keyword) {
606
+ const pair = keyword.split("|");
607
+ compiledKeywords[pair[0]] = [scopeName2, scoreForKeyword(pair[0], pair[1])];
480
608
  });
481
609
  }
482
610
  }
483
- function dt(e, t) {
484
- return t ? Number(t) : pt(e) ? 0 : 1;
611
+ function scoreForKeyword(keyword, providedScore) {
612
+ if (providedScore) {
613
+ return Number(providedScore);
614
+ }
615
+ return commonKeyword(keyword) ? 0 : 1;
485
616
  }
486
- function pt(e) {
487
- return gt.includes(e.toLowerCase());
617
+ function commonKeyword(keyword) {
618
+ return COMMON_KEYWORDS.includes(keyword.toLowerCase());
488
619
  }
489
- const _e = {}, D = (e) => {
490
- console.error(e);
491
- }, Me = (e, ...t) => {
492
- console.log(`WARN: ${e}`, ...t);
493
- }, L = (e, t) => {
494
- _e[`${e}/${t}`] || (console.log(`Deprecated as of ${e}. ${t}`), _e[`${e}/${t}`] = !0);
495
- }, W = new Error();
496
- function we(e, t, { key: i }) {
497
- let u = 0;
498
- const b = e[i], _ = {}, c = {};
499
- for (let r = 1; r <= t.length; r++)
500
- c[r + u] = b[r], _[r + u] = !0, u += ge(t[r - 1]);
501
- e[i] = c, e[i]._emit = _, e[i]._multi = !0;
620
+ const seenDeprecations = {};
621
+ const error = (message) => {
622
+ console.error(message);
623
+ };
624
+ const warn = (message, ...args) => {
625
+ console.log(`WARN: ${message}`, ...args);
626
+ };
627
+ const deprecated = (version2, message) => {
628
+ if (seenDeprecations[`${version2}/${message}`]) return;
629
+ console.log(`Deprecated as of ${version2}. ${message}`);
630
+ seenDeprecations[`${version2}/${message}`] = true;
631
+ };
632
+ const MultiClassError = new Error();
633
+ function remapScopeNames(mode, regexes, { key }) {
634
+ let offset = 0;
635
+ const scopeNames = mode[key];
636
+ const emit = {};
637
+ const positions = {};
638
+ for (let i = 1; i <= regexes.length; i++) {
639
+ positions[i + offset] = scopeNames[i];
640
+ emit[i + offset] = true;
641
+ offset += countMatchGroups(regexes[i - 1]);
642
+ }
643
+ mode[key] = positions;
644
+ mode[key]._emit = emit;
645
+ mode[key]._multi = true;
502
646
  }
503
- function Et(e) {
504
- if (Array.isArray(e.begin)) {
505
- if (e.skip || e.excludeBegin || e.returnBegin)
506
- throw D("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), W;
507
- if (typeof e.beginScope != "object" || e.beginScope === null)
508
- throw D("beginScope must be object"), W;
509
- we(e, e.begin, { key: "beginScope" }), e.begin = J(e.begin, { joinWith: "" });
647
+ function beginMultiClass(mode) {
648
+ if (!Array.isArray(mode.begin)) return;
649
+ if (mode.skip || mode.excludeBegin || mode.returnBegin) {
650
+ error("skip, excludeBegin, returnBegin not compatible with beginScope: {}");
651
+ throw MultiClassError;
652
+ }
653
+ if (typeof mode.beginScope !== "object" || mode.beginScope === null) {
654
+ error("beginScope must be object");
655
+ throw MultiClassError;
510
656
  }
657
+ remapScopeNames(mode, mode.begin, { key: "beginScope" });
658
+ mode.begin = _rewriteBackreferences(mode.begin, { joinWith: "" });
511
659
  }
512
- function bt(e) {
513
- if (Array.isArray(e.end)) {
514
- if (e.skip || e.excludeEnd || e.returnEnd)
515
- throw D("skip, excludeEnd, returnEnd not compatible with endScope: {}"), W;
516
- if (typeof e.endScope != "object" || e.endScope === null)
517
- throw D("endScope must be object"), W;
518
- we(e, e.end, { key: "endScope" }), e.end = J(e.end, { joinWith: "" });
660
+ function endMultiClass(mode) {
661
+ if (!Array.isArray(mode.end)) return;
662
+ if (mode.skip || mode.excludeEnd || mode.returnEnd) {
663
+ error("skip, excludeEnd, returnEnd not compatible with endScope: {}");
664
+ throw MultiClassError;
519
665
  }
666
+ if (typeof mode.endScope !== "object" || mode.endScope === null) {
667
+ error("endScope must be object");
668
+ throw MultiClassError;
669
+ }
670
+ remapScopeNames(mode, mode.end, { key: "endScope" });
671
+ mode.end = _rewriteBackreferences(mode.end, { joinWith: "" });
520
672
  }
521
- function _t(e) {
522
- e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
673
+ function scopeSugar(mode) {
674
+ if (mode.scope && typeof mode.scope === "object" && mode.scope !== null) {
675
+ mode.beginScope = mode.scope;
676
+ delete mode.scope;
677
+ }
523
678
  }
524
- function Mt(e) {
525
- _t(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), Et(e), bt(e);
679
+ function MultiClass(mode) {
680
+ scopeSugar(mode);
681
+ if (typeof mode.beginScope === "string") {
682
+ mode.beginScope = { _wrap: mode.beginScope };
683
+ }
684
+ if (typeof mode.endScope === "string") {
685
+ mode.endScope = { _wrap: mode.endScope };
686
+ }
687
+ beginMultiClass(mode);
688
+ endMultiClass(mode);
526
689
  }
527
- function wt(e) {
528
- function t(c, r) {
690
+ function compileLanguage(language) {
691
+ function langRe(value, global) {
529
692
  return new RegExp(
530
- P(c),
531
- "m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (r ? "g" : "")
693
+ source(value),
694
+ "m" + (language.case_insensitive ? "i" : "") + (language.unicodeRegex ? "u" : "") + (global ? "g" : "")
532
695
  );
533
696
  }
534
- class i {
697
+ class MultiRegex {
535
698
  constructor() {
536
- this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
699
+ this.matchIndexes = {};
700
+ this.regexes = [];
701
+ this.matchAt = 1;
702
+ this.position = 0;
537
703
  }
538
704
  // @ts-ignore
539
- addRule(r, l) {
540
- l.position = this.position++, this.matchIndexes[this.matchAt] = l, this.regexes.push([l, r]), this.matchAt += ge(r) + 1;
705
+ addRule(re, opts) {
706
+ opts.position = this.position++;
707
+ this.matchIndexes[this.matchAt] = opts;
708
+ this.regexes.push([opts, re]);
709
+ this.matchAt += countMatchGroups(re) + 1;
541
710
  }
542
711
  compile() {
543
- this.regexes.length === 0 && (this.exec = () => null);
544
- const r = this.regexes.map((l) => l[1]);
545
- this.matcherRe = t(J(r, { joinWith: "|" }), !0), this.lastIndex = 0;
712
+ if (this.regexes.length === 0) {
713
+ this.exec = () => null;
714
+ }
715
+ const terminators = this.regexes.map((el) => el[1]);
716
+ this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: "|" }), true);
717
+ this.lastIndex = 0;
546
718
  }
547
719
  /** @param {string} s */
548
- exec(r) {
720
+ exec(s) {
549
721
  this.matcherRe.lastIndex = this.lastIndex;
550
- const l = this.matcherRe.exec(r);
551
- if (!l)
722
+ const match = this.matcherRe.exec(s);
723
+ if (!match) {
552
724
  return null;
553
- const x = l.findIndex((U, m) => m > 0 && U !== void 0), M = this.matchIndexes[x];
554
- return l.splice(0, x), Object.assign(l, M);
725
+ }
726
+ const i = match.findIndex((el, i2) => i2 > 0 && el !== void 0);
727
+ const matchData = this.matchIndexes[i];
728
+ match.splice(0, i);
729
+ return Object.assign(match, matchData);
555
730
  }
556
731
  }
557
- class u {
732
+ class ResumableMultiRegex {
558
733
  constructor() {
559
- this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
734
+ this.rules = [];
735
+ this.multiRegexes = [];
736
+ this.count = 0;
737
+ this.lastIndex = 0;
738
+ this.regexIndex = 0;
560
739
  }
561
740
  // @ts-ignore
562
- getMatcher(r) {
563
- if (this.multiRegexes[r]) return this.multiRegexes[r];
564
- const l = new i();
565
- return this.rules.slice(r).forEach(([x, M]) => l.addRule(x, M)), l.compile(), this.multiRegexes[r] = l, l;
741
+ getMatcher(index) {
742
+ if (this.multiRegexes[index]) return this.multiRegexes[index];
743
+ const matcher = new MultiRegex();
744
+ this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));
745
+ matcher.compile();
746
+ this.multiRegexes[index] = matcher;
747
+ return matcher;
566
748
  }
567
749
  resumingScanAtSamePosition() {
568
750
  return this.regexIndex !== 0;
@@ -571,88 +753,163 @@ function Ft() {
571
753
  this.regexIndex = 0;
572
754
  }
573
755
  // @ts-ignore
574
- addRule(r, l) {
575
- this.rules.push([r, l]), l.type === "begin" && this.count++;
756
+ addRule(re, opts) {
757
+ this.rules.push([re, opts]);
758
+ if (opts.type === "begin") this.count++;
576
759
  }
577
760
  /** @param {string} s */
578
- exec(r) {
579
- const l = this.getMatcher(this.regexIndex);
580
- l.lastIndex = this.lastIndex;
581
- let x = l.exec(r);
582
- if (this.resumingScanAtSamePosition() && !(x && x.index === this.lastIndex)) {
583
- const M = this.getMatcher(0);
584
- M.lastIndex = this.lastIndex + 1, x = M.exec(r);
761
+ exec(s) {
762
+ const m = this.getMatcher(this.regexIndex);
763
+ m.lastIndex = this.lastIndex;
764
+ let result = m.exec(s);
765
+ if (this.resumingScanAtSamePosition()) {
766
+ if (result && result.index === this.lastIndex) ;
767
+ else {
768
+ const m2 = this.getMatcher(0);
769
+ m2.lastIndex = this.lastIndex + 1;
770
+ result = m2.exec(s);
771
+ }
772
+ }
773
+ if (result) {
774
+ this.regexIndex += result.position + 1;
775
+ if (this.regexIndex === this.count) {
776
+ this.considerAll();
777
+ }
585
778
  }
586
- return x && (this.regexIndex += x.position + 1, this.regexIndex === this.count && this.considerAll()), x;
779
+ return result;
587
780
  }
588
781
  }
589
- function b(c) {
590
- const r = new u();
591
- return c.contains.forEach((l) => r.addRule(l.begin, { rule: l, type: "begin" })), c.terminatorEnd && r.addRule(c.terminatorEnd, { type: "end" }), c.illegal && r.addRule(c.illegal, { type: "illegal" }), r;
782
+ function buildModeRegex(mode) {
783
+ const mm = new ResumableMultiRegex();
784
+ mode.contains.forEach((term) => mm.addRule(term.begin, { rule: term, type: "begin" }));
785
+ if (mode.terminatorEnd) {
786
+ mm.addRule(mode.terminatorEnd, { type: "end" });
787
+ }
788
+ if (mode.illegal) {
789
+ mm.addRule(mode.illegal, { type: "illegal" });
790
+ }
791
+ return mm;
592
792
  }
593
- function _(c, r) {
594
- const l = (
793
+ function compileMode(mode, parent) {
794
+ const cmode = (
595
795
  /** @type CompiledMode */
596
- c
796
+ mode
597
797
  );
598
- if (c.isCompiled) return l;
798
+ if (mode.isCompiled) return cmode;
599
799
  [
600
- ct,
800
+ scopeClassName,
601
801
  // do this early so compiler extensions generally don't have to worry about
602
802
  // the distinction between match/begin
603
- lt,
604
- Mt,
605
- ft
606
- ].forEach((M) => M(c, r)), e.compilerExtensions.forEach((M) => M(c, r)), c.__beforeBegin = null, [
607
- ot,
803
+ compileMatch,
804
+ MultiClass,
805
+ beforeMatchExt
806
+ ].forEach((ext) => ext(mode, parent));
807
+ language.compilerExtensions.forEach((ext) => ext(mode, parent));
808
+ mode.__beforeBegin = null;
809
+ [
810
+ beginKeywords,
608
811
  // do this later so compiler extensions that come earlier have access to the
609
812
  // raw array if they wanted to perhaps manipulate it, etc.
610
- at,
813
+ compileIllegal,
611
814
  // default to 1 relevance if not specified
612
- ut
613
- ].forEach((M) => M(c, r)), c.isCompiled = !0;
614
- let x = null;
615
- return typeof c.keywords == "object" && c.keywords.$pattern && (c.keywords = Object.assign({}, c.keywords), x = c.keywords.$pattern, delete c.keywords.$pattern), x = x || /\w+/, c.keywords && (c.keywords = be(c.keywords, e.case_insensitive)), l.keywordPatternRe = t(x, !0), r && (c.begin || (c.begin = /\B|\b/), l.beginRe = t(l.begin), !c.end && !c.endsWithParent && (c.end = /\B|\b/), c.end && (l.endRe = t(l.end)), l.terminatorEnd = P(l.end) || "", c.endsWithParent && r.terminatorEnd && (l.terminatorEnd += (c.end ? "|" : "") + r.terminatorEnd)), c.illegal && (l.illegalRe = t(
815
+ compileRelevance
816
+ ].forEach((ext) => ext(mode, parent));
817
+ mode.isCompiled = true;
818
+ let keywordPattern = null;
819
+ if (typeof mode.keywords === "object" && mode.keywords.$pattern) {
820
+ mode.keywords = Object.assign({}, mode.keywords);
821
+ keywordPattern = mode.keywords.$pattern;
822
+ delete mode.keywords.$pattern;
823
+ }
824
+ keywordPattern = keywordPattern || /\w+/;
825
+ if (mode.keywords) {
826
+ mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);
827
+ }
828
+ cmode.keywordPatternRe = langRe(keywordPattern, true);
829
+ if (parent) {
830
+ if (!mode.begin) mode.begin = /\B|\b/;
831
+ cmode.beginRe = langRe(cmode.begin);
832
+ if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
833
+ if (mode.end) cmode.endRe = langRe(cmode.end);
834
+ cmode.terminatorEnd = source(cmode.end) || "";
835
+ if (mode.endsWithParent && parent.terminatorEnd) {
836
+ cmode.terminatorEnd += (mode.end ? "|" : "") + parent.terminatorEnd;
837
+ }
838
+ }
839
+ if (mode.illegal) cmode.illegalRe = langRe(
616
840
  /** @type {RegExp | string} */
617
- c.illegal
618
- )), c.contains || (c.contains = []), c.contains = [].concat(...c.contains.map(function(M) {
619
- return xt(M === "self" ? c : M);
620
- })), c.contains.forEach(function(M) {
621
- _(
841
+ mode.illegal
842
+ );
843
+ if (!mode.contains) mode.contains = [];
844
+ mode.contains = [].concat(...mode.contains.map(function(c) {
845
+ return expandOrCloneMode(c === "self" ? mode : c);
846
+ }));
847
+ mode.contains.forEach(function(c) {
848
+ compileMode(
622
849
  /** @type Mode */
623
- M,
624
- l
850
+ c,
851
+ cmode
625
852
  );
626
- }), c.starts && _(c.starts, r), l.matcher = b(l), l;
853
+ });
854
+ if (mode.starts) {
855
+ compileMode(mode.starts, parent);
856
+ }
857
+ cmode.matcher = buildModeRegex(cmode);
858
+ return cmode;
627
859
  }
628
- if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
860
+ if (!language.compilerExtensions) language.compilerExtensions = [];
861
+ if (language.contains && language.contains.includes("self")) {
629
862
  throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
630
- return e.classNameAliases = T(e.classNameAliases || {}), _(
863
+ }
864
+ language.classNameAliases = inherit$1(language.classNameAliases || {});
865
+ return compileMode(
631
866
  /** @type Mode */
632
- e
867
+ language
633
868
  );
634
869
  }
635
- function xe(e) {
636
- return e ? e.endsWithParent || xe(e.starts) : !1;
870
+ function dependencyOnParent(mode) {
871
+ if (!mode) return false;
872
+ return mode.endsWithParent || dependencyOnParent(mode.starts);
637
873
  }
638
- function xt(e) {
639
- return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(t) {
640
- return T(e, { variants: null }, t);
641
- })), e.cachedVariants ? e.cachedVariants : xe(e) ? T(e, { starts: e.starts ? T(e.starts) : null }) : Object.isFrozen(e) ? T(e) : e;
874
+ function expandOrCloneMode(mode) {
875
+ if (mode.variants && !mode.cachedVariants) {
876
+ mode.cachedVariants = mode.variants.map(function(variant) {
877
+ return inherit$1(mode, { variants: null }, variant);
878
+ });
879
+ }
880
+ if (mode.cachedVariants) {
881
+ return mode.cachedVariants;
882
+ }
883
+ if (dependencyOnParent(mode)) {
884
+ return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });
885
+ }
886
+ if (Object.isFrozen(mode)) {
887
+ return inherit$1(mode);
888
+ }
889
+ return mode;
642
890
  }
643
- var Ot = "11.10.0";
644
- class Rt extends Error {
645
- constructor(t, i) {
646
- super(t), this.name = "HTMLInjectionError", this.html = i;
891
+ var version = "11.10.0";
892
+ class HTMLInjectionError extends Error {
893
+ constructor(reason, html) {
894
+ super(reason);
895
+ this.name = "HTMLInjectionError";
896
+ this.html = html;
647
897
  }
648
898
  }
649
- const Q = ae, Oe = T, Re = Symbol("nomatch"), yt = 7, ye = function(e) {
650
- const t = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null), u = [];
651
- let b = !0;
652
- const _ = "Could not find the language '{}', did you forget to load/include a language module?", c = { disableAutodetect: !0, name: "Plain text", contains: [] };
653
- let r = {
654
- ignoreUnescapedHTML: !1,
655
- throwUnescapedHTML: !1,
899
+ const escape = escapeHTML;
900
+ const inherit = inherit$1;
901
+ const NO_MATCH = Symbol("nomatch");
902
+ const MAX_KEYWORD_HITS = 7;
903
+ const HLJS = function(hljs) {
904
+ const languages = /* @__PURE__ */ Object.create(null);
905
+ const aliases = /* @__PURE__ */ Object.create(null);
906
+ const plugins = [];
907
+ let SAFE_MODE = true;
908
+ const LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?";
909
+ const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: "Plain text", contains: [] };
910
+ let options = {
911
+ ignoreUnescapedHTML: false,
912
+ throwUnescapedHTML: false,
656
913
  noHighlightRe: /^(no-?highlight)$/i,
657
914
  languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
658
915
  classPrefix: "hljs-",
@@ -660,404 +917,625 @@ function Ft() {
660
917
  languages: null,
661
918
  // beta configuration options, subject to change, welcome to discuss
662
919
  // https://github.com/highlightjs/highlight.js/issues/1086
663
- __emitter: Pe
920
+ __emitter: TokenTreeEmitter
664
921
  };
665
- function l(n) {
666
- return r.noHighlightRe.test(n);
667
- }
668
- function x(n) {
669
- let a = n.className + " ";
670
- a += n.parentNode ? n.parentNode.className : "";
671
- const h = r.languageDetectRe.exec(a);
672
- if (h) {
673
- const p = I(h[1]);
674
- return p || (Me(_.replace("{}", h[1])), Me("Falling back to no-highlight mode for this block.", n)), p ? h[1] : "no-highlight";
922
+ function shouldNotHighlight(languageName) {
923
+ return options.noHighlightRe.test(languageName);
924
+ }
925
+ function blockLanguage(block) {
926
+ let classes = block.className + " ";
927
+ classes += block.parentNode ? block.parentNode.className : "";
928
+ const match = options.languageDetectRe.exec(classes);
929
+ if (match) {
930
+ const language = getLanguage(match[1]);
931
+ if (!language) {
932
+ warn(LANGUAGE_NOT_FOUND.replace("{}", match[1]));
933
+ warn("Falling back to no-highlight mode for this block.", block);
934
+ }
935
+ return language ? match[1] : "no-highlight";
936
+ }
937
+ return classes.split(/\s+/).find((_class) => shouldNotHighlight(_class) || getLanguage(_class));
938
+ }
939
+ function highlight2(codeOrLanguageName, optionsOrCode, ignoreIllegals) {
940
+ let code = "";
941
+ let languageName = "";
942
+ if (typeof optionsOrCode === "object") {
943
+ code = codeOrLanguageName;
944
+ ignoreIllegals = optionsOrCode.ignoreIllegals;
945
+ languageName = optionsOrCode.language;
946
+ } else {
947
+ deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated.");
948
+ deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277");
949
+ languageName = codeOrLanguageName;
950
+ code = optionsOrCode;
951
+ }
952
+ if (ignoreIllegals === void 0) {
953
+ ignoreIllegals = true;
675
954
  }
676
- return a.split(/\s+/).find((p) => l(p) || I(p));
677
- }
678
- function M(n, a, h) {
679
- let p = "", w = "";
680
- typeof a == "object" ? (p = n, h = a.ignoreIllegals, w = a.language) : (L("10.7.0", "highlight(lang, code, ...args) has been deprecated."), L("10.7.0", `Please use highlight(code, options) instead.
681
- https://github.com/highlightjs/highlight.js/issues/2277`), w = n, p = a), h === void 0 && (h = !0);
682
- const S = {
683
- code: p,
684
- language: w
955
+ const context = {
956
+ code,
957
+ language: languageName
685
958
  };
686
- z("before:highlight", S);
687
- const B = S.result ? S.result : U(S.language, S.code, h);
688
- return B.code = S.code, z("after:highlight", B), B;
689
- }
690
- function U(n, a, h, p) {
691
- const w = /* @__PURE__ */ Object.create(null);
692
- function S(s, o) {
693
- return s.keywords[o];
959
+ fire("before:highlight", context);
960
+ const result = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals);
961
+ result.code = context.code;
962
+ fire("after:highlight", result);
963
+ return result;
964
+ }
965
+ function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {
966
+ const keywordHits = /* @__PURE__ */ Object.create(null);
967
+ function keywordData(mode, matchText) {
968
+ return mode.keywords[matchText];
694
969
  }
695
- function B() {
696
- if (!f.keywords) {
697
- O.addText(E);
970
+ function processKeywords() {
971
+ if (!top.keywords) {
972
+ emitter.addText(modeBuffer);
698
973
  return;
699
974
  }
700
- let s = 0;
701
- f.keywordPatternRe.lastIndex = 0;
702
- let o = f.keywordPatternRe.exec(E), g = "";
703
- for (; o; ) {
704
- g += E.substring(s, o.index);
705
- const d = A.case_insensitive ? o[0].toLowerCase() : o[0], R = S(f, d);
706
- if (R) {
707
- const [k, Wt] = R;
708
- if (O.addText(g), g = "", w[d] = (w[d] || 0) + 1, w[d] <= yt && (Y += Wt), k.startsWith("_"))
709
- g += o[0];
710
- else {
711
- const Kt = A.classNameAliases[k] || k;
712
- N(o[0], Kt);
975
+ let lastIndex = 0;
976
+ top.keywordPatternRe.lastIndex = 0;
977
+ let match = top.keywordPatternRe.exec(modeBuffer);
978
+ let buf = "";
979
+ while (match) {
980
+ buf += modeBuffer.substring(lastIndex, match.index);
981
+ const word = language.case_insensitive ? match[0].toLowerCase() : match[0];
982
+ const data = keywordData(top, word);
983
+ if (data) {
984
+ const [kind, keywordRelevance] = data;
985
+ emitter.addText(buf);
986
+ buf = "";
987
+ keywordHits[word] = (keywordHits[word] || 0) + 1;
988
+ if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance;
989
+ if (kind.startsWith("_")) {
990
+ buf += match[0];
991
+ } else {
992
+ const cssClass = language.classNameAliases[kind] || kind;
993
+ emitKeyword(match[0], cssClass);
713
994
  }
714
- } else
715
- g += o[0];
716
- s = f.keywordPatternRe.lastIndex, o = f.keywordPatternRe.exec(E);
995
+ } else {
996
+ buf += match[0];
997
+ }
998
+ lastIndex = top.keywordPatternRe.lastIndex;
999
+ match = top.keywordPatternRe.exec(modeBuffer);
717
1000
  }
718
- g += E.substring(s), O.addText(g);
1001
+ buf += modeBuffer.substring(lastIndex);
1002
+ emitter.addText(buf);
719
1003
  }
720
- function F() {
721
- if (E === "") return;
722
- let s = null;
723
- if (typeof f.subLanguage == "string") {
724
- if (!t[f.subLanguage]) {
725
- O.addText(E);
1004
+ function processSubLanguage() {
1005
+ if (modeBuffer === "") return;
1006
+ let result2 = null;
1007
+ if (typeof top.subLanguage === "string") {
1008
+ if (!languages[top.subLanguage]) {
1009
+ emitter.addText(modeBuffer);
726
1010
  return;
727
1011
  }
728
- s = U(f.subLanguage, E, !0, ve[f.subLanguage]), ve[f.subLanguage] = /** @type {CompiledMode} */
729
- s._top;
730
- } else
731
- s = ee(E, f.subLanguage.length ? f.subLanguage : null);
732
- f.relevance > 0 && (Y += s.relevance), O.__addSublanguage(s._emitter, s.language);
1012
+ result2 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);
1013
+ continuations[top.subLanguage] = /** @type {CompiledMode} */
1014
+ result2._top;
1015
+ } else {
1016
+ result2 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);
1017
+ }
1018
+ if (top.relevance > 0) {
1019
+ relevance += result2.relevance;
1020
+ }
1021
+ emitter.__addSublanguage(result2._emitter, result2.language);
733
1022
  }
734
- function y() {
735
- f.subLanguage != null ? F() : B(), E = "";
1023
+ function processBuffer() {
1024
+ if (top.subLanguage != null) {
1025
+ processSubLanguage();
1026
+ } else {
1027
+ processKeywords();
1028
+ }
1029
+ modeBuffer = "";
736
1030
  }
737
- function N(s, o) {
738
- s !== "" && (O.startScope(o), O.addText(s), O.endScope());
1031
+ function emitKeyword(keyword, scope) {
1032
+ if (keyword === "") return;
1033
+ emitter.startScope(scope);
1034
+ emitter.addText(keyword);
1035
+ emitter.endScope();
739
1036
  }
740
- function ke(s, o) {
741
- let g = 1;
742
- const d = o.length - 1;
743
- for (; g <= d; ) {
744
- if (!s._emit[g]) {
745
- g++;
1037
+ function emitMultiClass(scope, match) {
1038
+ let i = 1;
1039
+ const max = match.length - 1;
1040
+ while (i <= max) {
1041
+ if (!scope._emit[i]) {
1042
+ i++;
746
1043
  continue;
747
1044
  }
748
- const R = A.classNameAliases[s[g]] || s[g], k = o[g];
749
- R ? N(k, R) : (E = k, B(), E = ""), g++;
1045
+ const klass = language.classNameAliases[scope[i]] || scope[i];
1046
+ const text = match[i];
1047
+ if (klass) {
1048
+ emitKeyword(text, klass);
1049
+ } else {
1050
+ modeBuffer = text;
1051
+ processKeywords();
1052
+ modeBuffer = "";
1053
+ }
1054
+ i++;
750
1055
  }
751
1056
  }
752
- function Te(s, o) {
753
- return s.scope && typeof s.scope == "string" && O.openNode(A.classNameAliases[s.scope] || s.scope), s.beginScope && (s.beginScope._wrap ? (N(E, A.classNameAliases[s.beginScope._wrap] || s.beginScope._wrap), E = "") : s.beginScope._multi && (ke(s.beginScope, o), E = "")), f = Object.create(s, { parent: { value: f } }), f;
1057
+ function startNewMode(mode, match) {
1058
+ if (mode.scope && typeof mode.scope === "string") {
1059
+ emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);
1060
+ }
1061
+ if (mode.beginScope) {
1062
+ if (mode.beginScope._wrap) {
1063
+ emitKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);
1064
+ modeBuffer = "";
1065
+ } else if (mode.beginScope._multi) {
1066
+ emitMultiClass(mode.beginScope, match);
1067
+ modeBuffer = "";
1068
+ }
1069
+ }
1070
+ top = Object.create(mode, { parent: { value: top } });
1071
+ return top;
754
1072
  }
755
- function Ie(s, o, g) {
756
- let d = Ge(s.endRe, g);
757
- if (d) {
758
- if (s["on:end"]) {
759
- const R = new oe(s);
760
- s["on:end"](o, R), R.isMatchIgnored && (d = !1);
1073
+ function endOfMode(mode, match, matchPlusRemainder) {
1074
+ let matched = startsWith(mode.endRe, matchPlusRemainder);
1075
+ if (matched) {
1076
+ if (mode["on:end"]) {
1077
+ const resp = new Response(mode);
1078
+ mode["on:end"](match, resp);
1079
+ if (resp.isMatchIgnored) matched = false;
761
1080
  }
762
- if (d) {
763
- for (; s.endsParent && s.parent; )
764
- s = s.parent;
765
- return s;
1081
+ if (matched) {
1082
+ while (mode.endsParent && mode.parent) {
1083
+ mode = mode.parent;
1084
+ }
1085
+ return mode;
766
1086
  }
767
1087
  }
768
- if (s.endsWithParent)
769
- return Ie(s.parent, o, g);
1088
+ if (mode.endsWithParent) {
1089
+ return endOfMode(mode.parent, match, matchPlusRemainder);
1090
+ }
770
1091
  }
771
- function Pt(s) {
772
- return f.matcher.regexIndex === 0 ? (E += s[0], 1) : (se = !0, 0);
1092
+ function doIgnore(lexeme) {
1093
+ if (top.matcher.regexIndex === 0) {
1094
+ modeBuffer += lexeme[0];
1095
+ return 1;
1096
+ } else {
1097
+ resumeScanAtSamePosition = true;
1098
+ return 0;
1099
+ }
773
1100
  }
774
- function jt(s) {
775
- const o = s[0], g = s.rule, d = new oe(g), R = [g.__beforeBegin, g["on:begin"]];
776
- for (const k of R)
777
- if (k && (k(s, d), d.isMatchIgnored))
778
- return Pt(o);
779
- return g.skip ? E += o : (g.excludeBegin && (E += o), y(), !g.returnBegin && !g.excludeBegin && (E = o)), Te(g, s), g.returnBegin ? 0 : o.length;
1101
+ function doBeginMatch(match) {
1102
+ const lexeme = match[0];
1103
+ const newMode = match.rule;
1104
+ const resp = new Response(newMode);
1105
+ const beforeCallbacks = [newMode.__beforeBegin, newMode["on:begin"]];
1106
+ for (const cb of beforeCallbacks) {
1107
+ if (!cb) continue;
1108
+ cb(match, resp);
1109
+ if (resp.isMatchIgnored) return doIgnore(lexeme);
1110
+ }
1111
+ if (newMode.skip) {
1112
+ modeBuffer += lexeme;
1113
+ } else {
1114
+ if (newMode.excludeBegin) {
1115
+ modeBuffer += lexeme;
1116
+ }
1117
+ processBuffer();
1118
+ if (!newMode.returnBegin && !newMode.excludeBegin) {
1119
+ modeBuffer = lexeme;
1120
+ }
1121
+ }
1122
+ startNewMode(newMode, match);
1123
+ return newMode.returnBegin ? 0 : lexeme.length;
780
1124
  }
781
- function Ut(s) {
782
- const o = s[0], g = a.substring(s.index), d = Ie(f, s, g);
783
- if (!d)
784
- return Re;
785
- const R = f;
786
- f.endScope && f.endScope._wrap ? (y(), N(o, f.endScope._wrap)) : f.endScope && f.endScope._multi ? (y(), ke(f.endScope, s)) : R.skip ? E += o : (R.returnEnd || R.excludeEnd || (E += o), y(), R.excludeEnd && (E = o));
787
- do
788
- f.scope && O.closeNode(), !f.skip && !f.subLanguage && (Y += f.relevance), f = f.parent;
789
- while (f !== d.parent);
790
- return d.starts && Te(d.starts, s), R.returnEnd ? 0 : o.length;
1125
+ function doEndMatch(match) {
1126
+ const lexeme = match[0];
1127
+ const matchPlusRemainder = codeToHighlight.substring(match.index);
1128
+ const endMode = endOfMode(top, match, matchPlusRemainder);
1129
+ if (!endMode) {
1130
+ return NO_MATCH;
1131
+ }
1132
+ const origin = top;
1133
+ if (top.endScope && top.endScope._wrap) {
1134
+ processBuffer();
1135
+ emitKeyword(lexeme, top.endScope._wrap);
1136
+ } else if (top.endScope && top.endScope._multi) {
1137
+ processBuffer();
1138
+ emitMultiClass(top.endScope, match);
1139
+ } else if (origin.skip) {
1140
+ modeBuffer += lexeme;
1141
+ } else {
1142
+ if (!(origin.returnEnd || origin.excludeEnd)) {
1143
+ modeBuffer += lexeme;
1144
+ }
1145
+ processBuffer();
1146
+ if (origin.excludeEnd) {
1147
+ modeBuffer = lexeme;
1148
+ }
1149
+ }
1150
+ do {
1151
+ if (top.scope) {
1152
+ emitter.closeNode();
1153
+ }
1154
+ if (!top.skip && !top.subLanguage) {
1155
+ relevance += top.relevance;
1156
+ }
1157
+ top = top.parent;
1158
+ } while (top !== endMode.parent);
1159
+ if (endMode.starts) {
1160
+ startNewMode(endMode.starts, match);
1161
+ }
1162
+ return origin.returnEnd ? 0 : lexeme.length;
791
1163
  }
792
- function $t() {
793
- const s = [];
794
- for (let o = f; o !== A; o = o.parent)
795
- o.scope && s.unshift(o.scope);
796
- s.forEach((o) => O.openNode(o));
1164
+ function processContinuations() {
1165
+ const list = [];
1166
+ for (let current = top; current !== language; current = current.parent) {
1167
+ if (current.scope) {
1168
+ list.unshift(current.scope);
1169
+ }
1170
+ }
1171
+ list.forEach((item) => emitter.openNode(item));
797
1172
  }
798
- let X = {};
799
- function Be(s, o) {
800
- const g = o && o[0];
801
- if (E += s, g == null)
802
- return y(), 0;
803
- if (X.type === "begin" && o.type === "end" && X.index === o.index && g === "") {
804
- if (E += a.slice(o.index, o.index + 1), !b) {
805
- const d = new Error(`0 width match regex (${n})`);
806
- throw d.languageName = n, d.badRule = X.rule, d;
1173
+ let lastMatch = {};
1174
+ function processLexeme(textBeforeMatch, match) {
1175
+ const lexeme = match && match[0];
1176
+ modeBuffer += textBeforeMatch;
1177
+ if (lexeme == null) {
1178
+ processBuffer();
1179
+ return 0;
1180
+ }
1181
+ if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") {
1182
+ modeBuffer += codeToHighlight.slice(match.index, match.index + 1);
1183
+ if (!SAFE_MODE) {
1184
+ const err = new Error(`0 width match regex (${languageName})`);
1185
+ err.languageName = languageName;
1186
+ err.badRule = lastMatch.rule;
1187
+ throw err;
807
1188
  }
808
1189
  return 1;
809
1190
  }
810
- if (X = o, o.type === "begin")
811
- return jt(o);
812
- if (o.type === "illegal" && !h) {
813
- const d = new Error('Illegal lexeme "' + g + '" for mode "' + (f.scope || "<unnamed>") + '"');
814
- throw d.mode = f, d;
815
- } else if (o.type === "end") {
816
- const d = Ut(o);
817
- if (d !== Re)
818
- return d;
1191
+ lastMatch = match;
1192
+ if (match.type === "begin") {
1193
+ return doBeginMatch(match);
1194
+ } else if (match.type === "illegal" && !ignoreIllegals) {
1195
+ const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || "<unnamed>") + '"');
1196
+ err.mode = top;
1197
+ throw err;
1198
+ } else if (match.type === "end") {
1199
+ const processed = doEndMatch(match);
1200
+ if (processed !== NO_MATCH) {
1201
+ return processed;
1202
+ }
819
1203
  }
820
- if (o.type === "illegal" && g === "")
1204
+ if (match.type === "illegal" && lexeme === "") {
821
1205
  return 1;
822
- if (ie > 1e5 && ie > o.index * 3)
823
- throw new Error("potential infinite loop, way more iterations than matches");
824
- return E += g, g.length;
1206
+ }
1207
+ if (iterations > 1e5 && iterations > match.index * 3) {
1208
+ const err = new Error("potential infinite loop, way more iterations than matches");
1209
+ throw err;
1210
+ }
1211
+ modeBuffer += lexeme;
1212
+ return lexeme.length;
1213
+ }
1214
+ const language = getLanguage(languageName);
1215
+ if (!language) {
1216
+ error(LANGUAGE_NOT_FOUND.replace("{}", languageName));
1217
+ throw new Error('Unknown language: "' + languageName + '"');
825
1218
  }
826
- const A = I(n);
827
- if (!A)
828
- throw D(_.replace("{}", n)), new Error('Unknown language: "' + n + '"');
829
- const Gt = wt(A);
830
- let ne = "", f = p || Gt;
831
- const ve = {}, O = new r.__emitter(r);
832
- $t();
833
- let E = "", Y = 0, C = 0, ie = 0, se = !1;
1219
+ const md = compileLanguage(language);
1220
+ let result = "";
1221
+ let top = continuation || md;
1222
+ const continuations = {};
1223
+ const emitter = new options.__emitter(options);
1224
+ processContinuations();
1225
+ let modeBuffer = "";
1226
+ let relevance = 0;
1227
+ let index = 0;
1228
+ let iterations = 0;
1229
+ let resumeScanAtSamePosition = false;
834
1230
  try {
835
- if (A.__emitTokens)
836
- A.__emitTokens(a, O);
837
- else {
838
- for (f.matcher.considerAll(); ; ) {
839
- ie++, se ? se = !1 : f.matcher.considerAll(), f.matcher.lastIndex = C;
840
- const s = f.matcher.exec(a);
841
- if (!s) break;
842
- const o = a.substring(C, s.index), g = Be(o, s);
843
- C = s.index + g;
1231
+ if (!language.__emitTokens) {
1232
+ top.matcher.considerAll();
1233
+ for (; ; ) {
1234
+ iterations++;
1235
+ if (resumeScanAtSamePosition) {
1236
+ resumeScanAtSamePosition = false;
1237
+ } else {
1238
+ top.matcher.considerAll();
1239
+ }
1240
+ top.matcher.lastIndex = index;
1241
+ const match = top.matcher.exec(codeToHighlight);
1242
+ if (!match) break;
1243
+ const beforeMatch = codeToHighlight.substring(index, match.index);
1244
+ const processedCount = processLexeme(beforeMatch, match);
1245
+ index = match.index + processedCount;
844
1246
  }
845
- Be(a.substring(C));
1247
+ processLexeme(codeToHighlight.substring(index));
1248
+ } else {
1249
+ language.__emitTokens(codeToHighlight, emitter);
846
1250
  }
847
- return O.finalize(), ne = O.toHTML(), {
848
- language: n,
849
- value: ne,
850
- relevance: Y,
851
- illegal: !1,
852
- _emitter: O,
853
- _top: f
1251
+ emitter.finalize();
1252
+ result = emitter.toHTML();
1253
+ return {
1254
+ language: languageName,
1255
+ value: result,
1256
+ relevance,
1257
+ illegal: false,
1258
+ _emitter: emitter,
1259
+ _top: top
854
1260
  };
855
- } catch (s) {
856
- if (s.message && s.message.includes("Illegal"))
1261
+ } catch (err) {
1262
+ if (err.message && err.message.includes("Illegal")) {
857
1263
  return {
858
- language: n,
859
- value: Q(a),
860
- illegal: !0,
1264
+ language: languageName,
1265
+ value: escape(codeToHighlight),
1266
+ illegal: true,
861
1267
  relevance: 0,
862
1268
  _illegalBy: {
863
- message: s.message,
864
- index: C,
865
- context: a.slice(C - 100, C + 100),
866
- mode: s.mode,
867
- resultSoFar: ne
1269
+ message: err.message,
1270
+ index,
1271
+ context: codeToHighlight.slice(index - 100, index + 100),
1272
+ mode: err.mode,
1273
+ resultSoFar: result
868
1274
  },
869
- _emitter: O
1275
+ _emitter: emitter
870
1276
  };
871
- if (b)
1277
+ } else if (SAFE_MODE) {
872
1278
  return {
873
- language: n,
874
- value: Q(a),
875
- illegal: !1,
1279
+ language: languageName,
1280
+ value: escape(codeToHighlight),
1281
+ illegal: false,
876
1282
  relevance: 0,
877
- errorRaised: s,
878
- _emitter: O,
879
- _top: f
1283
+ errorRaised: err,
1284
+ _emitter: emitter,
1285
+ _top: top
880
1286
  };
881
- throw s;
1287
+ } else {
1288
+ throw err;
1289
+ }
882
1290
  }
883
1291
  }
884
- function m(n) {
885
- const a = {
886
- value: Q(n),
887
- illegal: !1,
1292
+ function justTextHighlightResult(code) {
1293
+ const result = {
1294
+ value: escape(code),
1295
+ illegal: false,
888
1296
  relevance: 0,
889
- _top: c,
890
- _emitter: new r.__emitter(r)
1297
+ _top: PLAINTEXT_LANGUAGE,
1298
+ _emitter: new options.__emitter(options)
891
1299
  };
892
- return a._emitter.addText(n), a;
1300
+ result._emitter.addText(code);
1301
+ return result;
893
1302
  }
894
- function ee(n, a) {
895
- a = a || r.languages || Object.keys(t);
896
- const h = m(n), p = a.filter(I).filter(Ae).map(
897
- (y) => U(y, n, !1)
1303
+ function highlightAuto(code, languageSubset) {
1304
+ languageSubset = languageSubset || options.languages || Object.keys(languages);
1305
+ const plaintext = justTextHighlightResult(code);
1306
+ const results = languageSubset.filter(getLanguage).filter(autoDetection).map(
1307
+ (name) => _highlight(name, code, false)
898
1308
  );
899
- p.unshift(h);
900
- const w = p.sort((y, N) => {
901
- if (y.relevance !== N.relevance) return N.relevance - y.relevance;
902
- if (y.language && N.language) {
903
- if (I(y.language).supersetOf === N.language)
1309
+ results.unshift(plaintext);
1310
+ const sorted = results.sort((a, b) => {
1311
+ if (a.relevance !== b.relevance) return b.relevance - a.relevance;
1312
+ if (a.language && b.language) {
1313
+ if (getLanguage(a.language).supersetOf === b.language) {
904
1314
  return 1;
905
- if (I(N.language).supersetOf === y.language)
1315
+ } else if (getLanguage(b.language).supersetOf === a.language) {
906
1316
  return -1;
1317
+ }
907
1318
  }
908
1319
  return 0;
909
- }), [S, B] = w, F = S;
910
- return F.secondBest = B, F;
911
- }
912
- function St(n, a, h) {
913
- const p = a && i[a] || h;
914
- n.classList.add("hljs"), n.classList.add(`language-${p}`);
915
- }
916
- function te(n) {
917
- let a = null;
918
- const h = x(n);
919
- if (l(h)) return;
920
- if (z(
1320
+ });
1321
+ const [best, secondBest] = sorted;
1322
+ const result = best;
1323
+ result.secondBest = secondBest;
1324
+ return result;
1325
+ }
1326
+ function updateClassName(element, currentLang, resultLang) {
1327
+ const language = currentLang && aliases[currentLang] || resultLang;
1328
+ element.classList.add("hljs");
1329
+ element.classList.add(`language-${language}`);
1330
+ }
1331
+ function highlightElement(element) {
1332
+ let node = null;
1333
+ const language = blockLanguage(element);
1334
+ if (shouldNotHighlight(language)) return;
1335
+ fire(
921
1336
  "before:highlightElement",
922
- { el: n, language: h }
923
- ), n.dataset.highlighted) {
924
- console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", n);
1337
+ { el: element, language }
1338
+ );
1339
+ if (element.dataset.highlighted) {
1340
+ console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", element);
925
1341
  return;
926
1342
  }
927
- if (n.children.length > 0 && (r.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(n)), r.throwUnescapedHTML))
928
- throw new Rt(
929
- "One of your code blocks includes unescaped HTML.",
930
- n.innerHTML
931
- );
932
- a = n;
933
- const p = a.textContent, w = h ? M(p, { language: h, ignoreIllegals: !0 }) : ee(p);
934
- n.innerHTML = w.value, n.dataset.highlighted = "yes", St(n, h, w.language), n.result = {
935
- language: w.language,
1343
+ if (element.children.length > 0) {
1344
+ if (!options.ignoreUnescapedHTML) {
1345
+ console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk.");
1346
+ console.warn("https://github.com/highlightjs/highlight.js/wiki/security");
1347
+ console.warn("The element with unescaped HTML:");
1348
+ console.warn(element);
1349
+ }
1350
+ if (options.throwUnescapedHTML) {
1351
+ const err = new HTMLInjectionError(
1352
+ "One of your code blocks includes unescaped HTML.",
1353
+ element.innerHTML
1354
+ );
1355
+ throw err;
1356
+ }
1357
+ }
1358
+ node = element;
1359
+ const text = node.textContent;
1360
+ const result = language ? highlight2(text, { language, ignoreIllegals: true }) : highlightAuto(text);
1361
+ element.innerHTML = result.value;
1362
+ element.dataset.highlighted = "yes";
1363
+ updateClassName(element, language, result.language);
1364
+ element.result = {
1365
+ language: result.language,
936
1366
  // TODO: remove with version 11.0
937
- re: w.relevance,
938
- relevance: w.relevance
939
- }, w.secondBest && (n.secondBest = {
940
- language: w.secondBest.language,
941
- relevance: w.secondBest.relevance
942
- }), z("after:highlightElement", { el: n, result: w, text: p });
943
- }
944
- function Nt(n) {
945
- r = Oe(r, n);
946
- }
947
- const At = () => {
948
- K(), L("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
1367
+ re: result.relevance,
1368
+ relevance: result.relevance
1369
+ };
1370
+ if (result.secondBest) {
1371
+ element.secondBest = {
1372
+ language: result.secondBest.language,
1373
+ relevance: result.secondBest.relevance
1374
+ };
1375
+ }
1376
+ fire("after:highlightElement", { el: element, result, text });
1377
+ }
1378
+ function configure(userOptions) {
1379
+ options = inherit(options, userOptions);
1380
+ }
1381
+ const initHighlighting = () => {
1382
+ highlightAll();
1383
+ deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
949
1384
  };
950
- function kt() {
951
- K(), L("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
1385
+ function initHighlightingOnLoad() {
1386
+ highlightAll();
1387
+ deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
952
1388
  }
953
- let Se = !1;
954
- function K() {
1389
+ let wantsHighlight = false;
1390
+ function highlightAll() {
955
1391
  if (document.readyState === "loading") {
956
- Se = !0;
1392
+ wantsHighlight = true;
957
1393
  return;
958
1394
  }
959
- document.querySelectorAll(r.cssSelector).forEach(te);
1395
+ const blocks = document.querySelectorAll(options.cssSelector);
1396
+ blocks.forEach(highlightElement);
1397
+ }
1398
+ function boot() {
1399
+ if (wantsHighlight) highlightAll();
960
1400
  }
961
- function Tt() {
962
- Se && K();
1401
+ if (typeof window !== "undefined" && window.addEventListener) {
1402
+ window.addEventListener("DOMContentLoaded", boot, false);
963
1403
  }
964
- typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", Tt, !1);
965
- function It(n, a) {
966
- let h = null;
1404
+ function registerLanguage(languageName, languageDefinition) {
1405
+ let lang = null;
967
1406
  try {
968
- h = a(e);
969
- } catch (p) {
970
- if (D("Language definition for '{}' could not be registered.".replace("{}", n)), b)
971
- D(p);
972
- else
973
- throw p;
974
- h = c;
1407
+ lang = languageDefinition(hljs);
1408
+ } catch (error$1) {
1409
+ error("Language definition for '{}' could not be registered.".replace("{}", languageName));
1410
+ if (!SAFE_MODE) {
1411
+ throw error$1;
1412
+ } else {
1413
+ error(error$1);
1414
+ }
1415
+ lang = PLAINTEXT_LANGUAGE;
1416
+ }
1417
+ if (!lang.name) lang.name = languageName;
1418
+ languages[languageName] = lang;
1419
+ lang.rawDefinition = languageDefinition.bind(null, hljs);
1420
+ if (lang.aliases) {
1421
+ registerAliases(lang.aliases, { languageName });
975
1422
  }
976
- h.name || (h.name = n), t[n] = h, h.rawDefinition = a.bind(null, e), h.aliases && Ne(h.aliases, { languageName: n });
977
1423
  }
978
- function Bt(n) {
979
- delete t[n];
980
- for (const a of Object.keys(i))
981
- i[a] === n && delete i[a];
1424
+ function unregisterLanguage(languageName) {
1425
+ delete languages[languageName];
1426
+ for (const alias of Object.keys(aliases)) {
1427
+ if (aliases[alias] === languageName) {
1428
+ delete aliases[alias];
1429
+ }
1430
+ }
982
1431
  }
983
- function vt() {
984
- return Object.keys(t);
1432
+ function listLanguages() {
1433
+ return Object.keys(languages);
985
1434
  }
986
- function I(n) {
987
- return n = (n || "").toLowerCase(), t[n] || t[i[n]];
1435
+ function getLanguage(name) {
1436
+ name = (name || "").toLowerCase();
1437
+ return languages[name] || languages[aliases[name]];
988
1438
  }
989
- function Ne(n, { languageName: a }) {
990
- typeof n == "string" && (n = [n]), n.forEach((h) => {
991
- i[h.toLowerCase()] = a;
1439
+ function registerAliases(aliasList, { languageName }) {
1440
+ if (typeof aliasList === "string") {
1441
+ aliasList = [aliasList];
1442
+ }
1443
+ aliasList.forEach((alias) => {
1444
+ aliases[alias.toLowerCase()] = languageName;
992
1445
  });
993
1446
  }
994
- function Ae(n) {
995
- const a = I(n);
996
- return a && !a.disableAutodetect;
1447
+ function autoDetection(name) {
1448
+ const lang = getLanguage(name);
1449
+ return lang && !lang.disableAutodetect;
997
1450
  }
998
- function Dt(n) {
999
- n["before:highlightBlock"] && !n["before:highlightElement"] && (n["before:highlightElement"] = (a) => {
1000
- n["before:highlightBlock"](
1001
- Object.assign({ block: a.el }, a)
1002
- );
1003
- }), n["after:highlightBlock"] && !n["after:highlightElement"] && (n["after:highlightElement"] = (a) => {
1004
- n["after:highlightBlock"](
1005
- Object.assign({ block: a.el }, a)
1006
- );
1007
- });
1451
+ function upgradePluginAPI(plugin) {
1452
+ if (plugin["before:highlightBlock"] && !plugin["before:highlightElement"]) {
1453
+ plugin["before:highlightElement"] = (data) => {
1454
+ plugin["before:highlightBlock"](
1455
+ Object.assign({ block: data.el }, data)
1456
+ );
1457
+ };
1458
+ }
1459
+ if (plugin["after:highlightBlock"] && !plugin["after:highlightElement"]) {
1460
+ plugin["after:highlightElement"] = (data) => {
1461
+ plugin["after:highlightBlock"](
1462
+ Object.assign({ block: data.el }, data)
1463
+ );
1464
+ };
1465
+ }
1008
1466
  }
1009
- function Ct(n) {
1010
- Dt(n), u.push(n);
1467
+ function addPlugin(plugin) {
1468
+ upgradePluginAPI(plugin);
1469
+ plugins.push(plugin);
1011
1470
  }
1012
- function Lt(n) {
1013
- const a = u.indexOf(n);
1014
- a !== -1 && u.splice(a, 1);
1471
+ function removePlugin(plugin) {
1472
+ const index = plugins.indexOf(plugin);
1473
+ if (index !== -1) {
1474
+ plugins.splice(index, 1);
1475
+ }
1015
1476
  }
1016
- function z(n, a) {
1017
- const h = n;
1018
- u.forEach(function(p) {
1019
- p[h] && p[h](a);
1477
+ function fire(event, args) {
1478
+ const cb = event;
1479
+ plugins.forEach(function(plugin) {
1480
+ if (plugin[cb]) {
1481
+ plugin[cb](args);
1482
+ }
1020
1483
  });
1021
1484
  }
1022
- function Ht(n) {
1023
- return L("10.7.0", "highlightBlock will be removed entirely in v12.0"), L("10.7.0", "Please use highlightElement now."), te(n);
1485
+ function deprecateHighlightBlock(el) {
1486
+ deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0");
1487
+ deprecated("10.7.0", "Please use highlightElement now.");
1488
+ return highlightElement(el);
1024
1489
  }
1025
- Object.assign(e, {
1026
- highlight: M,
1027
- highlightAuto: ee,
1028
- highlightAll: K,
1029
- highlightElement: te,
1490
+ Object.assign(hljs, {
1491
+ highlight: highlight2,
1492
+ highlightAuto,
1493
+ highlightAll,
1494
+ highlightElement,
1030
1495
  // TODO: Remove with v12 API
1031
- highlightBlock: Ht,
1032
- configure: Nt,
1033
- initHighlighting: At,
1034
- initHighlightingOnLoad: kt,
1035
- registerLanguage: It,
1036
- unregisterLanguage: Bt,
1037
- listLanguages: vt,
1038
- getLanguage: I,
1039
- registerAliases: Ne,
1040
- autoDetection: Ae,
1041
- inherit: Oe,
1042
- addPlugin: Ct,
1043
- removePlugin: Lt
1044
- }), e.debugMode = function() {
1045
- b = !1;
1046
- }, e.safeMode = function() {
1047
- b = !0;
1048
- }, e.versionString = Ot, e.regex = {
1049
- concat: v,
1050
- lookahead: fe,
1051
- either: q,
1052
- optional: Ue,
1053
- anyNumberOfTimes: je
1496
+ highlightBlock: deprecateHighlightBlock,
1497
+ configure,
1498
+ initHighlighting,
1499
+ initHighlightingOnLoad,
1500
+ registerLanguage,
1501
+ unregisterLanguage,
1502
+ listLanguages,
1503
+ getLanguage,
1504
+ registerAliases,
1505
+ autoDetection,
1506
+ inherit,
1507
+ addPlugin,
1508
+ removePlugin
1509
+ });
1510
+ hljs.debugMode = function() {
1511
+ SAFE_MODE = false;
1054
1512
  };
1055
- for (const n in G)
1056
- typeof G[n] == "object" && ce(G[n]);
1057
- return Object.assign(e, G), e;
1058
- }, H = ye({});
1059
- return H.newInstance = () => ye({}), re = H, H.HighlightJS = H, H.default = H, re;
1513
+ hljs.safeMode = function() {
1514
+ SAFE_MODE = true;
1515
+ };
1516
+ hljs.versionString = version;
1517
+ hljs.regex = {
1518
+ concat,
1519
+ lookahead,
1520
+ either,
1521
+ optional,
1522
+ anyNumberOfTimes
1523
+ };
1524
+ for (const key in MODES) {
1525
+ if (typeof MODES[key] === "object") {
1526
+ deepFreeze(MODES[key]);
1527
+ }
1528
+ }
1529
+ Object.assign(hljs, MODES);
1530
+ return hljs;
1531
+ };
1532
+ const highlight = HLJS({});
1533
+ highlight.newInstance = () => HLJS({});
1534
+ core = highlight;
1535
+ highlight.HighlightJS = highlight;
1536
+ highlight.default = highlight;
1537
+ return core;
1060
1538
  }
1061
1539
  export {
1062
- Ft as r
1540
+ requireCore as r
1063
1541
  };