@vc-shell/framework 1.1.46 → 1.1.47

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 (360) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/core/plugins/modularity/loader.ts +126 -97
  3. package/dist/assets/042c75b764bc78a7.svg +1 -0
  4. package/dist/assets/0ba156439a339f2a.svg +1 -0
  5. package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
  6. package/dist/assets/0f590f8a94577092.svg +1 -0
  7. package/dist/assets/0fc5820f8be53a1b.svg +1 -0
  8. package/dist/assets/10768e2cc79fc60b.svg +1 -0
  9. package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
  10. package/dist/assets/157b8721e0600ea8.svg +1 -0
  11. package/dist/assets/15e91cdd649cde9a.svg +1 -0
  12. package/dist/assets/1a3e84b2457f709a.woff +0 -0
  13. package/dist/assets/1de63eb118636cce.svg +1 -0
  14. package/dist/assets/1ea01de36eb5491b.svg +1 -0
  15. package/dist/assets/204eaf512fde2023.svg +1 -0
  16. package/dist/assets/2088983edf42e153.svg +1 -0
  17. package/dist/assets/208f810a9321a327.svg +1 -0
  18. package/dist/assets/21220a9d10e6c558.svg +1 -0
  19. package/dist/assets/220db345a102045d.woff2 +0 -0
  20. package/dist/assets/225da11d23968333.svg +1 -0
  21. package/dist/assets/226f862dd81bdc13.woff2 +0 -0
  22. package/dist/assets/23a2d53395ddb14f.woff +0 -0
  23. package/dist/assets/259e6ad461a52ad7.svg +1 -0
  24. package/dist/assets/261e6dec4d53b9ac.woff +0 -0
  25. package/dist/assets/262f46a0b6d94bb6.svg +1 -0
  26. package/dist/assets/2857c513073467da.svg +1 -0
  27. package/dist/assets/2b3be7889467d98f.woff +0 -0
  28. package/dist/assets/2d4e6190eec72737.svg +1 -0
  29. package/dist/assets/2eba973185078bc8.woff +0 -0
  30. package/dist/assets/327511cd4a7ba7f9.woff +0 -0
  31. package/dist/assets/334d3f6bc766c516.woff +0 -0
  32. package/dist/assets/34ff7dd0c2285956.svg +1 -0
  33. package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
  34. package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
  35. package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
  36. package/dist/assets/41275bcb979cb650.svg +1 -0
  37. package/dist/assets/42df4e2d6fa3fd2a.woff2 +0 -0
  38. package/dist/assets/434f7982590e462f.woff +0 -0
  39. package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
  40. package/dist/assets/4d7a77b0e5373992.svg +1 -0
  41. package/dist/assets/4e43c74354534fb3.svg +1 -0
  42. package/dist/assets/4fe75f5117100705.svg +1 -0
  43. package/dist/assets/52610491f372cb0c.woff2 +0 -0
  44. package/dist/assets/52e261a005074e1b.woff +0 -0
  45. package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
  46. package/dist/assets/572bb1bb4156a9c1.svg +1 -0
  47. package/dist/assets/5b3661be8be679d0.woff2 +0 -0
  48. package/dist/assets/5d96cfcc5bedd917.woff2 +0 -0
  49. package/dist/assets/6075995d7e74da46.woff2 +0 -0
  50. package/dist/assets/617c4736236e199e.woff +0 -0
  51. package/dist/assets/6619e9e10beea0e7.woff2 +0 -0
  52. package/dist/assets/67230f05dc94a265.svg +1 -0
  53. package/dist/assets/6798e4dd4add9b48.svg +1 -0
  54. package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
  55. package/dist/assets/6a3e73faf406cf33.svg +1 -0
  56. package/dist/assets/72de3a63bc0b70dd.svg +1 -0
  57. package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
  58. package/dist/assets/74ed5f8a78e71106.svg +1 -0
  59. package/dist/assets/7ce0c166fd6a1204.woff +0 -0
  60. package/dist/assets/7d55399c2a7bc985.svg +1 -0
  61. package/dist/assets/7d970675c69fca1d.woff +0 -0
  62. package/dist/assets/7eda727273fd98d3.svg +1 -0
  63. package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
  64. package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
  65. package/dist/assets/861e6b7192b3b6c7.woff +0 -0
  66. package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
  67. package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
  68. package/dist/assets/910b0d99b9e26568.svg +1 -0
  69. package/dist/assets/91eee1aa81f72683.woff +0 -0
  70. package/dist/assets/92508f8707159b51.svg +1 -0
  71. package/dist/assets/9392bf1d591e1abb.svg +1 -0
  72. package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
  73. package/dist/assets/9cb83236f6bb7ab1.svg +1 -0
  74. package/dist/assets/9d37314695c0b68d.woff +0 -0
  75. package/dist/assets/a18404194e3f9047.svg +1 -0
  76. package/dist/assets/a2017fe7f0a26510.svg +1 -0
  77. package/dist/assets/a47034e65dbcc3d7.woff +0 -0
  78. package/dist/assets/a617e11804bbacb7.woff +0 -0
  79. package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
  80. package/dist/assets/abf88f301a0730f4.svg +1 -0
  81. package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
  82. package/dist/assets/b1a596e31ad1185a.svg +1 -0
  83. package/dist/assets/b27767411c8427be.woff +0 -0
  84. package/dist/assets/b291dc35a17511f7.woff +0 -0
  85. package/dist/assets/b325adcae33bbe7a.svg +1 -0
  86. package/dist/assets/b372390551ca2fa1.svg +1 -0
  87. package/dist/assets/b5bb1e8fc975decd.svg +1 -0
  88. package/dist/assets/b645a4a2181b9dc1.svg +1 -0
  89. package/dist/assets/b6499ddce0a4ef7d.svg +1 -0
  90. package/dist/assets/b94421fadd23b0f2.svg +1 -0
  91. package/dist/assets/bb28fb0f27f1c11b.svg +1 -0
  92. package/dist/assets/bfbe205759295eca.woff2 +0 -0
  93. package/dist/assets/ca791c5ca5848a03.svg +1 -0
  94. package/dist/assets/cb32840ce330103f.woff +0 -0
  95. package/dist/assets/d084bda16abe8a56.svg +1 -0
  96. package/dist/assets/d32b129cae2fffd6.svg +1 -0
  97. package/dist/assets/d35a4c7113315758.woff2 +0 -0
  98. package/dist/assets/d3f792f54ae4c307.svg +1 -0
  99. package/dist/assets/d5a5b8630120073d.svg +1 -0
  100. package/dist/assets/d5f9664ebbfb104b.svg +1 -0
  101. package/dist/assets/d80b05788e407de7.woff2 +0 -0
  102. package/dist/assets/d84247b59449dd88.woff2 +0 -0
  103. package/dist/assets/dd05d43ff0df2fc7.svg +1 -0
  104. package/dist/assets/e38acaa1757232e0.svg +1 -0
  105. package/dist/assets/e4a8550f1c7ffe36.svg +1 -0
  106. package/dist/assets/e5adb5ae3a3698f6.svg +1 -0
  107. package/dist/assets/e61a1889bac955f4.woff2 +0 -0
  108. package/dist/assets/e72bb11356af94c7.svg +1 -0
  109. package/dist/assets/e98196a9f8dcb2f0.svg +1 -0
  110. package/dist/assets/ebec912a42ad49ff.woff +0 -0
  111. package/dist/assets/f09d89268e4c0317.svg +1 -0
  112. package/dist/assets/f276d55184e05a07.woff +0 -0
  113. package/dist/assets/f5722262b6e7214e.woff2 +0 -0
  114. package/dist/assets/f7fc8bf46089d8b2.svg +1 -0
  115. package/dist/assets/fcb1c1ffb5640194.woff +0 -0
  116. package/dist/assets/fe141d99763f5d2b.woff +0 -0
  117. package/dist/assets/fed13b0d59903483.svg +1 -0
  118. package/dist/assets/fed757d2c2344ead.woff2 +0 -0
  119. package/dist/assets/ffc438f20e79ce73.woff +0 -0
  120. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  121. package/dist/framework.js +16544 -25878
  122. package/dist/index.css +1 -1
  123. package/dist/index.d.ts +5 -8
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/tsconfig.tsbuildinfo +1 -1
  126. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  127. package/dist/vendor-boolbase-Bgn9I6iN.js +21 -0
  128. package/dist/vendor-cheerio-CleDsuQZ.js +1053 -0
  129. package/dist/vendor-cheerio-select-CVkYl3Z-.js +191 -0
  130. package/dist/vendor-css-select-CtIzVIiG.js +622 -0
  131. package/dist/vendor-css-what-CZZaquJM.js +267 -0
  132. package/dist/vendor-cypress-signalr-mock-CdKwIhWw.js +769 -0
  133. package/dist/vendor-date-fns-CdFbeoHV.js +2989 -0
  134. package/dist/vendor-dom-serializer-CugO0RdN.js +213 -0
  135. package/dist/vendor-dom7-wvIUV9pT.js +529 -0
  136. package/dist/vendor-domelementtype-B3sFIGaC.js +21 -0
  137. package/dist/vendor-domhandler-CL40eeX9.js +311 -0
  138. package/dist/vendor-dompurify-eYFoHPwR.js +528 -0
  139. package/dist/vendor-domutils-D3Y2YQFR.js +386 -0
  140. package/dist/vendor-entities-v26HW8wW.js +363 -0
  141. package/dist/vendor-floating-ui-core-C9uEvi1M.js +349 -0
  142. package/dist/vendor-floating-ui-dom-CZkYGmv4.js +393 -0
  143. package/dist/vendor-floating-ui-utils-Bx3BTd6_.js +259 -0
  144. package/dist/vendor-floating-ui-vue-CLOiVYP7.js +107 -0
  145. package/dist/vendor-headlessui-vue-Dg0Llidi.js +961 -0
  146. package/dist/vendor-htmlparser2-CXL_uhMI.js +735 -0
  147. package/dist/vendor-iconify-vue-D4fihzvl.js +1205 -0
  148. package/dist/vendor-intlify-core-base-Bvt2vJFV.js +1129 -0
  149. package/dist/vendor-intlify-message-compiler-1VxNzq21.js +945 -0
  150. package/dist/vendor-intlify-shared-D7kiPMOG.js +130 -0
  151. package/dist/vendor-iso-639-1-dVGfSUIM.js +781 -0
  152. package/dist/vendor-linkify-it-LzoUhj6C.js +199 -0
  153. package/dist/vendor-linkifyjs-DTu7SY_Y.js +705 -0
  154. package/dist/vendor-lodash-es-CrYlgAi8.js +4816 -0
  155. package/dist/vendor-markdown-it-4AJoRTAg.js +2263 -0
  156. package/dist/vendor-markdown-it-task-lists-Byg1-ms9.js +69 -0
  157. package/dist/vendor-mdurl-DZFDNdqC.js +192 -0
  158. package/dist/vendor-microsoft-applicationinsights-analytics-js-DA-ctcAL.js +1105 -0
  159. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-COfRj-2q.js +261 -0
  160. package/dist/vendor-microsoft-applicationinsights-channel-js-MTPYhH-I.js +1809 -0
  161. package/dist/vendor-microsoft-applicationinsights-common-CDVnJ6MR.js +1921 -0
  162. package/dist/vendor-microsoft-applicationinsights-core-js-D7Aicf8S.js +4127 -0
  163. package/dist/vendor-microsoft-applicationinsights-dependencies-js-CvQWWraU.js +1399 -0
  164. package/dist/vendor-microsoft-applicationinsights-properties-js-C0Iv1cZE.js +572 -0
  165. package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +43 -0
  166. package/dist/vendor-microsoft-applicationinsights-web-BRuQAzjU.js +487 -0
  167. package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +147 -0
  168. package/dist/vendor-microsoft-signalr-qIrag5xx.js +1761 -0
  169. package/dist/vendor-moment-CwOqp704.js +2589 -0
  170. package/dist/vendor-nevware21-ts-async-FAyg3c9V.js +260 -0
  171. package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +853 -0
  172. package/dist/vendor-nth-check-BE7AeBMg.js +45 -0
  173. package/dist/vendor-orderedmap-B3SOk52B.js +103 -0
  174. package/dist/vendor-parse5-DqztJOGh.js +5747 -0
  175. package/dist/vendor-parse5-htmlparser2-tree-adapter-CNubfdOP.js +143 -0
  176. package/dist/vendor-popperjs-core-LGjf7Wza.js +905 -0
  177. package/dist/vendor-prettier-D8C9GG-0.js +4858 -0
  178. package/dist/vendor-prosemirror-commands-BqYcdumy.js +344 -0
  179. package/dist/vendor-prosemirror-dropcursor-zknUsW5x.js +86 -0
  180. package/dist/vendor-prosemirror-gapcursor-DjOZhP78.js +200 -0
  181. package/dist/vendor-prosemirror-history-l8l3CFac.js +248 -0
  182. package/dist/vendor-prosemirror-keymap-C17r08p-.js +62 -0
  183. package/dist/vendor-prosemirror-markdown-WJEDhc-w.js +650 -0
  184. package/dist/vendor-prosemirror-model-BN5TnJD_.js +2736 -0
  185. package/dist/vendor-prosemirror-schema-list-CR0gi7aY.js +87 -0
  186. package/dist/vendor-prosemirror-state-B0bFP8WI.js +821 -0
  187. package/dist/vendor-prosemirror-tables-B1txTKlC.js +1711 -0
  188. package/dist/vendor-prosemirror-transform-Bo7kNPme.js +1507 -0
  189. package/dist/vendor-prosemirror-view--C7TZvmQ.js +3746 -0
  190. package/dist/vendor-punycode-js-CNI-zL6U.js +133 -0
  191. package/dist/vendor-rope-sequence-sEGCUMi8.js +100 -0
  192. package/dist/vendor-semver-BoKYtkQw.js +1021 -0
  193. package/dist/vendor-ssr-window-D4k3p53c.js +133 -0
  194. package/dist/vendor-swiper-CMVLTGu0.js +2825 -0
  195. package/dist/vendor-tippy-js-BGdgwGX-.js +812 -0
  196. package/dist/vendor-tiptap-core-BRY37Sb2.js +2806 -0
  197. package/dist/vendor-tiptap-extension-blockquote-CPd5qv-9.js +43 -0
  198. package/dist/vendor-tiptap-extension-bold-B0GwBNks.js +71 -0
  199. package/dist/vendor-tiptap-extension-bubble-menu-B0sZZld7.js +128 -0
  200. package/dist/vendor-tiptap-extension-bullet-list-CQm4ReOu.js +53 -0
  201. package/dist/vendor-tiptap-extension-code-C8cy6bRj.js +51 -0
  202. package/dist/vendor-tiptap-extension-code-block-BqTchNEf.js +133 -0
  203. package/dist/vendor-tiptap-extension-document-Dka1Uu0g.js +9 -0
  204. package/dist/vendor-tiptap-extension-dropcursor-CFSh-BuE.js +20 -0
  205. package/dist/vendor-tiptap-extension-floating-menu-H8PB4zeI.js +99 -0
  206. package/dist/vendor-tiptap-extension-gapcursor-CzwfD_IT.js +24 -0
  207. package/dist/vendor-tiptap-extension-hard-break-Rm6aVcrK.js +55 -0
  208. package/dist/vendor-tiptap-extension-heading-CavI6u1v.js +54 -0
  209. package/dist/vendor-tiptap-extension-history-WEN1_74D.js +35 -0
  210. package/dist/vendor-tiptap-extension-horizontal-rule-DZkUEL6s.js +58 -0
  211. package/dist/vendor-tiptap-extension-image-B67_mxGM.js +64 -0
  212. package/dist/vendor-tiptap-extension-italic-BshxBFou.js +70 -0
  213. package/dist/vendor-tiptap-extension-link-CJAQIgui.js +262 -0
  214. package/dist/vendor-tiptap-extension-list-item-DF-iMpqO.js +33 -0
  215. package/dist/vendor-tiptap-extension-ordered-list-CN8MF-kN.js +71 -0
  216. package/dist/vendor-tiptap-extension-paragraph-DI577lM5.js +33 -0
  217. package/dist/vendor-tiptap-extension-placeholder-DwAtlfAF.js +52 -0
  218. package/dist/vendor-tiptap-extension-strike-CIty09KN.js +61 -0
  219. package/dist/vendor-tiptap-extension-table-C5nv-GUb.js +213 -0
  220. package/dist/vendor-tiptap-extension-table-cell-DXbBhJW3.js +40 -0
  221. package/dist/vendor-tiptap-extension-table-header-rtggsYXA.js +40 -0
  222. package/dist/vendor-tiptap-extension-table-row-67khjMDt.js +22 -0
  223. package/dist/vendor-tiptap-extension-text-D1OHb_a1.js +8 -0
  224. package/dist/vendor-tiptap-extension-underline-IqWixw3m.js +40 -0
  225. package/dist/vendor-tiptap-markdown-DVxB1hbO.js +825 -0
  226. package/dist/vendor-tiptap-starter-kit-CPH9gu2X.js +29 -0
  227. package/dist/vendor-tiptap-vue-3-CkBe4_xM.js +225 -0
  228. package/dist/vendor-truncate-html-Bx1HJzRq.js +145 -0
  229. package/dist/vendor-uc-micro-4lbSaZOs.js +17 -0
  230. package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +93 -0
  231. package/dist/vendor-vee-validate-rules-DDeNM2Gc.js +314 -0
  232. package/dist/vendor-vue-currency-input-DxWnS-HB.js +315 -0
  233. package/dist/vendor-vue-devtools-api-aVYGocXp.js +93 -0
  234. package/dist/vendor-vue-i18n-DPtOLen3.js +1359 -0
  235. package/dist/vendor-vue3-application-insights-dAGGfA_M.js +69 -0
  236. package/dist/vendor-vue3-touch-events-8Pa3HHlV.js +169 -0
  237. package/dist/vendor-vuepic-vue-datepicker-DglsiNYa.js +4997 -0
  238. package/dist/vendor-vueuse-components-DtK_mxpP.js +219 -0
  239. package/dist/vendor-vueuse-core-cB-c7DzH.js +5129 -0
  240. package/dist/vendor-vueuse-shared-Dg7PMM0z.js +1169 -0
  241. package/dist/vendor-w3c-keyname-CLxH8j-f.js +92 -0
  242. package/dist/vendor-whatwg-fetch-l0sNRNKZ.js +1 -0
  243. package/package.json +5 -4
  244. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +2 -1
  245. package/dist/vendor-boolbase-Cp9L0GAZ.js +0 -25
  246. package/dist/vendor-cheerio-HN9zIPZn.js +0 -3135
  247. package/dist/vendor-cheerio-select-5Ry0HvBq.js +0 -306
  248. package/dist/vendor-css-select-DRIZ9kfZ.js +0 -966
  249. package/dist/vendor-css-what-DuPJ1HEF.js +0 -448
  250. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +0 -778
  251. package/dist/vendor-date-fns-515YWkk-.js +0 -6724
  252. package/dist/vendor-dom-serializer-nQMsqjYW.js +0 -286
  253. package/dist/vendor-dom7-CJLPMwy5.js +0 -941
  254. package/dist/vendor-domelementtype-CjSzQey5.js +0 -53
  255. package/dist/vendor-domhandler-9z8cS16a.js +0 -484
  256. package/dist/vendor-dompurify-CRFzu7ib.js +0 -1336
  257. package/dist/vendor-domutils-Bc-Opz-v.js +0 -981
  258. package/dist/vendor-entities-Bfsx4xOQ.js +0 -636
  259. package/dist/vendor-floating-ui-core-wV8u8QP4.js +0 -511
  260. package/dist/vendor-floating-ui-dom-DDnRPs17.js +0 -706
  261. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +0 -296
  262. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +0 -167
  263. package/dist/vendor-fontsource-plus-jakarta-sans.css +0 -1
  264. package/dist/vendor-headlessui-vue-CY9FRgTb.js +0 -83
  265. package/dist/vendor-htmlparser2-B1dhFPOs.js +0 -1426
  266. package/dist/vendor-iconify-vue-DfRGgyNu.js +0 -1840
  267. package/dist/vendor-intlify-core-base-BuknsFQe.js +0 -1876
  268. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +0 -1508
  269. package/dist/vendor-intlify-shared-Cz4YRMuC.js +0 -241
  270. package/dist/vendor-iso-639-1-BJCk9DvE.js +0 -819
  271. package/dist/vendor-linkify-it-CKUf4vsc.js +0 -830
  272. package/dist/vendor-linkifyjs-BfyGgbCh.js +0 -1756
  273. package/dist/vendor-lodash-es-BySUOlwf.js +0 -18333
  274. package/dist/vendor-markdown-it-D-apazHa.js +0 -6000
  275. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +0 -131
  276. package/dist/vendor-mdurl-BNh2CCgT.js +0 -537
  277. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +0 -1275
  278. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +0 -591
  279. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +0 -2153
  280. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +0 -2470
  281. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +0 -6589
  282. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +0 -1510
  283. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +0 -761
  284. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +0 -70
  285. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +0 -667
  286. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +0 -520
  287. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +0 -3339
  288. package/dist/vendor-moment-Mki5YqAR.js +0 -5679
  289. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +0 -395
  290. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +0 -1160
  291. package/dist/vendor-nth-check-Bx8TxtJt.js +0 -157
  292. package/dist/vendor-orderedmap-dGG6uMFJ.js +0 -137
  293. package/dist/vendor-parse5-Bt2NhSzR.js +0 -8432
  294. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +0 -216
  295. package/dist/vendor-popperjs-core-Cr2byIky.js +0 -1790
  296. package/dist/vendor-prettier-B4PaeWRQ.js +0 -98
  297. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +0 -561
  298. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +0 -146
  299. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +0 -236
  300. package/dist/vendor-prosemirror-history-BDaJkvNx.js +0 -414
  301. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +0 -128
  302. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +0 -866
  303. package/dist/vendor-prosemirror-model-BZu3WVcD.js +0 -3463
  304. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +0 -158
  305. package/dist/vendor-prosemirror-state-BvL9Pxph.js +0 -1003
  306. package/dist/vendor-prosemirror-tables-17qAnviK.js +0 -2159
  307. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +0 -2156
  308. package/dist/vendor-prosemirror-view-CU2WTHT7.js +0 -5811
  309. package/dist/vendor-punycode-js-iAs5RxMf.js +0 -441
  310. package/dist/vendor-rope-sequence-BdXDKoGt.js +0 -207
  311. package/dist/vendor-semver-CVLMK-S4.js +0 -2702
  312. package/dist/vendor-ssr-window-s6OpKa3O.js +0 -150
  313. package/dist/vendor-swiper-CdiyNHVt.js +0 -5679
  314. package/dist/vendor-tippy-js-DWFe2TfK.js +0 -1647
  315. package/dist/vendor-tiptap-core-NfwGfaQk.js +0 -4910
  316. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +0 -57
  317. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +0 -97
  318. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +0 -218
  319. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +0 -73
  320. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +0 -221
  321. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +0 -75
  322. package/dist/vendor-tiptap-extension-document-DssuotYs.js +0 -13
  323. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +0 -26
  324. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +0 -165
  325. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +0 -30
  326. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +0 -68
  327. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +0 -77
  328. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +0 -48
  329. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +0 -92
  330. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +0 -76
  331. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +0 -96
  332. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +0 -414
  333. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +0 -37
  334. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +0 -97
  335. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +0 -39
  336. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +0 -66
  337. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +0 -79
  338. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +0 -47
  339. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +0 -47
  340. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +0 -26
  341. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +0 -354
  342. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +0 -12
  343. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +0 -50
  344. package/dist/vendor-tiptap-markdown-7-PCADTU.js +0 -1017
  345. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +0 -88
  346. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +0 -268
  347. package/dist/vendor-truncate-html-3qQY0Djo.js +0 -196
  348. package/dist/vendor-uc-micro-jjt6LQ65.js +0 -23
  349. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +0 -154
  350. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +0 -536
  351. package/dist/vendor-vue-currency-input-DGAkEFBO.js +0 -545
  352. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +0 -169
  353. package/dist/vendor-vue-i18n-Co752uk3.js +0 -1897
  354. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +0 -119
  355. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +0 -416
  356. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +0 -5019
  357. package/dist/vendor-vueuse-components-l1bL12mE.js +0 -339
  358. package/dist/vendor-vueuse-core-DGcJOmwG.js +0 -7743
  359. package/dist/vendor-vueuse-shared-_mOXsFuM.js +0 -1568
  360. package/dist/vendor-w3c-keyname-BOm2dtJm.js +0 -121
