@prismicio/client 7.7.4 → 7.7.5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (765) hide show
  1. package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.cjs +63 -0
  2. package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.cjs.map +1 -0
  3. package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.js +63 -0
  4. package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.js.map +1 -0
  5. package/dist/_node_modules/@ungap/structured-clone/esm/index.cjs +12 -0
  6. package/dist/_node_modules/@ungap/structured-clone/esm/index.cjs.map +1 -0
  7. package/dist/_node_modules/@ungap/structured-clone/esm/index.js +12 -0
  8. package/dist/_node_modules/@ungap/structured-clone/esm/index.js.map +1 -0
  9. package/dist/_node_modules/@ungap/structured-clone/esm/serialize.cjs +127 -0
  10. package/dist/_node_modules/@ungap/structured-clone/esm/serialize.cjs.map +1 -0
  11. package/dist/_node_modules/@ungap/structured-clone/esm/serialize.js +127 -0
  12. package/dist/_node_modules/@ungap/structured-clone/esm/serialize.js.map +1 -0
  13. package/dist/_node_modules/@ungap/structured-clone/esm/types.cjs +23 -0
  14. package/dist/_node_modules/@ungap/structured-clone/esm/types.cjs.map +1 -0
  15. package/dist/_node_modules/@ungap/structured-clone/esm/types.js +23 -0
  16. package/dist/_node_modules/@ungap/structured-clone/esm/types.js.map +1 -0
  17. package/dist/_node_modules/bail/index.cjs +9 -0
  18. package/dist/_node_modules/bail/index.cjs.map +1 -0
  19. package/dist/_node_modules/bail/index.js +9 -0
  20. package/dist/_node_modules/bail/index.js.map +1 -0
  21. package/dist/_node_modules/bcp-47-match/index.cjs +74 -0
  22. package/dist/_node_modules/bcp-47-match/index.cjs.map +1 -0
  23. package/dist/_node_modules/bcp-47-match/index.js +74 -0
  24. package/dist/_node_modules/bcp-47-match/index.js.map +1 -0
  25. package/dist/_node_modules/boolbase/index.cjs +13 -0
  26. package/dist/_node_modules/boolbase/index.cjs.map +1 -0
  27. package/dist/_node_modules/boolbase/index.js +14 -0
  28. package/dist/_node_modules/boolbase/index.js.map +1 -0
  29. package/dist/_node_modules/ccount/index.cjs +17 -0
  30. package/dist/_node_modules/ccount/index.cjs.map +1 -0
  31. package/dist/_node_modules/ccount/index.js +17 -0
  32. package/dist/_node_modules/ccount/index.js.map +1 -0
  33. package/dist/_node_modules/character-entities/index.cjs +2131 -0
  34. package/dist/_node_modules/character-entities/index.cjs.map +1 -0
  35. package/dist/_node_modules/character-entities/index.js +2131 -0
  36. package/dist/_node_modules/character-entities/index.js.map +1 -0
  37. package/dist/_node_modules/character-entities-html4/index.cjs +258 -0
  38. package/dist/_node_modules/character-entities-html4/index.cjs.map +1 -0
  39. package/dist/_node_modules/character-entities-html4/index.js +258 -0
  40. package/dist/_node_modules/character-entities-html4/index.js.map +1 -0
  41. package/dist/_node_modules/character-entities-legacy/index.cjs +112 -0
  42. package/dist/_node_modules/character-entities-legacy/index.cjs.map +1 -0
  43. package/dist/_node_modules/character-entities-legacy/index.js +112 -0
  44. package/dist/_node_modules/character-entities-legacy/index.js.map +1 -0
  45. package/dist/_node_modules/comma-separated-tokens/index.cjs +32 -0
  46. package/dist/_node_modules/comma-separated-tokens/index.cjs.map +1 -0
  47. package/dist/_node_modules/comma-separated-tokens/index.js +32 -0
  48. package/dist/_node_modules/comma-separated-tokens/index.js.map +1 -0
  49. package/dist/_node_modules/devlop/lib/default.cjs +6 -0
  50. package/dist/_node_modules/devlop/lib/default.cjs.map +1 -0
  51. package/dist/_node_modules/devlop/lib/default.js +6 -0
  52. package/dist/_node_modules/devlop/lib/default.js.map +1 -0
  53. package/dist/_node_modules/direction/index.cjs +12 -0
  54. package/dist/_node_modules/direction/index.cjs.map +1 -0
  55. package/dist/_node_modules/direction/index.js +12 -0
  56. package/dist/_node_modules/direction/index.js.map +1 -0
  57. package/dist/_node_modules/extend/index.cjs +89 -0
  58. package/dist/_node_modules/extend/index.cjs.map +1 -0
  59. package/dist/_node_modules/extend/index.js +90 -0
  60. package/dist/_node_modules/extend/index.js.map +1 -0
  61. package/dist/_node_modules/hast-util-embedded/lib/index.cjs +14 -0
  62. package/dist/_node_modules/hast-util-embedded/lib/index.cjs.map +1 -0
  63. package/dist/_node_modules/hast-util-embedded/lib/index.js +14 -0
  64. package/dist/_node_modules/hast-util-embedded/lib/index.js.map +1 -0
  65. package/dist/_node_modules/hast-util-from-html/lib/errors.cjs +317 -0
  66. package/dist/_node_modules/hast-util-from-html/lib/errors.cjs.map +1 -0
  67. package/dist/_node_modules/hast-util-from-html/lib/errors.js +317 -0
  68. package/dist/_node_modules/hast-util-from-html/lib/errors.js.map +1 -0
  69. package/dist/_node_modules/hast-util-from-html/lib/index.cjs +96 -0
  70. package/dist/_node_modules/hast-util-from-html/lib/index.cjs.map +1 -0
  71. package/dist/_node_modules/hast-util-from-html/lib/index.js +96 -0
  72. package/dist/_node_modules/hast-util-from-html/lib/index.js.map +1 -0
  73. package/dist/_node_modules/hast-util-from-parse5/lib/index.cjs +187 -0
  74. package/dist/_node_modules/hast-util-from-parse5/lib/index.cjs.map +1 -0
  75. package/dist/_node_modules/hast-util-from-parse5/lib/index.js +187 -0
  76. package/dist/_node_modules/hast-util-from-parse5/lib/index.js.map +1 -0
  77. package/dist/_node_modules/hast-util-has-property/lib/index.cjs +9 -0
  78. package/dist/_node_modules/hast-util-has-property/lib/index.cjs.map +1 -0
  79. package/dist/_node_modules/hast-util-has-property/lib/index.js +9 -0
  80. package/dist/_node_modules/hast-util-has-property/lib/index.js.map +1 -0
  81. package/dist/_node_modules/hast-util-is-element/lib/index.cjs +102 -0
  82. package/dist/_node_modules/hast-util-is-element/lib/index.cjs.map +1 -0
  83. package/dist/_node_modules/hast-util-is-element/lib/index.js +102 -0
  84. package/dist/_node_modules/hast-util-is-element/lib/index.js.map +1 -0
  85. package/dist/_node_modules/hast-util-parse-selector/lib/index.cjs +40 -0
  86. package/dist/_node_modules/hast-util-parse-selector/lib/index.cjs.map +1 -0
  87. package/dist/_node_modules/hast-util-parse-selector/lib/index.js +40 -0
  88. package/dist/_node_modules/hast-util-parse-selector/lib/index.js.map +1 -0
  89. package/dist/_node_modules/hast-util-select/lib/attribute.cjs +67 -0
  90. package/dist/_node_modules/hast-util-select/lib/attribute.cjs.map +1 -0
  91. package/dist/_node_modules/hast-util-select/lib/attribute.js +67 -0
  92. package/dist/_node_modules/hast-util-select/lib/attribute.js.map +1 -0
  93. package/dist/_node_modules/hast-util-select/lib/class-name.cjs +12 -0
  94. package/dist/_node_modules/hast-util-select/lib/class-name.cjs.map +1 -0
  95. package/dist/_node_modules/hast-util-select/lib/class-name.js +12 -0
  96. package/dist/_node_modules/hast-util-select/lib/class-name.js.map +1 -0
  97. package/dist/_node_modules/hast-util-select/lib/enter-state.cjs +79 -0
  98. package/dist/_node_modules/hast-util-select/lib/enter-state.cjs.map +1 -0
  99. package/dist/_node_modules/hast-util-select/lib/enter-state.js +79 -0
  100. package/dist/_node_modules/hast-util-select/lib/enter-state.js.map +1 -0
  101. package/dist/_node_modules/hast-util-select/lib/id.cjs +7 -0
  102. package/dist/_node_modules/hast-util-select/lib/id.cjs.map +1 -0
  103. package/dist/_node_modules/hast-util-select/lib/id.js +7 -0
  104. package/dist/_node_modules/hast-util-select/lib/id.js.map +1 -0
  105. package/dist/_node_modules/hast-util-select/lib/index.cjs +38 -0
  106. package/dist/_node_modules/hast-util-select/lib/index.cjs.map +1 -0
  107. package/dist/_node_modules/hast-util-select/lib/index.js +38 -0
  108. package/dist/_node_modules/hast-util-select/lib/index.js.map +1 -0
  109. package/dist/_node_modules/hast-util-select/lib/name.cjs +7 -0
  110. package/dist/_node_modules/hast-util-select/lib/name.cjs.map +1 -0
  111. package/dist/_node_modules/hast-util-select/lib/name.js +7 -0
  112. package/dist/_node_modules/hast-util-select/lib/name.js.map +1 -0
  113. package/dist/_node_modules/hast-util-select/lib/parse.cjs +12 -0
  114. package/dist/_node_modules/hast-util-select/lib/parse.cjs.map +1 -0
  115. package/dist/_node_modules/hast-util-select/lib/parse.js +12 -0
  116. package/dist/_node_modules/hast-util-select/lib/parse.js.map +1 -0
  117. package/dist/_node_modules/hast-util-select/lib/pseudo.cjs +231 -0
  118. package/dist/_node_modules/hast-util-select/lib/pseudo.cjs.map +1 -0
  119. package/dist/_node_modules/hast-util-select/lib/pseudo.js +231 -0
  120. package/dist/_node_modules/hast-util-select/lib/pseudo.js.map +1 -0
  121. package/dist/_node_modules/hast-util-select/lib/test.cjs +27 -0
  122. package/dist/_node_modules/hast-util-select/lib/test.cjs.map +1 -0
  123. package/dist/_node_modules/hast-util-select/lib/test.js +27 -0
  124. package/dist/_node_modules/hast-util-select/lib/test.js.map +1 -0
  125. package/dist/_node_modules/hast-util-select/lib/walk.cjs +132 -0
  126. package/dist/_node_modules/hast-util-select/lib/walk.cjs.map +1 -0
  127. package/dist/_node_modules/hast-util-select/lib/walk.js +132 -0
  128. package/dist/_node_modules/hast-util-select/lib/walk.js.map +1 -0
  129. package/dist/_node_modules/hast-util-to-html/lib/handle/comment.cjs +24 -0
  130. package/dist/_node_modules/hast-util-to-html/lib/handle/comment.cjs.map +1 -0
  131. package/dist/_node_modules/hast-util-to-html/lib/handle/comment.js +24 -0
  132. package/dist/_node_modules/hast-util-to-html/lib/handle/comment.js.map +1 -0
  133. package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.cjs +7 -0
  134. package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.cjs.map +1 -0
  135. package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.js +7 -0
  136. package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.js.map +1 -0
  137. package/dist/_node_modules/hast-util-to-html/lib/handle/element.cjs +137 -0
  138. package/dist/_node_modules/hast-util-to-html/lib/handle/element.cjs.map +1 -0
  139. package/dist/_node_modules/hast-util-to-html/lib/handle/element.js +137 -0
  140. package/dist/_node_modules/hast-util-to-html/lib/handle/element.js.map +1 -0
  141. package/dist/_node_modules/hast-util-to-html/lib/handle/index.cjs +26 -0
  142. package/dist/_node_modules/hast-util-to-html/lib/handle/index.cjs.map +1 -0
  143. package/dist/_node_modules/hast-util-to-html/lib/handle/index.js +26 -0
  144. package/dist/_node_modules/hast-util-to-html/lib/handle/index.js.map +1 -0
  145. package/dist/_node_modules/hast-util-to-html/lib/handle/raw.cjs +8 -0
  146. package/dist/_node_modules/hast-util-to-html/lib/handle/raw.cjs.map +1 -0
  147. package/dist/_node_modules/hast-util-to-html/lib/handle/raw.js +8 -0
  148. package/dist/_node_modules/hast-util-to-html/lib/handle/raw.js.map +1 -0
  149. package/dist/_node_modules/hast-util-to-html/lib/handle/root.cjs +7 -0
  150. package/dist/_node_modules/hast-util-to-html/lib/handle/root.cjs.map +1 -0
  151. package/dist/_node_modules/hast-util-to-html/lib/handle/root.js +7 -0
  152. package/dist/_node_modules/hast-util-to-html/lib/handle/root.js.map +1 -0
  153. package/dist/_node_modules/hast-util-to-html/lib/handle/text.cjs +14 -0
  154. package/dist/_node_modules/hast-util-to-html/lib/handle/text.cjs.map +1 -0
  155. package/dist/_node_modules/hast-util-to-html/lib/handle/text.js +14 -0
  156. package/dist/_node_modules/hast-util-to-html/lib/handle/text.js.map +1 -0
  157. package/dist/_node_modules/hast-util-to-html/lib/index.cjs +62 -0
  158. package/dist/_node_modules/hast-util-to-html/lib/index.cjs.map +1 -0
  159. package/dist/_node_modules/hast-util-to-html/lib/index.js +62 -0
  160. package/dist/_node_modules/hast-util-to-html/lib/index.js.map +1 -0
  161. package/dist/_node_modules/hast-util-to-html/lib/omission/closing.cjs +92 -0
  162. package/dist/_node_modules/hast-util-to-html/lib/omission/closing.cjs.map +1 -0
  163. package/dist/_node_modules/hast-util-to-html/lib/omission/closing.js +92 -0
  164. package/dist/_node_modules/hast-util-to-html/lib/omission/closing.js.map +1 -0
  165. package/dist/_node_modules/hast-util-to-html/lib/omission/omission.cjs +11 -0
  166. package/dist/_node_modules/hast-util-to-html/lib/omission/omission.cjs.map +1 -0
  167. package/dist/_node_modules/hast-util-to-html/lib/omission/omission.js +11 -0
  168. package/dist/_node_modules/hast-util-to-html/lib/omission/omission.js.map +1 -0
  169. package/dist/_node_modules/hast-util-to-html/lib/omission/opening.cjs +52 -0
  170. package/dist/_node_modules/hast-util-to-html/lib/omission/opening.cjs.map +1 -0
  171. package/dist/_node_modules/hast-util-to-html/lib/omission/opening.js +52 -0
  172. package/dist/_node_modules/hast-util-to-html/lib/omission/opening.js.map +1 -0
  173. package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.cjs +24 -0
  174. package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.cjs.map +1 -0
  175. package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.js +24 -0
  176. package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.js.map +1 -0
  177. package/dist/_node_modules/hast-util-to-string/lib/index.cjs +24 -0
  178. package/dist/_node_modules/hast-util-to-string/lib/index.cjs.map +1 -0
  179. package/dist/_node_modules/hast-util-to-string/lib/index.js +24 -0
  180. package/dist/_node_modules/hast-util-to-string/lib/index.js.map +1 -0
  181. package/dist/_node_modules/hast-util-whitespace/lib/index.cjs +11 -0
  182. package/dist/_node_modules/hast-util-whitespace/lib/index.cjs.map +1 -0
  183. package/dist/_node_modules/hast-util-whitespace/lib/index.js +11 -0
  184. package/dist/_node_modules/hast-util-whitespace/lib/index.js.map +1 -0
  185. package/dist/_node_modules/hastscript/lib/create-h.cjs +159 -0
  186. package/dist/_node_modules/hastscript/lib/create-h.cjs.map +1 -0
  187. package/dist/_node_modules/hastscript/lib/create-h.js +159 -0
  188. package/dist/_node_modules/hastscript/lib/create-h.js.map +1 -0
  189. package/dist/_node_modules/hastscript/lib/index.cjs +10 -0
  190. package/dist/_node_modules/hastscript/lib/index.cjs.map +1 -0
  191. package/dist/_node_modules/hastscript/lib/index.js +10 -0
  192. package/dist/_node_modules/hastscript/lib/index.js.map +1 -0
  193. package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +45 -0
  194. package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.map +1 -0
  195. package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +45 -0
  196. package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.js.map +1 -0
  197. package/dist/_node_modules/html-void-elements/index.cjs +26 -0
  198. package/dist/_node_modules/html-void-elements/index.cjs.map +1 -0
  199. package/dist/_node_modules/html-void-elements/index.js +26 -0
  200. package/dist/_node_modules/html-void-elements/index.js.map +1 -0
  201. package/dist/_node_modules/mdast-util-from-markdown/lib/index.cjs +720 -0
  202. package/dist/_node_modules/mdast-util-from-markdown/lib/index.cjs.map +1 -0
  203. package/dist/_node_modules/mdast-util-from-markdown/lib/index.js +720 -0
  204. package/dist/_node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
  205. package/dist/_node_modules/mdast-util-to-hast/lib/footer.cjs +116 -0
  206. package/dist/_node_modules/mdast-util-to-hast/lib/footer.cjs.map +1 -0
  207. package/dist/_node_modules/mdast-util-to-hast/lib/footer.js +116 -0
  208. package/dist/_node_modules/mdast-util-to-hast/lib/footer.js.map +1 -0
  209. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs +14 -0
  210. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs.map +1 -0
  211. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +14 -0
  212. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.js.map +1 -0
  213. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.cjs +9 -0
  214. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.cjs.map +1 -0
  215. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.js +9 -0
  216. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.js.map +1 -0
  217. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.cjs +25 -0
  218. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.cjs.map +1 -0
  219. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.js +25 -0
  220. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.js.map +1 -0
  221. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.cjs +14 -0
  222. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.cjs.map +1 -0
  223. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.js +14 -0
  224. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.js.map +1 -0
  225. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs +14 -0
  226. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs.map +1 -0
  227. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +14 -0
  228. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.js.map +1 -0
  229. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs +42 -0
  230. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs.map +1 -0
  231. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +42 -0
  232. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js.map +1 -0
  233. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.cjs +14 -0
  234. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.cjs.map +1 -0
  235. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.js +14 -0
  236. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.js.map +1 -0
  237. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.cjs +12 -0
  238. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.cjs.map +1 -0
  239. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.js +12 -0
  240. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.js.map +1 -0
  241. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs +20 -0
  242. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs.map +1 -0
  243. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +20 -0
  244. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.js.map +1 -0
  245. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.cjs +17 -0
  246. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.cjs.map +1 -0
  247. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.js +17 -0
  248. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.js.map +1 -0
  249. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.cjs +60 -0
  250. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.cjs.map +1 -0
  251. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.js +60 -0
  252. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.js.map +1 -0
  253. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs +16 -0
  254. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs.map +1 -0
  255. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +16 -0
  256. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.js.map +1 -0
  257. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs +25 -0
  258. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs.map +1 -0
  259. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +25 -0
  260. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.js.map +1 -0
  261. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.cjs +19 -0
  262. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.cjs.map +1 -0
  263. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.js +19 -0
  264. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.js.map +1 -0
  265. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs +65 -0
  266. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs.map +1 -0
  267. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.js +65 -0
  268. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.js.map +1 -0
  269. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.cjs +27 -0
  270. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.cjs.map +1 -0
  271. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.js +27 -0
  272. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.js.map +1 -0
  273. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs +14 -0
  274. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs.map +1 -0
  275. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +14 -0
  276. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.js.map +1 -0
  277. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.cjs +9 -0
  278. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.cjs.map +1 -0
  279. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.js +9 -0
  280. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.js.map +1 -0
  281. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.cjs +14 -0
  282. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.cjs.map +1 -0
  283. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.js +14 -0
  284. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.js.map +1 -0
  285. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs +15 -0
  286. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs.map +1 -0
  287. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +15 -0
  288. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.js.map +1 -0
  289. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs +36 -0
  290. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs.map +1 -0
  291. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.js +36 -0
  292. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.js.map +1 -0
  293. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.cjs +40 -0
  294. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.cjs.map +1 -0
  295. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.js +40 -0
  296. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.js.map +1 -0
  297. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.cjs +10 -0
  298. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.cjs.map +1 -0
  299. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.js +10 -0
  300. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.js.map +1 -0
  301. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs +14 -0
  302. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs.map +1 -0
  303. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +14 -0
  304. package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js.map +1 -0
  305. package/dist/_node_modules/mdast-util-to-hast/lib/index.cjs +16 -0
  306. package/dist/_node_modules/mdast-util-to-hast/lib/index.cjs.map +1 -0
  307. package/dist/_node_modules/mdast-util-to-hast/lib/index.js +16 -0
  308. package/dist/_node_modules/mdast-util-to-hast/lib/index.js.map +1 -0
  309. package/dist/_node_modules/mdast-util-to-hast/lib/revert.cjs +30 -0
  310. package/dist/_node_modules/mdast-util-to-hast/lib/revert.cjs.map +1 -0
  311. package/dist/_node_modules/mdast-util-to-hast/lib/revert.js +30 -0
  312. package/dist/_node_modules/mdast-util-to-hast/lib/revert.js.map +1 -0
  313. package/dist/_node_modules/mdast-util-to-hast/lib/state.cjs +149 -0
  314. package/dist/_node_modules/mdast-util-to-hast/lib/state.cjs.map +1 -0
  315. package/dist/_node_modules/mdast-util-to-hast/lib/state.js +149 -0
  316. package/dist/_node_modules/mdast-util-to-hast/lib/state.js.map +1 -0
  317. package/dist/_node_modules/mdast-util-to-string/lib/index.cjs +39 -0
  318. package/dist/_node_modules/mdast-util-to-string/lib/index.cjs.map +1 -0
  319. package/dist/_node_modules/mdast-util-to-string/lib/index.js +39 -0
  320. package/dist/_node_modules/mdast-util-to-string/lib/index.js.map +1 -0
  321. package/dist/_node_modules/micromark/lib/constructs.cjs +94 -0
  322. package/dist/_node_modules/micromark/lib/constructs.cjs.map +1 -0
  323. package/dist/_node_modules/micromark/lib/constructs.js +94 -0
  324. package/dist/_node_modules/micromark/lib/constructs.js.map +1 -0
  325. package/dist/_node_modules/micromark/lib/create-tokenizer.cjs +316 -0
  326. package/dist/_node_modules/micromark/lib/create-tokenizer.cjs.map +1 -0
  327. package/dist/_node_modules/micromark/lib/create-tokenizer.js +316 -0
  328. package/dist/_node_modules/micromark/lib/create-tokenizer.js.map +1 -0
  329. package/dist/_node_modules/micromark/lib/initialize/content.cjs +58 -0
  330. package/dist/_node_modules/micromark/lib/initialize/content.cjs.map +1 -0
  331. package/dist/_node_modules/micromark/lib/initialize/content.js +58 -0
  332. package/dist/_node_modules/micromark/lib/initialize/content.js.map +1 -0
  333. package/dist/_node_modules/micromark/lib/initialize/document.cjs +212 -0
  334. package/dist/_node_modules/micromark/lib/initialize/document.cjs.map +1 -0
  335. package/dist/_node_modules/micromark/lib/initialize/document.js +212 -0
  336. package/dist/_node_modules/micromark/lib/initialize/document.js.map +1 -0
  337. package/dist/_node_modules/micromark/lib/initialize/flow.cjs +55 -0
  338. package/dist/_node_modules/micromark/lib/initialize/flow.cjs.map +1 -0
  339. package/dist/_node_modules/micromark/lib/initialize/flow.js +55 -0
  340. package/dist/_node_modules/micromark/lib/initialize/flow.js.map +1 -0
  341. package/dist/_node_modules/micromark/lib/initialize/text.cjs +143 -0
  342. package/dist/_node_modules/micromark/lib/initialize/text.cjs.map +1 -0
  343. package/dist/_node_modules/micromark/lib/initialize/text.js +143 -0
  344. package/dist/_node_modules/micromark/lib/initialize/text.js.map +1 -0
  345. package/dist/_node_modules/micromark/lib/parse.cjs +35 -0
  346. package/dist/_node_modules/micromark/lib/parse.cjs.map +1 -0
  347. package/dist/_node_modules/micromark/lib/parse.js +35 -0
  348. package/dist/_node_modules/micromark/lib/parse.js.map +1 -0
  349. package/dist/_node_modules/micromark/lib/postprocess.cjs +10 -0
  350. package/dist/_node_modules/micromark/lib/postprocess.cjs.map +1 -0
  351. package/dist/_node_modules/micromark/lib/postprocess.js +10 -0
  352. package/dist/_node_modules/micromark/lib/postprocess.js.map +1 -0
  353. package/dist/_node_modules/micromark/lib/preprocess.cjs +81 -0
  354. package/dist/_node_modules/micromark/lib/preprocess.cjs.map +1 -0
  355. package/dist/_node_modules/micromark/lib/preprocess.js +81 -0
  356. package/dist/_node_modules/micromark/lib/preprocess.js.map +1 -0
  357. package/dist/_node_modules/micromark-core-commonmark/lib/attention.cjs +116 -0
  358. package/dist/_node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -0
  359. package/dist/_node_modules/micromark-core-commonmark/lib/attention.js +116 -0
  360. package/dist/_node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
  361. package/dist/_node_modules/micromark-core-commonmark/lib/autolink.cjs +104 -0
  362. package/dist/_node_modules/micromark-core-commonmark/lib/autolink.cjs.map +1 -0
  363. package/dist/_node_modules/micromark-core-commonmark/lib/autolink.js +104 -0
  364. package/dist/_node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
  365. package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.cjs +19 -0
  366. package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.cjs.map +1 -0
  367. package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.js +19 -0
  368. package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
  369. package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.cjs +62 -0
  370. package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.cjs.map +1 -0
  371. package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.js +62 -0
  372. package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
  373. package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.cjs +29 -0
  374. package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.cjs.map +1 -0
  375. package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.js +29 -0
  376. package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
  377. package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.cjs +69 -0
  378. package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.cjs.map +1 -0
  379. package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.js +69 -0
  380. package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
  381. package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.cjs +187 -0
  382. package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -0
  383. package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.js +187 -0
  384. package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
  385. package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.cjs +68 -0
  386. package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -0
  387. package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.js +68 -0
  388. package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
  389. package/dist/_node_modules/micromark-core-commonmark/lib/code-text.cjs +117 -0
  390. package/dist/_node_modules/micromark-core-commonmark/lib/code-text.cjs.map +1 -0
  391. package/dist/_node_modules/micromark-core-commonmark/lib/code-text.js +117 -0
  392. package/dist/_node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
  393. package/dist/_node_modules/micromark-core-commonmark/lib/content.cjs +76 -0
  394. package/dist/_node_modules/micromark-core-commonmark/lib/content.cjs.map +1 -0
  395. package/dist/_node_modules/micromark-core-commonmark/lib/content.js +76 -0
  396. package/dist/_node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
  397. package/dist/_node_modules/micromark-core-commonmark/lib/definition.cjs +95 -0
  398. package/dist/_node_modules/micromark-core-commonmark/lib/definition.cjs.map +1 -0
  399. package/dist/_node_modules/micromark-core-commonmark/lib/definition.js +95 -0
  400. package/dist/_node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
  401. package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs +24 -0
  402. package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs.map +1 -0
  403. package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.js +24 -0
  404. package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
  405. package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.cjs +96 -0
  406. package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -0
  407. package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.js +96 -0
  408. package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
  409. package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.cjs +384 -0
  410. package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -0
  411. package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.js +384 -0
  412. package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
  413. package/dist/_node_modules/micromark-core-commonmark/lib/html-text.cjs +310 -0
  414. package/dist/_node_modules/micromark-core-commonmark/lib/html-text.cjs.map +1 -0
  415. package/dist/_node_modules/micromark-core-commonmark/lib/html-text.js +310 -0
  416. package/dist/_node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
  417. package/dist/_node_modules/micromark-core-commonmark/lib/label-end.cjs +219 -0
  418. package/dist/_node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -0
  419. package/dist/_node_modules/micromark-core-commonmark/lib/label-end.js +219 -0
  420. package/dist/_node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
  421. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.cjs +34 -0
  422. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -0
  423. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.js +34 -0
  424. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
  425. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.cjs +25 -0
  426. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -0
  427. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.js +25 -0
  428. package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
  429. package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.cjs +18 -0
  430. package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.cjs.map +1 -0
  431. package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.js +18 -0
  432. package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
  433. package/dist/_node_modules/micromark-core-commonmark/lib/list.cjs +136 -0
  434. package/dist/_node_modules/micromark-core-commonmark/lib/list.cjs.map +1 -0
  435. package/dist/_node_modules/micromark-core-commonmark/lib/list.js +136 -0
  436. package/dist/_node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
  437. package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.cjs +90 -0
  438. package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -0
  439. package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.js +90 -0
  440. package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
  441. package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.cjs +43 -0
  442. package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.cjs.map +1 -0
  443. package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.js +43 -0
  444. package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
  445. package/dist/_node_modules/micromark-factory-destination/index.cjs +95 -0
  446. package/dist/_node_modules/micromark-factory-destination/index.cjs.map +1 -0
  447. package/dist/_node_modules/micromark-factory-destination/index.js +95 -0
  448. package/dist/_node_modules/micromark-factory-destination/index.js.map +1 -0
  449. package/dist/_node_modules/micromark-factory-label/index.cjs +64 -0
  450. package/dist/_node_modules/micromark-factory-label/index.cjs.map +1 -0
  451. package/dist/_node_modules/micromark-factory-label/index.js +64 -0
  452. package/dist/_node_modules/micromark-factory-label/index.js.map +1 -0
  453. package/dist/_node_modules/micromark-factory-space/index.cjs +25 -0
  454. package/dist/_node_modules/micromark-factory-space/index.cjs.map +1 -0
  455. package/dist/_node_modules/micromark-factory-space/index.js +25 -0
  456. package/dist/_node_modules/micromark-factory-space/index.js.map +1 -0
  457. package/dist/_node_modules/micromark-factory-title/index.cjs +66 -0
  458. package/dist/_node_modules/micromark-factory-title/index.cjs.map +1 -0
  459. package/dist/_node_modules/micromark-factory-title/index.js +66 -0
  460. package/dist/_node_modules/micromark-factory-title/index.js.map +1 -0
  461. package/dist/_node_modules/micromark-factory-whitespace/index.cjs +27 -0
  462. package/dist/_node_modules/micromark-factory-whitespace/index.cjs.map +1 -0
  463. package/dist/_node_modules/micromark-factory-whitespace/index.js +27 -0
  464. package/dist/_node_modules/micromark-factory-whitespace/index.js.map +1 -0
  465. package/dist/_node_modules/micromark-util-character/index.cjs +45 -0
  466. package/dist/_node_modules/micromark-util-character/index.cjs.map +1 -0
  467. package/dist/_node_modules/micromark-util-character/index.js +45 -0
  468. package/dist/_node_modules/micromark-util-character/index.js.map +1 -0
  469. package/dist/_node_modules/micromark-util-chunked/index.cjs +37 -0
  470. package/dist/_node_modules/micromark-util-chunked/index.cjs.map +1 -0
  471. package/dist/_node_modules/micromark-util-chunked/index.js +37 -0
  472. package/dist/_node_modules/micromark-util-chunked/index.js.map +1 -0
  473. package/dist/_node_modules/micromark-util-classify-character/index.cjs +13 -0
  474. package/dist/_node_modules/micromark-util-classify-character/index.cjs.map +1 -0
  475. package/dist/_node_modules/micromark-util-classify-character/index.js +13 -0
  476. package/dist/_node_modules/micromark-util-classify-character/index.js.map +1 -0
  477. package/dist/_node_modules/micromark-util-combine-extensions/index.cjs +42 -0
  478. package/dist/_node_modules/micromark-util-combine-extensions/index.cjs.map +1 -0
  479. package/dist/_node_modules/micromark-util-combine-extensions/index.js +42 -0
  480. package/dist/_node_modules/micromark-util-combine-extensions/index.js.map +1 -0
  481. package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.cjs +20 -0
  482. package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.cjs.map +1 -0
  483. package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.js +20 -0
  484. package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
  485. package/dist/_node_modules/micromark-util-decode-string/index.cjs +22 -0
  486. package/dist/_node_modules/micromark-util-decode-string/index.cjs.map +1 -0
  487. package/dist/_node_modules/micromark-util-decode-string/index.js +22 -0
  488. package/dist/_node_modules/micromark-util-decode-string/index.js.map +1 -0
  489. package/dist/_node_modules/micromark-util-html-tag-name/index.cjs +70 -0
  490. package/dist/_node_modules/micromark-util-html-tag-name/index.cjs.map +1 -0
  491. package/dist/_node_modules/micromark-util-html-tag-name/index.js +70 -0
  492. package/dist/_node_modules/micromark-util-html-tag-name/index.js.map +1 -0
  493. package/dist/_node_modules/micromark-util-normalize-identifier/index.cjs +7 -0
  494. package/dist/_node_modules/micromark-util-normalize-identifier/index.cjs.map +1 -0
  495. package/dist/_node_modules/micromark-util-normalize-identifier/index.js +7 -0
  496. package/dist/_node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
  497. package/dist/_node_modules/micromark-util-resolve-all/index.cjs +16 -0
  498. package/dist/_node_modules/micromark-util-resolve-all/index.cjs.map +1 -0
  499. package/dist/_node_modules/micromark-util-resolve-all/index.js +16 -0
  500. package/dist/_node_modules/micromark-util-resolve-all/index.js.map +1 -0
  501. package/dist/_node_modules/micromark-util-sanitize-uri/index.cjs +42 -0
  502. package/dist/_node_modules/micromark-util-sanitize-uri/index.cjs.map +1 -0
  503. package/dist/_node_modules/micromark-util-sanitize-uri/index.js +42 -0
  504. package/dist/_node_modules/micromark-util-sanitize-uri/index.js.map +1 -0
  505. package/dist/_node_modules/micromark-util-subtokenize/index.cjs +149 -0
  506. package/dist/_node_modules/micromark-util-subtokenize/index.cjs.map +1 -0
  507. package/dist/_node_modules/micromark-util-subtokenize/index.js +149 -0
  508. package/dist/_node_modules/micromark-util-subtokenize/index.js.map +1 -0
  509. package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs +195 -0
  510. package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs.map +1 -0
  511. package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.js +195 -0
  512. package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.js.map +1 -0
  513. package/dist/_node_modules/nth-check/lib/esm/compile.cjs +20 -0
  514. package/dist/_node_modules/nth-check/lib/esm/compile.cjs.map +1 -0
  515. package/dist/_node_modules/nth-check/lib/esm/compile.js +20 -0
  516. package/dist/_node_modules/nth-check/lib/esm/compile.js.map +1 -0
  517. package/dist/_node_modules/nth-check/lib/esm/index.cjs +11 -0
  518. package/dist/_node_modules/nth-check/lib/esm/index.cjs.map +1 -0
  519. package/dist/_node_modules/nth-check/lib/esm/index.js +11 -0
  520. package/dist/_node_modules/nth-check/lib/esm/index.js.map +1 -0
  521. package/dist/_node_modules/nth-check/lib/esm/parse.cjs +59 -0
  522. package/dist/_node_modules/nth-check/lib/esm/parse.cjs.map +1 -0
  523. package/dist/_node_modules/nth-check/lib/esm/parse.js +59 -0
  524. package/dist/_node_modules/nth-check/lib/esm/parse.js.map +1 -0
  525. package/dist/_node_modules/property-information/index.cjs +14 -0
  526. package/dist/_node_modules/property-information/index.cjs.map +1 -0
  527. package/dist/_node_modules/property-information/index.js +14 -0
  528. package/dist/_node_modules/property-information/index.js.map +1 -0
  529. package/dist/_node_modules/property-information/lib/aria.cjs +62 -0
  530. package/dist/_node_modules/property-information/lib/aria.cjs.map +1 -0
  531. package/dist/_node_modules/property-information/lib/aria.js +62 -0
  532. package/dist/_node_modules/property-information/lib/aria.js.map +1 -0
  533. package/dist/_node_modules/property-information/lib/find.cjs +41 -0
  534. package/dist/_node_modules/property-information/lib/find.cjs.map +1 -0
  535. package/dist/_node_modules/property-information/lib/find.js +41 -0
  536. package/dist/_node_modules/property-information/lib/find.js.map +1 -0
  537. package/dist/_node_modules/property-information/lib/html.cjs +369 -0
  538. package/dist/_node_modules/property-information/lib/html.cjs.map +1 -0
  539. package/dist/_node_modules/property-information/lib/html.js +369 -0
  540. package/dist/_node_modules/property-information/lib/html.js.map +1 -0
  541. package/dist/_node_modules/property-information/lib/normalize.cjs +7 -0
  542. package/dist/_node_modules/property-information/lib/normalize.cjs.map +1 -0
  543. package/dist/_node_modules/property-information/lib/normalize.js +7 -0
  544. package/dist/_node_modules/property-information/lib/normalize.js.map +1 -0
  545. package/dist/_node_modules/property-information/lib/svg.cjs +567 -0
  546. package/dist/_node_modules/property-information/lib/svg.cjs.map +1 -0
  547. package/dist/_node_modules/property-information/lib/svg.js +567 -0
  548. package/dist/_node_modules/property-information/lib/svg.js.map +1 -0
  549. package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.cjs +8 -0
  550. package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.cjs.map +1 -0
  551. package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.js +8 -0
  552. package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.js.map +1 -0
  553. package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.cjs +7 -0
  554. package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.cjs.map +1 -0
  555. package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.js +7 -0
  556. package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.js.map +1 -0
  557. package/dist/_node_modules/property-information/lib/util/create.cjs +31 -0
  558. package/dist/_node_modules/property-information/lib/util/create.cjs.map +1 -0
  559. package/dist/_node_modules/property-information/lib/util/create.js +31 -0
  560. package/dist/_node_modules/property-information/lib/util/create.js.map +1 -0
  561. package/dist/_node_modules/property-information/lib/util/defined-info.cjs +33 -0
  562. package/dist/_node_modules/property-information/lib/util/defined-info.cjs.map +1 -0
  563. package/dist/_node_modules/property-information/lib/util/defined-info.js +33 -0
  564. package/dist/_node_modules/property-information/lib/util/defined-info.js.map +1 -0
  565. package/dist/_node_modules/property-information/lib/util/info.cjs +25 -0
  566. package/dist/_node_modules/property-information/lib/util/info.cjs.map +1 -0
  567. package/dist/_node_modules/property-information/lib/util/info.js +25 -0
  568. package/dist/_node_modules/property-information/lib/util/info.js.map +1 -0
  569. package/dist/_node_modules/property-information/lib/util/merge.cjs +15 -0
  570. package/dist/_node_modules/property-information/lib/util/merge.cjs.map +1 -0
  571. package/dist/_node_modules/property-information/lib/util/merge.js +15 -0
  572. package/dist/_node_modules/property-information/lib/util/merge.js.map +1 -0
  573. package/dist/_node_modules/property-information/lib/util/schema.cjs +22 -0
  574. package/dist/_node_modules/property-information/lib/util/schema.cjs.map +1 -0
  575. package/dist/_node_modules/property-information/lib/util/schema.js +22 -0
  576. package/dist/_node_modules/property-information/lib/util/schema.js.map +1 -0
  577. package/dist/_node_modules/property-information/lib/util/types.cjs +21 -0
  578. package/dist/_node_modules/property-information/lib/util/types.cjs.map +1 -0
  579. package/dist/_node_modules/property-information/lib/util/types.js +21 -0
  580. package/dist/_node_modules/property-information/lib/util/types.js.map +1 -0
  581. package/dist/_node_modules/property-information/lib/xlink.cjs +20 -0
  582. package/dist/_node_modules/property-information/lib/xlink.cjs.map +1 -0
  583. package/dist/_node_modules/property-information/lib/xlink.js +20 -0
  584. package/dist/_node_modules/property-information/lib/xlink.js.map +1 -0
  585. package/dist/_node_modules/property-information/lib/xml.cjs +12 -0
  586. package/dist/_node_modules/property-information/lib/xml.cjs.map +1 -0
  587. package/dist/_node_modules/property-information/lib/xml.js +12 -0
  588. package/dist/_node_modules/property-information/lib/xml.js.map +1 -0
  589. package/dist/_node_modules/property-information/lib/xmlns.cjs +12 -0
  590. package/dist/_node_modules/property-information/lib/xmlns.cjs.map +1 -0
  591. package/dist/_node_modules/property-information/lib/xmlns.js +12 -0
  592. package/dist/_node_modules/property-information/lib/xmlns.js.map +1 -0
  593. package/dist/_node_modules/rehype-minify-whitespace/lib/block.cjs +122 -0
  594. package/dist/_node_modules/rehype-minify-whitespace/lib/block.cjs.map +1 -0
  595. package/dist/_node_modules/rehype-minify-whitespace/lib/block.js +122 -0
  596. package/dist/_node_modules/rehype-minify-whitespace/lib/block.js.map +1 -0
  597. package/dist/_node_modules/rehype-minify-whitespace/lib/content.cjs +11 -0
  598. package/dist/_node_modules/rehype-minify-whitespace/lib/content.cjs.map +1 -0
  599. package/dist/_node_modules/rehype-minify-whitespace/lib/content.js +11 -0
  600. package/dist/_node_modules/rehype-minify-whitespace/lib/content.js.map +1 -0
  601. package/dist/_node_modules/rehype-minify-whitespace/lib/index.cjs +169 -0
  602. package/dist/_node_modules/rehype-minify-whitespace/lib/index.cjs.map +1 -0
  603. package/dist/_node_modules/rehype-minify-whitespace/lib/index.js +170 -0
  604. package/dist/_node_modules/rehype-minify-whitespace/lib/index.js.map +1 -0
  605. package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.cjs +24 -0
  606. package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.cjs.map +1 -0
  607. package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.js +24 -0
  608. package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.js.map +1 -0
  609. package/dist/_node_modules/rehype-parse/lib/index.cjs +21 -0
  610. package/dist/_node_modules/rehype-parse/lib/index.cjs.map +1 -0
  611. package/dist/_node_modules/rehype-parse/lib/index.js +22 -0
  612. package/dist/_node_modules/rehype-parse/lib/index.js.map +1 -0
  613. package/dist/_node_modules/remark-parse/lib/index.cjs +19 -0
  614. package/dist/_node_modules/remark-parse/lib/index.cjs.map +1 -0
  615. package/dist/_node_modules/remark-parse/lib/index.js +20 -0
  616. package/dist/_node_modules/remark-parse/lib/index.js.map +1 -0
  617. package/dist/_node_modules/remark-rehype/lib/index.cjs +21 -0
  618. package/dist/_node_modules/remark-rehype/lib/index.cjs.map +1 -0
  619. package/dist/_node_modules/remark-rehype/lib/index.js +22 -0
  620. package/dist/_node_modules/remark-rehype/lib/index.js.map +1 -0
  621. package/dist/_node_modules/space-separated-tokens/index.cjs +12 -0
  622. package/dist/_node_modules/space-separated-tokens/index.cjs.map +1 -0
  623. package/dist/_node_modules/space-separated-tokens/index.js +12 -0
  624. package/dist/_node_modules/space-separated-tokens/index.js.map +1 -0
  625. package/dist/_node_modules/stringify-entities/lib/constant/dangerous.cjs +14 -0
  626. package/dist/_node_modules/stringify-entities/lib/constant/dangerous.cjs.map +1 -0
  627. package/dist/_node_modules/stringify-entities/lib/constant/dangerous.js +14 -0
  628. package/dist/_node_modules/stringify-entities/lib/constant/dangerous.js.map +1 -0
  629. package/dist/_node_modules/stringify-entities/lib/core.cjs +52 -0
  630. package/dist/_node_modules/stringify-entities/lib/core.cjs.map +1 -0
  631. package/dist/_node_modules/stringify-entities/lib/core.js +52 -0
  632. package/dist/_node_modules/stringify-entities/lib/core.js.map +1 -0
  633. package/dist/_node_modules/stringify-entities/lib/index.cjs +9 -0
  634. package/dist/_node_modules/stringify-entities/lib/index.cjs.map +1 -0
  635. package/dist/_node_modules/stringify-entities/lib/index.js +9 -0
  636. package/dist/_node_modules/stringify-entities/lib/index.js.map +1 -0
  637. package/dist/_node_modules/stringify-entities/lib/util/format-smart.cjs +26 -0
  638. package/dist/_node_modules/stringify-entities/lib/util/format-smart.cjs.map +1 -0
  639. package/dist/_node_modules/stringify-entities/lib/util/format-smart.js +26 -0
  640. package/dist/_node_modules/stringify-entities/lib/util/format-smart.js.map +1 -0
  641. package/dist/_node_modules/stringify-entities/lib/util/to-decimal.cjs +9 -0
  642. package/dist/_node_modules/stringify-entities/lib/util/to-decimal.cjs.map +1 -0
  643. package/dist/_node_modules/stringify-entities/lib/util/to-decimal.js +9 -0
  644. package/dist/_node_modules/stringify-entities/lib/util/to-decimal.js.map +1 -0
  645. package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.cjs +9 -0
  646. package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.cjs.map +1 -0
  647. package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.js +9 -0
  648. package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.js.map +1 -0
  649. package/dist/_node_modules/stringify-entities/lib/util/to-named.cjs +28 -0
  650. package/dist/_node_modules/stringify-entities/lib/util/to-named.cjs.map +1 -0
  651. package/dist/_node_modules/stringify-entities/lib/util/to-named.js +28 -0
  652. package/dist/_node_modules/stringify-entities/lib/util/to-named.js.map +1 -0
  653. package/dist/_node_modules/trim-lines/index.cjs +42 -0
  654. package/dist/_node_modules/trim-lines/index.cjs.map +1 -0
  655. package/dist/_node_modules/trim-lines/index.js +42 -0
  656. package/dist/_node_modules/trim-lines/index.js.map +1 -0
  657. package/dist/_node_modules/trough/lib/index.cjs +87 -0
  658. package/dist/_node_modules/trough/lib/index.cjs.map +1 -0
  659. package/dist/_node_modules/trough/lib/index.js +87 -0
  660. package/dist/_node_modules/trough/lib/index.js.map +1 -0
  661. package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.cjs +10 -0
  662. package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.cjs.map +1 -0
  663. package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.js +11 -0
  664. package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.js.map +1 -0
  665. package/dist/_node_modules/unified/lib/callable-instance.cjs +31 -0
  666. package/dist/_node_modules/unified/lib/callable-instance.cjs.map +1 -0
  667. package/dist/_node_modules/unified/lib/callable-instance.js +31 -0
  668. package/dist/_node_modules/unified/lib/callable-instance.js.map +1 -0
  669. package/dist/_node_modules/unified/lib/index.cjs +637 -0
  670. package/dist/_node_modules/unified/lib/index.cjs.map +1 -0
  671. package/dist/_node_modules/unified/lib/index.js +637 -0
  672. package/dist/_node_modules/unified/lib/index.js.map +1 -0
  673. package/dist/_node_modules/unist-util-is/lib/index.cjs +94 -0
  674. package/dist/_node_modules/unist-util-is/lib/index.cjs.map +1 -0
  675. package/dist/_node_modules/unist-util-is/lib/index.js +94 -0
  676. package/dist/_node_modules/unist-util-is/lib/index.js.map +1 -0
  677. package/dist/_node_modules/unist-util-position/lib/index.cjs +28 -0
  678. package/dist/_node_modules/unist-util-position/lib/index.cjs.map +1 -0
  679. package/dist/_node_modules/unist-util-position/lib/index.js +28 -0
  680. package/dist/_node_modules/unist-util-position/lib/index.js.map +1 -0
  681. package/dist/_node_modules/unist-util-remove/lib/index.cjs +39 -0
  682. package/dist/_node_modules/unist-util-remove/lib/index.cjs.map +1 -0
  683. package/dist/_node_modules/unist-util-remove/lib/index.js +39 -0
  684. package/dist/_node_modules/unist-util-remove/lib/index.js.map +1 -0
  685. package/dist/_node_modules/unist-util-stringify-position/lib/index.cjs +28 -0
  686. package/dist/_node_modules/unist-util-stringify-position/lib/index.cjs.map +1 -0
  687. package/dist/_node_modules/unist-util-stringify-position/lib/index.js +28 -0
  688. package/dist/_node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
  689. package/dist/_node_modules/unist-util-visit/lib/index.cjs +28 -0
  690. package/dist/_node_modules/unist-util-visit/lib/index.cjs.map +1 -0
  691. package/dist/_node_modules/unist-util-visit/lib/index.js +29 -0
  692. package/dist/_node_modules/unist-util-visit/lib/index.js.map +1 -0
  693. package/dist/_node_modules/unist-util-visit-parents/lib/color.cjs +7 -0
  694. package/dist/_node_modules/unist-util-visit-parents/lib/color.cjs.map +1 -0
  695. package/dist/_node_modules/unist-util-visit-parents/lib/color.js +7 -0
  696. package/dist/_node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
  697. package/dist/_node_modules/unist-util-visit-parents/lib/index.cjs +84 -0
  698. package/dist/_node_modules/unist-util-visit-parents/lib/index.cjs.map +1 -0
  699. package/dist/_node_modules/unist-util-visit-parents/lib/index.js +84 -0
  700. package/dist/_node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
  701. package/dist/_node_modules/vfile/lib/index.cjs +463 -0
  702. package/dist/_node_modules/vfile/lib/index.cjs.map +1 -0
  703. package/dist/_node_modules/vfile/lib/index.js +463 -0
  704. package/dist/_node_modules/vfile/lib/index.js.map +1 -0
  705. package/dist/_node_modules/vfile/lib/minpath.browser.cjs +215 -0
  706. package/dist/_node_modules/vfile/lib/minpath.browser.cjs.map +1 -0
  707. package/dist/_node_modules/vfile/lib/minpath.browser.js +215 -0
  708. package/dist/_node_modules/vfile/lib/minpath.browser.js.map +1 -0
  709. package/dist/_node_modules/vfile/lib/minproc.browser.cjs +8 -0
  710. package/dist/_node_modules/vfile/lib/minproc.browser.cjs.map +1 -0
  711. package/dist/_node_modules/vfile/lib/minproc.browser.js +8 -0
  712. package/dist/_node_modules/vfile/lib/minproc.browser.js.map +1 -0
  713. package/dist/_node_modules/vfile/lib/minurl.browser.cjs +47 -0
  714. package/dist/_node_modules/vfile/lib/minurl.browser.cjs.map +1 -0
  715. package/dist/_node_modules/vfile/lib/minurl.browser.js +47 -0
  716. package/dist/_node_modules/vfile/lib/minurl.browser.js.map +1 -0
  717. package/dist/_node_modules/vfile/lib/minurl.shared.cjs +10 -0
  718. package/dist/_node_modules/vfile/lib/minurl.shared.cjs.map +1 -0
  719. package/dist/_node_modules/vfile/lib/minurl.shared.js +10 -0
  720. package/dist/_node_modules/vfile/lib/minurl.shared.js.map +1 -0
  721. package/dist/_node_modules/vfile-location/lib/index.cjs +50 -0
  722. package/dist/_node_modules/vfile-location/lib/index.cjs.map +1 -0
  723. package/dist/_node_modules/vfile-location/lib/index.js +50 -0
  724. package/dist/_node_modules/vfile-location/lib/index.js.map +1 -0
  725. package/dist/_node_modules/vfile-message/lib/index.cjs +139 -0
  726. package/dist/_node_modules/vfile-message/lib/index.cjs.map +1 -0
  727. package/dist/_node_modules/vfile-message/lib/index.js +139 -0
  728. package/dist/_node_modules/vfile-message/lib/index.js.map +1 -0
  729. package/dist/_node_modules/web-namespaces/index.cjs +12 -0
  730. package/dist/_node_modules/web-namespaces/index.cjs.map +1 -0
  731. package/dist/_node_modules/web-namespaces/index.js +12 -0
  732. package/dist/_node_modules/web-namespaces/index.js.map +1 -0
  733. package/dist/_node_modules/zwitch/index.cjs +23 -0
  734. package/dist/_node_modules/zwitch/index.cjs.map +1 -0
  735. package/dist/_node_modules/zwitch/index.js +23 -0
  736. package/dist/_node_modules/zwitch/index.js.map +1 -0
  737. package/dist/_virtual/_commonjsHelpers.cjs +7 -0
  738. package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
  739. package/dist/_virtual/_commonjsHelpers.js +7 -0
  740. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  741. package/dist/_virtual/index.cjs +9 -0
  742. package/dist/_virtual/index.cjs.map +1 -0
  743. package/dist/_virtual/index.js +9 -0
  744. package/dist/_virtual/index.js.map +1 -0
  745. package/dist/helpers/unstable_htmlAsRichText.cjs +3 -3
  746. package/dist/helpers/unstable_htmlAsRichText.cjs.map +1 -1
  747. package/dist/helpers/unstable_htmlAsRichText.js +2 -2
  748. package/dist/helpers/unstable_markdownAsRichText.cjs +4 -4
  749. package/dist/helpers/unstable_markdownAsRichText.cjs.map +1 -1
  750. package/dist/helpers/unstable_markdownAsRichText.js +3 -3
  751. package/dist/lib/hastSerializerHelpers.cjs +2 -2
  752. package/dist/lib/hastSerializerHelpers.cjs.map +1 -1
  753. package/dist/lib/hastSerializerHelpers.js +1 -1
  754. package/dist/lib/hastToRichText.cjs +5 -5
  755. package/dist/lib/hastToRichText.cjs.map +1 -1
  756. package/dist/lib/hastToRichText.js +2 -2
  757. package/dist/lib/hastToRichText.js.map +1 -1
  758. package/dist/lib/rehypeRichText.cjs +13 -12
  759. package/dist/lib/rehypeRichText.cjs.map +1 -1
  760. package/dist/lib/rehypeRichText.js +5 -4
  761. package/dist/lib/rehypeRichText.js.map +1 -1
  762. package/dist/package.json.cjs +1 -1
  763. package/dist/package.json.js +1 -1
  764. package/package.json +15 -13
  765. package/src/lib/hastToRichText.ts +1 -1
