@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,1876 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ decodeString
5
+ } from "./chunk-QYTOLPNI.js";
6
+ import {
7
+ classifyCharacter,
8
+ htmlBlockNames,
9
+ htmlRawNames
10
+ } from "./chunk-XTAS5Z3G.js";
11
+ import {
12
+ asciiAlpha,
13
+ asciiAlphanumeric,
14
+ asciiPunctuation
15
+ } from "./chunk-UC7JLE6J.js";
16
+ import {
17
+ zwitch
18
+ } from "./chunk-4HP6KGBI.js";
19
+ import {
20
+ phrasing
21
+ } from "./chunk-NMQRSEZM.js";
22
+ import {
23
+ toString
24
+ } from "./chunk-XFLCVHSQ.js";
25
+ import {
26
+ EXIT,
27
+ visit
28
+ } from "./chunk-TRYYWV7J.js";
29
+ import {
30
+ __name
31
+ } from "./chunk-ZVVMGPBJ.js";
32
+
33
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/configure.js
34
+ var own = {}.hasOwnProperty;
35
+ function configure(base, extension) {
36
+ let index = -1;
37
+ let key;
38
+ if (extension.extensions) {
39
+ while (++index < extension.extensions.length) {
40
+ configure(base, extension.extensions[index]);
41
+ }
42
+ }
43
+ for (key in extension) {
44
+ if (own.call(extension, key)) {
45
+ switch (key) {
46
+ case "extensions": {
47
+ break;
48
+ }
49
+ /* c8 ignore next 4 */
50
+ case "unsafe": {
51
+ list(base[key], extension[key]);
52
+ break;
53
+ }
54
+ case "join": {
55
+ list(base[key], extension[key]);
56
+ break;
57
+ }
58
+ case "handlers": {
59
+ map(base[key], extension[key]);
60
+ break;
61
+ }
62
+ default: {
63
+ base.options[key] = extension[key];
64
+ }
65
+ }
66
+ }
67
+ }
68
+ return base;
69
+ }
70
+ __name(configure, "configure");
71
+ function list(left, right) {
72
+ if (right) {
73
+ left.push(...right);
74
+ }
75
+ }
76
+ __name(list, "list");
77
+ function map(left, right) {
78
+ if (right) {
79
+ Object.assign(left, right);
80
+ }
81
+ }
82
+ __name(map, "map");
83
+
84
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
85
+ function blockquote(node, _, state, info) {
86
+ const exit = state.enter("blockquote");
87
+ const tracker = state.createTracker(info);
88
+ tracker.move("> ");
89
+ tracker.shift(2);
90
+ const value = state.indentLines(
91
+ state.containerFlow(node, tracker.current()),
92
+ map2
93
+ );
94
+ exit();
95
+ return value;
96
+ }
97
+ __name(blockquote, "blockquote");
98
+ function map2(line, _, blank) {
99
+ return ">" + (blank ? "" : " ") + line;
100
+ }
101
+ __name(map2, "map");
102
+
103
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
104
+ function patternInScope(stack, pattern) {
105
+ return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
106
+ }
107
+ __name(patternInScope, "patternInScope");
108
+ function listInScope(stack, list3, none) {
109
+ if (typeof list3 === "string") {
110
+ list3 = [list3];
111
+ }
112
+ if (!list3 || list3.length === 0) {
113
+ return none;
114
+ }
115
+ let index = -1;
116
+ while (++index < list3.length) {
117
+ if (stack.includes(list3[index])) {
118
+ return true;
119
+ }
120
+ }
121
+ return false;
122
+ }
123
+ __name(listInScope, "listInScope");
124
+
125
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/break.js
126
+ function hardBreak(_, _1, state, info) {
127
+ let index = -1;
128
+ while (++index < state.unsafe.length) {
129
+ const pattern = state.unsafe[index];
130
+ if (pattern.character === "\n" && !pattern.before && !pattern.after && patternInScope(state.stack, pattern)) {
131
+ return /[\t ]/.test(info.before) ? "" : " ";
132
+ }
133
+ }
134
+ return "\\\n";
135
+ }
136
+ __name(hardBreak, "hardBreak");
137
+
138
+ // node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js
139
+ function longestStreak(value, substring) {
140
+ const source = String(value);
141
+ let index = source.indexOf(substring);
142
+ let expected = index;
143
+ let count = 0;
144
+ let max = 0;
145
+ if (typeof substring !== "string") {
146
+ throw new TypeError("Expected substring");
147
+ }
148
+ while (index !== -1) {
149
+ if (index === expected) {
150
+ if (++count > max) {
151
+ max = count;
152
+ }
153
+ } else {
154
+ count = 1;
155
+ }
156
+ expected = index + substring.length;
157
+ index = source.indexOf(substring, expected);
158
+ }
159
+ return max;
160
+ }
161
+ __name(longestStreak, "longestStreak");
162
+
163
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
164
+ function formatCodeAsIndented(node, state) {
165
+ return Boolean(
166
+ state.options.fences === false && node.value && // If there’s no info…
167
+ !node.lang && // And there’s a non-whitespace character…
168
+ /[^\n\r ]/.test(node.value) && // And the value doesn’t start or end in a blank…
169
+ !/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(node.value)
170
+ );
171
+ }
172
+ __name(formatCodeAsIndented, "formatCodeAsIndented");
173
+
174
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
175
+ function checkFence(state) {
176
+ const marker = state.options.fence || "`";
177
+ if (marker !== "`" && marker !== "~") {
178
+ throw new Error(
179
+ "Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`"
180
+ );
181
+ }
182
+ return marker;
183
+ }
184
+ __name(checkFence, "checkFence");
185
+
186
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/code.js
187
+ function code(node, _, state, info) {
188
+ const marker = checkFence(state);
189
+ const raw = node.value || "";
190
+ if (formatCodeAsIndented(node, state)) {
191
+ const exit2 = state.enter("codeIndented");
192
+ const value2 = state.indentLines(raw, map3);
193
+ exit2();
194
+ return value2;
195
+ }
196
+ const tracker = state.createTracker(info);
197
+ const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));
198
+ const exit = state.enter("codeFenced");
199
+ const suffix = marker === "`" ? "GraveAccent" : "Tilde";
200
+ let value = tracker.move(sequence);
201
+ if (node.lang) {
202
+ const subexit = state.enter(`codeFencedLang${suffix}`);
203
+ value += tracker.move(
204
+ state.safe(node.lang, {
205
+ before: value,
206
+ after: " ",
207
+ encode: ["`"],
208
+ ...tracker.current()
209
+ })
210
+ );
211
+ subexit();
212
+ }
213
+ if (node.lang && node.meta) {
214
+ const subexit = state.enter(`codeFencedMeta${suffix}`);
215
+ value += tracker.move(" ");
216
+ value += tracker.move(
217
+ state.safe(node.meta, {
218
+ before: value,
219
+ after: "\n",
220
+ encode: ["`"],
221
+ ...tracker.current()
222
+ })
223
+ );
224
+ subexit();
225
+ }
226
+ value += tracker.move("\n");
227
+ if (raw) {
228
+ value += tracker.move(raw + "\n");
229
+ }
230
+ value += tracker.move(sequence);
231
+ exit();
232
+ return value;
233
+ }
234
+ __name(code, "code");
235
+ function map3(line, _, blank) {
236
+ return (blank ? "" : " ") + line;
237
+ }
238
+ __name(map3, "map");
239
+
240
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
241
+ function checkQuote(state) {
242
+ const marker = state.options.quote || '"';
243
+ if (marker !== '"' && marker !== "'") {
244
+ throw new Error(
245
+ "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`"
246
+ );
247
+ }
248
+ return marker;
249
+ }
250
+ __name(checkQuote, "checkQuote");
251
+
252
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/definition.js
253
+ function definition(node, _, state, info) {
254
+ const quote = checkQuote(state);
255
+ const suffix = quote === '"' ? "Quote" : "Apostrophe";
256
+ const exit = state.enter("definition");
257
+ let subexit = state.enter("label");
258
+ const tracker = state.createTracker(info);
259
+ let value = tracker.move("[");
260
+ value += tracker.move(
261
+ state.safe(state.associationId(node), {
262
+ before: value,
263
+ after: "]",
264
+ ...tracker.current()
265
+ })
266
+ );
267
+ value += tracker.move("]: ");
268
+ subexit();
269
+ if (
270
+ // If there’s no url, or…
271
+ !node.url || // If there are control characters or whitespace.
272
+ /[\0- \u007F]/.test(node.url)
273
+ ) {
274
+ subexit = state.enter("destinationLiteral");
275
+ value += tracker.move("<");
276
+ value += tracker.move(
277
+ state.safe(node.url, { before: value, after: ">", ...tracker.current() })
278
+ );
279
+ value += tracker.move(">");
280
+ } else {
281
+ subexit = state.enter("destinationRaw");
282
+ value += tracker.move(
283
+ state.safe(node.url, {
284
+ before: value,
285
+ after: node.title ? " " : "\n",
286
+ ...tracker.current()
287
+ })
288
+ );
289
+ }
290
+ subexit();
291
+ if (node.title) {
292
+ subexit = state.enter(`title${suffix}`);
293
+ value += tracker.move(" " + quote);
294
+ value += tracker.move(
295
+ state.safe(node.title, {
296
+ before: value,
297
+ after: quote,
298
+ ...tracker.current()
299
+ })
300
+ );
301
+ value += tracker.move(quote);
302
+ subexit();
303
+ }
304
+ exit();
305
+ return value;
306
+ }
307
+ __name(definition, "definition");
308
+
309
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
310
+ function checkEmphasis(state) {
311
+ const marker = state.options.emphasis || "*";
312
+ if (marker !== "*" && marker !== "_") {
313
+ throw new Error(
314
+ "Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`"
315
+ );
316
+ }
317
+ return marker;
318
+ }
319
+ __name(checkEmphasis, "checkEmphasis");
320
+
321
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
322
+ emphasis.attention = attention;
323
+ emphasis.peek = peek;
324
+ function emphasis(node, _, state, info) {
325
+ const exit = state.enter("phrasing");
326
+ const value = state.containerPhrasing({ type: "root", children: [node] }, info);
327
+ exit();
328
+ return value;
329
+ }
330
+ __name(emphasis, "emphasis");
331
+ function attention(_, state) {
332
+ const marker = checkEmphasis(state);
333
+ return {
334
+ construct: "emphasis",
335
+ markers: marker === "*" ? ["*", "_"] : ["_", "*"],
336
+ sizes: [1]
337
+ };
338
+ }
339
+ __name(attention, "attention");
340
+ function peek(_, _1, state) {
341
+ return state.options.emphasis || "*";
342
+ }
343
+ __name(peek, "peek");
344
+
345
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
346
+ function encodeCharacterReference(code3) {
347
+ return "&#x" + code3.toString(16).toUpperCase() + ";";
348
+ }
349
+ __name(encodeCharacterReference, "encodeCharacterReference");
350
+
351
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
352
+ function formatHeadingAsSetext(node, state) {
353
+ let literalWithBreak = false;
354
+ visit(node, function(node2) {
355
+ if ("value" in node2 && /\r?\n|\r/.test(node2.value) || node2.type === "break") {
356
+ literalWithBreak = true;
357
+ return EXIT;
358
+ }
359
+ });
360
+ return Boolean(
361
+ (!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak)
362
+ );
363
+ }
364
+ __name(formatHeadingAsSetext, "formatHeadingAsSetext");
365
+
366
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/heading.js
367
+ function heading(node, _, state, info) {
368
+ const rank = Math.max(Math.min(6, node.depth || 1), 1);
369
+ const tracker = state.createTracker(info);
370
+ if (formatHeadingAsSetext(node, state)) {
371
+ const exit2 = state.enter("headingSetext");
372
+ const subexit2 = state.enter("phrasing");
373
+ const value2 = state.containerPhrasing(node, {
374
+ ...tracker.current(),
375
+ before: "\n",
376
+ after: "\n"
377
+ });
378
+ subexit2();
379
+ exit2();
380
+ return value2 + "\n" + (rank === 1 ? "=" : "-").repeat(
381
+ // The whole size…
382
+ value2.length - // Minus the position of the character after the last EOL (or
383
+ // 0 if there is none)…
384
+ (Math.max(value2.lastIndexOf("\r"), value2.lastIndexOf("\n")) + 1)
385
+ );
386
+ }
387
+ const sequence = "#".repeat(rank);
388
+ const exit = state.enter("headingAtx");
389
+ const subexit = state.enter("phrasing");
390
+ tracker.move(sequence + " ");
391
+ let value = state.containerPhrasing(node, {
392
+ before: "# ",
393
+ after: "\n",
394
+ ...tracker.current()
395
+ });
396
+ const head = value.charCodeAt(0);
397
+ if (head === 9 || head === 32) {
398
+ value = encodeCharacterReference(head) + value.slice(1);
399
+ }
400
+ value = value ? sequence + " " + value : sequence;
401
+ if (state.options.closeAtx) {
402
+ value += " " + sequence;
403
+ }
404
+ subexit();
405
+ exit();
406
+ return value;
407
+ }
408
+ __name(heading, "heading");
409
+
410
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/html.js
411
+ html.peek = htmlPeek;
412
+ function html(node) {
413
+ return node.value || "";
414
+ }
415
+ __name(html, "html");
416
+ function htmlPeek() {
417
+ return "<";
418
+ }
419
+ __name(htmlPeek, "htmlPeek");
420
+
421
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image.js
422
+ image.peek = imagePeek;
423
+ function image(node, _, state, info) {
424
+ const quote = checkQuote(state);
425
+ const suffix = quote === '"' ? "Quote" : "Apostrophe";
426
+ const exit = state.enter("image");
427
+ let subexit = state.enter("label");
428
+ const tracker = state.createTracker(info);
429
+ let value = tracker.move("![");
430
+ value += tracker.move(
431
+ state.safe(node.alt, { before: value, after: "]", ...tracker.current() })
432
+ );
433
+ value += tracker.move("](");
434
+ subexit();
435
+ if (
436
+ // If there’s no url but there is a title…
437
+ !node.url && node.title || // If there are control characters or whitespace.
438
+ /[\0- \u007F]/.test(node.url)
439
+ ) {
440
+ subexit = state.enter("destinationLiteral");
441
+ value += tracker.move("<");
442
+ value += tracker.move(
443
+ state.safe(node.url, { before: value, after: ">", ...tracker.current() })
444
+ );
445
+ value += tracker.move(">");
446
+ } else {
447
+ subexit = state.enter("destinationRaw");
448
+ value += tracker.move(
449
+ state.safe(node.url, {
450
+ before: value,
451
+ after: node.title ? " " : ")",
452
+ ...tracker.current()
453
+ })
454
+ );
455
+ }
456
+ subexit();
457
+ if (node.title) {
458
+ subexit = state.enter(`title${suffix}`);
459
+ value += tracker.move(" " + quote);
460
+ value += tracker.move(
461
+ state.safe(node.title, {
462
+ before: value,
463
+ after: quote,
464
+ ...tracker.current()
465
+ })
466
+ );
467
+ value += tracker.move(quote);
468
+ subexit();
469
+ }
470
+ value += tracker.move(")");
471
+ exit();
472
+ return value;
473
+ }
474
+ __name(image, "image");
475
+ function imagePeek() {
476
+ return "!";
477
+ }
478
+ __name(imagePeek, "imagePeek");
479
+
480
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
481
+ imageReference.peek = imageReferencePeek;
482
+ function imageReference(node, _, state, info) {
483
+ const type = node.referenceType;
484
+ const exit = state.enter("imageReference");
485
+ let subexit = state.enter("label");
486
+ const tracker = state.createTracker(info);
487
+ let value = tracker.move("![");
488
+ const alt = state.safe(node.alt, {
489
+ before: value,
490
+ after: "]",
491
+ ...tracker.current()
492
+ });
493
+ value += tracker.move(alt + "][");
494
+ subexit();
495
+ const stack = state.stack;
496
+ state.stack = stack.filter(function(d) {
497
+ return d !== "phrasing";
498
+ });
499
+ subexit = state.enter("reference");
500
+ const reference = state.safe(state.associationId(node), {
501
+ before: value,
502
+ after: "]",
503
+ ...tracker.current()
504
+ });
505
+ subexit();
506
+ state.stack = stack;
507
+ exit();
508
+ if (type === "full" || !alt || alt !== reference) {
509
+ value += tracker.move(reference + "]");
510
+ } else if (type === "shortcut") {
511
+ value = value.slice(0, -1);
512
+ } else {
513
+ value += tracker.move("]");
514
+ }
515
+ return value;
516
+ }
517
+ __name(imageReference, "imageReference");
518
+ function imageReferencePeek() {
519
+ return "!";
520
+ }
521
+ __name(imageReferencePeek, "imageReferencePeek");
522
+
523
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
524
+ inlineCode.peek = inlineCodePeek;
525
+ function inlineCode(node, _, state) {
526
+ let value = node.value || "";
527
+ let sequence = "`";
528
+ let index = -1;
529
+ while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) {
530
+ sequence += "`";
531
+ }
532
+ if (/[^\n\r ]/.test(value) && (/^[\n\r ]/.test(value) && /[\n\r ]$/.test(value) || /^`|`$/.test(value))) {
533
+ value = " " + value + " ";
534
+ }
535
+ while (++index < state.unsafe.length) {
536
+ const pattern = state.unsafe[index];
537
+ const expression = state.compilePattern(pattern);
538
+ if (!pattern.atBreak) continue;
539
+ let match;
540
+ while (match = expression.exec(value)) {
541
+ let position = match.index;
542
+ if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) {
543
+ position--;
544
+ }
545
+ value = value.slice(0, position) + " " + value.slice(match.index + 1);
546
+ }
547
+ }
548
+ return sequence + value + sequence;
549
+ }
550
+ __name(inlineCode, "inlineCode");
551
+ function inlineCodePeek() {
552
+ return "`";
553
+ }
554
+ __name(inlineCodePeek, "inlineCodePeek");
555
+
556
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
557
+ function formatLinkAsAutolink(node, state) {
558
+ const raw = toString(node);
559
+ return Boolean(
560
+ !state.options.resourceLink && // If there’s a url…
561
+ node.url && // And there’s no title…
562
+ !node.title && // And the content of `node` is a single text node…
563
+ node.children && node.children.length === 1 && node.children[0].type === "text" && // And if the url is the same as the content…
564
+ (raw === node.url || "mailto:" + raw === node.url) && // And that starts w/ a protocol…
565
+ /^[a-z][+\-.a-z]+:/i.test(node.url) && // And that doesn’t contain ASCII control codes (character escapes and
566
+ // references don’t work), space, or angle brackets…
567
+ !/[\0- <>\u007F]/.test(node.url)
568
+ );
569
+ }
570
+ __name(formatLinkAsAutolink, "formatLinkAsAutolink");
571
+
572
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link.js
573
+ link.peek = linkPeek;
574
+ function link(node, _, state, info) {
575
+ const quote = checkQuote(state);
576
+ const suffix = quote === '"' ? "Quote" : "Apostrophe";
577
+ const tracker = state.createTracker(info);
578
+ if (formatLinkAsAutolink(node, state)) {
579
+ const stack = state.stack;
580
+ state.stack = stack.filter(function(d) {
581
+ return d !== "phrasing";
582
+ });
583
+ const exit2 = state.enter("autolink");
584
+ let value2 = tracker.move("<");
585
+ value2 += tracker.move(
586
+ state.containerPhrasing(node, {
587
+ before: value2,
588
+ after: ">",
589
+ ...tracker.current()
590
+ })
591
+ );
592
+ value2 += tracker.move(">");
593
+ exit2();
594
+ state.stack = stack;
595
+ return value2;
596
+ }
597
+ const exit = state.enter("link");
598
+ let subexit = state.enter("label");
599
+ let value = tracker.move("[");
600
+ value += tracker.move(
601
+ state.containerPhrasing(node, {
602
+ before: value,
603
+ after: "](",
604
+ ...tracker.current()
605
+ })
606
+ );
607
+ value += tracker.move("](");
608
+ subexit();
609
+ if (
610
+ // If there’s no url but there is a title…
611
+ !node.url && node.title || // If there are control characters or whitespace.
612
+ /[\0- \u007F]/.test(node.url)
613
+ ) {
614
+ subexit = state.enter("destinationLiteral");
615
+ value += tracker.move("<");
616
+ value += tracker.move(
617
+ state.safe(node.url, { before: value, after: ">", ...tracker.current() })
618
+ );
619
+ value += tracker.move(">");
620
+ } else {
621
+ subexit = state.enter("destinationRaw");
622
+ value += tracker.move(
623
+ state.safe(node.url, {
624
+ before: value,
625
+ after: node.title ? " " : ")",
626
+ ...tracker.current()
627
+ })
628
+ );
629
+ }
630
+ subexit();
631
+ if (node.title) {
632
+ subexit = state.enter(`title${suffix}`);
633
+ value += tracker.move(" " + quote);
634
+ value += tracker.move(
635
+ state.safe(node.title, {
636
+ before: value,
637
+ after: quote,
638
+ ...tracker.current()
639
+ })
640
+ );
641
+ value += tracker.move(quote);
642
+ subexit();
643
+ }
644
+ value += tracker.move(")");
645
+ exit();
646
+ return value;
647
+ }
648
+ __name(link, "link");
649
+ function linkPeek(node, _, state) {
650
+ return formatLinkAsAutolink(node, state) ? "<" : "[";
651
+ }
652
+ __name(linkPeek, "linkPeek");
653
+
654
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
655
+ linkReference.peek = linkReferencePeek;
656
+ function linkReference(node, _, state, info) {
657
+ const type = node.referenceType;
658
+ const exit = state.enter("linkReference");
659
+ let subexit = state.enter("label");
660
+ const tracker = state.createTracker(info);
661
+ let value = tracker.move("[");
662
+ const text2 = state.containerPhrasing(node, {
663
+ before: value,
664
+ after: "]",
665
+ ...tracker.current()
666
+ });
667
+ value += tracker.move(text2 + "][");
668
+ subexit();
669
+ const stack = state.stack;
670
+ state.stack = stack.filter(function(d) {
671
+ return d !== "phrasing";
672
+ });
673
+ subexit = state.enter("reference");
674
+ const reference = state.safe(state.associationId(node), {
675
+ before: value,
676
+ after: "]",
677
+ ...tracker.current()
678
+ });
679
+ subexit();
680
+ state.stack = stack;
681
+ exit();
682
+ if (type === "full" || !text2 || text2 !== reference) {
683
+ value += tracker.move(reference + "]");
684
+ } else if (type === "shortcut") {
685
+ value = value.slice(0, -1);
686
+ } else {
687
+ value += tracker.move("]");
688
+ }
689
+ return value;
690
+ }
691
+ __name(linkReference, "linkReference");
692
+ function linkReferencePeek() {
693
+ return "[";
694
+ }
695
+ __name(linkReferencePeek, "linkReferencePeek");
696
+
697
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
698
+ function checkBullet(state) {
699
+ const marker = state.options.bullet || "*";
700
+ if (marker !== "*" && marker !== "+" && marker !== "-") {
701
+ throw new Error(
702
+ "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`"
703
+ );
704
+ }
705
+ return marker;
706
+ }
707
+ __name(checkBullet, "checkBullet");
708
+
709
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
710
+ function checkBulletOther(state) {
711
+ const bullet = checkBullet(state);
712
+ const bulletOther = state.options.bulletOther;
713
+ if (!bulletOther) {
714
+ return bullet === "*" ? "-" : "*";
715
+ }
716
+ if (bulletOther !== "*" && bulletOther !== "+" && bulletOther !== "-") {
717
+ throw new Error(
718
+ "Cannot serialize items with `" + bulletOther + "` for `options.bulletOther`, expected `*`, `+`, or `-`"
719
+ );
720
+ }
721
+ if (bulletOther === bullet) {
722
+ throw new Error(
723
+ "Expected `bullet` (`" + bullet + "`) and `bulletOther` (`" + bulletOther + "`) to be different"
724
+ );
725
+ }
726
+ return bulletOther;
727
+ }
728
+ __name(checkBulletOther, "checkBulletOther");
729
+
730
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
731
+ function checkBulletOrdered(state) {
732
+ const marker = state.options.bulletOrdered || ".";
733
+ if (marker !== "." && marker !== ")") {
734
+ throw new Error(
735
+ "Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`"
736
+ );
737
+ }
738
+ return marker;
739
+ }
740
+ __name(checkBulletOrdered, "checkBulletOrdered");
741
+
742
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
743
+ function checkRule(state) {
744
+ const marker = state.options.rule || "*";
745
+ if (marker !== "*" && marker !== "-" && marker !== "_") {
746
+ throw new Error(
747
+ "Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`"
748
+ );
749
+ }
750
+ return marker;
751
+ }
752
+ __name(checkRule, "checkRule");
753
+
754
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list.js
755
+ function list2(node, parent, state, info) {
756
+ const exit = state.enter("list");
757
+ const bulletCurrent = state.bulletCurrent;
758
+ let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state);
759
+ const bulletOther = node.ordered ? bullet === "." ? ")" : "." : checkBulletOther(state);
760
+ let useDifferentMarker = parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false;
761
+ if (!node.ordered) {
762
+ const firstListItem = node.children ? node.children[0] : void 0;
763
+ if (
764
+ // Bullet could be used as a thematic break marker:
765
+ (bullet === "*" || bullet === "-") && // Empty first list item:
766
+ firstListItem && (!firstListItem.children || !firstListItem.children[0]) && // Directly in two other list items:
767
+ state.stack[state.stack.length - 1] === "list" && state.stack[state.stack.length - 2] === "listItem" && state.stack[state.stack.length - 3] === "list" && state.stack[state.stack.length - 4] === "listItem" && // That are each the first child.
768
+ state.indexStack[state.indexStack.length - 1] === 0 && state.indexStack[state.indexStack.length - 2] === 0 && state.indexStack[state.indexStack.length - 3] === 0
769
+ ) {
770
+ useDifferentMarker = true;
771
+ }
772
+ if (checkRule(state) === bullet && firstListItem) {
773
+ let index = -1;
774
+ while (++index < node.children.length) {
775
+ const item = node.children[index];
776
+ if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
777
+ useDifferentMarker = true;
778
+ break;
779
+ }
780
+ }
781
+ }
782
+ }
783
+ if (useDifferentMarker) {
784
+ bullet = bulletOther;
785
+ }
786
+ state.bulletCurrent = bullet;
787
+ const value = state.containerFlow(node, info);
788
+ state.bulletLastUsed = bullet;
789
+ state.bulletCurrent = bulletCurrent;
790
+ exit();
791
+ return value;
792
+ }
793
+ __name(list2, "list");
794
+
795
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
796
+ function checkListItemIndent(state) {
797
+ const style = state.options.listItemIndent || "one";
798
+ if (style !== "tab" && style !== "one" && style !== "mixed") {
799
+ throw new Error(
800
+ "Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`"
801
+ );
802
+ }
803
+ return style;
804
+ }
805
+ __name(checkListItemIndent, "checkListItemIndent");
806
+
807
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
808
+ function listItem(node, parent, state, info) {
809
+ const listItemIndent = checkListItemIndent(state);
810
+ let bullet = state.bulletCurrent || checkBullet(state);
811
+ if (parent && parent.type === "list" && parent.ordered) {
812
+ bullet = (typeof parent.start === "number" && parent.start > -1 ? parent.start : 1) + (state.options.incrementListMarker === false ? 0 : parent.children.indexOf(node)) + bullet;
813
+ }
814
+ let size = bullet.length + 1;
815
+ if (listItemIndent === "tab" || listItemIndent === "mixed" && (parent && parent.type === "list" && parent.spread || node.spread)) {
816
+ size = Math.ceil(size / 4) * 4;
817
+ }
818
+ const tracker = state.createTracker(info);
819
+ tracker.move(bullet + " ".repeat(size - bullet.length));
820
+ tracker.shift(size);
821
+ const exit = state.enter("listItem");
822
+ const value = state.indentLines(
823
+ state.containerFlow(node, tracker.current()),
824
+ map4
825
+ );
826
+ exit();
827
+ return value;
828
+ function map4(line, index, blank) {
829
+ if (index) {
830
+ return (blank ? "" : " ".repeat(size)) + line;
831
+ }
832
+ return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line;
833
+ }
834
+ __name(map4, "map");
835
+ }
836
+ __name(listItem, "listItem");
837
+
838
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
839
+ function paragraph(node, _, state, info) {
840
+ const exit = state.enter("paragraph");
841
+ const subexit = state.enter("phrasing");
842
+ const value = state.containerPhrasing(node, info);
843
+ subexit();
844
+ exit();
845
+ return value;
846
+ }
847
+ __name(paragraph, "paragraph");
848
+
849
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/root.js
850
+ function root(node, _, state, info) {
851
+ const hasPhrasing = node.children.some(function(d) {
852
+ return phrasing(d);
853
+ });
854
+ if (!hasPhrasing) return state.containerFlow(node, info);
855
+ const exit = state.enter("phrasing");
856
+ const value = state.containerPhrasing(node, info);
857
+ exit();
858
+ return value;
859
+ }
860
+ __name(root, "root");
861
+
862
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
863
+ function checkStrong(state) {
864
+ const marker = state.options.strong || "*";
865
+ if (marker !== "*" && marker !== "_") {
866
+ throw new Error(
867
+ "Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`"
868
+ );
869
+ }
870
+ return marker;
871
+ }
872
+ __name(checkStrong, "checkStrong");
873
+
874
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/strong.js
875
+ strong.attention = attention2;
876
+ strong.peek = peek2;
877
+ function strong(node, _, state, info) {
878
+ const exit = state.enter("phrasing");
879
+ const value = state.containerPhrasing({ type: "root", children: [node] }, info);
880
+ exit();
881
+ return value;
882
+ }
883
+ __name(strong, "strong");
884
+ function attention2(_, state) {
885
+ const marker = checkStrong(state);
886
+ return {
887
+ construct: "strong",
888
+ markers: marker === "*" ? ["*", "_"] : ["_", "*"],
889
+ sizes: [2]
890
+ };
891
+ }
892
+ __name(attention2, "attention");
893
+ function peek2(_, _1, state) {
894
+ return state.options.strong || "*";
895
+ }
896
+ __name(peek2, "peek");
897
+
898
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/text.js
899
+ function text(node, parent, state, info) {
900
+ const siblings = parent ? parent.children : [];
901
+ const index = siblings.indexOf(node);
902
+ return state.safe(node.value, {
903
+ ...info,
904
+ afterNode: siblings[index + 1],
905
+ beforeNode: siblings[index - 1]
906
+ });
907
+ }
908
+ __name(text, "text");
909
+
910
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
911
+ function checkRuleRepetition(state) {
912
+ const repetition = state.options.ruleRepetition || 3;
913
+ if (repetition < 3) {
914
+ throw new Error(
915
+ "Cannot serialize rules with repetition `" + repetition + "` for `options.ruleRepetition`, expected `3` or more"
916
+ );
917
+ }
918
+ return repetition;
919
+ }
920
+ __name(checkRuleRepetition, "checkRuleRepetition");
921
+
922
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
923
+ function thematicBreak(_, _1, state) {
924
+ const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
925
+ return state.options.ruleSpaces ? value.slice(0, -1) : value;
926
+ }
927
+ __name(thematicBreak, "thematicBreak");
928
+
929
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/index.js
930
+ var handle = {
931
+ blockquote,
932
+ break: hardBreak,
933
+ code,
934
+ definition,
935
+ emphasis,
936
+ hardBreak,
937
+ heading,
938
+ html,
939
+ image,
940
+ imageReference,
941
+ inlineCode,
942
+ link,
943
+ linkReference,
944
+ list: list2,
945
+ listItem,
946
+ paragraph,
947
+ root,
948
+ strong,
949
+ text,
950
+ thematicBreak
951
+ };
952
+
953
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/html-kind.js
954
+ function htmlKind(value) {
955
+ if (value.charCodeAt(0) !== 60) return;
956
+ const next = value.charCodeAt(1);
957
+ if (next === 33) {
958
+ const code4 = value.charCodeAt(2);
959
+ if (code4 === 45) return 2;
960
+ if (code4 === 91) return 5;
961
+ if (asciiAlpha(code4)) return 4;
962
+ return;
963
+ }
964
+ if (next === 63) return 3;
965
+ const closing = next === 47;
966
+ const start = closing ? 2 : 1;
967
+ let end = start;
968
+ let code3 = value.charCodeAt(end);
969
+ if (!asciiAlpha(code3)) return;
970
+ while (code3 === 45 || asciiAlphanumeric(code3)) {
971
+ code3 = value.charCodeAt(++end);
972
+ }
973
+ const name = value.slice(start, end).toLowerCase();
974
+ if (!closing && code3 !== 47 && htmlRawNames.includes(name)) {
975
+ return 1;
976
+ }
977
+ return htmlBlockNames.includes(name) ? 6 : 7;
978
+ }
979
+ __name(htmlKind, "htmlKind");
980
+
981
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/join.js
982
+ var join = [joinDefaults];
983
+ function joinDefaults(left, right, parent, state) {
984
+ if (right.type === "code" && formatCodeAsIndented(right, state) && (left.type === "list" || left.type === right.type && formatCodeAsIndented(left, state))) {
985
+ return false;
986
+ }
987
+ if ("spread" in parent && typeof parent.spread === "boolean") {
988
+ if (left.type === "paragraph" && // Two paragraphs.
989
+ (left.type === right.type || right.type === "definition" || // Paragraph followed by a setext heading.
990
+ right.type === "heading" && formatHeadingAsSetext(right, state))) {
991
+ return;
992
+ }
993
+ if (left.type === "html") {
994
+ const kind = htmlKind(left.value);
995
+ if (kind === void 0 || kind === 6 || kind === 7) return 1;
996
+ }
997
+ if (left.type === "paragraph" && right.type === "html") {
998
+ const kind = htmlKind(right.value);
999
+ if (kind === void 0 || kind === 7) return 1;
1000
+ }
1001
+ return parent.spread ? 1 : 0;
1002
+ }
1003
+ }
1004
+ __name(joinDefaults, "joinDefaults");
1005
+
1006
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/unsafe.js
1007
+ var fullPhrasingSpans = [
1008
+ "autolink",
1009
+ "destinationLiteral",
1010
+ "destinationRaw",
1011
+ "reference",
1012
+ "titleQuote",
1013
+ "titleApostrophe"
1014
+ ];
1015
+ var unsafe = [
1016
+ { character: " ", after: "[\\r\\n]", inConstruct: "phrasing" },
1017
+ { character: " ", before: "[\\r\\n]", inConstruct: "phrasing" },
1018
+ {
1019
+ character: " ",
1020
+ inConstruct: ["codeFencedLangGraveAccent", "codeFencedLangTilde"]
1021
+ },
1022
+ {
1023
+ character: "\r",
1024
+ inConstruct: [
1025
+ "codeFencedLangGraveAccent",
1026
+ "codeFencedLangTilde",
1027
+ "codeFencedMetaGraveAccent",
1028
+ "codeFencedMetaTilde",
1029
+ "destinationLiteral",
1030
+ "headingAtx"
1031
+ ]
1032
+ },
1033
+ {
1034
+ character: "\n",
1035
+ inConstruct: [
1036
+ "codeFencedLangGraveAccent",
1037
+ "codeFencedLangTilde",
1038
+ "codeFencedMetaGraveAccent",
1039
+ "codeFencedMetaTilde",
1040
+ "destinationLiteral",
1041
+ "headingAtx"
1042
+ ]
1043
+ },
1044
+ { character: "\r", before: "[\\r\\n]", inConstruct: "phrasing" },
1045
+ { character: "\r", after: "\\r", inConstruct: "phrasing" },
1046
+ { character: "\n", before: "\\n", inConstruct: "phrasing" },
1047
+ { character: "\n", after: "[\\r\\n]", inConstruct: "phrasing" },
1048
+ { character: " ", after: "[\\r\\n]", inConstruct: "phrasing" },
1049
+ { character: " ", before: "[\\r\\n]", inConstruct: "phrasing" },
1050
+ {
1051
+ character: " ",
1052
+ inConstruct: ["codeFencedLangGraveAccent", "codeFencedLangTilde"]
1053
+ },
1054
+ // An exclamation mark can start an image, if it is followed by a link or
1055
+ // a link reference.
1056
+ {
1057
+ character: "!",
1058
+ after: "\\[",
1059
+ inConstruct: "phrasing",
1060
+ notInConstruct: fullPhrasingSpans
1061
+ },
1062
+ // A quote can break out of a title.
1063
+ { character: '"', inConstruct: "titleQuote" },
1064
+ // A number sign could start an ATX heading if it starts a line.
1065
+ { atBreak: true, character: "#" },
1066
+ { character: "#", inConstruct: "headingAtx", after: "(?:[\r\n]|$)" },
1067
+ // Dollar sign and percentage are not used in markdown.
1068
+ // An ampersand could start a character reference.
1069
+ { character: "&", after: "[#A-Za-z]", inConstruct: "phrasing" },
1070
+ // An apostrophe can break out of a title.
1071
+ { character: "'", inConstruct: "titleApostrophe" },
1072
+ // A left paren could break out of a destination raw.
1073
+ { character: "(", inConstruct: "destinationRaw" },
1074
+ // A left paren followed by `]` could make something into a link or image.
1075
+ {
1076
+ before: "\\]",
1077
+ character: "(",
1078
+ inConstruct: "phrasing",
1079
+ notInConstruct: fullPhrasingSpans
1080
+ },
1081
+ // A right paren could start a list item or break out of a destination
1082
+ // raw.
1083
+ { atBreak: true, before: "\\d+", character: ")" },
1084
+ { character: ")", inConstruct: "destinationRaw" },
1085
+ // An asterisk can start thematic breaks, list items, emphasis, strong.
1086
+ { atBreak: true, character: "*", after: "(?:[ \r\n*])" },
1087
+ { character: "*", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
1088
+ // A plus sign could start a list item.
1089
+ { atBreak: true, character: "+", after: "(?:[ \r\n])" },
1090
+ // A dash can start thematic breaks, list items, and setext heading
1091
+ // underlines.
1092
+ { atBreak: true, character: "-", after: "(?:[ \r\n-])" },
1093
+ // A dot could start a list item.
1094
+ { atBreak: true, before: "\\d+", character: ".", after: "(?:[ \r\n]|$)" },
1095
+ // Slash, colon, and semicolon are not used in markdown for constructs.
1096
+ // A less than can start html (flow or text) or an autolink.
1097
+ // HTML could start with an exclamation mark (declaration, cdata, comment),
1098
+ // slash (closing tag), question mark (instruction), or a letter (tag).
1099
+ // An autolink also starts with a letter.
1100
+ // Finally, it could break out of a destination literal.
1101
+ { atBreak: true, character: "<", after: "[!/?A-Za-z]" },
1102
+ {
1103
+ character: "<",
1104
+ after: "[!/?A-Za-z]",
1105
+ inConstruct: "phrasing",
1106
+ notInConstruct: fullPhrasingSpans
1107
+ },
1108
+ { character: "<", inConstruct: "destinationLiteral" },
1109
+ // An equals to can start setext heading underlines.
1110
+ { atBreak: true, character: "=" },
1111
+ // A greater than can start block quotes and it can break out of a
1112
+ // destination literal.
1113
+ { atBreak: true, character: ">" },
1114
+ { character: ">", inConstruct: "destinationLiteral" },
1115
+ // Question mark and at sign are not used in markdown for constructs.
1116
+ // A left bracket can start definitions, references, labels,
1117
+ { atBreak: true, character: "[" },
1118
+ { character: "[", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
1119
+ { character: "[", inConstruct: ["label", "reference"] },
1120
+ // A backslash can start an escape (when followed by punctuation) or a
1121
+ // hard break (when followed by an eol).
1122
+ // Note: typical escapes are handled in `safe`!
1123
+ { character: "\\", after: "[\\r\\n]", inConstruct: "phrasing" },
1124
+ // A right bracket can exit labels.
1125
+ { character: "]", inConstruct: ["label", "reference"] },
1126
+ // Caret is not used in markdown for constructs.
1127
+ // An underscore can start emphasis, strong, or a thematic break.
1128
+ { atBreak: true, character: "_" },
1129
+ { character: "_", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
1130
+ // A grave accent can start code (fenced or text), or it can break out of
1131
+ // a grave accent code fence.
1132
+ { atBreak: true, character: "`" },
1133
+ {
1134
+ character: "`",
1135
+ inConstruct: ["codeFencedLangGraveAccent", "codeFencedMetaGraveAccent"]
1136
+ },
1137
+ { character: "`", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
1138
+ // Left brace, vertical bar, right brace are not used in markdown for
1139
+ // constructs.
1140
+ // A tilde can start code (fenced).
1141
+ { atBreak: true, character: "~" },
1142
+ { character: "<", inConstruct: "autolink" },
1143
+ { character: ">", inConstruct: "autolink" },
1144
+ { character: "\x7F", inConstruct: "autolink" }
1145
+ ];
1146
+ var code2 = -1;
1147
+ while (++code2 < 33) {
1148
+ unsafe.push({ character: String.fromCharCode(code2), inConstruct: "autolink" });
1149
+ }
1150
+
1151
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/association.js
1152
+ function association(node) {
1153
+ if (node.label || !node.identifier) {
1154
+ return node.label || "";
1155
+ }
1156
+ return decodeString(node.identifier);
1157
+ }
1158
+ __name(association, "association");
1159
+
1160
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js
1161
+ function compilePattern(pattern) {
1162
+ if (!pattern._compiled) {
1163
+ const before = (pattern.atBreak ? "[\\r\\n][\\t ]*" : "") + (pattern.before ? "(?:" + pattern.before + ")" : "");
1164
+ pattern._compiled = new RegExp(
1165
+ (pattern.beforeNode ? "^" : before ? "(" + before + ")" : "") + (/[$()*+.?[\\\]^{|}]/.test(pattern.character) ? "\\" : "") + pattern.character + (pattern.afterNode ? "$" : pattern.after ? "(?:" + pattern.after + ")" : ""),
1166
+ pattern.unicode ? "gu" : "g"
1167
+ );
1168
+ }
1169
+ return pattern._compiled;
1170
+ }
1171
+ __name(compilePattern, "compilePattern");
1172
+
1173
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/character.js
1174
+ function firstCharacter(value) {
1175
+ const code3 = value.codePointAt(0);
1176
+ return code3 === void 0 ? "" : String.fromCodePoint(code3);
1177
+ }
1178
+ __name(firstCharacter, "firstCharacter");
1179
+ function lastCharacter(value) {
1180
+ const code3 = value.codePointAt(value.length - 2);
1181
+ return code3 !== void 0 && code3 > 65535 ? value.slice(-2) : value.slice(-1);
1182
+ }
1183
+ __name(lastCharacter, "lastCharacter");
1184
+
1185
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/encode-info.js
1186
+ function encodeInfo(outside, inside, marker) {
1187
+ const outsideKind = classifyCharacter(outside);
1188
+ const insideKind = classifyCharacter(inside);
1189
+ if (outsideKind === void 0) {
1190
+ return insideKind === void 0 ? (
1191
+ // Letter inside:
1192
+ // we have to encode *both* letters for `_` as it is looser.
1193
+ // it already forms for `*` (and GFMs `~`).
1194
+ marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false }
1195
+ ) : insideKind === 1 ? (
1196
+ // Whitespace inside: encode both (letter, whitespace).
1197
+ { inside: true, outside: true }
1198
+ ) : (
1199
+ // Punctuation inside: encode outer (letter)
1200
+ { inside: false, outside: true }
1201
+ );
1202
+ }
1203
+ if (outsideKind === 1) {
1204
+ return insideKind === void 0 ? (
1205
+ // Letter inside: already forms.
1206
+ { inside: false, outside: false }
1207
+ ) : insideKind === 1 ? (
1208
+ // Whitespace inside: encode both (whitespace).
1209
+ { inside: true, outside: true }
1210
+ ) : (
1211
+ // Punctuation inside: already forms.
1212
+ { inside: false, outside: false }
1213
+ );
1214
+ }
1215
+ return insideKind === void 0 ? (
1216
+ // Letter inside: already forms.
1217
+ { inside: false, outside: false }
1218
+ ) : insideKind === 1 ? (
1219
+ // Whitespace inside: encode inner (whitespace).
1220
+ { inside: true, outside: false }
1221
+ ) : (
1222
+ // Punctuation inside: already forms.
1223
+ { inside: false, outside: false }
1224
+ );
1225
+ }
1226
+ __name(encodeInfo, "encodeInfo");
1227
+
1228
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
1229
+ var builtins = /* @__PURE__ */ new Map([
1230
+ ["*", false],
1231
+ ["_", true]
1232
+ ]);
1233
+ function candidates(tokens, involved, runOf) {
1234
+ const related = /* @__PURE__ */ new Set();
1235
+ for (const token of tokens) {
1236
+ const siblings = runOf.get(token);
1237
+ if (siblings && token.attention && involved.some((d) => d.attention === token.attention)) {
1238
+ for (const sibling of siblings.tokens) {
1239
+ related.add(sibling.attention);
1240
+ }
1241
+ }
1242
+ }
1243
+ const ordered = [];
1244
+ for (const token of tokens) {
1245
+ if (token.attention && related.delete(token.attention)) {
1246
+ ordered.push(token.attention);
1247
+ }
1248
+ }
1249
+ ordered.reverse();
1250
+ return ordered;
1251
+ }
1252
+ __name(candidates, "candidates");
1253
+ function check(tokens, before, after) {
1254
+ const runs = [];
1255
+ const wrong = /* @__PURE__ */ new Map();
1256
+ const runOf = /* @__PURE__ */ new Map();
1257
+ let index = 0;
1258
+ while (index < tokens.length) {
1259
+ if (!tokens[index].attention) {
1260
+ index++;
1261
+ continue;
1262
+ }
1263
+ const marker = tokens[index].value.charAt(0);
1264
+ const strict = builtins.get(marker);
1265
+ let end = index + 1;
1266
+ while (end < tokens.length && tokens[end].attention && tokens[end].value.charAt(0) === marker) {
1267
+ end++;
1268
+ }
1269
+ const head = index ? tokens[index - 1].value : before;
1270
+ const previous = classifyCharacter(head.charCodeAt(head.length - 1));
1271
+ const next = classifyCharacter(
1272
+ (end < tokens.length ? tokens[end].value : after).charCodeAt(0)
1273
+ );
1274
+ const open = !next || next === 2 && Boolean(previous);
1275
+ const close = !previous || previous === 2 && Boolean(next);
1276
+ const run = {
1277
+ tokens: tokens.slice(index, end),
1278
+ markers: [],
1279
+ start: 0,
1280
+ end: 0,
1281
+ // Underscores are strict, they cannot open or close inside words.
1282
+ open: strict ? open && (Boolean(previous) || !close) : open,
1283
+ close: strict ? close && (Boolean(next) || !open) : close,
1284
+ // All builtins can split runs.
1285
+ split: strict !== void 0
1286
+ };
1287
+ for (const token of run.tokens) {
1288
+ wrong.set(token, [...run.tokens]);
1289
+ runOf.set(token, run);
1290
+ let size = token.value.length;
1291
+ while (size--) run.markers.push(token);
1292
+ }
1293
+ run.end = run.markers.length;
1294
+ runs.push(run);
1295
+ index = end;
1296
+ }
1297
+ pair(runs, wrong);
1298
+ index = -1;
1299
+ while (++index < tokens.length) {
1300
+ const involved = wrong.get(tokens[index]);
1301
+ if (involved) return { attention: candidates(tokens, involved, runOf), index };
1302
+ }
1303
+ }
1304
+ __name(check, "check");
1305
+ function containerPhrasing(parent, state, info) {
1306
+ return serialize(phrasing2(parent, state, info), info.before, info.after);
1307
+ }
1308
+ __name(containerPhrasing, "containerPhrasing");
1309
+ function encode(tokens, start) {
1310
+ const token = tokens[start ? 0 : tokens.length - 1];
1311
+ if (!token || token.attention) return;
1312
+ const character = start ? firstCharacter(token.value) : lastCharacter(token.value);
1313
+ const reference = encodeCharacterReference(
1314
+ /** @type {number} */
1315
+ character.codePointAt(0)
1316
+ );
1317
+ token.value = start ? reference + token.value.slice(character.length) : token.value.slice(0, token.value.length - character.length) + reference;
1318
+ }
1319
+ __name(encode, "encode");
1320
+ function improve(items, chosen, mistake, before, after) {
1321
+ for (const attention3 of mistake.attention) {
1322
+ const current = chosen.get(attention3) || attention3.sequences[0];
1323
+ for (const sequence of attention3.sequences) {
1324
+ if (sequence === current) continue;
1325
+ const trial = new Map(chosen);
1326
+ trial.set(attention3, sequence);
1327
+ const tokens = render(items, trial, before, after);
1328
+ const next = check(tokens, before, after);
1329
+ if (!next || next.index > mistake.index) {
1330
+ return { chosen: trial, mistake: next, tokens };
1331
+ }
1332
+ }
1333
+ }
1334
+ }
1335
+ __name(improve, "improve");
1336
+ function pair(runs, wrong) {
1337
+ let index = 0;
1338
+ while (index < runs.length) {
1339
+ const closer = runs[index];
1340
+ const marker = closer.tokens[0].value.charAt(0);
1341
+ const closerSize = closer.end - closer.start;
1342
+ let open = closer.close && closerSize ? index : 0;
1343
+ while (open--) {
1344
+ const opener = runs[open];
1345
+ const openerSize = opener.end - opener.start;
1346
+ if (opener.tokens[0].value.charAt(0) === marker && opener.open && openerSize && (closer.split ? (
1347
+ // The rule of 3, on the sizes that are left.
1348
+ !((opener.close || closer.open) && closerSize % 3) || (openerSize + closerSize) % 3
1349
+ ) : (
1350
+ // Others pair whole runs of the same size.
1351
+ openerSize === opener.markers.length && openerSize === closerSize
1352
+ ))) {
1353
+ const size = closer.split ? openerSize > 1 && closerSize > 1 ? 2 : 1 : closerSize;
1354
+ const opening = opener.markers.slice(opener.end - size, opener.end);
1355
+ const closing = closer.markers.slice(closer.start, closer.start + size);
1356
+ const openToken = opening[0];
1357
+ const closeToken = closing[0];
1358
+ if (
1359
+ // Whole sequences:
1360
+ // the markers of a sequence are next to each other,
1361
+ // so if the first and last marker are of one sequence of that size,
1362
+ // all markers are exactly that sequence.
1363
+ openToken === opening[size - 1] && openToken.value.length === size && closeToken === closing[size - 1] && closeToken.value.length === size && // Of the same attention, so its opening and closing sequence.
1364
+ openToken.attention === closeToken.attention
1365
+ ) {
1366
+ wrong.delete(openToken);
1367
+ wrong.delete(closeToken);
1368
+ } else {
1369
+ const involved = [.../* @__PURE__ */ new Set([...opening, ...closing])];
1370
+ for (const token of involved) {
1371
+ const list3 = wrong.get(token);
1372
+ if (list3) list3.push(...involved);
1373
+ }
1374
+ }
1375
+ opener.end -= size;
1376
+ closer.start += size;
1377
+ break;
1378
+ }
1379
+ }
1380
+ if (open === -1 || closer.start === closer.end) index++;
1381
+ }
1382
+ }
1383
+ __name(pair, "pair");
1384
+ function attentionSequences(type, markers, sizes) {
1385
+ if (markers.length === 0) {
1386
+ throw new Error(
1387
+ "Cannot serialize `" + type + "` as attention without markers, expected one or more markers"
1388
+ );
1389
+ }
1390
+ if (sizes.length === 0) {
1391
+ throw new Error(
1392
+ "Cannot serialize `" + type + "` as attention without sizes, expected one or more sizes"
1393
+ );
1394
+ }
1395
+ for (const size of sizes) {
1396
+ if (!Number.isSafeInteger(size) || size < 1) {
1397
+ throw new Error(
1398
+ "Cannot serialize `" + type + "` as attention with `" + size + "` as size, expected positive integer"
1399
+ );
1400
+ }
1401
+ }
1402
+ const sequences = [];
1403
+ for (const marker of markers) {
1404
+ if (marker.length !== 1) {
1405
+ throw new Error(
1406
+ "Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected a single ascii character"
1407
+ );
1408
+ }
1409
+ if (!asciiPunctuation(marker.charCodeAt(0))) {
1410
+ throw new Error(
1411
+ "Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected ascii punctuation"
1412
+ );
1413
+ }
1414
+ for (const size of sizes) {
1415
+ sequences.push(marker.repeat(size));
1416
+ }
1417
+ }
1418
+ return sequences;
1419
+ }
1420
+ __name(attentionSequences, "attentionSequences");
1421
+ function phrasing2(parent, state, info) {
1422
+ const indexStack = state.indexStack;
1423
+ const children = parent.children || [];
1424
+ const results = [];
1425
+ let index = -1;
1426
+ let before = info.before;
1427
+ indexStack.push(-1);
1428
+ let tracker = state.createTracker(info);
1429
+ while (++index < children.length) {
1430
+ const child = children[index];
1431
+ let after;
1432
+ indexStack[indexStack.length - 1] = index;
1433
+ if (index + 1 < children.length) {
1434
+ let handle3 = state.handle.handlers[children[index + 1].type];
1435
+ if (handle3 && handle3.peek) handle3 = handle3.peek;
1436
+ after = handle3 ? firstCharacter(
1437
+ handle3(children[index + 1], parent, state, {
1438
+ before: "",
1439
+ after: "",
1440
+ ...tracker.current()
1441
+ })
1442
+ ) : "";
1443
+ } else {
1444
+ after = info.after;
1445
+ }
1446
+ const previous = results[results.length - 1];
1447
+ if (typeof previous === "string" && (before === "\r" || before === "\n") && child.type === "html" && htmlKind(child.value) !== 7) {
1448
+ results[results.length - 1] = previous.replace(/(\r?\n|\r)$/, " ");
1449
+ before = " ";
1450
+ tracker = state.createTracker(info);
1451
+ tracker.move(serialize(results, info.before, info.after));
1452
+ }
1453
+ const handle2 = state.handle.handlers[child.type];
1454
+ if (handle2 && handle2.attention) {
1455
+ const { construct, markers, sizes } = handle2.attention(child, state);
1456
+ const sequences = attentionSequences(child.type, markers, sizes);
1457
+ const sequence = sequences[0];
1458
+ const exit = state.enter(construct);
1459
+ tracker.move(sequence);
1460
+ const inside = phrasing2(
1461
+ /** @type {PhrasingParents} */
1462
+ child,
1463
+ state,
1464
+ {
1465
+ ...tracker.current(),
1466
+ before: sequence,
1467
+ after: sequence
1468
+ }
1469
+ );
1470
+ tracker.move(serialize(inside, sequence, sequence));
1471
+ tracker.move(sequence);
1472
+ exit();
1473
+ results.push({ children: inside, sequences });
1474
+ before = sequence.charAt(sequence.length - 1);
1475
+ } else {
1476
+ const value = state.handle(child, parent, state, {
1477
+ ...tracker.current(),
1478
+ after,
1479
+ before
1480
+ });
1481
+ if (!value) continue;
1482
+ tracker.move(value);
1483
+ results.push(value);
1484
+ before = lastCharacter(value);
1485
+ }
1486
+ }
1487
+ indexStack.pop();
1488
+ return results;
1489
+ }
1490
+ __name(phrasing2, "phrasing");
1491
+ function render(items, chosen, before, after) {
1492
+ const tokens = [];
1493
+ let encodeAfter;
1494
+ let previous = lastCharacter(before);
1495
+ let index = -1;
1496
+ while (++index < items.length) {
1497
+ const item = items[index];
1498
+ if (typeof item === "string") {
1499
+ const token = { value: item, attention: void 0 };
1500
+ if (encodeAfter && encodeAfter === firstCharacter(item)) {
1501
+ encode([token], true);
1502
+ }
1503
+ encodeAfter = void 0;
1504
+ tokens.push(token);
1505
+ if (token.value) previous = lastCharacter(token.value);
1506
+ continue;
1507
+ }
1508
+ const sequence = chosen.get(item) || item.sequences[0];
1509
+ const marker = sequence.charAt(0);
1510
+ const next = items[index + 1];
1511
+ const outsideBefore = previous;
1512
+ const outsideAfter = firstCharacter(
1513
+ next === void 0 ? after : typeof next === "string" ? next : chosen.get(next) || next.sequences[0]
1514
+ );
1515
+ const inside = render(item.children, chosen, sequence, sequence);
1516
+ const head = inside.length > 0 ? inside[0].value : "";
1517
+ const open = encodeInfo(
1518
+ outsideBefore.charCodeAt(outsideBefore.length - 1),
1519
+ head.charCodeAt(0),
1520
+ marker
1521
+ );
1522
+ if (open.inside) encode(inside, true);
1523
+ const tail = inside.length > 0 ? lastCharacter(inside[inside.length - 1].value) : "";
1524
+ const close = encodeInfo(
1525
+ outsideAfter.charCodeAt(0),
1526
+ tail.charCodeAt(tail.length - 1),
1527
+ marker
1528
+ );
1529
+ if (close.inside) encode(inside, false);
1530
+ if (open.outside && outsideBefore !== "\n" && outsideBefore !== "\r") {
1531
+ encode(tokens, false);
1532
+ }
1533
+ if (close.outside) encodeAfter = outsideAfter;
1534
+ tokens.push({ value: sequence, attention: item }, ...inside, {
1535
+ value: sequence,
1536
+ attention: item
1537
+ });
1538
+ previous = sequence.charAt(sequence.length - 1);
1539
+ }
1540
+ return tokens;
1541
+ }
1542
+ __name(render, "render");
1543
+ function serialize(items, before, after) {
1544
+ let chosen = /* @__PURE__ */ new Map();
1545
+ const initial = render(items, chosen, before, after);
1546
+ let tokens = initial;
1547
+ let mistake = check(tokens, before, after);
1548
+ while (mistake) {
1549
+ const next = improve(items, chosen, mistake, before, after);
1550
+ if (!next) {
1551
+ tokens = initial;
1552
+ break;
1553
+ }
1554
+ chosen = next.chosen;
1555
+ tokens = next.tokens;
1556
+ mistake = next.mistake;
1557
+ }
1558
+ let result = "";
1559
+ for (const token of tokens) result += token.value;
1560
+ return result;
1561
+ }
1562
+ __name(serialize, "serialize");
1563
+
1564
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
1565
+ function containerFlow(parent, state, info) {
1566
+ const indexStack = state.indexStack;
1567
+ const children = parent.children || [];
1568
+ const tracker = state.createTracker(info);
1569
+ const results = [];
1570
+ let index = -1;
1571
+ indexStack.push(-1);
1572
+ while (++index < children.length) {
1573
+ const child = children[index];
1574
+ indexStack[indexStack.length - 1] = index;
1575
+ results.push(
1576
+ tracker.move(
1577
+ state.handle(child, parent, state, {
1578
+ before: "\n",
1579
+ after: "\n",
1580
+ ...tracker.current()
1581
+ })
1582
+ )
1583
+ );
1584
+ if (child.type !== "list") {
1585
+ state.bulletLastUsed = void 0;
1586
+ }
1587
+ if (index < children.length - 1) {
1588
+ results.push(
1589
+ tracker.move(between(child, children[index + 1], parent, state))
1590
+ );
1591
+ }
1592
+ }
1593
+ indexStack.pop();
1594
+ return results.join("");
1595
+ }
1596
+ __name(containerFlow, "containerFlow");
1597
+ function between(left, right, parent, state) {
1598
+ let index = state.join.length;
1599
+ while (index--) {
1600
+ const result = state.join[index](left, right, parent, state);
1601
+ if (result === true || result === 1) {
1602
+ break;
1603
+ }
1604
+ if (typeof result === "number") {
1605
+ return "\n".repeat(1 + result);
1606
+ }
1607
+ if (result === false) {
1608
+ return "\n\n<!---->\n\n";
1609
+ }
1610
+ }
1611
+ return "\n\n";
1612
+ }
1613
+ __name(between, "between");
1614
+
1615
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
1616
+ var eol = /\r?\n|\r/g;
1617
+ function indentLines(value, map4) {
1618
+ const result = [];
1619
+ let start = 0;
1620
+ let line = 0;
1621
+ let match;
1622
+ while (match = eol.exec(value)) {
1623
+ one(value.slice(start, match.index));
1624
+ result.push(match[0]);
1625
+ start = match.index + match[0].length;
1626
+ line++;
1627
+ }
1628
+ one(value.slice(start));
1629
+ return result.join("");
1630
+ function one(value2) {
1631
+ result.push(map4(value2, line, !value2));
1632
+ }
1633
+ __name(one, "one");
1634
+ }
1635
+ __name(indentLines, "indentLines");
1636
+
1637
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/safe.js
1638
+ var own2 = {}.hasOwnProperty;
1639
+ function safe(state, input, config) {
1640
+ const value = (config.before || "") + (input || "") + (config.after || "");
1641
+ const positions = [];
1642
+ const result = [];
1643
+ const infos = {};
1644
+ const percentEncode = state.stack.includes("autolink");
1645
+ const offset = config.before ? config.before.length : 0;
1646
+ const end = value.length - (config.after ? config.after.length : 0);
1647
+ let index = -1;
1648
+ while (++index < state.unsafe.length) {
1649
+ const pattern = state.unsafe[index];
1650
+ if (!patternInScope(state.stack, pattern) || !nodeInScope(pattern.beforeNode, config.beforeNode) || !nodeInScope(pattern.afterNode, config.afterNode)) {
1651
+ continue;
1652
+ }
1653
+ const expression = state.compilePattern(pattern);
1654
+ const from = pattern.beforeNode ? offset : 0;
1655
+ const subject = value.slice(from, pattern.afterNode ? end : void 0);
1656
+ let match;
1657
+ while (match = expression.exec(subject)) {
1658
+ const before = "before" in pattern || Boolean(pattern.atBreak);
1659
+ const after = "after" in pattern;
1660
+ const position = from + match.index + (before ? match[1].length : 0);
1661
+ if (own2.call(infos, position)) {
1662
+ if (infos[position].before && !before) {
1663
+ infos[position].before = false;
1664
+ }
1665
+ if (infos[position].after && !after) {
1666
+ infos[position].after = false;
1667
+ }
1668
+ } else {
1669
+ positions.push(position);
1670
+ infos[position] = { before, after };
1671
+ }
1672
+ }
1673
+ }
1674
+ positions.sort(numerical);
1675
+ let start = offset;
1676
+ index = -1;
1677
+ while (++index < positions.length) {
1678
+ const position = positions[index];
1679
+ if (position < start || position >= end) {
1680
+ continue;
1681
+ }
1682
+ if (value.charAt(position) === "_" && // Preceded by an unescaped character that is not punctuation or whitespace:
1683
+ position > 0 && classifyCharacter(value.charCodeAt(position - 1)) === void 0 && !own2.call(infos, position - 1) && // Characters next to attention markers can become character references
1684
+ // later, turning `a` into `&#x61;`, so those do not count.
1685
+ !(position - 1 === offset && /[*_]/.test(value.charAt(offset - 1)))) {
1686
+ let sequenceEnd = position + 1;
1687
+ while (sequenceEnd < end && value.charAt(sequenceEnd) === "_") {
1688
+ sequenceEnd++;
1689
+ }
1690
+ const skip = sequenceEnd - position - 1;
1691
+ if (
1692
+ // All underscores in the run are unsafe positions, so they can be
1693
+ // skipped.
1694
+ positions[index + skip] === sequenceEnd - 1 && // Rest as above.
1695
+ sequenceEnd < value.length && classifyCharacter(value.charCodeAt(sequenceEnd)) === void 0 && !own2.call(infos, sequenceEnd) && !(sequenceEnd === end - 1 && /[*_]/.test(value.charAt(end)))
1696
+ ) {
1697
+ index += skip;
1698
+ continue;
1699
+ }
1700
+ }
1701
+ if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) {
1702
+ continue;
1703
+ }
1704
+ if (start !== position) {
1705
+ const slice = value.slice(start, position);
1706
+ result.push(percentEncode ? slice : escapeBackslashes(slice, "\\"));
1707
+ }
1708
+ start = position;
1709
+ if (percentEncode) {
1710
+ result.push(
1711
+ "%" + value.charCodeAt(position).toString(16).toUpperCase().padStart(2, "0")
1712
+ );
1713
+ start++;
1714
+ } else if (/[!-/:-@[-`{-~]/.test(value.charAt(position)) && (!config.encode || !config.encode.includes(value.charAt(position)))) {
1715
+ result.push("\\");
1716
+ } else {
1717
+ result.push(encodeCharacterReference(value.charCodeAt(position)));
1718
+ start++;
1719
+ }
1720
+ }
1721
+ const rest = value.slice(start, end);
1722
+ result.push(percentEncode ? rest : escapeBackslashes(rest, config.after));
1723
+ return result.join("");
1724
+ }
1725
+ __name(safe, "safe");
1726
+ function nodeInScope(types, node) {
1727
+ if (!types) return true;
1728
+ if (!node) return false;
1729
+ return typeof types === "string" ? types === node.type : types.includes(node.type);
1730
+ }
1731
+ __name(nodeInScope, "nodeInScope");
1732
+ function numerical(a, b) {
1733
+ return a - b;
1734
+ }
1735
+ __name(numerical, "numerical");
1736
+ function escapeBackslashes(value, after) {
1737
+ const expression = /\\(?=[!-/:-@[-`{-~])/g;
1738
+ const positions = [];
1739
+ const results = [];
1740
+ const whole = value + after;
1741
+ let index = -1;
1742
+ let start = 0;
1743
+ let match;
1744
+ while (match = expression.exec(whole)) {
1745
+ positions.push(match.index);
1746
+ }
1747
+ while (++index < positions.length) {
1748
+ if (start !== positions[index]) {
1749
+ results.push(value.slice(start, positions[index]));
1750
+ }
1751
+ results.push("\\");
1752
+ start = positions[index];
1753
+ }
1754
+ results.push(value.slice(start));
1755
+ return results.join("");
1756
+ }
1757
+ __name(escapeBackslashes, "escapeBackslashes");
1758
+
1759
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/track.js
1760
+ function track(config) {
1761
+ const options = config || {};
1762
+ const now = options.now || {};
1763
+ let lineShift = options.lineShift || 0;
1764
+ let line = now.line || 1;
1765
+ let column = now.column || 1;
1766
+ return { move, current, shift };
1767
+ function current() {
1768
+ return { now: { line, column }, lineShift };
1769
+ }
1770
+ __name(current, "current");
1771
+ function shift(value) {
1772
+ lineShift += value;
1773
+ }
1774
+ __name(shift, "shift");
1775
+ function move(input) {
1776
+ const value = input || "";
1777
+ const chunks = value.split(/\r?\n|\r/g);
1778
+ const tail = chunks[chunks.length - 1];
1779
+ line += chunks.length - 1;
1780
+ column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift;
1781
+ return value;
1782
+ }
1783
+ __name(move, "move");
1784
+ }
1785
+ __name(track, "track");
1786
+
1787
+ // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/index.js
1788
+ function toMarkdown(tree, options) {
1789
+ const settings = options || {};
1790
+ const state = {
1791
+ associationId: association,
1792
+ bulletCurrent: void 0,
1793
+ bulletLastUsed: void 0,
1794
+ containerPhrasing: containerPhrasingBound,
1795
+ containerFlow: containerFlowBound,
1796
+ createTracker: track,
1797
+ compilePattern,
1798
+ enter,
1799
+ // @ts-expect-error: GFM / frontmatter are typed in `mdast` but not defined
1800
+ // here.
1801
+ handlers: { ...handle },
1802
+ // @ts-expect-error: add `handle` in a second.
1803
+ handle: void 0,
1804
+ indentLines,
1805
+ indexStack: [],
1806
+ join: [...join],
1807
+ options: {},
1808
+ safe: safeBound,
1809
+ stack: [],
1810
+ unsafe: [...unsafe]
1811
+ };
1812
+ configure(state, settings);
1813
+ if (state.options.tightDefinitions) {
1814
+ state.join.push(joinDefinition);
1815
+ }
1816
+ state.handle = zwitch("type", {
1817
+ invalid,
1818
+ unknown,
1819
+ handlers: state.handlers
1820
+ });
1821
+ let result = state.handle(
1822
+ phrasing(tree) ? { type: "root", children: [tree] } : tree,
1823
+ void 0,
1824
+ state,
1825
+ { before: "\n", after: "\n", now: { line: 1, column: 1 }, lineShift: 0 }
1826
+ );
1827
+ if (result && result.charCodeAt(result.length - 1) !== 10 && result.charCodeAt(result.length - 1) !== 13) {
1828
+ result += "\n";
1829
+ }
1830
+ return result;
1831
+ function enter(name) {
1832
+ state.stack.push(name);
1833
+ return exit;
1834
+ function exit() {
1835
+ state.stack.pop();
1836
+ }
1837
+ __name(exit, "exit");
1838
+ }
1839
+ __name(enter, "enter");
1840
+ }
1841
+ __name(toMarkdown, "toMarkdown");
1842
+ function invalid(value) {
1843
+ throw new Error("Cannot handle value `" + value + "`, expected node");
1844
+ }
1845
+ __name(invalid, "invalid");
1846
+ function unknown(value) {
1847
+ const node = (
1848
+ /** @type {Nodes} */
1849
+ value
1850
+ );
1851
+ throw new Error("Cannot handle unknown node `" + node.type + "`");
1852
+ }
1853
+ __name(unknown, "unknown");
1854
+ function joinDefinition(left, right) {
1855
+ if (left.type === "definition" && left.type === right.type) {
1856
+ return 0;
1857
+ }
1858
+ }
1859
+ __name(joinDefinition, "joinDefinition");
1860
+ function containerPhrasingBound(parent, info) {
1861
+ return containerPhrasing(parent, this, info);
1862
+ }
1863
+ __name(containerPhrasingBound, "containerPhrasingBound");
1864
+ function containerFlowBound(parent, info) {
1865
+ return containerFlow(parent, this, info);
1866
+ }
1867
+ __name(containerFlowBound, "containerFlowBound");
1868
+ function safeBound(value, config) {
1869
+ return safe(this, value, config);
1870
+ }
1871
+ __name(safeBound, "safeBound");
1872
+
1873
+ export {
1874
+ handle,
1875
+ toMarkdown
1876
+ };