@wirecat/wordpress-cli 0.0.0-stage → 0.1.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 (256) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +204 -0
  3. package/README.md +248 -2
  4. package/contracts/wirecat.json +2535 -0
  5. package/dist/bin/wordpress.d.ts +3 -0
  6. package/dist/bin/wordpress.d.ts.map +1 -0
  7. package/dist/bin/wordpress.js +40 -0
  8. package/dist/bin/wordpress.js.map +1 -0
  9. package/dist/bundle/agent-LKBRYKNB.js +37 -0
  10. package/dist/bundle/all-profiles-OEV7VFQG.js +320 -0
  11. package/dist/bundle/anthropic-JKTZP2DW.js +91 -0
  12. package/dist/bundle/app-server-7LWLDDE2.js +249 -0
  13. package/dist/bundle/bun-2FLR4IV4.js +169 -0
  14. package/dist/bundle/bun-sqlite-GRSRX5P4.js +76 -0
  15. package/dist/bundle/chunk-2BI25SEE.js +259 -0
  16. package/dist/bundle/chunk-2UEGJ5AJ.js +52 -0
  17. package/dist/bundle/chunk-2XUV7HNE.js +58 -0
  18. package/dist/bundle/chunk-2Z7UOXFC.js +16 -0
  19. package/dist/bundle/chunk-3BM6KBWP.js +2788 -0
  20. package/dist/bundle/chunk-3BRAZVHR.js +1010 -0
  21. package/dist/bundle/chunk-3LMW7U7F.js +1233 -0
  22. package/dist/bundle/chunk-3LVTQFGB.js +2000 -0
  23. package/dist/bundle/chunk-3TKFFSFU.js +106 -0
  24. package/dist/bundle/chunk-3UX4VJWD.js +78 -0
  25. package/dist/bundle/chunk-4HEXAGKT.js +334 -0
  26. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  27. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  28. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  29. package/dist/bundle/chunk-5XPHFV7H.js +2333 -0
  30. package/dist/bundle/chunk-5Z3P543G.js +80 -0
  31. package/dist/bundle/chunk-6UYDKCV6.js +794 -0
  32. package/dist/bundle/chunk-7GNB4LBX.js +50 -0
  33. package/dist/bundle/chunk-7HJFBOAT.js +161 -0
  34. package/dist/bundle/chunk-7JVKQ6NM.js +206 -0
  35. package/dist/bundle/chunk-7QH5BZUG.js +142 -0
  36. package/dist/bundle/chunk-A474OVIW.js +1392 -0
  37. package/dist/bundle/chunk-AENEMQL3.js +1068 -0
  38. package/dist/bundle/chunk-AL7I4DT4.js +65718 -0
  39. package/dist/bundle/chunk-ARGRGTPX.js +108 -0
  40. package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
  41. package/dist/bundle/chunk-BAXNAOOL.js +76 -0
  42. package/dist/bundle/chunk-BH63B66W.js +407 -0
  43. package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
  44. package/dist/bundle/chunk-CFQQTDSA.js +46 -0
  45. package/dist/bundle/chunk-CGCUOT67.js +388 -0
  46. package/dist/bundle/chunk-CHPWBQUK.js +39 -0
  47. package/dist/bundle/chunk-D72URWJE.js +532 -0
  48. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  49. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  50. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  51. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  52. package/dist/bundle/chunk-EHW45LLT.js +100 -0
  53. package/dist/bundle/chunk-F3AV5ZSL.js +338 -0
  54. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  55. package/dist/bundle/chunk-F5ZAN7OC.js +6848 -0
  56. package/dist/bundle/chunk-FMMYBVCH.js +38 -0
  57. package/dist/bundle/chunk-FNB4SWTY.js +66 -0
  58. package/dist/bundle/chunk-FQROWBKV.js +12660 -0
  59. package/dist/bundle/chunk-FV2HJOSC.js +771 -0
  60. package/dist/bundle/chunk-GCAJW4SR.js +53 -0
  61. package/dist/bundle/chunk-GPRJXJC7.js +102 -0
  62. package/dist/bundle/chunk-HCOZUOSN.js +54 -0
  63. package/dist/bundle/chunk-HM6AMYHR.js +72 -0
  64. package/dist/bundle/chunk-HVXOA4FO.js +23 -0
  65. package/dist/bundle/chunk-HWQ7572G.js +95 -0
  66. package/dist/bundle/chunk-IJVTN5L3.js +82 -0
  67. package/dist/bundle/chunk-IZDDBOHU.js +3610 -0
  68. package/dist/bundle/chunk-JAE5B4G7.js +388 -0
  69. package/dist/bundle/chunk-K2Y5K37O.js +218 -0
  70. package/dist/bundle/chunk-KCH224US.js +9581 -0
  71. package/dist/bundle/chunk-KZJQPJK5.js +230 -0
  72. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  73. package/dist/bundle/chunk-LECMHK2F.js +18 -0
  74. package/dist/bundle/chunk-LWEMZJLG.js +1332 -0
  75. package/dist/bundle/chunk-LWTETL2O.js +185 -0
  76. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  77. package/dist/bundle/chunk-MJ6LTG4L.js +170 -0
  78. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  79. package/dist/bundle/chunk-ODVGFCBE.js +557 -0
  80. package/dist/bundle/chunk-OEQNP56V.js +633 -0
  81. package/dist/bundle/chunk-OV6WQY3L.js +39 -0
  82. package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
  83. package/dist/bundle/chunk-PPNTY7LD.js +733 -0
  84. package/dist/bundle/chunk-PRZYRA66.js +358 -0
  85. package/dist/bundle/chunk-PV5UYGRJ.js +41594 -0
  86. package/dist/bundle/chunk-QYTOLPNI.js +52 -0
  87. package/dist/bundle/chunk-R7Y3XU66.js +362 -0
  88. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  89. package/dist/bundle/chunk-SD5CXGIG.js +188 -0
  90. package/dist/bundle/chunk-SXY5G62I.js +288 -0
  91. package/dist/bundle/chunk-T37TAXVL.js +29 -0
  92. package/dist/bundle/chunk-T5SOY3AE.js +1197 -0
  93. package/dist/bundle/chunk-TJ7OORSO.js +1876 -0
  94. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  95. package/dist/bundle/chunk-U6VLNYCO.js +73 -0
  96. package/dist/bundle/chunk-UC7JLE6J.js +58 -0
  97. package/dist/bundle/chunk-UUIOAZPH.js +156 -0
  98. package/dist/bundle/chunk-UXQ24OY6.js +4072 -0
  99. package/dist/bundle/chunk-VBRRMGON.js +1007 -0
  100. package/dist/bundle/chunk-VRIBES2C.js +319 -0
  101. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  102. package/dist/bundle/chunk-XT5XYQEZ.js +3414 -0
  103. package/dist/bundle/chunk-XTAS5Z3G.js +2231 -0
  104. package/dist/bundle/chunk-XYQVVW4R.js +24 -0
  105. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  106. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  107. package/dist/bundle/chunk-YUDVRFXN.js +63 -0
  108. package/dist/bundle/chunk-Z3I2MCUT.js +131 -0
  109. package/dist/bundle/chunk-ZDI3WC7V.js +353 -0
  110. package/dist/bundle/chunk-ZVQ7KFMT.js +274 -0
  111. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  112. package/dist/bundle/command-contract-P7YE4EKS.js +37 -0
  113. package/dist/bundle/command-server-entry-XIMCBWMV.js +166 -0
  114. package/dist/bundle/decode-6XK55WYV.js +297 -0
  115. package/dist/bundle/definitions-GIQCGYPR.js +7986 -0
  116. package/dist/bundle/dispatch-JQBAZWCL.js +411 -0
  117. package/dist/bundle/dist-2TV3NVE5.js +7577 -0
  118. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  119. package/dist/bundle/echarts-YRRVLEX3.js +42501 -0
  120. package/dist/bundle/embed-L3EEQSGX.js +38 -0
  121. package/dist/bundle/embedder-BIKLBV3J.js +111 -0
  122. package/dist/bundle/failure-I6AAF5R5.js +25 -0
  123. package/dist/bundle/first-run-W6G6TYZ2.js +29 -0
  124. package/dist/bundle/first-screen-ITIAJIBU.js +37 -0
  125. package/dist/bundle/hast-util-from-html-ZHU6HGIE.js +10531 -0
  126. package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
  127. package/dist/bundle/hast-util-to-mdast-D62XX3NR.js +2272 -0
  128. package/dist/bundle/instructions-AG7SRWTR.js +11 -0
  129. package/dist/bundle/mcp-YGOAUNC3.js +167 -0
  130. package/dist/bundle/mdast-util-from-markdown-WVUJDSUO.js +1900 -0
  131. package/dist/bundle/mdast-util-gfm-KN2D32QS.js +1040 -0
  132. package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
  133. package/dist/bundle/mdast-util-to-markdown-UCAJNHJO.js +18 -0
  134. package/dist/bundle/meeting-combined-CQJ3JHHU.js +24 -0
  135. package/dist/bundle/meeting-model-MZ7VVBNK.js +25 -0
  136. package/dist/bundle/meeting-semantic-DADWRRHP.js +22 -0
  137. package/dist/bundle/micromark-extension-gfm-EEJRRJ36.js +1771 -0
  138. package/dist/bundle/node-GJQYN4FT.js +176 -0
  139. package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
  140. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  141. package/dist/bundle/node-sqlite-TPR62DT2.js +74 -0
  142. package/dist/bundle/oauth-WGY7JQVW.js +20 -0
  143. package/dist/bundle/open-DE7QZNAN.js +23 -0
  144. package/dist/bundle/openai-NHEFT3HS.js +238 -0
  145. package/dist/bundle/process-MEKCZMX3.js +91 -0
  146. package/dist/bundle/program-EP2S5BTM.js +38857 -0
  147. package/dist/bundle/prompt-PWY53BYH.js +17 -0
  148. package/dist/bundle/recognize-74TXHKMQ.js +26 -0
  149. package/dist/bundle/remote-F5TJZ5ER.js +31 -0
  150. package/dist/bundle/rerank-HWUO52UF.js +52 -0
  151. package/dist/bundle/schemas-4K6WWS5N.js +2157 -0
  152. package/dist/bundle/serve-I2USUY4X.js +199 -0
  153. package/dist/bundle/server-GDYDNO6K.js +79 -0
  154. package/dist/bundle/server-KYUW2AHB.js +212 -0
  155. package/dist/bundle/sqlite-runtime-N6VFGBJK.js +20 -0
  156. package/dist/bundle/state-L6JSCN77.js +36 -0
  157. package/dist/bundle/store-EPG2YPN3.js +291 -0
  158. package/dist/bundle/store-SQWQJE32.js +181 -0
  159. package/dist/bundle/store-maintenance-command-FTGSICVA.js +66 -0
  160. package/dist/bundle/surface-SNMHY6GP.js +65 -0
  161. package/dist/bundle/wordpress.js +183 -0
  162. package/dist/commands/api.d.ts +22 -0
  163. package/dist/commands/api.d.ts.map +1 -0
  164. package/dist/commands/api.js +37 -0
  165. package/dist/commands/api.js.map +1 -0
  166. package/dist/commands/content.d.ts +4 -0
  167. package/dist/commands/content.d.ts.map +1 -0
  168. package/dist/commands/content.js +94 -0
  169. package/dist/commands/content.js.map +1 -0
  170. package/dist/commands/session.d.ts +8 -0
  171. package/dist/commands/session.d.ts.map +1 -0
  172. package/dist/commands/session.js +28 -0
  173. package/dist/commands/session.js.map +1 -0
  174. package/dist/config.d.ts +13 -0
  175. package/dist/config.d.ts.map +1 -0
  176. package/dist/config.js +69 -0
  177. package/dist/config.js.map +1 -0
  178. package/dist/context.d.ts +37 -0
  179. package/dist/context.d.ts.map +1 -0
  180. package/dist/context.js +31 -0
  181. package/dist/context.js.map +1 -0
  182. package/dist/generated/definitions.d.ts +3 -0
  183. package/dist/generated/definitions.d.ts.map +1 -0
  184. package/dist/generated/definitions.js +7982 -0
  185. package/dist/generated/definitions.js.map +1 -0
  186. package/dist/generated/manifest.d.ts +6 -0
  187. package/dist/generated/manifest.d.ts.map +1 -0
  188. package/dist/generated/manifest.js +8830 -0
  189. package/dist/generated/manifest.js.map +1 -0
  190. package/dist/generated/schemas.d.ts +229 -0
  191. package/dist/generated/schemas.d.ts.map +1 -0
  192. package/dist/generated/schemas.js +2019 -0
  193. package/dist/generated/schemas.js.map +1 -0
  194. package/dist/generated/types.d.ts +3365 -0
  195. package/dist/generated/types.d.ts.map +1 -0
  196. package/dist/generated/types.js +5 -0
  197. package/dist/generated/types.js.map +1 -0
  198. package/dist/generated/wirecat-config.d.ts +11 -0
  199. package/dist/generated/wirecat-config.d.ts.map +1 -0
  200. package/dist/generated/wirecat-config.js +337 -0
  201. package/dist/generated/wirecat-config.js.map +1 -0
  202. package/dist/identity.d.ts +28 -0
  203. package/dist/identity.d.ts.map +1 -0
  204. package/dist/identity.js +29 -0
  205. package/dist/identity.js.map +1 -0
  206. package/dist/index.d.ts +3 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js +3 -0
  209. package/dist/index.js.map +1 -0
  210. package/dist/program.d.ts +6 -0
  211. package/dist/program.d.ts.map +1 -0
  212. package/dist/program.js +53 -0
  213. package/dist/program.js.map +1 -0
  214. package/dist/version.d.ts +2 -0
  215. package/dist/version.d.ts.map +1 -0
  216. package/dist/version.js +2 -0
  217. package/dist/version.js.map +1 -0
  218. package/dist/wcat.d.ts +3 -0
  219. package/dist/wcat.d.ts.map +1 -0
  220. package/dist/wcat.js +4 -0
  221. package/dist/wcat.js.map +1 -0
  222. package/package.json +87 -4
  223. package/skills/wordpress-cli/SKILL.md +88 -0
  224. package/skills/wordpress-cli/references/api/api-block-directory.md +17 -0
  225. package/skills/wordpress-cli/references/api/api-block-patterns.md +13 -0
  226. package/skills/wordpress-cli/references/api/api-block-types.md +34 -0
  227. package/skills/wordpress-cli/references/api/api-blocks.md +159 -0
  228. package/skills/wordpress-cli/references/api/api-categories.md +69 -0
  229. package/skills/wordpress-cli/references/api/api-comments.md +79 -0
  230. package/skills/wordpress-cli/references/api/api-font-collections.md +16 -0
  231. package/skills/wordpress-cli/references/api/api-font-families.md +122 -0
  232. package/skills/wordpress-cli/references/api/api-global-styles.md +29 -0
  233. package/skills/wordpress-cli/references/api/api-media.md +106 -0
  234. package/skills/wordpress-cli/references/api/api-menu-items.md +115 -0
  235. package/skills/wordpress-cli/references/api/api-menu-locations.md +22 -0
  236. package/skills/wordpress-cli/references/api/api-menus.md +69 -0
  237. package/skills/wordpress-cli/references/api/api-navigation.md +155 -0
  238. package/skills/wordpress-cli/references/api/api-pages.md +161 -0
  239. package/skills/wordpress-cli/references/api/api-pattern-directory.md +23 -0
  240. package/skills/wordpress-cli/references/api/api-plugins.md +25 -0
  241. package/skills/wordpress-cli/references/api/api-posts.md +166 -0
  242. package/skills/wordpress-cli/references/api/api-search.md +21 -0
  243. package/skills/wordpress-cli/references/api/api-settings.md +19 -0
  244. package/skills/wordpress-cli/references/api/api-sidebars.md +34 -0
  245. package/skills/wordpress-cli/references/api/api-statuses.md +22 -0
  246. package/skills/wordpress-cli/references/api/api-tags.md +69 -0
  247. package/skills/wordpress-cli/references/api/api-taxonomies.md +23 -0
  248. package/skills/wordpress-cli/references/api/api-template-parts.md +38 -0
  249. package/skills/wordpress-cli/references/api/api-templates.md +38 -0
  250. package/skills/wordpress-cli/references/api/api-themes.md +12 -0
  251. package/skills/wordpress-cli/references/api/api-types.md +22 -0
  252. package/skills/wordpress-cli/references/api/api-users.md +149 -0
  253. package/skills/wordpress-cli/references/api/api-widget-types.md +46 -0
  254. package/skills/wordpress-cli/references/api/api-widgets.md +57 -0
  255. package/skills/wordpress-cli/references/api/api-wp-pattern-category.md +69 -0
  256. package/skills/wordpress-cli/references/api.md +44 -0