@@ -1,1426 +0,0 @@
1
- import { x as xmlDecodeTree, h as htmlDecodeTree, d as determineBranch, B as BinTrieFlags, r as replaceCodePoint, f as fromCodePoint } from './vendor-entities-Bfsx4xOQ.js';
2
- import { f as DomHandler } from './vendor-domhandler-9z8cS16a.js';
3
-
4
- var CharCodes;
5
- (function (CharCodes) {
6
- CharCodes[CharCodes["Tab"] = 9] = "Tab";
7
- CharCodes[CharCodes["NewLine"] = 10] = "NewLine";
8
- CharCodes[CharCodes["FormFeed"] = 12] = "FormFeed";
9
- CharCodes[CharCodes["CarriageReturn"] = 13] = "CarriageReturn";
10
- CharCodes[CharCodes["Space"] = 32] = "Space";
11
- CharCodes[CharCodes["ExclamationMark"] = 33] = "ExclamationMark";
12
- CharCodes[CharCodes["Number"] = 35] = "Number";
13
- CharCodes[CharCodes["Amp"] = 38] = "Amp";
14
- CharCodes[CharCodes["SingleQuote"] = 39] = "SingleQuote";
15
- CharCodes[CharCodes["DoubleQuote"] = 34] = "DoubleQuote";
16
- CharCodes[CharCodes["Dash"] = 45] = "Dash";
17
- CharCodes[CharCodes["Slash"] = 47] = "Slash";
18
- CharCodes[CharCodes["Zero"] = 48] = "Zero";
19
- CharCodes[CharCodes["Nine"] = 57] = "Nine";
20
- CharCodes[CharCodes["Semi"] = 59] = "Semi";
21
- CharCodes[CharCodes["Lt"] = 60] = "Lt";
22
- CharCodes[CharCodes["Eq"] = 61] = "Eq";
23
- CharCodes[CharCodes["Gt"] = 62] = "Gt";
24
- CharCodes[CharCodes["Questionmark"] = 63] = "Questionmark";
25
- CharCodes[CharCodes["UpperA"] = 65] = "UpperA";
26
- CharCodes[CharCodes["LowerA"] = 97] = "LowerA";
27
- CharCodes[CharCodes["UpperF"] = 70] = "UpperF";
28
- CharCodes[CharCodes["LowerF"] = 102] = "LowerF";
29
- CharCodes[CharCodes["UpperZ"] = 90] = "UpperZ";
30
- CharCodes[CharCodes["LowerZ"] = 122] = "LowerZ";
31
- CharCodes[CharCodes["LowerX"] = 120] = "LowerX";
32
- CharCodes[CharCodes["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
33
- })(CharCodes || (CharCodes = {}));
34
- /** All the states the tokenizer can be in. */
35
- var State;
36
- (function (State) {
37
- State[State["Text"] = 1] = "Text";
38
- State[State["BeforeTagName"] = 2] = "BeforeTagName";
39
- State[State["InTagName"] = 3] = "InTagName";
40
- State[State["InSelfClosingTag"] = 4] = "InSelfClosingTag";
41
- State[State["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
42
- State[State["InClosingTagName"] = 6] = "InClosingTagName";
43
- State[State["AfterClosingTagName"] = 7] = "AfterClosingTagName";
44
- // Attributes
45
- State[State["BeforeAttributeName"] = 8] = "BeforeAttributeName";
46
- State[State["InAttributeName"] = 9] = "InAttributeName";
47
- State[State["AfterAttributeName"] = 10] = "AfterAttributeName";
48
- State[State["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
49
- State[State["InAttributeValueDq"] = 12] = "InAttributeValueDq";
50
- State[State["InAttributeValueSq"] = 13] = "InAttributeValueSq";
51
- State[State["InAttributeValueNq"] = 14] = "InAttributeValueNq";
52
- // Declarations
53
- State[State["BeforeDeclaration"] = 15] = "BeforeDeclaration";
54
- State[State["InDeclaration"] = 16] = "InDeclaration";
55
- // Processing instructions
56
- State[State["InProcessingInstruction"] = 17] = "InProcessingInstruction";
57
- // Comments & CDATA
58
- State[State["BeforeComment"] = 18] = "BeforeComment";
59
- State[State["CDATASequence"] = 19] = "CDATASequence";
60
- State[State["InSpecialComment"] = 20] = "InSpecialComment";
61
- State[State["InCommentLike"] = 21] = "InCommentLike";
62
- // Special tags
63
- State[State["BeforeSpecialS"] = 22] = "BeforeSpecialS";
64
- State[State["SpecialStartSequence"] = 23] = "SpecialStartSequence";
65
- State[State["InSpecialTag"] = 24] = "InSpecialTag";
66
- State[State["BeforeEntity"] = 25] = "BeforeEntity";
67
- State[State["BeforeNumericEntity"] = 26] = "BeforeNumericEntity";
68
- State[State["InNamedEntity"] = 27] = "InNamedEntity";
69
- State[State["InNumericEntity"] = 28] = "InNumericEntity";
70
- State[State["InHexEntity"] = 29] = "InHexEntity";
71
- })(State || (State = {}));
72
- function isWhitespace(c) {
73
- return (c === CharCodes.Space ||
74
- c === CharCodes.NewLine ||
75
- c === CharCodes.Tab ||
76
- c === CharCodes.FormFeed ||
77
- c === CharCodes.CarriageReturn);
78
- }
79
- function isEndOfTagSection(c) {
80
- return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);
81
- }
82
- function isNumber(c) {
83
- return c >= CharCodes.Zero && c <= CharCodes.Nine;
84
- }
85
- function isASCIIAlpha(c) {
86
- return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||
87
- (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));
88
- }
89
- function isHexDigit(c) {
90
- return ((c >= CharCodes.UpperA && c <= CharCodes.UpperF) ||
91
- (c >= CharCodes.LowerA && c <= CharCodes.LowerF));
92
- }
93
- var QuoteType;
94
- (function (QuoteType) {
95
- QuoteType[QuoteType["NoValue"] = 0] = "NoValue";
96
- QuoteType[QuoteType["Unquoted"] = 1] = "Unquoted";
97
- QuoteType[QuoteType["Single"] = 2] = "Single";
98
- QuoteType[QuoteType["Double"] = 3] = "Double";
99
- })(QuoteType || (QuoteType = {}));
100
- /**
101
- * Sequences used to match longer strings.
102
- *
103
- * We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End
104
- * sequences with an increased offset.
105
- */
106
- const Sequences = {
107
- Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]),
108
- CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]),
109
- CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]),
110
- ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]),
111
- StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]),
112
- TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`
113
- };
114
- class Tokenizer {
115
- constructor({ xmlMode = false, decodeEntities = true, }, cbs) {
116
- this.cbs = cbs;
117
- /** The current state the tokenizer is in. */
118
- this.state = State.Text;
119
- /** The read buffer. */
120
- this.buffer = "";
121
- /** The beginning of the section that is currently being read. */
122
- this.sectionStart = 0;
123
- /** The index within the buffer that we are currently looking at. */
124
- this.index = 0;
125
- /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
126
- this.baseState = State.Text;
127
- /** For special parsing behavior inside of script and style tags. */
128
- this.isSpecial = false;
129
- /** Indicates whether the tokenizer has been paused. */
130
- this.running = true;
131
- /** The offset of the current buffer. */
132
- this.offset = 0;
133
- this.currentSequence = undefined;
134
- this.sequenceIndex = 0;
135
- this.trieIndex = 0;
136
- this.trieCurrent = 0;
137
- /** For named entities, the index of the value. For numeric entities, the code point. */
138
- this.entityResult = 0;
139
- this.entityExcess = 0;
140
- this.xmlMode = xmlMode;
141
- this.decodeEntities = decodeEntities;
142
- this.entityTrie = xmlMode ? xmlDecodeTree : htmlDecodeTree;
143
- }
144
- reset() {
145
- this.state = State.Text;
146
- this.buffer = "";
147
- this.sectionStart = 0;
148
- this.index = 0;
149
- this.baseState = State.Text;
150
- this.currentSequence = undefined;
151
- this.running = true;
152
- this.offset = 0;
153
- }
154
- write(chunk) {
155
- this.offset += this.buffer.length;
156
- this.buffer = chunk;
157
- this.parse();
158
- }
159
- end() {
160
- if (this.running)
161
- this.finish();
162
- }
163
- pause() {
164
- this.running = false;
165
- }
166
- resume() {
167
- this.running = true;
168
- if (this.index < this.buffer.length + this.offset) {
169
- this.parse();
170
- }
171
- }
172
- /**
173
- * The current index within all of the written data.
174
- */
175
- getIndex() {
176
- return this.index;
177
- }
178
- /**
179
- * The start of the current section.
180
- */
181
- getSectionStart() {
182
- return this.sectionStart;
183
- }
184
- stateText(c) {
185
- if (c === CharCodes.Lt ||
186
- (!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {
187
- if (this.index > this.sectionStart) {
188
- this.cbs.ontext(this.sectionStart, this.index);
189
- }
190
- this.state = State.BeforeTagName;
191
- this.sectionStart = this.index;
192
- }
193
- else if (this.decodeEntities && c === CharCodes.Amp) {
194
- this.state = State.BeforeEntity;
195
- }
196
- }
197
- stateSpecialStartSequence(c) {
198
- const isEnd = this.sequenceIndex === this.currentSequence.length;
199
- const isMatch = isEnd
200
- ? // If we are at the end of the sequence, make sure the tag name has ended
201
- isEndOfTagSection(c)
202
- : // Otherwise, do a case-insensitive comparison
203
- (c | 0x20) === this.currentSequence[this.sequenceIndex];
204
- if (!isMatch) {
205
- this.isSpecial = false;
206
- }
207
- else if (!isEnd) {
208
- this.sequenceIndex++;
209
- return;
210
- }
211
- this.sequenceIndex = 0;
212
- this.state = State.InTagName;
213
- this.stateInTagName(c);
214
- }
215
- /** Look for an end tag. For <title> tags, also decode entities. */
216
- stateInSpecialTag(c) {
217
- if (this.sequenceIndex === this.currentSequence.length) {
218
- if (c === CharCodes.Gt || isWhitespace(c)) {
219
- const endOfText = this.index - this.currentSequence.length;
220
- if (this.sectionStart < endOfText) {
221
- // Spoof the index so that reported locations match up.
222
- const actualIndex = this.index;
223
- this.index = endOfText;
224
- this.cbs.ontext(this.sectionStart, endOfText);
225
- this.index = actualIndex;
226
- }
227
- this.isSpecial = false;
228
- this.sectionStart = endOfText + 2; // Skip over the `</`
229
- this.stateInClosingTagName(c);
230
- return; // We are done; skip the rest of the function.
231
- }
232
- this.sequenceIndex = 0;
233
- }
234
- if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {
235
- this.sequenceIndex += 1;
236
- }
237
- else if (this.sequenceIndex === 0) {
238
- if (this.currentSequence === Sequences.TitleEnd) {
239
- // We have to parse entities in <title> tags.
240
- if (this.decodeEntities && c === CharCodes.Amp) {
241
- this.state = State.BeforeEntity;
242
- }
243
- }
244
- else if (this.fastForwardTo(CharCodes.Lt)) {
245
- // Outside of <title> tags, we can fast-forward.
246
- this.sequenceIndex = 1;
247
- }
248
- }
249
- else {
250
- // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.
251
- this.sequenceIndex = Number(c === CharCodes.Lt);
252
- }
253
- }
254
- stateCDATASequence(c) {
255
- if (c === Sequences.Cdata[this.sequenceIndex]) {
256
- if (++this.sequenceIndex === Sequences.Cdata.length) {
257
- this.state = State.InCommentLike;
258
- this.currentSequence = Sequences.CdataEnd;
259
- this.sequenceIndex = 0;
260
- this.sectionStart = this.index + 1;
261
- }
262
- }
263
- else {
264
- this.sequenceIndex = 0;
265
- this.state = State.InDeclaration;
266
- this.stateInDeclaration(c); // Reconsume the character
267
- }
268
- }
269
- /**
270
- * When we wait for one specific character, we can speed things up
271
- * by skipping through the buffer until we find it.
272
- *
273
- * @returns Whether the character was found.
274
- */
275
- fastForwardTo(c) {
276
- while (++this.index < this.buffer.length + this.offset) {
277
- if (this.buffer.charCodeAt(this.index - this.offset) === c) {
278
- return true;
279
- }
280
- }
281
- /*
282
- * We increment the index at the end of the `parse` loop,
283
- * so set it to `buffer.length - 1` here.
284
- *
285
- * TODO: Refactor `parse` to increment index before calling states.
286
- */
287
- this.index = this.buffer.length + this.offset - 1;
288
- return false;
289
- }
290
- /**
291
- * Comments and CDATA end with `-->` and `]]>`.
292
- *
293
- * Their common qualities are:
294
- * - Their end sequences have a distinct character they start with.
295
- * - That character is then repeated, so we have to check multiple repeats.
296
- * - All characters but the start character of the sequence can be skipped.
297
- */
298
- stateInCommentLike(c) {
299
- if (c === this.currentSequence[this.sequenceIndex]) {
300
- if (++this.sequenceIndex === this.currentSequence.length) {
301
- if (this.currentSequence === Sequences.CdataEnd) {
302
- this.cbs.oncdata(this.sectionStart, this.index, 2);
303
- }
304
- else {
305
- this.cbs.oncomment(this.sectionStart, this.index, 2);
306
- }
307
- this.sequenceIndex = 0;
308
- this.sectionStart = this.index + 1;
309
- this.state = State.Text;
310
- }
311
- }
312
- else if (this.sequenceIndex === 0) {
313
- // Fast-forward to the first character of the sequence
314
- if (this.fastForwardTo(this.currentSequence[0])) {
315
- this.sequenceIndex = 1;
316
- }
317
- }
318
- else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
319
- // Allow long sequences, eg. --->, ]]]>
320
- this.sequenceIndex = 0;
321
- }
322
- }
323
- /**
324
- * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
325
- *
326
- * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
327
- * We allow anything that wouldn't end the tag.
328
- */
329
- isTagStartChar(c) {
330
- return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
331
- }
332
- startSpecial(sequence, offset) {
333
- this.isSpecial = true;
334
- this.currentSequence = sequence;
335
- this.sequenceIndex = offset;
336
- this.state = State.SpecialStartSequence;
337
- }
338
- stateBeforeTagName(c) {
339
- if (c === CharCodes.ExclamationMark) {
340
- this.state = State.BeforeDeclaration;
341
- this.sectionStart = this.index + 1;
342
- }
343
- else if (c === CharCodes.Questionmark) {
344
- this.state = State.InProcessingInstruction;
345
- this.sectionStart = this.index + 1;
346
- }
347
- else if (this.isTagStartChar(c)) {
348
- const lower = c | 0x20;
349
- this.sectionStart = this.index;
350
- if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {
351
- this.startSpecial(Sequences.TitleEnd, 3);
352
- }
353
- else {
354
- this.state =
355
- !this.xmlMode && lower === Sequences.ScriptEnd[2]
356
- ? State.BeforeSpecialS
357
- : State.InTagName;
358
- }
359
- }
360
- else if (c === CharCodes.Slash) {
361
- this.state = State.BeforeClosingTagName;
362
- }
363
- else {
364
- this.state = State.Text;
365
- this.stateText(c);
366
- }
367
- }
368
- stateInTagName(c) {
369
- if (isEndOfTagSection(c)) {
370
- this.cbs.onopentagname(this.sectionStart, this.index);
371
- this.sectionStart = -1;
372
- this.state = State.BeforeAttributeName;
373
- this.stateBeforeAttributeName(c);
374
- }
375
- }
376
- stateBeforeClosingTagName(c) {
377
- if (isWhitespace(c)) ;
378
- else if (c === CharCodes.Gt) {
379
- this.state = State.Text;
380
- }
381
- else {
382
- this.state = this.isTagStartChar(c)
383
- ? State.InClosingTagName
384
- : State.InSpecialComment;
385
- this.sectionStart = this.index;
386
- }
387
- }
388
- stateInClosingTagName(c) {
389
- if (c === CharCodes.Gt || isWhitespace(c)) {
390
- this.cbs.onclosetag(this.sectionStart, this.index);
391
- this.sectionStart = -1;
392
- this.state = State.AfterClosingTagName;
393
- this.stateAfterClosingTagName(c);
394
- }
395
- }
396
- stateAfterClosingTagName(c) {
397
- // Skip everything until ">"
398
- if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
399
- this.state = State.Text;
400
- this.baseState = State.Text;
401
- this.sectionStart = this.index + 1;
402
- }
403
- }
404
- stateBeforeAttributeName(c) {
405
- if (c === CharCodes.Gt) {
406
- this.cbs.onopentagend(this.index);
407
- if (this.isSpecial) {
408
- this.state = State.InSpecialTag;
409
- this.sequenceIndex = 0;
410
- }
411
- else {
412
- this.state = State.Text;
413
- }
414
- this.baseState = this.state;
415
- this.sectionStart = this.index + 1;
416
- }
417
- else if (c === CharCodes.Slash) {
418
- this.state = State.InSelfClosingTag;
419
- }
420
- else if (!isWhitespace(c)) {
421
- this.state = State.InAttributeName;
422
- this.sectionStart = this.index;
423
- }
424
- }
425
- stateInSelfClosingTag(c) {
426
- if (c === CharCodes.Gt) {
427
- this.cbs.onselfclosingtag(this.index);
428
- this.state = State.Text;
429
- this.baseState = State.Text;
430
- this.sectionStart = this.index + 1;
431
- this.isSpecial = false; // Reset special state, in case of self-closing special tags
432
- }
433
- else if (!isWhitespace(c)) {
434
- this.state = State.BeforeAttributeName;
435
- this.stateBeforeAttributeName(c);
436
- }
437
- }
438
- stateInAttributeName(c) {
439
- if (c === CharCodes.Eq || isEndOfTagSection(c)) {
440
- this.cbs.onattribname(this.sectionStart, this.index);
441
- this.sectionStart = -1;
442
- this.state = State.AfterAttributeName;
443
- this.stateAfterAttributeName(c);
444
- }
445
- }
446
- stateAfterAttributeName(c) {
447
- if (c === CharCodes.Eq) {
448
- this.state = State.BeforeAttributeValue;
449
- }
450
- else if (c === CharCodes.Slash || c === CharCodes.Gt) {
451
- this.cbs.onattribend(QuoteType.NoValue, this.index);
452
- this.state = State.BeforeAttributeName;
453
- this.stateBeforeAttributeName(c);
454
- }
455
- else if (!isWhitespace(c)) {
456
- this.cbs.onattribend(QuoteType.NoValue, this.index);
457
- this.state = State.InAttributeName;
458
- this.sectionStart = this.index;
459
- }
460
- }
461
- stateBeforeAttributeValue(c) {
462
- if (c === CharCodes.DoubleQuote) {
463
- this.state = State.InAttributeValueDq;
464
- this.sectionStart = this.index + 1;
465
- }
466
- else if (c === CharCodes.SingleQuote) {
467
- this.state = State.InAttributeValueSq;
468
- this.sectionStart = this.index + 1;
469
- }
470
- else if (!isWhitespace(c)) {
471
- this.sectionStart = this.index;
472
- this.state = State.InAttributeValueNq;
473
- this.stateInAttributeValueNoQuotes(c); // Reconsume token
474
- }
475
- }
476
- handleInAttributeValue(c, quote) {
477
- if (c === quote ||
478
- (!this.decodeEntities && this.fastForwardTo(quote))) {
479
- this.cbs.onattribdata(this.sectionStart, this.index);
480
- this.sectionStart = -1;
481
- this.cbs.onattribend(quote === CharCodes.DoubleQuote
482
- ? QuoteType.Double
483
- : QuoteType.Single, this.index);
484
- this.state = State.BeforeAttributeName;
485
- }
486
- else if (this.decodeEntities && c === CharCodes.Amp) {
487
- this.baseState = this.state;
488
- this.state = State.BeforeEntity;
489
- }
490
- }
491
- stateInAttributeValueDoubleQuotes(c) {
492
- this.handleInAttributeValue(c, CharCodes.DoubleQuote);
493
- }
494
- stateInAttributeValueSingleQuotes(c) {
495
- this.handleInAttributeValue(c, CharCodes.SingleQuote);
496
- }
497
- stateInAttributeValueNoQuotes(c) {
498
- if (isWhitespace(c) || c === CharCodes.Gt) {
499
- this.cbs.onattribdata(this.sectionStart, this.index);
500
- this.sectionStart = -1;
501
- this.cbs.onattribend(QuoteType.Unquoted, this.index);
502
- this.state = State.BeforeAttributeName;
503
- this.stateBeforeAttributeName(c);
504
- }
505
- else if (this.decodeEntities && c === CharCodes.Amp) {
506
- this.baseState = this.state;
507
- this.state = State.BeforeEntity;
508
- }
509
- }
510
- stateBeforeDeclaration(c) {
511
- if (c === CharCodes.OpeningSquareBracket) {
512
- this.state = State.CDATASequence;
513
- this.sequenceIndex = 0;
514
- }
515
- else {
516
- this.state =
517
- c === CharCodes.Dash
518
- ? State.BeforeComment
519
- : State.InDeclaration;
520
- }
521
- }
522
- stateInDeclaration(c) {
523
- if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
524
- this.cbs.ondeclaration(this.sectionStart, this.index);
525
- this.state = State.Text;
526
- this.sectionStart = this.index + 1;
527
- }
528
- }
529
- stateInProcessingInstruction(c) {
530
- if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
531
- this.cbs.onprocessinginstruction(this.sectionStart, this.index);
532
- this.state = State.Text;
533
- this.sectionStart = this.index + 1;
534
- }
535
- }
536
- stateBeforeComment(c) {
537
- if (c === CharCodes.Dash) {
538
- this.state = State.InCommentLike;
539
- this.currentSequence = Sequences.CommentEnd;
540
- // Allow short comments (eg. <!-->)
541
- this.sequenceIndex = 2;
542
- this.sectionStart = this.index + 1;
543
- }
544
- else {
545
- this.state = State.InDeclaration;
546
- }
547
- }
548
- stateInSpecialComment(c) {
549
- if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
550
- this.cbs.oncomment(this.sectionStart, this.index, 0);
551
- this.state = State.Text;
552
- this.sectionStart = this.index + 1;
553
- }
554
- }
555
- stateBeforeSpecialS(c) {
556
- const lower = c | 0x20;
557
- if (lower === Sequences.ScriptEnd[3]) {
558
- this.startSpecial(Sequences.ScriptEnd, 4);
559
- }
560
- else if (lower === Sequences.StyleEnd[3]) {
561
- this.startSpecial(Sequences.StyleEnd, 4);
562
- }
563
- else {
564
- this.state = State.InTagName;
565
- this.stateInTagName(c); // Consume the token again
566
- }
567
- }
568
- stateBeforeEntity(c) {
569
- // Start excess with 1 to include the '&'
570
- this.entityExcess = 1;
571
- this.entityResult = 0;
572
- if (c === CharCodes.Number) {
573
- this.state = State.BeforeNumericEntity;
574
- }
575
- else if (c === CharCodes.Amp) ;
576
- else {
577
- this.trieIndex = 0;
578
- this.trieCurrent = this.entityTrie[0];
579
- this.state = State.InNamedEntity;
580
- this.stateInNamedEntity(c);
581
- }
582
- }
583
- stateInNamedEntity(c) {
584
- this.entityExcess += 1;
585
- this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);
586
- if (this.trieIndex < 0) {
587
- this.emitNamedEntity();
588
- this.index--;
589
- return;
590
- }
591
- this.trieCurrent = this.entityTrie[this.trieIndex];
592
- const masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;
593
- // If the branch is a value, store it and continue
594
- if (masked) {
595
- // The mask is the number of bytes of the value, including the current byte.
596
- const valueLength = (masked >> 14) - 1;
597
- // If we have a legacy entity while parsing strictly, just skip the number of bytes
598
- if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {
599
- this.trieIndex += valueLength;
600
- }
601
- else {
602
- // Add 1 as we have already incremented the excess
603
- const entityStart = this.index - this.entityExcess + 1;
604
- if (entityStart > this.sectionStart) {
605
- this.emitPartial(this.sectionStart, entityStart);
606
- }
607
- // If this is a surrogate pair, consume the next two bytes
608
- this.entityResult = this.trieIndex;
609
- this.trieIndex += valueLength;
610
- this.entityExcess = 0;
611
- this.sectionStart = this.index + 1;
612
- if (valueLength === 0) {
613
- this.emitNamedEntity();
614
- }
615
- }
616
- }
617
- }
618
- emitNamedEntity() {
619
- this.state = this.baseState;
620
- if (this.entityResult === 0) {
621
- return;
622
- }
623
- const valueLength = (this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >>
624
- 14;
625
- switch (valueLength) {
626
- case 1: {
627
- this.emitCodePoint(this.entityTrie[this.entityResult] &
628
- ~BinTrieFlags.VALUE_LENGTH);
629
- break;
630
- }
631
- case 2: {
632
- this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
633
- break;
634
- }
635
- case 3: {
636
- this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
637
- this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
638
- }
639
- }
640
- }
641
- stateBeforeNumericEntity(c) {
642
- if ((c | 0x20) === CharCodes.LowerX) {
643
- this.entityExcess++;
644
- this.state = State.InHexEntity;
645
- }
646
- else {
647
- this.state = State.InNumericEntity;
648
- this.stateInNumericEntity(c);
649
- }
650
- }
651
- emitNumericEntity(strict) {
652
- const entityStart = this.index - this.entityExcess - 1;
653
- const numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);
654
- if (numberStart !== this.index) {
655
- // Emit leading data if any
656
- if (entityStart > this.sectionStart) {
657
- this.emitPartial(this.sectionStart, entityStart);
658
- }
659
- this.sectionStart = this.index + Number(strict);
660
- this.emitCodePoint(replaceCodePoint(this.entityResult));
661
- }
662
- this.state = this.baseState;
663
- }
664
- stateInNumericEntity(c) {
665
- if (c === CharCodes.Semi) {
666
- this.emitNumericEntity(true);
667
- }
668
- else if (isNumber(c)) {
669
- this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);
670
- this.entityExcess++;
671
- }
672
- else {
673
- if (this.allowLegacyEntity()) {
674
- this.emitNumericEntity(false);
675
- }
676
- else {
677
- this.state = this.baseState;
678
- }
679
- this.index--;
680
- }
681
- }
682
- stateInHexEntity(c) {
683
- if (c === CharCodes.Semi) {
684
- this.emitNumericEntity(true);
685
- }
686
- else if (isNumber(c)) {
687
- this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);
688
- this.entityExcess++;
689
- }
690
- else if (isHexDigit(c)) {
691
- this.entityResult =
692
- this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);
693
- this.entityExcess++;
694
- }
695
- else {
696
- if (this.allowLegacyEntity()) {
697
- this.emitNumericEntity(false);
698
- }
699
- else {
700
- this.state = this.baseState;
701
- }
702
- this.index--;
703
- }
704
- }
705
- allowLegacyEntity() {
706
- return (!this.xmlMode &&
707
- (this.baseState === State.Text ||
708
- this.baseState === State.InSpecialTag));
709
- }
710
- /**
711
- * Remove data that has already been consumed from the buffer.
712
- */
713
- cleanup() {
714
- // If we are inside of text or attributes, emit what we already have.
715
- if (this.running && this.sectionStart !== this.index) {
716
- if (this.state === State.Text ||
717
- (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {
718
- this.cbs.ontext(this.sectionStart, this.index);
719
- this.sectionStart = this.index;
720
- }
721
- else if (this.state === State.InAttributeValueDq ||
722
- this.state === State.InAttributeValueSq ||
723
- this.state === State.InAttributeValueNq) {
724
- this.cbs.onattribdata(this.sectionStart, this.index);
725
- this.sectionStart = this.index;
726
- }
727
- }
728
- }
729
- shouldContinue() {
730
- return this.index < this.buffer.length + this.offset && this.running;
731
- }
732
- /**
733
- * Iterates through the buffer, calling the function corresponding to the current state.
734
- *
735
- * States that are more likely to be hit are higher up, as a performance improvement.
736
- */
737
- parse() {
738
- while (this.shouldContinue()) {
739
- const c = this.buffer.charCodeAt(this.index - this.offset);
740
- switch (this.state) {
741
- case State.Text: {
742
- this.stateText(c);
743
- break;
744
- }
745
- case State.SpecialStartSequence: {
746
- this.stateSpecialStartSequence(c);
747
- break;
748
- }
749
- case State.InSpecialTag: {
750
- this.stateInSpecialTag(c);
751
- break;
752
- }
753
- case State.CDATASequence: {
754
- this.stateCDATASequence(c);
755
- break;
756
- }
757
- case State.InAttributeValueDq: {
758
- this.stateInAttributeValueDoubleQuotes(c);
759
- break;
760
- }
761
- case State.InAttributeName: {
762
- this.stateInAttributeName(c);
763
- break;
764
- }
765
- case State.InCommentLike: {
766
- this.stateInCommentLike(c);
767
- break;
768
- }
769
- case State.InSpecialComment: {
770
- this.stateInSpecialComment(c);
771
- break;
772
- }
773
- case State.BeforeAttributeName: {
774
- this.stateBeforeAttributeName(c);
775
- break;
776
- }
777
- case State.InTagName: {
778
- this.stateInTagName(c);
779
- break;
780
- }
781
- case State.InClosingTagName: {
782
- this.stateInClosingTagName(c);
783
- break;
784
- }
785
- case State.BeforeTagName: {
786
- this.stateBeforeTagName(c);
787
- break;
788
- }
789
- case State.AfterAttributeName: {
790
- this.stateAfterAttributeName(c);
791
- break;
792
- }
793
- case State.InAttributeValueSq: {
794
- this.stateInAttributeValueSingleQuotes(c);
795
- break;
796
- }
797
- case State.BeforeAttributeValue: {
798
- this.stateBeforeAttributeValue(c);
799
- break;
800
- }
801
- case State.BeforeClosingTagName: {
802
- this.stateBeforeClosingTagName(c);
803
- break;
804
- }
805
- case State.AfterClosingTagName: {
806
- this.stateAfterClosingTagName(c);
807
- break;
808
- }
809
- case State.BeforeSpecialS: {
810
- this.stateBeforeSpecialS(c);
811
- break;
812
- }
813
- case State.InAttributeValueNq: {
814
- this.stateInAttributeValueNoQuotes(c);
815
- break;
816
- }
817
- case State.InSelfClosingTag: {
818
- this.stateInSelfClosingTag(c);
819
- break;
820
- }
821
- case State.InDeclaration: {
822
- this.stateInDeclaration(c);
823
- break;
824
- }
825
- case State.BeforeDeclaration: {
826
- this.stateBeforeDeclaration(c);
827
- break;
828
- }
829
- case State.BeforeComment: {
830
- this.stateBeforeComment(c);
831
- break;
832
- }
833
- case State.InProcessingInstruction: {
834
- this.stateInProcessingInstruction(c);
835
- break;
836
- }
837
- case State.InNamedEntity: {
838
- this.stateInNamedEntity(c);
839
- break;
840
- }
841
- case State.BeforeEntity: {
842
- this.stateBeforeEntity(c);
843
- break;
844
- }
845
- case State.InHexEntity: {
846
- this.stateInHexEntity(c);
847
- break;
848
- }
849
- case State.InNumericEntity: {
850
- this.stateInNumericEntity(c);
851
- break;
852
- }
853
- default: {
854
- // `this._state === State.BeforeNumericEntity`
855
- this.stateBeforeNumericEntity(c);
856
- }
857
- }
858
- this.index++;
859
- }
860
- this.cleanup();
861
- }
862
- finish() {
863
- if (this.state === State.InNamedEntity) {
864
- this.emitNamedEntity();
865
- }
866
- // If there is remaining data, emit it in a reasonable way
867
- if (this.sectionStart < this.index) {
868
- this.handleTrailingData();
869
- }
870
- this.cbs.onend();
871
- }
872
- /** Handle any trailing data. */
873
- handleTrailingData() {
874
- const endIndex = this.buffer.length + this.offset;
875
- if (this.state === State.InCommentLike) {
876
- if (this.currentSequence === Sequences.CdataEnd) {
877
- this.cbs.oncdata(this.sectionStart, endIndex, 0);
878
- }
879
- else {
880
- this.cbs.oncomment(this.sectionStart, endIndex, 0);
881
- }
882
- }
883
- else if (this.state === State.InNumericEntity &&
884
- this.allowLegacyEntity()) {
885
- this.emitNumericEntity(false);
886
- // All trailing data will have been consumed
887
- }
888
- else if (this.state === State.InHexEntity &&
889
- this.allowLegacyEntity()) {
890
- this.emitNumericEntity(false);
891
- // All trailing data will have been consumed
892
- }
893
- else if (this.state === State.InTagName ||
894
- this.state === State.BeforeAttributeName ||
895
- this.state === State.BeforeAttributeValue ||
896
- this.state === State.AfterAttributeName ||
897
- this.state === State.InAttributeName ||
898
- this.state === State.InAttributeValueSq ||
899
- this.state === State.InAttributeValueDq ||
900
- this.state === State.InAttributeValueNq ||
901
- this.state === State.InClosingTagName) ;
902
- else {
903
- this.cbs.ontext(this.sectionStart, endIndex);
904
- }
905
- }
906
- emitPartial(start, endIndex) {
907
- if (this.baseState !== State.Text &&
908
- this.baseState !== State.InSpecialTag) {
909
- this.cbs.onattribdata(start, endIndex);
910
- }
911
- else {
912
- this.cbs.ontext(start, endIndex);
913
- }
914
- }
915
- emitCodePoint(cp) {
916
- if (this.baseState !== State.Text &&
917
- this.baseState !== State.InSpecialTag) {
918
- this.cbs.onattribentity(cp);
919
- }
920
- else {
921
- this.cbs.ontextentity(cp);
922
- }
923
- }
924
- }
925
-
926
- const formTags = new Set([
927
- "input",
928
- "option",
929
- "optgroup",
930
- "select",
931
- "button",
932
- "datalist",
933
- "textarea",
934
- ]);
935
- const pTag = new Set(["p"]);
936
- const tableSectionTags = new Set(["thead", "tbody"]);
937
- const ddtTags = new Set(["dd", "dt"]);
938
- const rtpTags = new Set(["rt", "rp"]);
939
- const openImpliesClose = new Map([
940
- ["tr", new Set(["tr", "th", "td"])],
941
- ["th", new Set(["th"])],
942
- ["td", new Set(["thead", "th", "td"])],
943
- ["body", new Set(["head", "link", "script"])],
944
- ["li", new Set(["li"])],
945
- ["p", pTag],
946
- ["h1", pTag],
947
- ["h2", pTag],
948
- ["h3", pTag],
949
- ["h4", pTag],
950
- ["h5", pTag],
951
- ["h6", pTag],
952
- ["select", formTags],
953
- ["input", formTags],
954
- ["output", formTags],
955
- ["button", formTags],
956
- ["datalist", formTags],
957
- ["textarea", formTags],
958
- ["option", new Set(["option"])],
959
- ["optgroup", new Set(["optgroup", "option"])],
960
- ["dd", ddtTags],
961
- ["dt", ddtTags],
962
- ["address", pTag],
963
- ["article", pTag],
964
- ["aside", pTag],
965
- ["blockquote", pTag],
966
- ["details", pTag],
967
- ["div", pTag],
968
- ["dl", pTag],
969
- ["fieldset", pTag],
970
- ["figcaption", pTag],
971
- ["figure", pTag],
972
- ["footer", pTag],
973
- ["form", pTag],
974
- ["header", pTag],
975
- ["hr", pTag],
976
- ["main", pTag],
977
- ["nav", pTag],
978
- ["ol", pTag],
979
- ["pre", pTag],
980
- ["section", pTag],
981
- ["table", pTag],
982
- ["ul", pTag],
983
- ["rt", rtpTags],
984
- ["rp", rtpTags],
985
- ["tbody", tableSectionTags],
986
- ["tfoot", tableSectionTags],
987
- ]);
988
- const voidElements = new Set([
989
- "area",
990
- "base",
991
- "basefont",
992
- "br",
993
- "col",
994
- "command",
995
- "embed",
996
- "frame",
997
- "hr",
998
- "img",
999
- "input",
1000
- "isindex",
1001
- "keygen",
1002
- "link",
1003
- "meta",
1004
- "param",
1005
- "source",
1006
- "track",
1007
- "wbr",
1008
- ]);
1009
- const foreignContextElements = new Set(["math", "svg"]);
1010
- const htmlIntegrationElements = new Set([
1011
- "mi",
1012
- "mo",
1013
- "mn",
1014
- "ms",
1015
- "mtext",
1016
- "annotation-xml",
1017
- "foreignobject",
1018
- "desc",
1019
- "title",
1020
- ]);
1021
- const reNameEnd = /\s|\//;
1022
- class Parser {
1023
- constructor(cbs, options = {}) {
1024
- var _a, _b, _c, _d, _e;
1025
- this.options = options;
1026
- /** The start index of the last event. */
1027
- this.startIndex = 0;
1028
- /** The end index of the last event. */
1029
- this.endIndex = 0;
1030
- /**
1031
- * Store the start index of the current open tag,
1032
- * so we can update the start index for attributes.
1033
- */
1034
- this.openTagStart = 0;
1035
- this.tagname = "";
1036
- this.attribname = "";
1037
- this.attribvalue = "";
1038
- this.attribs = null;
1039
- this.stack = [];
1040
- this.foreignContext = [];
1041
- this.buffers = [];
1042
- this.bufferOffset = 0;
1043
- /** The index of the last written buffer. Used when resuming after a `pause()`. */
1044
- this.writeIndex = 0;
1045
- /** Indicates whether the parser has finished running / `.end` has been called. */
1046
- this.ended = false;
1047
- this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
1048
- this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;
1049
- this.lowerCaseAttributeNames =
1050
- (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;
1051
- this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer)(this.options, this);
1052
- (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);
1053
- }
1054
- // Tokenizer event handlers
1055
- /** @internal */
1056
- ontext(start, endIndex) {
1057
- var _a, _b;
1058
- const data = this.getSlice(start, endIndex);
1059
- this.endIndex = endIndex - 1;
1060
- (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);
1061
- this.startIndex = endIndex;
1062
- }
1063
- /** @internal */
1064
- ontextentity(cp) {
1065
- var _a, _b;
1066
- /*
1067
- * Entities can be emitted on the character, or directly after.
1068
- * We use the section start here to get accurate indices.
1069
- */
1070
- const index = this.tokenizer.getSectionStart();
1071
- this.endIndex = index - 1;
1072
- (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, fromCodePoint(cp));
1073
- this.startIndex = index;
1074
- }
1075
- isVoidElement(name) {
1076
- return !this.options.xmlMode && voidElements.has(name);
1077
- }
1078
- /** @internal */
1079
- onopentagname(start, endIndex) {
1080
- this.endIndex = endIndex;
1081
- let name = this.getSlice(start, endIndex);
1082
- if (this.lowerCaseTagNames) {
1083
- name = name.toLowerCase();
1084
- }
1085
- this.emitOpenTag(name);
1086
- }
1087
- emitOpenTag(name) {
1088
- var _a, _b, _c, _d;
1089
- this.openTagStart = this.startIndex;
1090
- this.tagname = name;
1091
- const impliesClose = !this.options.xmlMode && openImpliesClose.get(name);
1092
- if (impliesClose) {
1093
- while (this.stack.length > 0 &&
1094
- impliesClose.has(this.stack[this.stack.length - 1])) {
1095
- const element = this.stack.pop();
1096
- (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, true);
1097
- }
1098
- }
1099
- if (!this.isVoidElement(name)) {
1100
- this.stack.push(name);
1101
- if (foreignContextElements.has(name)) {
1102
- this.foreignContext.push(true);
1103
- }
1104
- else if (htmlIntegrationElements.has(name)) {
1105
- this.foreignContext.push(false);
1106
- }
1107
- }
1108
- (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);
1109
- if (this.cbs.onopentag)
1110
- this.attribs = {};
1111
- }
1112
- endOpenTag(isImplied) {
1113
- var _a, _b;
1114
- this.startIndex = this.openTagStart;
1115
- if (this.attribs) {
1116
- (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);
1117
- this.attribs = null;
1118
- }
1119
- if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
1120
- this.cbs.onclosetag(this.tagname, true);
1121
- }
1122
- this.tagname = "";
1123
- }
1124
- /** @internal */
1125
- onopentagend(endIndex) {
1126
- this.endIndex = endIndex;
1127
- this.endOpenTag(false);
1128
- // Set `startIndex` for next node
1129
- this.startIndex = endIndex + 1;
1130
- }
1131
- /** @internal */
1132
- onclosetag(start, endIndex) {
1133
- var _a, _b, _c, _d, _e, _f;
1134
- this.endIndex = endIndex;
1135
- let name = this.getSlice(start, endIndex);
1136
- if (this.lowerCaseTagNames) {
1137
- name = name.toLowerCase();
1138
- }
1139
- if (foreignContextElements.has(name) ||
1140
- htmlIntegrationElements.has(name)) {
1141
- this.foreignContext.pop();
1142
- }
1143
- if (!this.isVoidElement(name)) {
1144
- const pos = this.stack.lastIndexOf(name);
1145
- if (pos !== -1) {
1146
- if (this.cbs.onclosetag) {
1147
- let count = this.stack.length - pos;
1148
- while (count--) {
1149
- // We know the stack has sufficient elements.
1150
- this.cbs.onclosetag(this.stack.pop(), count !== 0);
1151
- }
1152
- }
1153
- else
1154
- this.stack.length = pos;
1155
- }
1156
- else if (!this.options.xmlMode && name === "p") {
1157
- // Implicit open before close
1158
- this.emitOpenTag("p");
1159
- this.closeCurrentTag(true);
1160
- }
1161
- }
1162
- else if (!this.options.xmlMode && name === "br") {
1163
- // We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed.
1164
- (_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, "br");
1165
- (_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, "br", {}, true);
1166
- (_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, "br", false);
1167
- }
1168
- // Set `startIndex` for next node
1169
- this.startIndex = endIndex + 1;
1170
- }
1171
- /** @internal */
1172
- onselfclosingtag(endIndex) {
1173
- this.endIndex = endIndex;
1174
- if (this.options.xmlMode ||
1175
- this.options.recognizeSelfClosing ||
1176
- this.foreignContext[this.foreignContext.length - 1]) {
1177
- this.closeCurrentTag(false);
1178
- // Set `startIndex` for next node
1179
- this.startIndex = endIndex + 1;
1180
- }
1181
- else {
1182
- // Ignore the fact that the tag is self-closing.
1183
- this.onopentagend(endIndex);
1184
- }
1185
- }
1186
- closeCurrentTag(isOpenImplied) {
1187
- var _a, _b;
1188
- const name = this.tagname;
1189
- this.endOpenTag(isOpenImplied);
1190
- // Self-closing tags will be on the top of the stack
1191
- if (this.stack[this.stack.length - 1] === name) {
1192
- // If the opening tag isn't implied, the closing tag has to be implied.
1193
- (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);
1194
- this.stack.pop();
1195
- }
1196
- }
1197
- /** @internal */
1198
- onattribname(start, endIndex) {
1199
- this.startIndex = start;
1200
- const name = this.getSlice(start, endIndex);
1201
- this.attribname = this.lowerCaseAttributeNames
1202
- ? name.toLowerCase()
1203
- : name;
1204
- }
1205
- /** @internal */
1206
- onattribdata(start, endIndex) {
1207
- this.attribvalue += this.getSlice(start, endIndex);
1208
- }
1209
- /** @internal */
1210
- onattribentity(cp) {
1211
- this.attribvalue += fromCodePoint(cp);
1212
- }
1213
- /** @internal */
1214
- onattribend(quote, endIndex) {
1215
- var _a, _b;
1216
- this.endIndex = endIndex;
1217
- (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double
1218
- ? '"'
1219
- : quote === QuoteType.Single
1220
- ? "'"
1221
- : quote === QuoteType.NoValue
1222
- ? undefined
1223
- : null);
1224
- if (this.attribs &&
1225
- !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
1226
- this.attribs[this.attribname] = this.attribvalue;
1227
- }
1228
- this.attribvalue = "";
1229
- }
1230
- getInstructionName(value) {
1231
- const index = value.search(reNameEnd);
1232
- let name = index < 0 ? value : value.substr(0, index);
1233
- if (this.lowerCaseTagNames) {
1234
- name = name.toLowerCase();
1235
- }
1236
- return name;
1237
- }
1238
- /** @internal */
1239
- ondeclaration(start, endIndex) {
1240
- this.endIndex = endIndex;
1241
- const value = this.getSlice(start, endIndex);
1242
- if (this.cbs.onprocessinginstruction) {
1243
- const name = this.getInstructionName(value);
1244
- this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);
1245
- }
1246
- // Set `startIndex` for next node
1247
- this.startIndex = endIndex + 1;
1248
- }
1249
- /** @internal */
1250
- onprocessinginstruction(start, endIndex) {
1251
- this.endIndex = endIndex;
1252
- const value = this.getSlice(start, endIndex);
1253
- if (this.cbs.onprocessinginstruction) {
1254
- const name = this.getInstructionName(value);
1255
- this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);
1256
- }
1257
- // Set `startIndex` for next node
1258
- this.startIndex = endIndex + 1;
1259
- }
1260
- /** @internal */
1261
- oncomment(start, endIndex, offset) {
1262
- var _a, _b, _c, _d;
1263
- this.endIndex = endIndex;
1264
- (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset));
1265
- (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
1266
- // Set `startIndex` for next node
1267
- this.startIndex = endIndex + 1;
1268
- }
1269
- /** @internal */
1270
- oncdata(start, endIndex, offset) {
1271
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1272
- this.endIndex = endIndex;
1273
- const value = this.getSlice(start, endIndex - offset);
1274
- if (this.options.xmlMode || this.options.recognizeCDATA) {
1275
- (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
1276
- (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
1277
- (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
1278
- }
1279
- else {
1280
- (_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);
1281
- (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);
1282
- }
1283
- // Set `startIndex` for next node
1284
- this.startIndex = endIndex + 1;
1285
- }
1286
- /** @internal */
1287
- onend() {
1288
- var _a, _b;
1289
- if (this.cbs.onclosetag) {
1290
- // Set the end index for all remaining tags
1291
- this.endIndex = this.startIndex;
1292
- for (let index = this.stack.length; index > 0; this.cbs.onclosetag(this.stack[--index], true))
1293
- ;
1294
- }
1295
- (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
1296
- }
1297
- /**
1298
- * Resets the parser to a blank state, ready to parse a new HTML document
1299
- */
1300
- reset() {
1301
- var _a, _b, _c, _d;
1302
- (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
1303
- this.tokenizer.reset();
1304
- this.tagname = "";
1305
- this.attribname = "";
1306
- this.attribs = null;
1307
- this.stack.length = 0;
1308
- this.startIndex = 0;
1309
- this.endIndex = 0;
1310
- (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
1311
- this.buffers.length = 0;
1312
- this.bufferOffset = 0;
1313
- this.writeIndex = 0;
1314
- this.ended = false;
1315
- }
1316
- /**
1317
- * Resets the parser, then parses a complete document and
1318
- * pushes it to the handler.
1319
- *
1320
- * @param data Document to parse.
1321
- */
1322
- parseComplete(data) {
1323
- this.reset();
1324
- this.end(data);
1325
- }
1326
- getSlice(start, end) {
1327
- while (start - this.bufferOffset >= this.buffers[0].length) {
1328
- this.shiftBuffer();
1329
- }
1330
- let slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
1331
- while (end - this.bufferOffset > this.buffers[0].length) {
1332
- this.shiftBuffer();
1333
- slice += this.buffers[0].slice(0, end - this.bufferOffset);
1334
- }
1335
- return slice;
1336
- }
1337
- shiftBuffer() {
1338
- this.bufferOffset += this.buffers[0].length;
1339
- this.writeIndex--;
1340
- this.buffers.shift();
1341
- }
1342
- /**
1343
- * Parses a chunk of data and calls the corresponding callbacks.
1344
- *
1345
- * @param chunk Chunk to parse.
1346
- */
1347
- write(chunk) {
1348
- var _a, _b;
1349
- if (this.ended) {
1350
- (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".write() after done!"));
1351
- return;
1352
- }
1353
- this.buffers.push(chunk);
1354
- if (this.tokenizer.running) {
1355
- this.tokenizer.write(chunk);
1356
- this.writeIndex++;
1357
- }
1358
- }
1359
- /**
1360
- * Parses the end of the buffer and clears the stack, calls onend.
1361
- *
1362
- * @param chunk Optional final chunk to parse.
1363
- */
1364
- end(chunk) {
1365
- var _a, _b;
1366
- if (this.ended) {
1367
- (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".end() after done!"));
1368
- return;
1369
- }
1370
- if (chunk)
1371
- this.write(chunk);
1372
- this.ended = true;
1373
- this.tokenizer.end();
1374
- }
1375
- /**
1376
- * Pauses parsing. The parser won't emit events until `resume` is called.
1377
- */
1378
- pause() {
1379
- this.tokenizer.pause();
1380
- }
1381
- /**
1382
- * Resumes parsing after `pause` was called.
1383
- */
1384
- resume() {
1385
- this.tokenizer.resume();
1386
- while (this.tokenizer.running &&
1387
- this.writeIndex < this.buffers.length) {
1388
- this.tokenizer.write(this.buffers[this.writeIndex++]);
1389
- }
1390
- if (this.ended)
1391
- this.tokenizer.end();
1392
- }
1393
- /**
1394
- * Alias of `write`, for backwards compatibility.
1395
- *
1396
- * @param chunk Chunk to parse.
1397
- * @deprecated
1398
- */
1399
- parseChunk(chunk) {
1400
- this.write(chunk);
1401
- }
1402
- /**
1403
- * Alias of `end`, for backwards compatibility.
1404
- *
1405
- * @param chunk Optional final chunk to parse.
1406
- * @deprecated
1407
- */
1408
- done(chunk) {
1409
- this.end(chunk);
1410
- }
1411
- }
1412
-
1413
- // Helper methods
1414
- /**
1415
- * Parses the data, returns the resulting document.
1416
- *
1417
- * @param data The data that should be parsed.
1418
- * @param options Optional options for the parser and DOM builder.
1419
- */
1420
- function parseDocument(data, options) {
1421
- const handler = new DomHandler(undefined, options);
1422
- new Parser(handler, options).end(data);
1423
- return handler.root;
1424
- }
1425
-
1426
- export { parseDocument as p };