@@ -0,0 +1,231 @@
1
+ import { extendedFilter } from "../../bcp-47-match/index.js";
2
+ import { parse } from "../../comma-separated-tokens/index.js";
3
+ import { ok } from "../../devlop/lib/default.js";
4
+ import nthCheck$1 from "../../nth-check/lib/esm/index.js";
5
+ import { zwitch } from "../../zwitch/index.js";
6
+ import { walk } from "./walk.js";
7
+ import { hasProperty } from "../../hast-util-has-property/lib/index.js";
8
+ import { whitespace } from "../../hast-util-whitespace/lib/index.js";
9
+ const nthCheck = nthCheck$1.default || nthCheck$1;
10
+ const pseudo = zwitch("name", {
11
+ handlers: {
12
+ "any-link": anyLink,
13
+ blank,
14
+ checked,
15
+ dir,
16
+ disabled,
17
+ empty,
18
+ enabled,
19
+ "first-child": firstChild,
20
+ "first-of-type": firstOfType,
21
+ has,
22
+ is,
23
+ lang,
24
+ "last-child": lastChild,
25
+ "last-of-type": lastOfType,
26
+ not,
27
+ "nth-child": nthChild,
28
+ "nth-last-child": nthLastChild,
29
+ "nth-last-of-type": nthLastOfType,
30
+ "nth-of-type": nthOfType,
31
+ "only-child": onlyChild,
32
+ "only-of-type": onlyOfType,
33
+ optional,
34
+ "read-only": readOnly,
35
+ "read-write": readWrite,
36
+ required,
37
+ root,
38
+ scope
39
+ },
40
+ invalid: invalidPseudo,
41
+ unknown: unknownPseudo
42
+ });
43
+ function anyLink(_, element) {
44
+ return (element.tagName === "a" || element.tagName === "area" || element.tagName === "link") && hasProperty(element, "href");
45
+ }
46
+ function assertDeep(state, query) {
47
+ if (state.shallow) {
48
+ throw new Error("Cannot use `:" + query.name + "` without parent");
49
+ }
50
+ }
51
+ function blank(_, element) {
52
+ return !someChildren(element, check);
53
+ function check(child) {
54
+ return child.type === "element" || child.type === "text" && !whitespace(child);
55
+ }
56
+ }
57
+ function checked(_, element) {
58
+ if (element.tagName === "input" || element.tagName === "menuitem") {
59
+ return Boolean(
60
+ (element.properties.type === "checkbox" || element.properties.type === "radio") && hasProperty(element, "checked")
61
+ );
62
+ }
63
+ if (element.tagName === "option") {
64
+ return hasProperty(element, "selected");
65
+ }
66
+ return false;
67
+ }
68
+ function dir(query, _1, _2, _3, state) {
69
+ ok(query.argument);
70
+ ok(query.argument.type === "String");
71
+ return state.direction === query.argument.value;
72
+ }
73
+ function disabled(_, element) {
74
+ return (element.tagName === "button" || element.tagName === "input" || element.tagName === "select" || element.tagName === "textarea" || element.tagName === "optgroup" || element.tagName === "option" || element.tagName === "menuitem" || element.tagName === "fieldset") && hasProperty(element, "disabled");
75
+ }
76
+ function empty(_, element) {
77
+ return !someChildren(element, check);
78
+ function check(child) {
79
+ return child.type === "element" || child.type === "text";
80
+ }
81
+ }
82
+ function enabled(query, element) {
83
+ return !disabled(query, element);
84
+ }
85
+ function firstChild(query, _1, _2, _3, state) {
86
+ assertDeep(state, query);
87
+ return state.elementIndex === 0;
88
+ }
89
+ function firstOfType(query, _1, _2, _3, state) {
90
+ assertDeep(state, query);
91
+ return state.typeIndex === 0;
92
+ }
93
+ function getCachedNthCheck(query) {
94
+ let fn = query._cachedFn;
95
+ if (!fn) {
96
+ const value = query.argument;
97
+ if (value.type !== "Formula") {
98
+ throw new Error(
99
+ "Expected `nth` formula, such as `even` or `2n+1` (`of` is not yet supported)"
100
+ );
101
+ }
102
+ fn = nthCheck(value.a + "n+" + value.b);
103
+ query._cachedFn = fn;
104
+ }
105
+ return fn;
106
+ }
107
+ function has(query, element, _1, _2, state) {
108
+ ok(query.argument);
109
+ ok(query.argument.type === "Selector");
110
+ const childState = {
111
+ ...state,
112
+ // Not found yet.
113
+ found: false,
114
+ // One result is enough.
115
+ one: true,
116
+ results: [],
117
+ rootQuery: query.argument,
118
+ scopeElements: [element],
119
+ // Do walk deep.
120
+ shallow: false
121
+ };
122
+ walk(childState, { type: "root", children: element.children });
123
+ return childState.results.length > 0;
124
+ }
125
+ function invalidPseudo() {
126
+ }
127
+ function is(query, element, _1, _2, state) {
128
+ ok(query.argument);
129
+ ok(query.argument.type === "Selector");
130
+ const childState = {
131
+ ...state,
132
+ // Not found yet.
133
+ found: false,
134
+ // One result is enough.
135
+ one: true,
136
+ results: [],
137
+ rootQuery: query.argument,
138
+ scopeElements: [element],
139
+ // Do walk deep.
140
+ shallow: false
141
+ };
142
+ walk(childState, element);
143
+ return childState.results[0] === element;
144
+ }
145
+ function lang(query, _1, _2, _3, state) {
146
+ ok(query.argument);
147
+ ok(query.argument.type === "String");
148
+ return state.language !== "" && state.language !== void 0 && extendedFilter(state.language, parse(query.argument.value)).length > 0;
149
+ }
150
+ function lastChild(query, _1, _2, _3, state) {
151
+ assertDeep(state, query);
152
+ return Boolean(
153
+ state.elementCount && state.elementIndex === state.elementCount - 1
154
+ );
155
+ }
156
+ function lastOfType(query, _1, _2, _3, state) {
157
+ assertDeep(state, query);
158
+ return typeof state.typeIndex === "number" && typeof state.typeCount === "number" && state.typeIndex === state.typeCount - 1;
159
+ }
160
+ function not(query, element, index, parent, state) {
161
+ return !is(query, element, index, parent, state);
162
+ }
163
+ function nthChild(query, _1, _2, _3, state) {
164
+ const fn = getCachedNthCheck(query);
165
+ assertDeep(state, query);
166
+ return typeof state.elementIndex === "number" && fn(state.elementIndex);
167
+ }
168
+ function nthLastChild(query, _1, _2, _3, state) {
169
+ const fn = getCachedNthCheck(query);
170
+ assertDeep(state, query);
171
+ return Boolean(
172
+ typeof state.elementCount === "number" && typeof state.elementIndex === "number" && fn(state.elementCount - state.elementIndex - 1)
173
+ );
174
+ }
175
+ function nthLastOfType(query, _1, _2, _3, state) {
176
+ const fn = getCachedNthCheck(query);
177
+ assertDeep(state, query);
178
+ return typeof state.typeCount === "number" && typeof state.typeIndex === "number" && fn(state.typeCount - 1 - state.typeIndex);
179
+ }
180
+ function nthOfType(query, _1, _2, _3, state) {
181
+ const fn = getCachedNthCheck(query);
182
+ assertDeep(state, query);
183
+ return typeof state.typeIndex === "number" && fn(state.typeIndex);
184
+ }
185
+ function onlyChild(query, _1, _2, _3, state) {
186
+ assertDeep(state, query);
187
+ return state.elementCount === 1;
188
+ }
189
+ function onlyOfType(query, _1, _2, _3, state) {
190
+ assertDeep(state, query);
191
+ return state.typeCount === 1;
192
+ }
193
+ function optional(query, element) {
194
+ return !required(query, element);
195
+ }
196
+ function readOnly(query, element, index, parent, state) {
197
+ return !readWrite(query, element, index, parent, state);
198
+ }
199
+ function readWrite(_, element, _1, _2, state) {
200
+ return element.tagName === "input" || element.tagName === "textarea" ? !hasProperty(element, "readOnly") && !hasProperty(element, "disabled") : Boolean(state.editableOrEditingHost);
201
+ }
202
+ function required(_, element) {
203
+ return (element.tagName === "input" || element.tagName === "textarea" || element.tagName === "select") && hasProperty(element, "required");
204
+ }
205
+ function root(_1, element, _2, parent, state) {
206
+ return Boolean(
207
+ (!parent || parent.type === "root") && state.schema && (state.schema.space === "html" || state.schema.space === "svg") && (element.tagName === "html" || element.tagName === "svg")
208
+ );
209
+ }
210
+ function scope(_1, element, _2, _3, state) {
211
+ return state.scopeElements.includes(element);
212
+ }
213
+ function someChildren(element, check) {
214
+ const children = element.children;
215
+ let index = -1;
216
+ while (++index < children.length) {
217
+ if (check(children[index])) return true;
218
+ }
219
+ return false;
220
+ }
221
+ function unknownPseudo(query_) {
222
+ const query = (
223
+ /** @type {AstPseudoClass} */
224
+ query_
225
+ );
226
+ throw new Error("Unknown pseudo-selector `" + query.name + "`");
227
+ }
228
+ export {
229
+ pseudo
230
+ };
231
+ //# sourceMappingURL=pseudo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pseudo.js","sources":["../../../../node_modules/hast-util-select/lib/pseudo.js"],"sourcesContent":["/**\n * @typedef {import('css-selector-parser').AstPseudoClass} AstPseudoClass\n *\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Parents} Parents\n *\n * @typedef {import('./index.js').State} State\n */\n\nimport {extendedFilter} from 'bcp-47-match'\nimport {parse as commas} from 'comma-separated-tokens'\nimport {ok as assert, unreachable} from 'devlop'\nimport {hasProperty} from 'hast-util-has-property'\nimport {whitespace} from 'hast-util-whitespace'\nimport fauxEsmNthCheck from 'nth-check'\nimport {zwitch} from 'zwitch'\nimport {walk} from './walk.js'\n\n/** @type {import('nth-check').default} */\n// @ts-expect-error: types are broken.\nconst nthCheck = fauxEsmNthCheck.default || fauxEsmNthCheck\n\n/** @type {(rule: AstPseudoClass, element: Element, index: number | undefined, parent: Parents | undefined, state: State) => boolean} */\nexport const pseudo = zwitch('name', {\n handlers: {\n 'any-link': anyLink,\n blank,\n checked,\n dir,\n disabled,\n empty,\n enabled,\n 'first-child': firstChild,\n 'first-of-type': firstOfType,\n has,\n is,\n lang,\n 'last-child': lastChild,\n 'last-of-type': lastOfType,\n not,\n 'nth-child': nthChild,\n 'nth-last-child': nthLastChild,\n 'nth-last-of-type': nthLastOfType,\n 'nth-of-type': nthOfType,\n 'only-child': onlyChild,\n 'only-of-type': onlyOfType,\n optional,\n 'read-only': readOnly,\n 'read-write': readWrite,\n required,\n root,\n scope\n },\n invalid: invalidPseudo,\n unknown: unknownPseudo\n})\n\n/**\n * Check whether an element matches an `:any-link` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction anyLink(_, element) {\n return (\n (element.tagName === 'a' ||\n element.tagName === 'area' ||\n element.tagName === 'link') &&\n hasProperty(element, 'href')\n )\n}\n\n/**\n * @param {State} state\n * State.\n * @param {AstPseudoClass} query\n * Query.\n */\nfunction assertDeep(state, query) {\n if (state.shallow) {\n throw new Error('Cannot use `:' + query.name + '` without parent')\n }\n}\n\n/**\n * Check whether an element matches a `:blank` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction blank(_, element) {\n return !someChildren(element, check)\n\n /**\n * @param {ElementContent} child\n * @returns {boolean}\n */\n function check(child) {\n return (\n child.type === 'element' || (child.type === 'text' && !whitespace(child))\n )\n }\n}\n\n/**\n * Check whether an element matches a `:checked` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction checked(_, element) {\n if (element.tagName === 'input' || element.tagName === 'menuitem') {\n return Boolean(\n (element.properties.type === 'checkbox' ||\n element.properties.type === 'radio') &&\n hasProperty(element, 'checked')\n )\n }\n\n if (element.tagName === 'option') {\n return hasProperty(element, 'selected')\n }\n\n return false\n}\n\n/**\n * Check whether an element matches a `:dir()` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction dir(query, _1, _2, _3, state) {\n assert(query.argument, 'expected `argument`')\n assert(query.argument.type === 'String', 'expected plain text')\n return state.direction === query.argument.value\n}\n\n/**\n * Check whether an element matches a `:disabled` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction disabled(_, element) {\n return (\n (element.tagName === 'button' ||\n element.tagName === 'input' ||\n element.tagName === 'select' ||\n element.tagName === 'textarea' ||\n element.tagName === 'optgroup' ||\n element.tagName === 'option' ||\n element.tagName === 'menuitem' ||\n element.tagName === 'fieldset') &&\n hasProperty(element, 'disabled')\n )\n}\n\n/**\n * Check whether an element matches an `:empty` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction empty(_, element) {\n return !someChildren(element, check)\n\n /**\n * @param {ElementContent} child\n * @returns {boolean}\n */\n function check(child) {\n return child.type === 'element' || child.type === 'text'\n }\n}\n\n/**\n * Check whether an element matches an `:enabled` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction enabled(query, element) {\n return !disabled(query, element)\n}\n\n/**\n * Check whether an element matches a `:first-child` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction firstChild(query, _1, _2, _3, state) {\n assertDeep(state, query)\n return state.elementIndex === 0\n}\n\n/**\n * Check whether an element matches a `:first-of-type` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction firstOfType(query, _1, _2, _3, state) {\n assertDeep(state, query)\n return state.typeIndex === 0\n}\n\n/**\n * @param {AstPseudoClass} query\n * Query.\n * @returns {(value: number) => boolean}\n * N.\n */\nfunction getCachedNthCheck(query) {\n /** @type {(value: number) => boolean} */\n // @ts-expect-error: cache.\n let fn = query._cachedFn\n\n if (!fn) {\n const value = query.argument\n assert(value, 'expected `argument`')\n\n if (value.type !== 'Formula') {\n throw new Error(\n 'Expected `nth` formula, such as `even` or `2n+1` (`of` is not yet supported)'\n )\n }\n\n fn = nthCheck(value.a + 'n+' + value.b)\n // @ts-expect-error: cache.\n query._cachedFn = fn\n }\n\n return fn\n}\n\n/**\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} _1\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _2\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction has(query, element, _1, _2, state) {\n assert(query.argument, 'expected `argument`')\n assert(query.argument.type === 'Selector', 'expected selector')\n\n /** @type {State} */\n const childState = {\n ...state,\n // Not found yet.\n found: false,\n // One result is enough.\n one: true,\n results: [],\n rootQuery: query.argument,\n scopeElements: [element],\n // Do walk deep.\n shallow: false\n }\n\n walk(childState, {type: 'root', children: element.children})\n\n return childState.results.length > 0\n}\n\n// Shouldn’t be called, parser gives correct data.\n/* c8 ignore next 3 */\nfunction invalidPseudo() {\n unreachable('Invalid pseudo-selector')\n}\n\n/**\n * Check whether an element `:is` further selectors.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} _1\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _2\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction is(query, element, _1, _2, state) {\n assert(query.argument, 'expected `argument`')\n assert(query.argument.type === 'Selector', 'expected selector')\n\n /** @type {State} */\n const childState = {\n ...state,\n // Not found yet.\n found: false,\n // One result is enough.\n one: true,\n results: [],\n rootQuery: query.argument,\n scopeElements: [element],\n // Do walk deep.\n shallow: false\n }\n\n walk(childState, element)\n\n return childState.results[0] === element\n}\n\n/**\n * Check whether an element matches a `:lang()` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction lang(query, _1, _2, _3, state) {\n assert(query.argument, 'expected `argument`')\n assert(query.argument.type === 'String', 'expected string')\n\n return (\n state.language !== '' &&\n state.language !== undefined &&\n extendedFilter(state.language, commas(query.argument.value)).length > 0\n )\n}\n\n/**\n * Check whether an element matches a `:last-child` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction lastChild(query, _1, _2, _3, state) {\n assertDeep(state, query)\n return Boolean(\n state.elementCount && state.elementIndex === state.elementCount - 1\n )\n}\n\n/**\n * Check whether an element matches a `:last-of-type` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction lastOfType(query, _1, _2, _3, state) {\n assertDeep(state, query)\n return (\n typeof state.typeIndex === 'number' &&\n typeof state.typeCount === 'number' &&\n state.typeIndex === state.typeCount - 1\n )\n}\n\n/**\n * Check whether an element does `:not` match further selectors.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} index\n * Index of `element` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction not(query, element, index, parent, state) {\n return !is(query, element, index, parent, state)\n}\n\n/**\n * Check whether an element matches an `:nth-child` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction nthChild(query, _1, _2, _3, state) {\n const fn = getCachedNthCheck(query)\n assertDeep(state, query)\n return typeof state.elementIndex === 'number' && fn(state.elementIndex)\n}\n\n/**\n * Check whether an element matches an `:nth-last-child` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction nthLastChild(query, _1, _2, _3, state) {\n const fn = getCachedNthCheck(query)\n assertDeep(state, query)\n return Boolean(\n typeof state.elementCount === 'number' &&\n typeof state.elementIndex === 'number' &&\n fn(state.elementCount - state.elementIndex - 1)\n )\n}\n\n/**\n * Check whether an element matches a `:nth-last-of-type` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction nthLastOfType(query, _1, _2, _3, state) {\n const fn = getCachedNthCheck(query)\n assertDeep(state, query)\n return (\n typeof state.typeCount === 'number' &&\n typeof state.typeIndex === 'number' &&\n fn(state.typeCount - 1 - state.typeIndex)\n )\n}\n\n/**\n * Check whether an element matches an `:nth-of-type` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction nthOfType(query, _1, _2, _3, state) {\n const fn = getCachedNthCheck(query)\n assertDeep(state, query)\n return typeof state.typeIndex === 'number' && fn(state.typeIndex)\n}\n\n/**\n * Check whether an element matches an `:only-child` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction onlyChild(query, _1, _2, _3, state) {\n assertDeep(state, query)\n return state.elementCount === 1\n}\n\n/**\n * Check whether an element matches an `:only-of-type` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} _1\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction onlyOfType(query, _1, _2, _3, state) {\n assertDeep(state, query)\n return state.typeCount === 1\n}\n\n/**\n * Check whether an element matches an `:optional` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction optional(query, element) {\n return !required(query, element)\n}\n\n/**\n * Check whether an element matches a `:read-only` pseudo.\n *\n * @param {AstPseudoClass} query\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} index\n * Index of `element` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction readOnly(query, element, index, parent, state) {\n return !readWrite(query, element, index, parent, state)\n}\n\n/**\n * Check whether an element matches a `:read-write` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} _1\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _2\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction readWrite(_, element, _1, _2, state) {\n return element.tagName === 'input' || element.tagName === 'textarea'\n ? !hasProperty(element, 'readOnly') && !hasProperty(element, 'disabled')\n : Boolean(state.editableOrEditingHost)\n}\n\n/**\n * Check whether an element matches a `:required` pseudo.\n *\n * @param {AstPseudoClass} _\n * Query.\n * @param {Element} element\n * Element.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction required(_, element) {\n return (\n (element.tagName === 'input' ||\n element.tagName === 'textarea' ||\n element.tagName === 'select') &&\n hasProperty(element, 'required')\n )\n}\n\n/**\n * Check whether an element matches a `:root` pseudo.\n *\n * @param {AstPseudoClass} _1\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction root(_1, element, _2, parent, state) {\n return Boolean(\n (!parent || parent.type === 'root') &&\n state.schema &&\n (state.schema.space === 'html' || state.schema.space === 'svg') &&\n (element.tagName === 'html' || element.tagName === 'svg')\n )\n}\n\n/**\n * Check whether an element matches a `:scope` pseudo.\n *\n * @param {AstPseudoClass} _1\n * Query.\n * @param {Element} element\n * Element.\n * @param {number | undefined} _2\n * Index of `element` in `parent`.\n * @param {Parents | undefined} _3\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nfunction scope(_1, element, _2, _3, state) {\n return state.scopeElements.includes(element)\n}\n\n/**\n * Check children.\n *\n * @param {Element} element\n * Element.\n * @param {(child: ElementContent) => boolean} check\n * Check.\n * @returns {boolean}\n * Whether a child of `element` matches `check`.\n */\nfunction someChildren(element, check) {\n const children = element.children\n let index = -1\n\n while (++index < children.length) {\n if (check(children[index])) return true\n }\n\n return false\n}\n\n/**\n * @param {unknown} query_\n * Query-like value.\n * @returns {never}\n * Nothing.\n * @throws\n * Exception.\n */\nfunction unknownPseudo(query_) {\n // Runtime JS guarantees it has a `name`.\n const query = /** @type {AstPseudoClass} */ (query_)\n throw new Error('Unknown pseudo-selector `' + query.name + '`')\n}\n"],"names":["fauxEsmNthCheck","assert","commas"],"mappings":";;;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AO,SAAS,OAAO,QAAQ,OAAO;AACtD,SAAO,CAAC,UAAU,OAAO,SAAS,OAAO,QAAQ,KAAK;AACxD;AAkBA,SAAS,UAAU,GAAG,SAAS,IAAI,IAAI,OAAO;AAC5C,SAAO,QAAQ,YAAY,WAAW,QAAQ,YAAY,aACtD,CAAC,YAAY,SAAS,UAAU,KAAK,CAAC,YAAY,SAAS,UAAU,IACrE,QAAQ,MAAM,qBAAqB;AACzC;AAYA,SAAS,SAAS,GAAG,SAAS;AAC5B,UACG,QAAQ,YAAY,WACnB,QAAQ,YAAY,cACpB,QAAQ,YAAY,aACtB,YAAY,SAAS,UAAU;AAEnC;AAkBA,SAAS,KAAK,IAAI,SAAS,IAAI,QAAQ,OAAO;AAC5C,SAAO;AAAA,KACJ,CAAC,UAAU,OAAO,SAAS,WAC1B,MAAM,WACL,MAAM,OAAO,UAAU,UAAU,MAAM,OAAO,UAAU,WACxD,QAAQ,YAAY,UAAU,QAAQ,YAAY;AAAA,EACtD;AACH;AAkBA,SAAS,MAAM,IAAI,SAAS,IAAI,IAAI,OAAO;AACzC,SAAO,MAAM,cAAc,SAAS,OAAO;AAC7C;AAYA,SAAS,aAAa,SAAS,OAAO;AACpC,QAAM,WAAW,QAAQ;AACzB,MAAI,QAAQ;AAEZ,SAAO,EAAE,QAAQ,SAAS,QAAQ;AAChC,QAAI,MAAM,SAAS,KAAK,CAAC,EAAG,QAAO;AAAA,EACpC;AAED,SAAO;AACT;AAUA,SAAS,cAAc,QAAQ;AAE7B,QAAM;AAAA;AAAA,IAAuC;AAAA;AAC7C,QAAM,IAAI,MAAM,8BAA8B,MAAM,OAAO,GAAG;AAChE;","x_google_ignoreList":[0]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const attribute = require("./attribute.cjs");
4
+ const className = require("./class-name.cjs");
5
+ const id = require("./id.cjs");
6
+ const name = require("./name.cjs");
7
+ const pseudo = require("./pseudo.cjs");
8
+ function test(query, element, index, parent, state) {
9
+ for (const item of query.items) {
10
+ if (item.type === "Attribute") {
11
+ if (!attribute.attribute(item, element, state.schema)) return false;
12
+ } else if (item.type === "Id") {
13
+ if (!id.id(item, element)) return false;
14
+ } else if (item.type === "ClassName") {
15
+ if (!className.className(item, element)) return false;
16
+ } else if (item.type === "PseudoClass") {
17
+ if (!pseudo.pseudo(item, element, index, parent, state)) return false;
18
+ } else if (item.type === "PseudoElement") {
19
+ throw new Error("Invalid selector: `::" + item.name + "`");
20
+ } else if (item.type === "TagName") {
21
+ if (!name.name(item, element)) return false;
22
+ } else ;
23
+ }
24
+ return true;
25
+ }
26
+ exports.test = test;
27
+ //# sourceMappingURL=test.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.cjs","sources":["../../../../node_modules/hast-util-select/lib/test.js"],"sourcesContent":["/**\n * @typedef {import('css-selector-parser').AstRule} AstRule\n *\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Parents} Parents\n *\n * @typedef {import('./index.js').State} State\n */\n\nimport {attribute} from './attribute.js'\nimport {className} from './class-name.js'\nimport {id} from './id.js'\nimport {name} from './name.js'\nimport {pseudo} from './pseudo.js'\n\n/**\n * Test a rule.\n *\n * @param {AstRule} query\n * AST rule (with `pseudoClasses`).\n * @param {Element} element\n * Element.\n * @param {number | undefined} index\n * Index of `element` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nexport function test(query, element, index, parent, state) {\n for (const item of query.items) {\n // eslint-disable-next-line unicorn/prefer-switch\n if (item.type === 'Attribute') {\n if (!attribute(item, element, state.schema)) return false\n } else if (item.type === 'Id') {\n if (!id(item, element)) return false\n } else if (item.type === 'ClassName') {\n if (!className(item, element)) return false\n } else if (item.type === 'PseudoClass') {\n if (!pseudo(item, element, index, parent, state)) return false\n } else if (item.type === 'PseudoElement') {\n throw new Error('Invalid selector: `::' + item.name + '`')\n } else if (item.type === 'TagName') {\n if (!name(item, element)) return false\n } else {\n // Otherwise `item.type` is `WildcardTag`, which matches.\n }\n }\n\n return true\n}\n"],"names":["attribute","id","className","pseudo","name"],"mappings":";;;;;;;AA+BO,SAAS,KAAK,OAAO,SAAS,OAAO,QAAQ,OAAO;AACzD,aAAW,QAAQ,MAAM,OAAO;AAE9B,QAAI,KAAK,SAAS,aAAa;AAC7B,UAAI,CAACA,UAAS,UAAC,MAAM,SAAS,MAAM,MAAM,EAAG,QAAO;AAAA,IAC1D,WAAe,KAAK,SAAS,MAAM;AAC7B,UAAI,CAACC,GAAAA,GAAG,MAAM,OAAO,EAAG,QAAO;AAAA,IACrC,WAAe,KAAK,SAAS,aAAa;AACpC,UAAI,CAACC,UAAAA,UAAU,MAAM,OAAO,EAAG,QAAO;AAAA,IAC5C,WAAe,KAAK,SAAS,eAAe;AACtC,UAAI,CAACC,OAAAA,OAAO,MAAM,SAAS,OAAO,QAAQ,KAAK,EAAG,QAAO;AAAA,IAC/D,WAAe,KAAK,SAAS,iBAAiB;AACxC,YAAM,IAAI,MAAM,0BAA0B,KAAK,OAAO,GAAG;AAAA,IAC/D,WAAe,KAAK,SAAS,WAAW;AAClC,UAAI,CAACC,KAAAA,KAAK,MAAM,OAAO,EAAG,QAAO;AAAA,IACvC,MAAW;AAAA,EAGR;AAED,SAAO;AACT;;","x_google_ignoreList":[0]}
@@ -0,0 +1,27 @@
1
+ import { attribute } from "./attribute.js";
2
+ import { className } from "./class-name.js";
3
+ import { id } from "./id.js";
4
+ import { name } from "./name.js";
5
+ import { pseudo } from "./pseudo.js";
6
+ function test(query, element, index, parent, state) {
7
+ for (const item of query.items) {
8
+ if (item.type === "Attribute") {
9
+ if (!attribute(item, element, state.schema)) return false;
10
+ } else if (item.type === "Id") {
11
+ if (!id(item, element)) return false;
12
+ } else if (item.type === "ClassName") {
13
+ if (!className(item, element)) return false;
14
+ } else if (item.type === "PseudoClass") {
15
+ if (!pseudo(item, element, index, parent, state)) return false;
16
+ } else if (item.type === "PseudoElement") {
17
+ throw new Error("Invalid selector: `::" + item.name + "`");
18
+ } else if (item.type === "TagName") {
19
+ if (!name(item, element)) return false;
20
+ } else ;
21
+ }
22
+ return true;
23
+ }
24
+ export {
25
+ test
26
+ };
27
+ //# sourceMappingURL=test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.js","sources":["../../../../node_modules/hast-util-select/lib/test.js"],"sourcesContent":["/**\n * @typedef {import('css-selector-parser').AstRule} AstRule\n *\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Parents} Parents\n *\n * @typedef {import('./index.js').State} State\n */\n\nimport {attribute} from './attribute.js'\nimport {className} from './class-name.js'\nimport {id} from './id.js'\nimport {name} from './name.js'\nimport {pseudo} from './pseudo.js'\n\n/**\n * Test a rule.\n *\n * @param {AstRule} query\n * AST rule (with `pseudoClasses`).\n * @param {Element} element\n * Element.\n * @param {number | undefined} index\n * Index of `element` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `element`.\n * @param {State} state\n * State.\n * @returns {boolean}\n * Whether `element` matches `query`.\n */\nexport function test(query, element, index, parent, state) {\n for (const item of query.items) {\n // eslint-disable-next-line unicorn/prefer-switch\n if (item.type === 'Attribute') {\n if (!attribute(item, element, state.schema)) return false\n } else if (item.type === 'Id') {\n if (!id(item, element)) return false\n } else if (item.type === 'ClassName') {\n if (!className(item, element)) return false\n } else if (item.type === 'PseudoClass') {\n if (!pseudo(item, element, index, parent, state)) return false\n } else if (item.type === 'PseudoElement') {\n throw new Error('Invalid selector: `::' + item.name + '`')\n } else if (item.type === 'TagName') {\n if (!name(item, element)) return false\n } else {\n // Otherwise `item.type` is `WildcardTag`, which matches.\n }\n }\n\n return true\n}\n"],"names":[],"mappings":";;;;;AA+BO,SAAS,KAAK,OAAO,SAAS,OAAO,QAAQ,OAAO;AACzD,aAAW,QAAQ,MAAM,OAAO;AAE9B,QAAI,KAAK,SAAS,aAAa;AAC7B,UAAI,CAAC,UAAU,MAAM,SAAS,MAAM,MAAM,EAAG,QAAO;AAAA,IAC1D,WAAe,KAAK,SAAS,MAAM;AAC7B,UAAI,CAAC,GAAG,MAAM,OAAO,EAAG,QAAO;AAAA,IACrC,WAAe,KAAK,SAAS,aAAa;AACpC,UAAI,CAAC,UAAU,MAAM,OAAO,EAAG,QAAO;AAAA,IAC5C,WAAe,KAAK,SAAS,eAAe;AACtC,UAAI,CAAC,OAAO,MAAM,SAAS,OAAO,QAAQ,KAAK,EAAG,QAAO;AAAA,IAC/D,WAAe,KAAK,SAAS,iBAAiB;AACxC,YAAM,IAAI,MAAM,0BAA0B,KAAK,OAAO,GAAG;AAAA,IAC/D,WAAe,KAAK,SAAS,WAAW;AAClC,UAAI,CAAC,KAAK,MAAM,OAAO,EAAG,QAAO;AAAA,IACvC,MAAW;AAAA,EAGR;AAED,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const enterState = require("./enter-state.cjs");
4
+ const test = require("./test.cjs");
5
+ const empty = [];
6
+ function walk(state, tree) {
7
+ if (tree) {
8
+ one(state, [], tree, void 0, void 0, tree);
9
+ }
10
+ }
11
+ function add(nest, field, rule) {
12
+ const list = nest[field];
13
+ if (list) {
14
+ list.push(rule);
15
+ } else {
16
+ nest[field] = [rule];
17
+ }
18
+ }
19
+ function all(state, nest, node, tree) {
20
+ const fromParent = combine(nest.descendant, nest.directChild);
21
+ let fromSibling;
22
+ let index = -1;
23
+ const total = { count: 0, types: /* @__PURE__ */ new Map() };
24
+ const before = { count: 0, types: /* @__PURE__ */ new Map() };
25
+ while (++index < node.children.length) {
26
+ count(total, node.children[index]);
27
+ }
28
+ index = -1;
29
+ while (++index < node.children.length) {
30
+ const child = node.children[index];
31
+ const name = child.type === "element" ? child.tagName.toUpperCase() : void 0;
32
+ state.elementIndex = before.count;
33
+ state.typeIndex = name ? before.types.get(name) || 0 : 0;
34
+ state.elementCount = total.count;
35
+ state.typeCount = name ? total.types.get(name) : 0;
36
+ if ("children" in child) {
37
+ const forSibling = combine(fromParent, fromSibling);
38
+ const nest2 = one(
39
+ state,
40
+ forSibling,
41
+ node.children[index],
42
+ index,
43
+ node,
44
+ tree
45
+ );
46
+ fromSibling = combine(nest2.generalSibling, nest2.adjacentSibling);
47
+ }
48
+ if (state.one && state.found) {
49
+ break;
50
+ }
51
+ count(before, node.children[index]);
52
+ }
53
+ }
54
+ function applySelectors(state, rules, node, index, parent) {
55
+ const nestResult = {
56
+ adjacentSibling: void 0,
57
+ descendant: void 0,
58
+ directChild: void 0,
59
+ generalSibling: void 0
60
+ };
61
+ let selectorIndex = -1;
62
+ while (++selectorIndex < rules.length) {
63
+ const rule = rules[selectorIndex];
64
+ if (state.one && state.found) {
65
+ break;
66
+ }
67
+ if (state.shallow && rule.nestedRule) {
68
+ throw new Error("Expected selector without nesting");
69
+ }
70
+ if (test.test(rule, node, index, parent, state)) {
71
+ const nest = rule.nestedRule;
72
+ if (nest) {
73
+ const label = nest.combinator === "+" ? "adjacentSibling" : nest.combinator === "~" ? "generalSibling" : nest.combinator === ">" ? "directChild" : "descendant";
74
+ add(nestResult, label, nest);
75
+ } else {
76
+ state.found = true;
77
+ if (!state.results.includes(node)) {
78
+ state.results.push(node);
79
+ }
80
+ }
81
+ }
82
+ if (rule.combinator === void 0) {
83
+ add(nestResult, "descendant", rule);
84
+ } else if (rule.combinator === "~") {
85
+ add(nestResult, "generalSibling", rule);
86
+ }
87
+ }
88
+ return nestResult;
89
+ }
90
+ function combine(left, right) {
91
+ return left && right && left.length > 0 && right.length > 0 ? [...left, ...right] : left && left.length > 0 ? left : right && right.length > 0 ? right : empty;
92
+ }
93
+ function count(counts, node) {
94
+ if (node.type === "element") {
95
+ const name = node.tagName.toUpperCase();
96
+ const count2 = (counts.types.get(name) || 0) + 1;
97
+ counts.count++;
98
+ counts.types.set(name, count2);
99
+ }
100
+ }
101
+ function one(state, currentRules, node, index, parent, tree) {
102
+ let nestResult = {
103
+ adjacentSibling: void 0,
104
+ descendant: void 0,
105
+ directChild: void 0,
106
+ generalSibling: void 0
107
+ };
108
+ const exit = enterState.enterState(state, node);
109
+ if (node.type === "element") {
110
+ let rootRules = state.rootQuery.rules;
111
+ if (parent && parent !== tree) {
112
+ rootRules = state.rootQuery.rules.filter(
113
+ (d) => d.combinator === void 0 || d.combinator === ">" && parent === tree
114
+ );
115
+ }
116
+ nestResult = applySelectors(
117
+ state,
118
+ // Try the root rules for this element too.
119
+ combine(currentRules, rootRules),
120
+ node,
121
+ index,
122
+ parent
123
+ );
124
+ }
125
+ if ("children" in node && !state.shallow && !(state.one && state.found)) {
126
+ all(state, nestResult, node, tree);
127
+ }
128
+ exit();
129
+ return nestResult;
130
+ }
131
+ exports.walk = walk;
132
+ //# sourceMappingURL=walk.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walk.cjs","sources":["../../../../node_modules/hast-util-select/lib/walk.js"],"sourcesContent":["/**\n * @typedef {import('css-selector-parser').AstRule} AstRule\n *\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Parents} Parents\n *\n * @typedef {import('./index.js').State} State\n */\n\n/**\n * @typedef Counts\n * Info on elements in a parent.\n * @property {number} count\n * Number of elements.\n * @property {Map<string, number>} types\n * Number of elements by tag name.\n *\n * @typedef Nest\n * Rule sets by nesting.\n * @property {Array<AstRule> | undefined} adjacentSibling\n * `a + b`\n * @property {Array<AstRule> | undefined} descendant\n * `a b`\n * @property {Array<AstRule> | undefined} directChild\n * `a > b`\n * @property {Array<AstRule> | undefined} generalSibling\n * `a ~ b`\n */\n\nimport {enterState} from './enter-state.js'\nimport {test} from './test.js'\n\n/** @type {Array<never>} */\nconst empty = []\n\n/**\n * Walk a tree.\n *\n * @param {State} state\n * State.\n * @param {Nodes | undefined} tree\n * Tree.\n */\nexport function walk(state, tree) {\n if (tree) {\n one(state, [], tree, undefined, undefined, tree)\n }\n}\n\n/**\n * Add a rule to a nesting map.\n *\n * @param {Nest} nest\n * Nesting.\n * @param {keyof Nest} field\n * Field.\n * @param {AstRule} rule\n * Rule.\n */\nfunction add(nest, field, rule) {\n const list = nest[field]\n if (list) {\n list.push(rule)\n } else {\n nest[field] = [rule]\n }\n}\n\n/**\n * Check in a parent.\n *\n * @param {State} state\n * State.\n * @param {Nest} nest\n * Nesting.\n * @param {Parents} node\n * Parent.\n * @param {Nodes} tree\n * Tree.\n * @returns {undefined}\n * Nothing.\n */\nfunction all(state, nest, node, tree) {\n const fromParent = combine(nest.descendant, nest.directChild)\n /** @type {Array<AstRule> | undefined} */\n let fromSibling\n let index = -1\n /**\n * Total counts.\n * @type {Counts}\n */\n const total = {count: 0, types: new Map()}\n /**\n * Counts of previous siblings.\n * @type {Counts}\n */\n const before = {count: 0, types: new Map()}\n\n while (++index < node.children.length) {\n count(total, node.children[index])\n }\n\n index = -1\n\n while (++index < node.children.length) {\n const child = node.children[index]\n // Uppercase to prevent prototype polution, injecting `constructor` or so.\n // Normalize because HTML is insensitive.\n const name =\n child.type === 'element' ? child.tagName.toUpperCase() : undefined\n // Before counting further elements:\n state.elementIndex = before.count\n state.typeIndex = name ? before.types.get(name) || 0 : 0\n // After counting all elements.\n state.elementCount = total.count\n state.typeCount = name ? total.types.get(name) : 0\n\n // Only apply if this is a parent, this should be an element, but we check\n // for parents so that we delve into custom nodes too.\n if ('children' in child) {\n const forSibling = combine(fromParent, fromSibling)\n const nest = one(\n state,\n forSibling,\n node.children[index],\n index,\n node,\n tree\n )\n fromSibling = combine(nest.generalSibling, nest.adjacentSibling)\n }\n\n // We found one thing, and one is enough.\n if (state.one && state.found) {\n break\n }\n\n count(before, node.children[index])\n }\n}\n\n/**\n * Apply selectors to an element.\n *\n * @param {State} state\n * Current state.\n * @param {Array<AstRule>} rules\n * Rules to apply.\n * @param {Element} node\n * Element to apply rules to.\n * @param {number | undefined} index\n * Index of `node` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {Nest}\n * Further rules.\n */\nfunction applySelectors(state, rules, node, index, parent) {\n /** @type {Nest} */\n const nestResult = {\n adjacentSibling: undefined,\n descendant: undefined,\n directChild: undefined,\n generalSibling: undefined\n }\n let selectorIndex = -1\n\n while (++selectorIndex < rules.length) {\n const rule = rules[selectorIndex]\n\n // We found one thing, and one is enough.\n if (state.one && state.found) {\n break\n }\n\n // When shallow, we don’t allow nested rules.\n // Idea: we could allow a stack of parents?\n // Might get quite complex though.\n if (state.shallow && rule.nestedRule) {\n throw new Error('Expected selector without nesting')\n }\n\n // If this rule matches:\n if (test(rule, node, index, parent, state)) {\n const nest = rule.nestedRule\n\n // Are there more?\n if (nest) {\n /** @type {keyof Nest} */\n const label =\n nest.combinator === '+'\n ? 'adjacentSibling'\n : nest.combinator === '~'\n ? 'generalSibling'\n : nest.combinator === '>'\n ? 'directChild'\n : 'descendant'\n add(nestResult, label, nest)\n } else {\n // We have a match!\n state.found = true\n\n if (!state.results.includes(node)) {\n state.results.push(node)\n }\n }\n }\n\n // Descendant.\n if (rule.combinator === undefined) {\n add(nestResult, 'descendant', rule)\n }\n // Adjacent.\n else if (rule.combinator === '~') {\n add(nestResult, 'generalSibling', rule)\n }\n // Drop direct child (`>`), adjacent sibling (`+`).\n }\n\n return nestResult\n}\n\n/**\n * Combine two lists, if needed.\n *\n * This is optimized to create as few lists as possible.\n *\n * @param {Array<AstRule> | undefined} left\n * Rules.\n * @param {Array<AstRule> | undefined} right\n * Rules.\n * @returns {Array<AstRule>}\n * Rules.\n */\nfunction combine(left, right) {\n return left && right && left.length > 0 && right.length > 0\n ? [...left, ...right]\n : left && left.length > 0\n ? left\n : right && right.length > 0\n ? right\n : empty\n}\n\n/**\n * Count a node.\n *\n * @param {Counts} counts\n * Counts.\n * @param {Nodes} node\n * Node (we’re looking for elements).\n * @returns {undefined}\n * Nothing.\n */\nfunction count(counts, node) {\n if (node.type === 'element') {\n // Uppercase to prevent prototype polution, injecting `constructor` or so.\n // Normalize because HTML is insensitive.\n const name = node.tagName.toUpperCase()\n const count = (counts.types.get(name) || 0) + 1\n counts.count++\n counts.types.set(name, count)\n }\n}\n\n/**\n * Check a node.\n *\n * @param {State} state\n * State.\n * @param {Array<AstRule>} currentRules\n * Rules.\n * @param {Nodes} node\n * Node.\n * @param {number | undefined} index\n * Index of `node` in `parent`.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {Nodes} tree\n * Tree.\n * @returns {Nest}\n * Nesting.\n */\nfunction one(state, currentRules, node, index, parent, tree) {\n /** @type {Nest} */\n let nestResult = {\n adjacentSibling: undefined,\n descendant: undefined,\n directChild: undefined,\n generalSibling: undefined\n }\n\n const exit = enterState(state, node)\n\n if (node.type === 'element') {\n let rootRules = state.rootQuery.rules\n\n // Remove direct child rules if this is the root.\n // This only happens for a `:has()` rule, which can be like\n // `a:has(> b)`.\n if (parent && parent !== tree) {\n rootRules = state.rootQuery.rules.filter(\n (d) =>\n d.combinator === undefined ||\n (d.combinator === '>' && parent === tree)\n )\n }\n\n nestResult = applySelectors(\n state,\n // Try the root rules for this element too.\n combine(currentRules, rootRules),\n node,\n index,\n parent\n )\n }\n\n // If this is a parent, and we want to delve into them, and we haven’t found\n // our single result yet.\n if ('children' in node && !state.shallow && !(state.one && state.found)) {\n all(state, nestResult, node, tree)\n }\n\n exit()\n\n return nestResult\n}\n"],"names":["nest","test","count","enterState"],"mappings":";;;;AAkCA,MAAM,QAAQ,CAAE;AAUT,SAAS,KAAK,OAAO,MAAM;AAChC,MAAI,MAAM;AACR,QAAI,OAAO,CAAE,GAAE,MAAM,QAAW,QAAW,IAAI;AAAA,EAChD;AACH;AAYA,SAAS,IAAI,MAAM,OAAO,MAAM;AAC9B,QAAM,OAAO,KAAK,KAAK;AACvB,MAAI,MAAM;AACR,SAAK,KAAK,IAAI;AAAA,EAClB,OAAS;AACL,SAAK,KAAK,IAAI,CAAC,IAAI;AAAA,EACpB;AACH;AAgBA,SAAS,IAAI,OAAO,MAAM,MAAM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b,gBAAgB;AAAA,EACjB;AAED,QAAM,OAAOC,WAAAA,WAAW,OAAO,IAAI;AAEnC,MAAI,KAAK,SAAS,WAAW;AAC3B,QAAI,YAAY,MAAM,UAAU;AAKhC,QAAI,UAAU,WAAW,MAAM;AAC7B,kBAAY,MAAM,UAAU,MAAM;AAAA,QAChC,CAAC,MACC,EAAE,eAAe,UAChB,EAAE,eAAe,OAAO,WAAW;AAAA,MACvC;AAAA,IACF;AAED,iBAAa;AAAA,MACX;AAAA;AAAA,MAEA,QAAQ,cAAc,SAAS;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACF;AAID,MAAI,cAAc,QAAQ,CAAC,MAAM,WAAW,EAAE,MAAM,OAAO,MAAM,QAAQ;AACvE,QAAI,OAAO,YAAY,MAAM,IAAI;AAAA,EAClC;AAED,OAAM;AAEN,SAAO;AACT;;","x_google_ignoreList":[0]}
@@ -0,0 +1,132 @@
1
+ import { enterState } from "./enter-state.js";
2
+ import { test } from "./test.js";
3
+ const empty = [];
4
+ function walk(state, tree) {
5
+ if (tree) {
6
+ one(state, [], tree, void 0, void 0, tree);
7
+ }
8
+ }
9
+ function add(nest, field, rule) {
10
+ const list = nest[field];
11
+ if (list) {
12
+ list.push(rule);
13
+ } else {
14
+ nest[field] = [rule];
15
+ }
16
+ }
17
+ function all(state, nest, node, tree) {
18
+ const fromParent = combine(nest.descendant, nest.directChild);
19
+ let fromSibling;
20
+ let index = -1;
21
+ const total = { count: 0, types: /* @__PURE__ */ new Map() };
22
+ const before = { count: 0, types: /* @__PURE__ */ new Map() };
23
+ while (++index < node.children.length) {
24
+ count(total, node.children[index]);
25
+ }
26
+ index = -1;
27
+ while (++index < node.children.length) {
28
+ const child = node.children[index];
29
+ const name = child.type === "element" ? child.tagName.toUpperCase() : void 0;
30
+ state.elementIndex = before.count;
31
+ state.typeIndex = name ? before.types.get(name) || 0 : 0;
32
+ state.elementCount = total.count;
33
+ state.typeCount = name ? total.types.get(name) : 0;
34
+ if ("children" in child) {
35
+ const forSibling = combine(fromParent, fromSibling);
36
+ const nest2 = one(
37
+ state,
38
+ forSibling,
39
+ node.children[index],
40
+ index,
41
+ node,
42
+ tree
43
+ );
44
+ fromSibling = combine(nest2.generalSibling, nest2.adjacentSibling);
45
+ }
46
+ if (state.one && state.found) {
47
+ break;
48
+ }
49
+ count(before, node.children[index]);
50
+ }
51
+ }
52
+ function applySelectors(state, rules, node, index, parent) {
53
+ const nestResult = {
54
+ adjacentSibling: void 0,
55
+ descendant: void 0,
56
+ directChild: void 0,
57
+ generalSibling: void 0
58
+ };
59
+ let selectorIndex = -1;
60
+ while (++selectorIndex < rules.length) {
61
+ const rule = rules[selectorIndex];
62
+ if (state.one && state.found) {
63
+ break;
64
+ }
65
+ if (state.shallow && rule.nestedRule) {
66
+ throw new Error("Expected selector without nesting");
67
+ }
68
+ if (test(rule, node, index, parent, state)) {
69
+ const nest = rule.nestedRule;
70
+ if (nest) {
71
+ const label = nest.combinator === "+" ? "adjacentSibling" : nest.combinator === "~" ? "generalSibling" : nest.combinator === ">" ? "directChild" : "descendant";
72
+ add(nestResult, label, nest);
73
+ } else {
74
+ state.found = true;
75
+ if (!state.results.includes(node)) {
76
+ state.results.push(node);
77
+ }
78
+ }
79
+ }
80
+ if (rule.combinator === void 0) {
81
+ add(nestResult, "descendant", rule);
82
+ } else if (rule.combinator === "~") {
83
+ add(nestResult, "generalSibling", rule);
84
+ }
85
+ }
86
+ return nestResult;
87
+ }
88
+ function combine(left, right) {
89
+ return left && right && left.length > 0 && right.length > 0 ? [...left, ...right] : left && left.length > 0 ? left : right && right.length > 0 ? right : empty;
90
+ }
91
+ function count(counts, node) {
92
+ if (node.type === "element") {
93
+ const name = node.tagName.toUpperCase();
94
+ const count2 = (counts.types.get(name) || 0) + 1;
95
+ counts.count++;
96
+ counts.types.set(name, count2);
97
+ }
98
+ }
99
+ function one(state, currentRules, node, index, parent, tree) {
100
+ let nestResult = {
101
+ adjacentSibling: void 0,
102
+ descendant: void 0,
103
+ directChild: void 0,
104
+ generalSibling: void 0
105
+ };
106
+ const exit = enterState(state, node);
107
+ if (node.type === "element") {
108
+ let rootRules = state.rootQuery.rules;
109
+ if (parent && parent !== tree) {
110
+ rootRules = state.rootQuery.rules.filter(
111
+ (d) => d.combinator === void 0 || d.combinator === ">" && parent === tree
112
+ );
113
+ }
114
+ nestResult = applySelectors(
115
+ state,
116
+ // Try the root rules for this element too.
117
+ combine(currentRules, rootRules),
118
+ node,
119
+ index,
120
+ parent
121
+ );
122
+ }
123
+ if ("children" in node && !state.shallow && !(state.one && state.found)) {
124
+ all(state, nestResult, node, tree);
125
+ }
126
+ exit();
127
+ return nestResult;
128
+ }
129
+ export {
130
+ walk
131
+ };
132
+ //# sourceMappingURL=walk.js.map