@@ -0,0 +1,1900 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ EditMap,
5
+ attention,
6
+ autolink,
7
+ blankLine,
8
+ blockQuote,
9
+ characterEscape,
10
+ characterReference,
11
+ codeFenced,
12
+ codeIndented,
13
+ codeText,
14
+ combineExtensions,
15
+ content,
16
+ definition,
17
+ factorySpace,
18
+ hardBreakEscape,
19
+ headingAtx,
20
+ htmlFlow,
21
+ htmlText,
22
+ labelEnd,
23
+ labelStartImage,
24
+ labelStartLink,
25
+ lineEnding,
26
+ list,
27
+ push,
28
+ resolveAll,
29
+ setextUnderline,
30
+ splice,
31
+ subtokenize,
32
+ thematicBreak
33
+ } from "./chunk-XT5XYQEZ.js";
34
+ import {
35
+ normalizeIdentifier
36
+ } from "./chunk-F4BX7TH2.js";
37
+ import {
38
+ stringifyPosition
39
+ } from "./chunk-YHWFF6DN.js";
40
+ import {
41
+ decodeNumericCharacterReference,
42
+ decodeString
43
+ } from "./chunk-QYTOLPNI.js";
44
+ import {
45
+ decodeNamedCharacterReference
46
+ } from "./chunk-XTAS5Z3G.js";
47
+ import {
48
+ markdownLineEnding
49
+ } from "./chunk-UC7JLE6J.js";
50
+ import {
51
+ toString
52
+ } from "./chunk-XFLCVHSQ.js";
53
+ import {
54
+ __export,
55
+ __name
56
+ } from "./chunk-ZVVMGPBJ.js";
57
+
58
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/initialize/content.js
59
+ var content2 = {
60
+ tokenize: initializeContent
61
+ };
62
+ function initializeContent(effects) {
63
+ const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);
64
+ let previous;
65
+ return contentStart;
66
+ function afterContentStartConstruct(code) {
67
+ if (code === null) {
68
+ effects.consume(code);
69
+ return;
70
+ }
71
+ effects.enter("lineEnding");
72
+ effects.consume(code);
73
+ effects.exit("lineEnding");
74
+ return factorySpace(effects, contentStart, "linePrefix");
75
+ }
76
+ __name(afterContentStartConstruct, "afterContentStartConstruct");
77
+ function paragraphInitial(code) {
78
+ effects.enter("paragraph");
79
+ return lineStart(code);
80
+ }
81
+ __name(paragraphInitial, "paragraphInitial");
82
+ function lineStart(code) {
83
+ const token = effects.enter("chunkText", {
84
+ contentType: "text",
85
+ previous
86
+ });
87
+ if (previous) {
88
+ previous.next = token;
89
+ }
90
+ previous = token;
91
+ return data(code);
92
+ }
93
+ __name(lineStart, "lineStart");
94
+ function data(code) {
95
+ if (code === null) {
96
+ effects.exit("chunkText");
97
+ effects.exit("paragraph");
98
+ effects.consume(code);
99
+ return;
100
+ }
101
+ if (markdownLineEnding(code)) {
102
+ effects.consume(code);
103
+ effects.exit("chunkText");
104
+ return lineStart;
105
+ }
106
+ effects.consume(code);
107
+ return data;
108
+ }
109
+ __name(data, "data");
110
+ }
111
+ __name(initializeContent, "initializeContent");
112
+
113
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/initialize/document.js
114
+ var document = {
115
+ tokenize: initializeDocument
116
+ };
117
+ var containerConstruct = {
118
+ tokenize: tokenizeContainer
119
+ };
120
+ function initializeDocument(effects) {
121
+ const self = this;
122
+ const stack = [];
123
+ let continued = 0;
124
+ let childFlow;
125
+ let childToken;
126
+ let lineStartOffset;
127
+ return start;
128
+ function start(code) {
129
+ if (continued < stack.length) {
130
+ const item = stack[continued];
131
+ self.containerState = item[1];
132
+ return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);
133
+ }
134
+ return checkNewContainers(code);
135
+ }
136
+ __name(start, "start");
137
+ function documentContinue(code) {
138
+ continued++;
139
+ if (self.containerState._closeFlow) {
140
+ self.containerState._closeFlow = void 0;
141
+ if (childFlow) {
142
+ closeFlow();
143
+ }
144
+ const indexBeforeExits = self.events.length;
145
+ let indexBeforeFlow = indexBeforeExits;
146
+ let point2;
147
+ while (indexBeforeFlow--) {
148
+ if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
149
+ point2 = self.events[indexBeforeFlow][1].end;
150
+ break;
151
+ }
152
+ }
153
+ exitContainers(continued);
154
+ let index = indexBeforeExits;
155
+ while (index < self.events.length) {
156
+ self.events[index][1].end = {
157
+ ...point2
158
+ };
159
+ index++;
160
+ }
161
+ const editMap = new EditMap();
162
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
163
+ editMap.add(indexBeforeExits, index - indexBeforeExits, []);
164
+ editMap.consume(self.events);
165
+ return checkNewContainers(code);
166
+ }
167
+ return start(code);
168
+ }
169
+ __name(documentContinue, "documentContinue");
170
+ function checkNewContainers(code) {
171
+ if (continued === stack.length) {
172
+ if (!childFlow) {
173
+ return documentContinued(code);
174
+ }
175
+ if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
176
+ return flowStart(code);
177
+ }
178
+ self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);
179
+ }
180
+ self.containerState = {};
181
+ return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);
182
+ }
183
+ __name(checkNewContainers, "checkNewContainers");
184
+ function thereIsANewContainer(code) {
185
+ if (childFlow) {
186
+ closeFlow();
187
+ }
188
+ exitContainers(continued);
189
+ return documentContinued(code);
190
+ }
191
+ __name(thereIsANewContainer, "thereIsANewContainer");
192
+ function thereIsNoNewContainer(code) {
193
+ self.parser.lazy[self.now().line] = continued !== stack.length;
194
+ lineStartOffset = self.now().offset;
195
+ return flowStart(code);
196
+ }
197
+ __name(thereIsNoNewContainer, "thereIsNoNewContainer");
198
+ function documentContinued(code) {
199
+ self.containerState = {};
200
+ return effects.attempt(containerConstruct, containerContinue, flowStart)(code);
201
+ }
202
+ __name(documentContinued, "documentContinued");
203
+ function containerContinue(code) {
204
+ continued++;
205
+ stack.push([self.currentConstruct, self.containerState]);
206
+ return documentContinued(code);
207
+ }
208
+ __name(containerContinue, "containerContinue");
209
+ function flowStart(code) {
210
+ if (code === null) {
211
+ if (childFlow) {
212
+ closeFlow();
213
+ }
214
+ exitContainers(0);
215
+ effects.consume(code);
216
+ return;
217
+ }
218
+ childFlow = childFlow || self.parser.flow(self.now());
219
+ effects.enter("chunkFlow", {
220
+ _tokenizer: childFlow,
221
+ contentType: "flow",
222
+ previous: childToken
223
+ });
224
+ return flowContinue(code);
225
+ }
226
+ __name(flowStart, "flowStart");
227
+ function flowContinue(code) {
228
+ if (code === null) {
229
+ writeToChild(effects.exit("chunkFlow"), true);
230
+ exitContainers(0);
231
+ effects.consume(code);
232
+ return;
233
+ }
234
+ if (markdownLineEnding(code)) {
235
+ effects.consume(code);
236
+ writeToChild(effects.exit("chunkFlow"));
237
+ continued = 0;
238
+ self.interrupt = void 0;
239
+ return start;
240
+ }
241
+ effects.consume(code);
242
+ return flowContinue;
243
+ }
244
+ __name(flowContinue, "flowContinue");
245
+ function writeToChild(token, endOfFile) {
246
+ const stream = self.sliceStream(token);
247
+ if (endOfFile) {
248
+ stream.push(null);
249
+ }
250
+ token.previous = childToken;
251
+ if (childToken) {
252
+ childToken.next = token;
253
+ }
254
+ childToken = token;
255
+ childFlow.defineSkip(token.start);
256
+ childFlow.write(stream);
257
+ if (self.parser.lazy[token.start.line]) {
258
+ let index = childFlow.events.length;
259
+ while (index--) {
260
+ if (
261
+ // The token starts before the line ending…
262
+ childFlow.events[index][1].start.offset < lineStartOffset && // …and either is not ended yet…
263
+ (!childFlow.events[index][1].end || // …or ends after it.
264
+ childFlow.events[index][1].end.offset > lineStartOffset)
265
+ ) {
266
+ return;
267
+ }
268
+ }
269
+ const indexBeforeExits = self.events.length;
270
+ let indexBeforeFlow = indexBeforeExits;
271
+ let seen;
272
+ let point2;
273
+ while (indexBeforeFlow--) {
274
+ if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
275
+ if (seen) {
276
+ point2 = self.events[indexBeforeFlow][1].end;
277
+ break;
278
+ }
279
+ seen = true;
280
+ }
281
+ }
282
+ exitContainers(continued);
283
+ index = indexBeforeExits;
284
+ while (index < self.events.length) {
285
+ self.events[index][1].end = {
286
+ ...point2
287
+ };
288
+ index++;
289
+ }
290
+ const editMap = new EditMap();
291
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
292
+ editMap.add(indexBeforeExits, index - indexBeforeExits, []);
293
+ editMap.consume(self.events);
294
+ }
295
+ }
296
+ __name(writeToChild, "writeToChild");
297
+ function exitContainers(size) {
298
+ let index = stack.length;
299
+ while (index-- > size) {
300
+ const entry = stack[index];
301
+ self.containerState = entry[1];
302
+ entry[0].exit.call(self, effects);
303
+ }
304
+ stack.length = size;
305
+ }
306
+ __name(exitContainers, "exitContainers");
307
+ function closeFlow() {
308
+ childFlow.write([null]);
309
+ childToken = void 0;
310
+ childFlow = void 0;
311
+ self.containerState._closeFlow = void 0;
312
+ }
313
+ __name(closeFlow, "closeFlow");
314
+ }
315
+ __name(initializeDocument, "initializeDocument");
316
+ function tokenizeContainer(effects, ok, nok) {
317
+ return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
318
+ }
319
+ __name(tokenizeContainer, "tokenizeContainer");
320
+
321
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/initialize/flow.js
322
+ var flow = {
323
+ tokenize: initializeFlow
324
+ };
325
+ function initializeFlow(effects) {
326
+ const self = this;
327
+ const initial = effects.attempt(
328
+ // Try to parse a blank line.
329
+ blankLine,
330
+ atBlankEnding,
331
+ // Try to parse initial flow (essentially, only code).
332
+ effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), "linePrefix"))
333
+ );
334
+ return initial;
335
+ function atBlankEnding(code) {
336
+ if (code === null) {
337
+ effects.consume(code);
338
+ return;
339
+ }
340
+ effects.enter("lineEndingBlank");
341
+ effects.consume(code);
342
+ effects.exit("lineEndingBlank");
343
+ self.currentConstruct = void 0;
344
+ return initial;
345
+ }
346
+ __name(atBlankEnding, "atBlankEnding");
347
+ function afterConstruct(code) {
348
+ if (code === null) {
349
+ effects.consume(code);
350
+ return;
351
+ }
352
+ effects.enter("lineEnding");
353
+ effects.consume(code);
354
+ effects.exit("lineEnding");
355
+ self.currentConstruct = void 0;
356
+ return initial;
357
+ }
358
+ __name(afterConstruct, "afterConstruct");
359
+ }
360
+ __name(initializeFlow, "initializeFlow");
361
+
362
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/initialize/text.js
363
+ var resolver = {
364
+ resolveAll: createResolver()
365
+ };
366
+ var string = initializeFactory("string");
367
+ var text = initializeFactory("text");
368
+ function initializeFactory(field) {
369
+ return {
370
+ resolveAll: createResolver(field === "text" ? resolveAllLineSuffixes : void 0),
371
+ tokenize: initializeText
372
+ };
373
+ function initializeText(effects) {
374
+ const self = this;
375
+ const constructs = this.parser.constructs[field];
376
+ const text3 = effects.attempt(constructs, start, notText);
377
+ return start;
378
+ function start(code) {
379
+ return atBreak(code) ? text3(code) : notText(code);
380
+ }
381
+ __name(start, "start");
382
+ function notText(code) {
383
+ if (code === null) {
384
+ effects.consume(code);
385
+ return;
386
+ }
387
+ effects.enter("data");
388
+ effects.consume(code);
389
+ return data;
390
+ }
391
+ __name(notText, "notText");
392
+ function data(code) {
393
+ if (atBreak(code)) {
394
+ effects.exit("data");
395
+ return text3(code);
396
+ }
397
+ effects.consume(code);
398
+ return data;
399
+ }
400
+ __name(data, "data");
401
+ function atBreak(code) {
402
+ if (code === null) {
403
+ return true;
404
+ }
405
+ const list2 = constructs[code];
406
+ let index = -1;
407
+ if (list2) {
408
+ while (++index < list2.length) {
409
+ const item = list2[index];
410
+ if (!item.previous || item.previous.call(self, self.previous)) {
411
+ return true;
412
+ }
413
+ }
414
+ }
415
+ return false;
416
+ }
417
+ __name(atBreak, "atBreak");
418
+ }
419
+ __name(initializeText, "initializeText");
420
+ }
421
+ __name(initializeFactory, "initializeFactory");
422
+ function createResolver(extraResolver) {
423
+ return resolveAllText;
424
+ function resolveAllText(events, context) {
425
+ let index = -1;
426
+ let enter;
427
+ while (++index <= events.length) {
428
+ if (enter === void 0) {
429
+ if (events[index] && events[index][1].type === "data") {
430
+ enter = index;
431
+ index++;
432
+ }
433
+ } else if (!events[index] || events[index][1].type !== "data") {
434
+ if (index !== enter + 2) {
435
+ events[enter][1].end = events[index - 1][1].end;
436
+ events.splice(enter + 2, index - enter - 2);
437
+ index = enter + 2;
438
+ }
439
+ enter = void 0;
440
+ }
441
+ }
442
+ return extraResolver ? extraResolver(events, context) : events;
443
+ }
444
+ __name(resolveAllText, "resolveAllText");
445
+ }
446
+ __name(createResolver, "createResolver");
447
+ function resolveAllLineSuffixes(events, context) {
448
+ const editMap = new EditMap();
449
+ let eventIndex = 0;
450
+ while (++eventIndex <= events.length) {
451
+ if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") {
452
+ const data = events[eventIndex - 1][1];
453
+ const chunks = context.sliceStream(data);
454
+ let index = chunks.length;
455
+ let bufferIndex = -1;
456
+ let size = 0;
457
+ let tabs;
458
+ while (index--) {
459
+ const chunk = chunks[index];
460
+ if (typeof chunk === "string") {
461
+ bufferIndex = chunk.length;
462
+ while (chunk.charCodeAt(bufferIndex - 1) === 32) {
463
+ size++;
464
+ bufferIndex--;
465
+ }
466
+ if (bufferIndex) {
467
+ break;
468
+ }
469
+ bufferIndex = -1;
470
+ } else if (chunk === -2) {
471
+ tabs = true;
472
+ size++;
473
+ } else if (chunk === -1) {
474
+ } else {
475
+ index++;
476
+ break;
477
+ }
478
+ }
479
+ if (context._contentTypeTextTrailing && eventIndex === events.length) {
480
+ size = 0;
481
+ }
482
+ if (size) {
483
+ const token = {
484
+ type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing",
485
+ start: {
486
+ _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,
487
+ _index: data.start._index + index,
488
+ line: data.end.line,
489
+ column: data.end.column - size,
490
+ offset: data.end.offset - size
491
+ },
492
+ end: {
493
+ ...data.end
494
+ }
495
+ };
496
+ data.end = {
497
+ ...token.start
498
+ };
499
+ if (data.start.offset === data.end.offset) {
500
+ Object.assign(data, token);
501
+ } else {
502
+ editMap.add(eventIndex, 0, [["enter", token, context], ["exit", token, context]]);
503
+ }
504
+ }
505
+ eventIndex++;
506
+ }
507
+ }
508
+ editMap.consume(events);
509
+ return events;
510
+ }
511
+ __name(resolveAllLineSuffixes, "resolveAllLineSuffixes");
512
+
513
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/constructs.js
514
+ var constructs_exports = {};
515
+ __export(constructs_exports, {
516
+ attentionMarkers: () => attentionMarkers,
517
+ contentInitial: () => contentInitial,
518
+ disable: () => disable,
519
+ document: () => document2,
520
+ flow: () => flow2,
521
+ flowInitial: () => flowInitial,
522
+ insideSpan: () => insideSpan,
523
+ string: () => string2,
524
+ text: () => text2
525
+ });
526
+ var document2 = {
527
+ [42]: list,
528
+ [43]: list,
529
+ [45]: list,
530
+ [48]: list,
531
+ [49]: list,
532
+ [50]: list,
533
+ [51]: list,
534
+ [52]: list,
535
+ [53]: list,
536
+ [54]: list,
537
+ [55]: list,
538
+ [56]: list,
539
+ [57]: list,
540
+ [62]: blockQuote
541
+ };
542
+ var contentInitial = {
543
+ [91]: definition
544
+ };
545
+ var flowInitial = {
546
+ [-2]: codeIndented,
547
+ [-1]: codeIndented,
548
+ [32]: codeIndented
549
+ };
550
+ var flow2 = {
551
+ [35]: headingAtx,
552
+ [42]: thematicBreak,
553
+ [45]: [setextUnderline, thematicBreak],
554
+ [60]: htmlFlow,
555
+ [61]: setextUnderline,
556
+ [95]: thematicBreak,
557
+ [96]: codeFenced,
558
+ [126]: codeFenced
559
+ };
560
+ var string2 = {
561
+ [38]: characterReference,
562
+ [92]: characterEscape
563
+ };
564
+ var text2 = {
565
+ [-5]: lineEnding,
566
+ [-4]: lineEnding,
567
+ [-3]: lineEnding,
568
+ [33]: labelStartImage,
569
+ [38]: characterReference,
570
+ [42]: attention,
571
+ [60]: [autolink, htmlText],
572
+ [91]: labelStartLink,
573
+ [92]: [hardBreakEscape, characterEscape],
574
+ [93]: labelEnd,
575
+ [95]: attention,
576
+ [96]: codeText
577
+ };
578
+ var insideSpan = {
579
+ null: [attention, resolver]
580
+ };
581
+ var attentionMarkers = {
582
+ null: [42, 95]
583
+ };
584
+ var disable = {
585
+ null: []
586
+ };
587
+
588
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/create-tokenizer.js
589
+ function createTokenizer(parser, initialize, from) {
590
+ let point2 = {
591
+ _bufferIndex: -1,
592
+ _index: 0,
593
+ line: from && from.line || 1,
594
+ column: from && from.column || 1,
595
+ offset: from && from.offset || 0
596
+ };
597
+ const columnStart = {};
598
+ const resolveAllConstructs = [];
599
+ let chunks = [];
600
+ let stack = [];
601
+ let consumed = true;
602
+ const effects = {
603
+ attempt: constructFactory(onsuccessfulconstruct),
604
+ check: constructFactory(onsuccessfulcheck),
605
+ consume,
606
+ enter,
607
+ exit,
608
+ interrupt: constructFactory(onsuccessfulcheck, {
609
+ interrupt: true
610
+ })
611
+ };
612
+ const context = {
613
+ code: null,
614
+ containerState: {},
615
+ defineSkip,
616
+ events: [],
617
+ now,
618
+ parser,
619
+ previous: null,
620
+ sliceSerialize,
621
+ sliceStream,
622
+ write
623
+ };
624
+ let state = initialize.tokenize.call(context, effects);
625
+ let expectedCode;
626
+ if (initialize.resolveAll) {
627
+ resolveAllConstructs.push(initialize);
628
+ }
629
+ return context;
630
+ function write(slice) {
631
+ chunks = push(chunks, slice);
632
+ main();
633
+ if (chunks[chunks.length - 1] !== null) {
634
+ return [];
635
+ }
636
+ addResult(initialize, 0);
637
+ context.events = resolveAll(resolveAllConstructs, context.events, context);
638
+ return context.events;
639
+ }
640
+ __name(write, "write");
641
+ function sliceSerialize(token, expandTabs) {
642
+ return serializeChunks(sliceStream(token), expandTabs);
643
+ }
644
+ __name(sliceSerialize, "sliceSerialize");
645
+ function sliceStream(token) {
646
+ return sliceChunks(chunks, token);
647
+ }
648
+ __name(sliceStream, "sliceStream");
649
+ function now() {
650
+ const {
651
+ _bufferIndex,
652
+ _index,
653
+ line,
654
+ column,
655
+ offset
656
+ } = point2;
657
+ return {
658
+ _bufferIndex,
659
+ _index,
660
+ line,
661
+ column,
662
+ offset
663
+ };
664
+ }
665
+ __name(now, "now");
666
+ function defineSkip(value) {
667
+ columnStart[value.line] = value.column;
668
+ accountForPotentialSkip();
669
+ }
670
+ __name(defineSkip, "defineSkip");
671
+ function main() {
672
+ while (point2._index < chunks.length) {
673
+ const chunk = chunks[point2._index];
674
+ if (typeof chunk === "string") {
675
+ const chunkIndex = point2._index;
676
+ if (point2._bufferIndex < 0) {
677
+ point2._bufferIndex = 0;
678
+ }
679
+ while (point2._index === chunkIndex && point2._bufferIndex < chunk.length) {
680
+ go(chunk.charCodeAt(point2._bufferIndex));
681
+ }
682
+ } else {
683
+ go(chunk);
684
+ }
685
+ }
686
+ }
687
+ __name(main, "main");
688
+ function go(code) {
689
+ consumed = void 0;
690
+ expectedCode = code;
691
+ state = state(code);
692
+ }
693
+ __name(go, "go");
694
+ function consume(code) {
695
+ if (markdownLineEnding(code)) {
696
+ point2.line++;
697
+ point2.column = 1;
698
+ point2.offset += code === -3 ? 2 : 1;
699
+ accountForPotentialSkip();
700
+ } else if (code !== -1) {
701
+ point2.column++;
702
+ point2.offset++;
703
+ }
704
+ if (point2._bufferIndex < 0) {
705
+ point2._index++;
706
+ } else {
707
+ point2._bufferIndex++;
708
+ if (point2._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
709
+ // strings.
710
+ /** @type {string} */
711
+ chunks[point2._index].length) {
712
+ point2._bufferIndex = -1;
713
+ point2._index++;
714
+ }
715
+ }
716
+ context.previous = code;
717
+ consumed = true;
718
+ }
719
+ __name(consume, "consume");
720
+ function enter(type, fields) {
721
+ const token = fields || {};
722
+ token.type = type;
723
+ token.start = now();
724
+ context.events.push(["enter", token, context]);
725
+ stack.push(token);
726
+ return token;
727
+ }
728
+ __name(enter, "enter");
729
+ function exit(type) {
730
+ const token = stack.pop();
731
+ token.end = now();
732
+ context.events.push(["exit", token, context]);
733
+ return token;
734
+ }
735
+ __name(exit, "exit");
736
+ function onsuccessfulconstruct(construct, info) {
737
+ addResult(construct, info.from);
738
+ }
739
+ __name(onsuccessfulconstruct, "onsuccessfulconstruct");
740
+ function onsuccessfulcheck(_, info) {
741
+ info.restore();
742
+ }
743
+ __name(onsuccessfulcheck, "onsuccessfulcheck");
744
+ function constructFactory(onreturn, fields) {
745
+ return hook;
746
+ function hook(constructs, returnState, bogusState) {
747
+ let listOfConstructs;
748
+ let constructIndex;
749
+ let currentConstruct;
750
+ let info;
751
+ return Array.isArray(constructs) ? (
752
+ /* c8 ignore next 1 */
753
+ handleListOfConstructs(constructs)
754
+ ) : "tokenize" in constructs ? (
755
+ // Looks like a construct.
756
+ handleListOfConstructs([
757
+ /** @type {Construct} */
758
+ constructs
759
+ ])
760
+ ) : handleMapOfConstructs(constructs);
761
+ function handleMapOfConstructs(map) {
762
+ return start;
763
+ function start(code) {
764
+ const left = code !== null && map[code];
765
+ const all = code !== null && map.null;
766
+ const list2 = [
767
+ // To do: add more extension tests.
768
+ /* c8 ignore next 2 */
769
+ ...Array.isArray(left) ? left : left ? [left] : [],
770
+ ...Array.isArray(all) ? all : all ? [all] : []
771
+ ];
772
+ return handleListOfConstructs(list2)(code);
773
+ }
774
+ __name(start, "start");
775
+ }
776
+ __name(handleMapOfConstructs, "handleMapOfConstructs");
777
+ function handleListOfConstructs(list2) {
778
+ listOfConstructs = list2;
779
+ constructIndex = 0;
780
+ if (list2.length === 0) {
781
+ return bogusState;
782
+ }
783
+ return handleConstruct(list2[constructIndex]);
784
+ }
785
+ __name(handleListOfConstructs, "handleListOfConstructs");
786
+ function handleConstruct(construct) {
787
+ return start;
788
+ function start(code) {
789
+ info = store();
790
+ currentConstruct = construct;
791
+ if (!construct.partial) {
792
+ context.currentConstruct = construct;
793
+ }
794
+ if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {
795
+ return nok(code);
796
+ }
797
+ return construct.tokenize.call(
798
+ // If we do have fields, create an object w/ `context` as its
799
+ // prototype.
800
+ // This allows a “live binding”, which is needed for `interrupt`.
801
+ fields ? Object.assign(Object.create(context), fields) : context,
802
+ effects,
803
+ ok,
804
+ nok
805
+ )(code);
806
+ }
807
+ __name(start, "start");
808
+ }
809
+ __name(handleConstruct, "handleConstruct");
810
+ function ok(code) {
811
+ consumed = true;
812
+ onreturn(currentConstruct, info);
813
+ return returnState;
814
+ }
815
+ __name(ok, "ok");
816
+ function nok(code) {
817
+ consumed = true;
818
+ info.restore();
819
+ if (++constructIndex < listOfConstructs.length) {
820
+ return handleConstruct(listOfConstructs[constructIndex]);
821
+ }
822
+ return bogusState;
823
+ }
824
+ __name(nok, "nok");
825
+ }
826
+ __name(hook, "hook");
827
+ }
828
+ __name(constructFactory, "constructFactory");
829
+ function addResult(construct, from2) {
830
+ if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {
831
+ resolveAllConstructs.push(construct);
832
+ }
833
+ if (construct.resolve) {
834
+ splice(context.events, from2, context.events.length - from2, construct.resolve(context.events.slice(from2), context));
835
+ }
836
+ if (construct.resolveTo) {
837
+ context.events = construct.resolveTo(context.events, context);
838
+ }
839
+ }
840
+ __name(addResult, "addResult");
841
+ function store() {
842
+ const startPoint = now();
843
+ const startPrevious = context.previous;
844
+ const startCurrentConstruct = context.currentConstruct;
845
+ const startEventsIndex = context.events.length;
846
+ const startStack = Array.from(stack);
847
+ return {
848
+ from: startEventsIndex,
849
+ restore
850
+ };
851
+ function restore() {
852
+ point2 = startPoint;
853
+ context.previous = startPrevious;
854
+ context.currentConstruct = startCurrentConstruct;
855
+ context.events.length = startEventsIndex;
856
+ stack = startStack;
857
+ accountForPotentialSkip();
858
+ }
859
+ __name(restore, "restore");
860
+ }
861
+ __name(store, "store");
862
+ function accountForPotentialSkip() {
863
+ if (point2.line in columnStart && point2.column < 2) {
864
+ point2.column = columnStart[point2.line];
865
+ point2.offset += columnStart[point2.line] - 1;
866
+ }
867
+ }
868
+ __name(accountForPotentialSkip, "accountForPotentialSkip");
869
+ }
870
+ __name(createTokenizer, "createTokenizer");
871
+ function sliceChunks(chunks, token) {
872
+ const startIndex = token.start._index;
873
+ const startBufferIndex = token.start._bufferIndex;
874
+ const endIndex = token.end._index;
875
+ const endBufferIndex = token.end._bufferIndex;
876
+ let view;
877
+ if (startIndex === endIndex) {
878
+ view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];
879
+ } else {
880
+ view = chunks.slice(startIndex, endIndex);
881
+ if (startBufferIndex > -1) {
882
+ const head = view[0];
883
+ if (typeof head === "string") {
884
+ view[0] = head.slice(startBufferIndex);
885
+ } else {
886
+ view.shift();
887
+ }
888
+ }
889
+ if (endBufferIndex > 0) {
890
+ view.push(chunks[endIndex].slice(0, endBufferIndex));
891
+ }
892
+ }
893
+ return view;
894
+ }
895
+ __name(sliceChunks, "sliceChunks");
896
+ function serializeChunks(chunks, expandTabs) {
897
+ let index = -1;
898
+ const result = [];
899
+ let atTab;
900
+ while (++index < chunks.length) {
901
+ const chunk = chunks[index];
902
+ let value;
903
+ if (typeof chunk === "string") {
904
+ value = chunk;
905
+ } else {
906
+ switch (chunk) {
907
+ case -5: {
908
+ value = "\r";
909
+ break;
910
+ }
911
+ case -4: {
912
+ value = "\n";
913
+ break;
914
+ }
915
+ case -3: {
916
+ value = "\r\n";
917
+ break;
918
+ }
919
+ case -2: {
920
+ value = expandTabs ? " " : " ";
921
+ break;
922
+ }
923
+ case -1: {
924
+ if (!expandTabs && atTab) {
925
+ continue;
926
+ }
927
+ value = " ";
928
+ break;
929
+ }
930
+ default: {
931
+ value = String.fromCharCode(chunk);
932
+ }
933
+ }
934
+ }
935
+ atTab = chunk === -2;
936
+ result.push(value);
937
+ }
938
+ return result.join("");
939
+ }
940
+ __name(serializeChunks, "serializeChunks");
941
+
942
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/parse.js
943
+ function parse(options) {
944
+ const settings = options || {};
945
+ const constructs = (
946
+ /** @type {FullNormalizedExtension} */
947
+ combineExtensions([constructs_exports, ...settings.extensions || []])
948
+ );
949
+ const parser = {
950
+ constructs,
951
+ content: create(content2),
952
+ defined: [],
953
+ document: create(document),
954
+ flow: create(flow),
955
+ lazy: {},
956
+ string: create(string),
957
+ text: create(text)
958
+ };
959
+ return parser;
960
+ function create(initial) {
961
+ return creator;
962
+ function creator(from) {
963
+ return createTokenizer(parser, initial, from);
964
+ }
965
+ __name(creator, "creator");
966
+ }
967
+ __name(create, "create");
968
+ }
969
+ __name(parse, "parse");
970
+
971
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/postprocess.js
972
+ function postprocess(events) {
973
+ while (!subtokenize(events)) {
974
+ }
975
+ return events;
976
+ }
977
+ __name(postprocess, "postprocess");
978
+
979
+ // node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/preprocess.js
980
+ var search = /[\0\t\n\r]/g;
981
+ function preprocess() {
982
+ let column = 1;
983
+ let buffer = "";
984
+ let start = true;
985
+ let atCarriageReturn;
986
+ return preprocessor;
987
+ function preprocessor(value, encoding, end) {
988
+ value = buffer + (typeof value === "string" ? value.toString() : new TextDecoder(encoding || void 0).decode(value));
989
+ const chunks = [];
990
+ let startPosition = 0;
991
+ buffer = "";
992
+ if (start) {
993
+ if (value.charCodeAt(0) === 65279) {
994
+ startPosition++;
995
+ }
996
+ start = void 0;
997
+ }
998
+ while (startPosition < value.length) {
999
+ search.lastIndex = startPosition;
1000
+ const match = search.exec(value);
1001
+ const endPosition = match && match.index !== void 0 ? match.index : value.length;
1002
+ const code = value.charCodeAt(endPosition);
1003
+ if (!match) {
1004
+ buffer = value.slice(startPosition);
1005
+ break;
1006
+ }
1007
+ if (code === 10 && startPosition === endPosition && atCarriageReturn) {
1008
+ chunks.push(-3);
1009
+ atCarriageReturn = void 0;
1010
+ } else {
1011
+ if (atCarriageReturn) {
1012
+ chunks.push(-5);
1013
+ atCarriageReturn = void 0;
1014
+ }
1015
+ if (startPosition < endPosition) {
1016
+ chunks.push(value.slice(startPosition, endPosition));
1017
+ column += endPosition - startPosition;
1018
+ }
1019
+ switch (code) {
1020
+ case 0: {
1021
+ chunks.push(65533);
1022
+ column++;
1023
+ break;
1024
+ }
1025
+ case 9: {
1026
+ const next = Math.ceil(column / 4) * 4;
1027
+ chunks.push(-2);
1028
+ while (column++ < next) {
1029
+ chunks.push(-1);
1030
+ }
1031
+ break;
1032
+ }
1033
+ case 10: {
1034
+ chunks.push(-4);
1035
+ column = 1;
1036
+ break;
1037
+ }
1038
+ default: {
1039
+ atCarriageReturn = true;
1040
+ column = 1;
1041
+ }
1042
+ }
1043
+ }
1044
+ startPosition = endPosition + 1;
1045
+ }
1046
+ if (end) {
1047
+ if (atCarriageReturn) {
1048
+ chunks.push(-5);
1049
+ }
1050
+ if (buffer) {
1051
+ chunks.push(buffer);
1052
+ }
1053
+ chunks.push(null);
1054
+ }
1055
+ return chunks;
1056
+ }
1057
+ __name(preprocessor, "preprocessor");
1058
+ }
1059
+ __name(preprocess, "preprocess");
1060
+
1061
+ // node_modules/.pnpm/mdast-util-from-markdown@2.1.0/node_modules/mdast-util-from-markdown/lib/index.js
1062
+ var own = {}.hasOwnProperty;
1063
+ function fromMarkdown(value, encoding, options) {
1064
+ if (encoding && typeof encoding === "object") {
1065
+ options = encoding;
1066
+ encoding = void 0;
1067
+ }
1068
+ return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));
1069
+ }
1070
+ __name(fromMarkdown, "fromMarkdown");
1071
+ function compiler(options) {
1072
+ const config = {
1073
+ afterExit: [],
1074
+ beforeEnter: [],
1075
+ transforms: [],
1076
+ canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
1077
+ enter: {
1078
+ autolink: opener(link),
1079
+ autolinkProtocol: onenterdata,
1080
+ autolinkEmail: onenterdata,
1081
+ atxHeading: opener(heading),
1082
+ blockQuote: opener(blockQuote2),
1083
+ characterEscape: onenterdata,
1084
+ characterReference: onenterdata,
1085
+ codeFenced: opener(codeFlow),
1086
+ codeFencedFenceInfo: buffer,
1087
+ codeFencedFenceMeta: buffer,
1088
+ codeIndented: opener(codeFlow, buffer),
1089
+ codeText: opener(codeText2, buffer),
1090
+ codeTextData: onenterdata,
1091
+ data: onenterdata,
1092
+ codeFlowValue: onenterdata,
1093
+ definition: opener(definition2),
1094
+ definitionDestinationString: buffer,
1095
+ definitionLabelString: buffer,
1096
+ definitionTitleString: buffer,
1097
+ emphasis: opener(emphasis),
1098
+ hardBreakEscape: opener(hardBreak),
1099
+ hardBreakTrailing: opener(hardBreak),
1100
+ htmlFlow: opener(html, buffer),
1101
+ htmlFlowData: onenterdata,
1102
+ htmlText: opener(html, buffer),
1103
+ htmlTextData: onenterdata,
1104
+ image: opener(image),
1105
+ label: buffer,
1106
+ link: opener(link),
1107
+ listItem: opener(listItem),
1108
+ listItemValue: onenterlistitemvalue,
1109
+ listOrdered: opener(list2, onenterlistordered),
1110
+ listUnordered: opener(list2),
1111
+ paragraph: opener(paragraph),
1112
+ reference: onenterreference,
1113
+ referenceString: buffer,
1114
+ resourceDestinationString: buffer,
1115
+ resourceTitleString: buffer,
1116
+ setextHeading: opener(heading),
1117
+ strong: opener(strong),
1118
+ thematicBreak: opener(thematicBreak2)
1119
+ },
1120
+ exit: {
1121
+ atxHeading: closer(),
1122
+ atxHeadingSequence: onexitatxheadingsequence,
1123
+ autolink: closer(),
1124
+ autolinkEmail: onexitautolinkemail,
1125
+ autolinkProtocol: onexitautolinkprotocol,
1126
+ blockQuote: closer(),
1127
+ characterEscapeValue: onexitdata,
1128
+ characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
1129
+ characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
1130
+ characterReferenceValue: onexitcharacterreferencevalue,
1131
+ characterReference: onexitcharacterreference,
1132
+ codeFenced: closer(onexitcodefenced),
1133
+ codeFencedFence: onexitcodefencedfence,
1134
+ codeFencedFenceInfo: onexitcodefencedfenceinfo,
1135
+ codeFencedFenceMeta: onexitcodefencedfencemeta,
1136
+ codeFlowValue: onexitdata,
1137
+ codeIndented: closer(onexitcodeindented),
1138
+ codeText: closer(onexitcodetext),
1139
+ codeTextData: onexitdata,
1140
+ data: onexitdata,
1141
+ definition: closer(),
1142
+ definitionDestinationString: onexitdefinitiondestinationstring,
1143
+ definitionLabelString: onexitdefinitionlabelstring,
1144
+ definitionTitleString: onexitdefinitiontitlestring,
1145
+ emphasis: closer(),
1146
+ hardBreakEscape: closer(onexithardbreak),
1147
+ hardBreakTrailing: closer(onexithardbreak),
1148
+ htmlFlow: closer(onexithtmlflow),
1149
+ htmlFlowData: onexitdata,
1150
+ htmlText: closer(onexithtmltext),
1151
+ htmlTextData: onexitdata,
1152
+ image: closer(onexitimage),
1153
+ label: onexitlabel,
1154
+ labelText: onexitlabeltext,
1155
+ lineEnding: onexitlineending,
1156
+ link: closer(onexitlink),
1157
+ listItem: closer(),
1158
+ listOrdered: closer(),
1159
+ listUnordered: closer(),
1160
+ paragraph: closer(),
1161
+ referenceString: onexitreferencestring,
1162
+ resourceDestinationString: onexitresourcedestinationstring,
1163
+ resourceTitleString: onexitresourcetitlestring,
1164
+ resource: onexitresource,
1165
+ setextHeading: closer(onexitsetextheading),
1166
+ setextHeadingLineSequence: onexitsetextheadinglinesequence,
1167
+ setextHeadingText: onexitsetextheadingtext,
1168
+ strong: closer(),
1169
+ thematicBreak: closer()
1170
+ }
1171
+ };
1172
+ configure(config, (options || {}).mdastExtensions || []);
1173
+ const data = {};
1174
+ return compile;
1175
+ function compile(events) {
1176
+ let tree = {
1177
+ type: "root",
1178
+ children: [],
1179
+ position: void 0
1180
+ };
1181
+ const context = {
1182
+ stack: [tree],
1183
+ tokenStack: [],
1184
+ config,
1185
+ enter,
1186
+ exit,
1187
+ buffer,
1188
+ resume,
1189
+ data
1190
+ };
1191
+ const listStack = [];
1192
+ const prepared = [];
1193
+ let index = -1;
1194
+ while (++index < events.length) {
1195
+ prepared.push(events[index]);
1196
+ if (events[index][1].type === "listOrdered" || events[index][1].type === "listUnordered") {
1197
+ if (events[index][0] === "enter") {
1198
+ listStack.push(prepared.length - 1);
1199
+ } else {
1200
+ const tail = listStack.pop();
1201
+ prepareList(prepared, tail);
1202
+ }
1203
+ }
1204
+ }
1205
+ events = prepared;
1206
+ index = -1;
1207
+ while (++index < events.length) {
1208
+ const handler = config[events[index][0]];
1209
+ if (events[index][0] === "enter" && config.beforeEnter.length > 0) {
1210
+ callListeners(config.beforeEnter, {
1211
+ ...context,
1212
+ sliceSerialize: events[index][2].sliceSerialize
1213
+ }, events[index][1]);
1214
+ }
1215
+ if (own.call(handler, events[index][1].type)) {
1216
+ handler[events[index][1].type].call({
1217
+ ...context,
1218
+ sliceSerialize: events[index][2].sliceSerialize
1219
+ }, events[index][1]);
1220
+ }
1221
+ if (events[index][0] === "exit" && config.afterExit.length > 0) {
1222
+ callListeners(config.afterExit, {
1223
+ ...context,
1224
+ sliceSerialize: events[index][2].sliceSerialize
1225
+ }, events[index][1]);
1226
+ }
1227
+ }
1228
+ if (context.tokenStack.length > 0) {
1229
+ const tail = context.tokenStack[context.tokenStack.length - 1];
1230
+ const handler = tail[1] || defaultOnError;
1231
+ handler.call(context, void 0, tail[0]);
1232
+ }
1233
+ tree.position = {
1234
+ start: point(events.length > 0 ? events[0][1].start : {
1235
+ line: 1,
1236
+ column: 1,
1237
+ offset: 0
1238
+ }),
1239
+ end: point(events.length > 0 ? events[events.length - 2][1].end : {
1240
+ line: 1,
1241
+ column: 1,
1242
+ offset: 0
1243
+ })
1244
+ };
1245
+ index = -1;
1246
+ while (++index < config.transforms.length) {
1247
+ tree = config.transforms[index](tree) || tree;
1248
+ }
1249
+ return tree;
1250
+ }
1251
+ __name(compile, "compile");
1252
+ function callListeners(listeners, context, token) {
1253
+ let index = -1;
1254
+ while (++index < listeners.length) {
1255
+ listeners[index].call(context, token);
1256
+ }
1257
+ }
1258
+ __name(callListeners, "callListeners");
1259
+ function prepareList(events, start) {
1260
+ const end = events.length - 1;
1261
+ let index = start - 1;
1262
+ let containerBalance = -1;
1263
+ let listSpread = false;
1264
+ let listItem2;
1265
+ let lineIndex;
1266
+ let firstBlankLineIndex;
1267
+ let atMarker;
1268
+ const insertions = [];
1269
+ while (++index <= end) {
1270
+ const event = events[index];
1271
+ switch (event[1].type) {
1272
+ case "listUnordered":
1273
+ case "listOrdered":
1274
+ case "blockQuote": {
1275
+ if (event[0] === "enter") {
1276
+ containerBalance++;
1277
+ } else {
1278
+ containerBalance--;
1279
+ }
1280
+ atMarker = void 0;
1281
+ break;
1282
+ }
1283
+ case "lineEndingBlank": {
1284
+ if (event[0] === "enter") {
1285
+ if (listItem2 && !atMarker && !containerBalance && !firstBlankLineIndex) {
1286
+ firstBlankLineIndex = index;
1287
+ }
1288
+ atMarker = void 0;
1289
+ }
1290
+ break;
1291
+ }
1292
+ case "linePrefix":
1293
+ case "listItemValue":
1294
+ case "listItemMarker":
1295
+ case "listItemPrefix":
1296
+ case "listItemPrefixWhitespace": {
1297
+ break;
1298
+ }
1299
+ default: {
1300
+ atMarker = void 0;
1301
+ }
1302
+ }
1303
+ if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) {
1304
+ if (listItem2) {
1305
+ let tailIndex = index;
1306
+ lineIndex = void 0;
1307
+ while (tailIndex--) {
1308
+ const tailEvent = events[tailIndex];
1309
+ if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") {
1310
+ if (tailEvent[0] === "exit") continue;
1311
+ if (lineIndex) {
1312
+ events[lineIndex][1].type = "lineEndingBlank";
1313
+ listSpread = true;
1314
+ }
1315
+ tailEvent[1].type = "lineEnding";
1316
+ lineIndex = tailIndex;
1317
+ } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") {
1318
+ } else {
1319
+ break;
1320
+ }
1321
+ }
1322
+ if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {
1323
+ listItem2._spread = true;
1324
+ }
1325
+ listItem2.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);
1326
+ insertions.push({
1327
+ at: lineIndex || index,
1328
+ event: ["exit", listItem2, event[2]]
1329
+ });
1330
+ }
1331
+ if (event[1].type === "listItemPrefix") {
1332
+ const item = {
1333
+ type: "listItem",
1334
+ _spread: false,
1335
+ start: Object.assign({}, event[1].start),
1336
+ // @ts-expect-error: we’ll add `end` in a second.
1337
+ end: void 0
1338
+ };
1339
+ listItem2 = item;
1340
+ insertions.push({
1341
+ at: index,
1342
+ event: ["enter", item, event[2]]
1343
+ });
1344
+ firstBlankLineIndex = void 0;
1345
+ atMarker = true;
1346
+ }
1347
+ }
1348
+ }
1349
+ const listEvents = events.splice(start);
1350
+ let insertion = 0;
1351
+ index = -1;
1352
+ while (++index < listEvents.length) {
1353
+ while (insertion < insertions.length && insertions[insertion].at === start + index) {
1354
+ events.push(insertions[insertion++].event);
1355
+ }
1356
+ events.push(listEvents[index]);
1357
+ }
1358
+ events[start][1]._spread = listSpread;
1359
+ }
1360
+ __name(prepareList, "prepareList");
1361
+ function opener(create, and) {
1362
+ return open;
1363
+ function open(token) {
1364
+ enter.call(this, create(token), token);
1365
+ if (and) and.call(this, token);
1366
+ }
1367
+ __name(open, "open");
1368
+ }
1369
+ __name(opener, "opener");
1370
+ function buffer() {
1371
+ this.stack.push({
1372
+ type: "fragment",
1373
+ children: []
1374
+ });
1375
+ }
1376
+ __name(buffer, "buffer");
1377
+ function enter(node, token, errorHandler) {
1378
+ const parent = this.stack[this.stack.length - 1];
1379
+ const siblings = parent.children;
1380
+ siblings.push(node);
1381
+ this.stack.push(node);
1382
+ this.tokenStack.push([token, errorHandler || void 0]);
1383
+ node.position = {
1384
+ start: point(token.start),
1385
+ // @ts-expect-error: `end` will be patched later.
1386
+ end: void 0
1387
+ };
1388
+ }
1389
+ __name(enter, "enter");
1390
+ function closer(and) {
1391
+ return close;
1392
+ function close(token) {
1393
+ if (and) and.call(this, token);
1394
+ exit.call(this, token);
1395
+ }
1396
+ __name(close, "close");
1397
+ }
1398
+ __name(closer, "closer");
1399
+ function exit(token, onExitError) {
1400
+ const node = this.stack.pop();
1401
+ const open = this.tokenStack.pop();
1402
+ if (!open) {
1403
+ throw new Error("Cannot close `" + token.type + "` (" + stringifyPosition({
1404
+ start: token.start,
1405
+ end: token.end
1406
+ }) + "): it\u2019s not open");
1407
+ }
1408
+ if (open[0].type !== token.type) {
1409
+ if (onExitError) {
1410
+ onExitError.call(this, token, open[0]);
1411
+ } else {
1412
+ const handler = open[1] || defaultOnError;
1413
+ handler.call(this, token, open[0]);
1414
+ }
1415
+ }
1416
+ node.position.end = point(token.end);
1417
+ }
1418
+ __name(exit, "exit");
1419
+ function resume() {
1420
+ return toString(this.stack.pop());
1421
+ }
1422
+ __name(resume, "resume");
1423
+ function onenterlistordered() {
1424
+ this.data.expectingFirstListItemValue = true;
1425
+ }
1426
+ __name(onenterlistordered, "onenterlistordered");
1427
+ function onenterlistitemvalue(token) {
1428
+ if (this.data.expectingFirstListItemValue) {
1429
+ const ancestor = this.stack[this.stack.length - 2];
1430
+ ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);
1431
+ this.data.expectingFirstListItemValue = void 0;
1432
+ }
1433
+ }
1434
+ __name(onenterlistitemvalue, "onenterlistitemvalue");
1435
+ function onexitcodefencedfenceinfo() {
1436
+ const data2 = this.resume();
1437
+ const node = this.stack[this.stack.length - 1];
1438
+ node.lang = data2;
1439
+ }
1440
+ __name(onexitcodefencedfenceinfo, "onexitcodefencedfenceinfo");
1441
+ function onexitcodefencedfencemeta() {
1442
+ const data2 = this.resume();
1443
+ const node = this.stack[this.stack.length - 1];
1444
+ node.meta = data2;
1445
+ }
1446
+ __name(onexitcodefencedfencemeta, "onexitcodefencedfencemeta");
1447
+ function onexitcodefencedfence() {
1448
+ if (this.data.flowCodeInside) return;
1449
+ this.buffer();
1450
+ this.data.flowCodeInside = true;
1451
+ }
1452
+ __name(onexitcodefencedfence, "onexitcodefencedfence");
1453
+ function onexitcodefenced() {
1454
+ const data2 = this.resume();
1455
+ const node = this.stack[this.stack.length - 1];
1456
+ node.value = data2.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, "");
1457
+ this.data.flowCodeInside = void 0;
1458
+ }
1459
+ __name(onexitcodefenced, "onexitcodefenced");
1460
+ function onexitcodeindented() {
1461
+ const data2 = this.resume();
1462
+ const node = this.stack[this.stack.length - 1];
1463
+ node.value = data2.replace(/(\r?\n|\r)$/g, "");
1464
+ }
1465
+ __name(onexitcodeindented, "onexitcodeindented");
1466
+ function onexitdefinitionlabelstring(token) {
1467
+ const label = this.resume();
1468
+ const node = this.stack[this.stack.length - 1];
1469
+ node.label = label;
1470
+ node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
1471
+ }
1472
+ __name(onexitdefinitionlabelstring, "onexitdefinitionlabelstring");
1473
+ function onexitdefinitiontitlestring() {
1474
+ const data2 = this.resume();
1475
+ const node = this.stack[this.stack.length - 1];
1476
+ node.title = data2;
1477
+ }
1478
+ __name(onexitdefinitiontitlestring, "onexitdefinitiontitlestring");
1479
+ function onexitdefinitiondestinationstring() {
1480
+ const data2 = this.resume();
1481
+ const node = this.stack[this.stack.length - 1];
1482
+ node.url = data2;
1483
+ }
1484
+ __name(onexitdefinitiondestinationstring, "onexitdefinitiondestinationstring");
1485
+ function onexitatxheadingsequence(token) {
1486
+ const node = this.stack[this.stack.length - 1];
1487
+ if (!node.depth) {
1488
+ const depth = this.sliceSerialize(token).length;
1489
+ node.depth = depth;
1490
+ }
1491
+ }
1492
+ __name(onexitatxheadingsequence, "onexitatxheadingsequence");
1493
+ function onexitsetextheadingtext() {
1494
+ this.data.setextHeadingSlurpLineEnding = true;
1495
+ }
1496
+ __name(onexitsetextheadingtext, "onexitsetextheadingtext");
1497
+ function onexitsetextheadinglinesequence(token) {
1498
+ const node = this.stack[this.stack.length - 1];
1499
+ node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;
1500
+ }
1501
+ __name(onexitsetextheadinglinesequence, "onexitsetextheadinglinesequence");
1502
+ function onexitsetextheading() {
1503
+ this.data.setextHeadingSlurpLineEnding = void 0;
1504
+ }
1505
+ __name(onexitsetextheading, "onexitsetextheading");
1506
+ function onenterdata(token) {
1507
+ const node = this.stack[this.stack.length - 1];
1508
+ const siblings = node.children;
1509
+ let tail = siblings[siblings.length - 1];
1510
+ if (!tail || tail.type !== "text") {
1511
+ tail = text3();
1512
+ tail.position = {
1513
+ start: point(token.start),
1514
+ // @ts-expect-error: we’ll add `end` later.
1515
+ end: void 0
1516
+ };
1517
+ siblings.push(tail);
1518
+ }
1519
+ this.stack.push(tail);
1520
+ }
1521
+ __name(onenterdata, "onenterdata");
1522
+ function onexitdata(token) {
1523
+ const tail = this.stack.pop();
1524
+ tail.value += this.sliceSerialize(token);
1525
+ tail.position.end = point(token.end);
1526
+ }
1527
+ __name(onexitdata, "onexitdata");
1528
+ function onexitlineending(token) {
1529
+ const context = this.stack[this.stack.length - 1];
1530
+ if (this.data.atHardBreak) {
1531
+ const tail = context.children[context.children.length - 1];
1532
+ tail.position.end = point(token.end);
1533
+ this.data.atHardBreak = void 0;
1534
+ return;
1535
+ }
1536
+ if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {
1537
+ onenterdata.call(this, token);
1538
+ onexitdata.call(this, token);
1539
+ }
1540
+ }
1541
+ __name(onexitlineending, "onexitlineending");
1542
+ function onexithardbreak() {
1543
+ this.data.atHardBreak = true;
1544
+ }
1545
+ __name(onexithardbreak, "onexithardbreak");
1546
+ function onexithtmlflow() {
1547
+ const data2 = this.resume();
1548
+ const node = this.stack[this.stack.length - 1];
1549
+ node.value = data2;
1550
+ }
1551
+ __name(onexithtmlflow, "onexithtmlflow");
1552
+ function onexithtmltext() {
1553
+ const data2 = this.resume();
1554
+ const node = this.stack[this.stack.length - 1];
1555
+ node.value = data2;
1556
+ }
1557
+ __name(onexithtmltext, "onexithtmltext");
1558
+ function onexitcodetext() {
1559
+ const data2 = this.resume();
1560
+ const node = this.stack[this.stack.length - 1];
1561
+ node.value = data2;
1562
+ }
1563
+ __name(onexitcodetext, "onexitcodetext");
1564
+ function onexitlink() {
1565
+ const node = this.stack[this.stack.length - 1];
1566
+ if (this.data.inReference) {
1567
+ const referenceType = this.data.referenceType || "shortcut";
1568
+ node.type += "Reference";
1569
+ node.referenceType = referenceType;
1570
+ delete node.url;
1571
+ delete node.title;
1572
+ } else {
1573
+ delete node.identifier;
1574
+ delete node.label;
1575
+ }
1576
+ this.data.referenceType = void 0;
1577
+ }
1578
+ __name(onexitlink, "onexitlink");
1579
+ function onexitimage() {
1580
+ const node = this.stack[this.stack.length - 1];
1581
+ if (this.data.inReference) {
1582
+ const referenceType = this.data.referenceType || "shortcut";
1583
+ node.type += "Reference";
1584
+ node.referenceType = referenceType;
1585
+ delete node.url;
1586
+ delete node.title;
1587
+ } else {
1588
+ delete node.identifier;
1589
+ delete node.label;
1590
+ }
1591
+ this.data.referenceType = void 0;
1592
+ }
1593
+ __name(onexitimage, "onexitimage");
1594
+ function onexitlabeltext(token) {
1595
+ const string3 = this.sliceSerialize(token);
1596
+ const ancestor = this.stack[this.stack.length - 2];
1597
+ ancestor.label = decodeString(string3);
1598
+ ancestor.identifier = normalizeIdentifier(string3).toLowerCase();
1599
+ }
1600
+ __name(onexitlabeltext, "onexitlabeltext");
1601
+ function onexitlabel() {
1602
+ const fragment = this.stack[this.stack.length - 1];
1603
+ const value = this.resume();
1604
+ const node = this.stack[this.stack.length - 1];
1605
+ this.data.inReference = true;
1606
+ if (node.type === "link") {
1607
+ const children = fragment.children;
1608
+ node.children = children;
1609
+ } else {
1610
+ node.alt = value;
1611
+ }
1612
+ }
1613
+ __name(onexitlabel, "onexitlabel");
1614
+ function onexitresourcedestinationstring() {
1615
+ const data2 = this.resume();
1616
+ const node = this.stack[this.stack.length - 1];
1617
+ node.url = data2;
1618
+ }
1619
+ __name(onexitresourcedestinationstring, "onexitresourcedestinationstring");
1620
+ function onexitresourcetitlestring() {
1621
+ const data2 = this.resume();
1622
+ const node = this.stack[this.stack.length - 1];
1623
+ node.title = data2;
1624
+ }
1625
+ __name(onexitresourcetitlestring, "onexitresourcetitlestring");
1626
+ function onexitresource() {
1627
+ this.data.inReference = void 0;
1628
+ }
1629
+ __name(onexitresource, "onexitresource");
1630
+ function onenterreference() {
1631
+ this.data.referenceType = "collapsed";
1632
+ }
1633
+ __name(onenterreference, "onenterreference");
1634
+ function onexitreferencestring(token) {
1635
+ const label = this.resume();
1636
+ const node = this.stack[this.stack.length - 1];
1637
+ node.label = label;
1638
+ node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
1639
+ this.data.referenceType = "full";
1640
+ }
1641
+ __name(onexitreferencestring, "onexitreferencestring");
1642
+ function onexitcharacterreferencemarker(token) {
1643
+ this.data.characterReferenceType = token.type;
1644
+ }
1645
+ __name(onexitcharacterreferencemarker, "onexitcharacterreferencemarker");
1646
+ function onexitcharacterreferencevalue(token) {
1647
+ const data2 = this.sliceSerialize(token);
1648
+ const type = this.data.characterReferenceType;
1649
+ let value;
1650
+ if (type) {
1651
+ value = decodeNumericCharacterReference(data2, type === "characterReferenceMarkerNumeric" ? 10 : 16);
1652
+ this.data.characterReferenceType = void 0;
1653
+ } else {
1654
+ const result = decodeNamedCharacterReference(data2);
1655
+ value = result;
1656
+ }
1657
+ const tail = this.stack[this.stack.length - 1];
1658
+ tail.value += value;
1659
+ }
1660
+ __name(onexitcharacterreferencevalue, "onexitcharacterreferencevalue");
1661
+ function onexitcharacterreference(token) {
1662
+ const tail = this.stack.pop();
1663
+ tail.position.end = point(token.end);
1664
+ }
1665
+ __name(onexitcharacterreference, "onexitcharacterreference");
1666
+ function onexitautolinkprotocol(token) {
1667
+ onexitdata.call(this, token);
1668
+ const node = this.stack[this.stack.length - 1];
1669
+ node.url = this.sliceSerialize(token);
1670
+ }
1671
+ __name(onexitautolinkprotocol, "onexitautolinkprotocol");
1672
+ function onexitautolinkemail(token) {
1673
+ onexitdata.call(this, token);
1674
+ const node = this.stack[this.stack.length - 1];
1675
+ node.url = "mailto:" + this.sliceSerialize(token);
1676
+ }
1677
+ __name(onexitautolinkemail, "onexitautolinkemail");
1678
+ function blockQuote2() {
1679
+ return {
1680
+ type: "blockquote",
1681
+ children: [],
1682
+ position: void 0
1683
+ };
1684
+ }
1685
+ __name(blockQuote2, "blockQuote");
1686
+ function codeFlow() {
1687
+ return {
1688
+ type: "code",
1689
+ lang: null,
1690
+ meta: null,
1691
+ value: "",
1692
+ position: void 0
1693
+ };
1694
+ }
1695
+ __name(codeFlow, "codeFlow");
1696
+ function codeText2() {
1697
+ return {
1698
+ type: "inlineCode",
1699
+ value: "",
1700
+ position: void 0
1701
+ };
1702
+ }
1703
+ __name(codeText2, "codeText");
1704
+ function definition2() {
1705
+ return {
1706
+ type: "definition",
1707
+ identifier: "",
1708
+ label: null,
1709
+ title: null,
1710
+ url: "",
1711
+ position: void 0
1712
+ };
1713
+ }
1714
+ __name(definition2, "definition");
1715
+ function emphasis() {
1716
+ return {
1717
+ type: "emphasis",
1718
+ children: [],
1719
+ position: void 0
1720
+ };
1721
+ }
1722
+ __name(emphasis, "emphasis");
1723
+ function heading() {
1724
+ return {
1725
+ type: "heading",
1726
+ // @ts-expect-error `depth` will be set later.
1727
+ depth: 0,
1728
+ children: [],
1729
+ position: void 0
1730
+ };
1731
+ }
1732
+ __name(heading, "heading");
1733
+ function hardBreak() {
1734
+ return {
1735
+ type: "break",
1736
+ position: void 0
1737
+ };
1738
+ }
1739
+ __name(hardBreak, "hardBreak");
1740
+ function html() {
1741
+ return {
1742
+ type: "html",
1743
+ value: "",
1744
+ position: void 0
1745
+ };
1746
+ }
1747
+ __name(html, "html");
1748
+ function image() {
1749
+ return {
1750
+ type: "image",
1751
+ title: null,
1752
+ url: "",
1753
+ alt: null,
1754
+ position: void 0
1755
+ };
1756
+ }
1757
+ __name(image, "image");
1758
+ function link() {
1759
+ return {
1760
+ type: "link",
1761
+ title: null,
1762
+ url: "",
1763
+ children: [],
1764
+ position: void 0
1765
+ };
1766
+ }
1767
+ __name(link, "link");
1768
+ function list2(token) {
1769
+ return {
1770
+ type: "list",
1771
+ ordered: token.type === "listOrdered",
1772
+ start: null,
1773
+ spread: token._spread,
1774
+ children: [],
1775
+ position: void 0
1776
+ };
1777
+ }
1778
+ __name(list2, "list");
1779
+ function listItem(token) {
1780
+ return {
1781
+ type: "listItem",
1782
+ spread: token._spread,
1783
+ checked: null,
1784
+ children: [],
1785
+ position: void 0
1786
+ };
1787
+ }
1788
+ __name(listItem, "listItem");
1789
+ function paragraph() {
1790
+ return {
1791
+ type: "paragraph",
1792
+ children: [],
1793
+ position: void 0
1794
+ };
1795
+ }
1796
+ __name(paragraph, "paragraph");
1797
+ function strong() {
1798
+ return {
1799
+ type: "strong",
1800
+ children: [],
1801
+ position: void 0
1802
+ };
1803
+ }
1804
+ __name(strong, "strong");
1805
+ function text3() {
1806
+ return {
1807
+ type: "text",
1808
+ value: "",
1809
+ position: void 0
1810
+ };
1811
+ }
1812
+ __name(text3, "text");
1813
+ function thematicBreak2() {
1814
+ return {
1815
+ type: "thematicBreak",
1816
+ position: void 0
1817
+ };
1818
+ }
1819
+ __name(thematicBreak2, "thematicBreak");
1820
+ }
1821
+ __name(compiler, "compiler");
1822
+ function point(d) {
1823
+ return {
1824
+ line: d.line,
1825
+ column: d.column,
1826
+ offset: d.offset
1827
+ };
1828
+ }
1829
+ __name(point, "point");
1830
+ function configure(combined, extensions) {
1831
+ let index = -1;
1832
+ while (++index < extensions.length) {
1833
+ const value = extensions[index];
1834
+ if (Array.isArray(value)) {
1835
+ configure(combined, value);
1836
+ } else {
1837
+ extension(combined, value);
1838
+ }
1839
+ }
1840
+ }
1841
+ __name(configure, "configure");
1842
+ function extension(combined, extension2) {
1843
+ let key;
1844
+ for (key in extension2) {
1845
+ if (own.call(extension2, key)) {
1846
+ switch (key) {
1847
+ case "canContainEols": {
1848
+ const right = extension2[key];
1849
+ if (right) {
1850
+ combined[key].push(...right);
1851
+ }
1852
+ break;
1853
+ }
1854
+ case "transforms": {
1855
+ const right = extension2[key];
1856
+ if (right) {
1857
+ combined[key].push(...right);
1858
+ }
1859
+ break;
1860
+ }
1861
+ case "afterExit":
1862
+ case "beforeEnter": {
1863
+ const right = extension2[key];
1864
+ if (right) {
1865
+ combined[key].push(right);
1866
+ }
1867
+ break;
1868
+ }
1869
+ case "enter":
1870
+ case "exit": {
1871
+ const right = extension2[key];
1872
+ if (right) {
1873
+ Object.assign(combined[key], right);
1874
+ }
1875
+ break;
1876
+ }
1877
+ }
1878
+ }
1879
+ }
1880
+ }
1881
+ __name(extension, "extension");
1882
+ function defaultOnError(left, right) {
1883
+ if (left) {
1884
+ throw new Error("Cannot close `" + left.type + "` (" + stringifyPosition({
1885
+ start: left.start,
1886
+ end: left.end
1887
+ }) + "): a different token (`" + right.type + "`, " + stringifyPosition({
1888
+ start: right.start,
1889
+ end: right.end
1890
+ }) + ") is open");
1891
+ }
1892
+ throw new Error("Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({
1893
+ start: right.start,
1894
+ end: right.end
1895
+ }) + ") is still open");
1896
+ }
1897
+ __name(defaultOnError, "defaultOnError");
1898
+ export {
1899
+ fromMarkdown
1900
+ };