@seriousgaming/sdk-tools 1.6.1 → 1.8.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 (202) hide show
  1. package/dist/agent/guidance.md +1 -0
  2. package/dist/{cli-2NU2LPEE.js → cli-27M4PX7O.js} +17 -17
  3. package/dist/{cli-2BH7FX27.js → cli-2FXZZLCL.js} +1 -1
  4. package/dist/{cli-5ACDPCXI.js → cli-2KDV2DYC.js} +3 -3
  5. package/dist/{cli-OXAUOWCN.js → cli-2QM63J3I.js} +1 -1
  6. package/dist/{cli-HW53ICZC.js → cli-32NRB2IT.js} +15 -15
  7. package/dist/{cli-45OCBG53.js → cli-3HBYH4VF.js} +11 -11
  8. package/dist/{cli-4VFZHLDG.js → cli-3HPAKEJJ.js} +2 -2
  9. package/dist/{cli-R2MUZQE2.js → cli-3HZGJRQW.js} +11 -11
  10. package/dist/{cli-PGCIHPU7.js → cli-3OCKRPXI.js} +18 -18
  11. package/dist/{cli-64AB62PM.js → cli-3OVXQJEW.js} +2 -2
  12. package/dist/{cli-4UWFQNGF.js → cli-3VV2JLHX.js} +1 -1
  13. package/dist/{cli-XSLNH5PR.js → cli-42ZUP4X3.js} +141 -5
  14. package/dist/{cli-ZJFQ7EEA.js → cli-4B5OBHSY.js} +19 -19
  15. package/dist/{cli-7A6MKCUJ.js → cli-4EMNCU63.js} +27 -19
  16. package/dist/cli-5CG6BMCY.js +36 -0
  17. package/dist/{cli-XZCJIKIV.js → cli-5FRKWNVP.js} +19 -19
  18. package/dist/{cli-Y3DDNMPX.js → cli-5P66N5G6.js} +17 -17
  19. package/dist/{cli-6VNKQ3OX.js → cli-5SYPXJCB.js} +28 -16
  20. package/dist/{cli-G6CANSPL.js → cli-66AHBZRZ.js} +15 -15
  21. package/dist/{cli-BJMS3VX3.js → cli-6AGWTGTO.js} +106 -28
  22. package/dist/{cli-TTMBBEJC.js → cli-6BAZE75K.js} +18 -18
  23. package/dist/{cli-GFNDW2DL.js → cli-6FVHRL3H.js} +19 -19
  24. package/dist/{cli-QVASWX2A.js → cli-6GDPO5VU.js} +2 -2
  25. package/dist/{cli-7XLHO2FE.js → cli-6NBER36P.js} +1 -1
  26. package/dist/{cli-FQRVFGN6.js → cli-726NJARI.js} +0 -0
  27. package/dist/{cli-CD5CIJZI.js → cli-72DRYVTT.js} +13 -13
  28. package/dist/{cli-MMN4BPO4.js → cli-7CW2BBJG.js} +1 -1
  29. package/dist/{cli-XAT25PRU.js → cli-7GJGFILU.js} +15 -15
  30. package/dist/{cli-HFX3YPUL.js → cli-7NCVUM5U.js} +3 -3
  31. package/dist/cli-7S4G4EKK.js +110 -0
  32. package/dist/{cli-J4DKUUTK.js → cli-7V6GUIIS.js} +2 -2
  33. package/dist/{cli-N6H6T2E2.js → cli-AEAFLZGY.js} +12 -0
  34. package/dist/{cli-C47GJATR.js → cli-AGYCXRPR.js} +3 -3
  35. package/dist/{cli-XSVGKI3R.js → cli-BC4KKNLA.js} +1 -1
  36. package/dist/cli-BQ3FHENQ.js +16 -0
  37. package/dist/{cli-KGM6RRQW.js → cli-BXCCODYD.js} +20 -20
  38. package/dist/cli-C2XDL4LD.js +30 -0
  39. package/dist/{cli-MJUYJIEP.js → cli-C45A5VX6.js} +3 -3
  40. package/dist/{cli-DOXRQ3S5.js → cli-C7YZNPWX.js} +11 -11
  41. package/dist/{cli-HOE3WLFH.js → cli-CAX4CQTC.js} +13 -13
  42. package/dist/{cli-YOTGR3NB.js → cli-CVOLMK3Z.js} +1 -1
  43. package/dist/{cli-ILFDANBR.js → cli-D3CZRXVJ.js} +63 -17
  44. package/dist/{cli-4YB3ROVR.js → cli-DMKRP33X.js} +1 -1
  45. package/dist/{cli-Y3O5F4JN.js → cli-DPFN2LIZ.js} +15 -15
  46. package/dist/{cli-6UTPHWRQ.js → cli-DT756M3Z.js} +20 -20
  47. package/dist/{cli-TIDQ4WUE.js → cli-DXHPYN4N.js} +1 -1
  48. package/dist/{cli-6K3VQQUS.js → cli-E665NKUQ.js} +5 -5
  49. package/dist/{cli-O5ABH2WK.js → cli-EK7CGMGS.js} +17 -17
  50. package/dist/{cli-6QB2VFPY.js → cli-ESU3J563.js} +15 -15
  51. package/dist/{cli-VPRRICZA.js → cli-F47ELAXM.js} +47 -47
  52. package/dist/{cli-RLEGRWFM.js → cli-FH4WBZHA.js} +14 -14
  53. package/dist/{cli-3D3ZXWOV.js → cli-FHKRO6OU.js} +19 -19
  54. package/dist/{cli-JZCLIT3O.js → cli-FSEDPZR5.js} +19 -19
  55. package/dist/{cli-XOTNXEJA.js → cli-FV45UZQP.js} +19 -19
  56. package/dist/{cli-AV2FYC5G.js → cli-G7FX7ZIU.js} +12 -12
  57. package/dist/{cli-IP4RXGHM.js → cli-GFONBOJT.js} +129 -38
  58. package/dist/{cli-C5QOJJWX.js → cli-GHIMH6JU.js} +1 -1
  59. package/dist/{cli-IDVUHGKG.js → cli-HC7L5DXV.js} +15 -15
  60. package/dist/{cli-WU43JT4T.js → cli-HJPNNORV.js} +2 -2
  61. package/dist/{cli-QY5NZAR7.js → cli-HMEZHQBC.js} +17 -17
  62. package/dist/{cli-JZOZOEZM.js → cli-HQUVSAHY.js} +18 -18
  63. package/dist/{cli-MYJGMA6U.js → cli-IC5FOT2J.js} +1 -1
  64. package/dist/{cli-VL2P354N.js → cli-IVZ7AHUJ.js} +3 -3
  65. package/dist/{cli-B6YHEKIJ.js → cli-J2OTL6JH.js} +5 -5
  66. package/dist/{cli-Z56ZIVA6.js → cli-JA6UFTSX.js} +17 -17
  67. package/dist/{cli-MJV47HKI.js → cli-JOXCAGM7.js} +19 -19
  68. package/dist/{cli-ZBN5KAIB.js → cli-JQ6I5GGE.js} +3 -3
  69. package/dist/{cli-TDSQSCX4.js → cli-K6M6YB67.js} +1 -1
  70. package/dist/{cli-C6ZLPK2U.js → cli-KFVA7DT3.js} +3 -3
  71. package/dist/{cli-KOGRWFN7.js → cli-KH6FKM5A.js} +15 -15
  72. package/dist/{cli-5IAW3LIF.js → cli-KMT235FV.js} +2 -2
  73. package/dist/{cli-ZDUADFBY.js → cli-KU4PG7ZA.js} +15 -15
  74. package/dist/{cli-N45DREM4.js → cli-L4DEEAMK.js} +17 -17
  75. package/dist/{cli-MU5LB43S.js → cli-ME3JKMJL.js} +19 -19
  76. package/dist/{cli-C3CMJSNL.js → cli-MJ65PIYI.js} +15 -15
  77. package/dist/cli-MM2ROZWO.js +36 -0
  78. package/dist/{cli-RZITKPJX.js → cli-MN7X4UG2.js} +1 -1
  79. package/dist/{cli-4SIWLHQO.js → cli-MPU4FLA7.js} +4 -4
  80. package/dist/{cli-HCRTYQQS.js → cli-MPWTXNF6.js} +2 -2
  81. package/dist/{cli-EVI36HEM.js → cli-N5K2KHPR.js} +15 -15
  82. package/dist/{cli-RSW6EBBD.js → cli-NGOQWOQE.js} +15 -15
  83. package/dist/{cli-ZTWOE3ZT.js → cli-NU4SCD5D.js} +1 -1
  84. package/dist/{cli-BYCHKSSH.js → cli-O3IMNLN2.js} +282 -96
  85. package/dist/{cli-KGT5L7VZ.js → cli-OUFXSQOW.js} +7265 -4467
  86. package/dist/{cli-DFBTZEBX.js → cli-PEY6XZDE.js} +16 -16
  87. package/dist/{cli-QUSCIUOM.js → cli-PLW3TWJ7.js} +19 -19
  88. package/dist/{cli-JVI24FI6.js → cli-PO2ALWHP.js} +13 -13
  89. package/dist/{cli-3BRC32CP.js → cli-PPEB3ENS.js} +18 -18
  90. package/dist/{cli-ZDOTXEKL.js → cli-PZ7G544B.js} +3 -3
  91. package/dist/{cli-L7VYSXQK.js → cli-Q5BKFFDL.js} +4 -4
  92. package/dist/{cli-3ZKWV3PN.js → cli-QAI6T5FL.js} +15 -15
  93. package/dist/{cli-KSGB2ZLK.js → cli-QAVLRCQ5.js} +3 -3
  94. package/dist/{cli-VDBW23SS.js → cli-QDIH2G2P.js} +15 -15
  95. package/dist/cli-SN7D7HTX.js +36 -0
  96. package/dist/{cli-IEMKI7J7.js → cli-SOQJHK4Q.js} +6 -6
  97. package/dist/{cli-4PXNOJQX.js → cli-SPKPDXWD.js} +15 -15
  98. package/dist/{cli-MOPSZ3CS.js → cli-SWUAXVIJ.js} +15 -15
  99. package/dist/cli-TJNLXQJ5.js +36 -0
  100. package/dist/{cli-BUQI5UU4.js → cli-U2EWI6H5.js} +11 -11
  101. package/dist/{cli-TT36JCU5.js → cli-UADUC4JD.js} +2 -2
  102. package/dist/{cli-FWFRKQNE.js → cli-UR63LFVK.js} +2 -2
  103. package/dist/{cli-J4UBELKF.js → cli-UTHPCZYL.js} +2 -2
  104. package/dist/{cli-Q6ZBZYK2.js → cli-UYV3BDPA.js} +3 -3
  105. package/dist/{cli-LQOHATY2.js → cli-UZCQL6YP.js} +3 -3
  106. package/dist/{cli-HKORECAG.js → cli-V5K3CCYZ.js} +2 -2
  107. package/dist/cli-V7L3HEL4.js +36 -0
  108. package/dist/{cli-HSIHDN6K.js → cli-VBSF3R3L.js} +16 -16
  109. package/dist/{cli-NROTDF5Y.js → cli-VQ4OJ4KE.js} +18 -18
  110. package/dist/{cli-IUS2YCD3.js → cli-VTLFQHDO.js} +1 -1
  111. package/dist/{cli-JJSWBW4H.js → cli-W7XCTGQ7.js} +15 -15
  112. package/dist/{cli-UZZFNXRX.js → cli-W7Y7X3FX.js} +19 -19
  113. package/dist/cli-WWNTBK37.js +1973 -0
  114. package/dist/cli-XPJGW375.js +36 -0
  115. package/dist/{cli-SRHBXZCN.js → cli-Y33ULHYO.js} +1 -1
  116. package/dist/{cli-TTKICM5P.js → cli-YLYB4ITF.js} +13 -13
  117. package/dist/{cli-72XDEFU3.js → cli-ZFY6TGU7.js} +4 -4
  118. package/dist/{cli-6SGCYEEC.js → cli-ZSKP2IRP.js} +53 -38
  119. package/dist/cli.js +53 -51
  120. package/dist/client.js +17699 -16630
  121. package/dist/core/game-settings.d.ts +5 -3
  122. package/dist/core/save-scenario.d.ts +1 -0
  123. package/dist/core/session-roster.d.ts +10 -0
  124. package/dist/core/session-start-gate.d.ts +25 -0
  125. package/dist/core/session.d.ts +4 -0
  126. package/dist/dev/console/assets/index-CVNjiRUh.js +208 -0
  127. package/dist/dev/console/index.html +1 -1
  128. package/dist/dev/routes.d.ts +5 -2
  129. package/dist/dev/shell.d.ts +9 -1
  130. package/dist/dev/view/batch.d.ts +11 -1
  131. package/dist/dev/view/route.d.ts +18 -1
  132. package/dist/dev/view/view.d.ts +9 -0
  133. package/dist/docs/api/deck.md +1 -1
  134. package/dist/docs/api/index.md +2 -2
  135. package/dist/docs/api/sdk-commands.md +4 -0
  136. package/dist/docs/api/sdk-e2e.md +12 -6
  137. package/dist/docs/api/sdk-projection.md +1 -0
  138. package/dist/docs/api/sdk-tools-client.md +7 -1
  139. package/dist/docs/api/sdk-tools-playwright.md +1 -8
  140. package/dist/docs/api/sdk-ui-testing.md +1 -0
  141. package/dist/docs/api/sdk-ui.md +67 -63
  142. package/dist/docs/api/sdk.md +12 -1
  143. package/dist/docs/changelog.md +26 -0
  144. package/dist/docs/cli-and-dev-server.md +4 -0
  145. package/dist/docs/cli-error-codes.md +7 -1
  146. package/dist/docs/cli-reference.md +20 -2
  147. package/dist/docs/concepts/index.md +1 -0
  148. package/dist/docs/guides/engine.md +5 -0
  149. package/dist/docs/guides/file-handling.md +4 -1
  150. package/dist/docs/guides/llm-integration.md +3 -2
  151. package/dist/docs/guides/multi-team-games.md +2 -0
  152. package/dist/docs/guides/patterns.md +5 -0
  153. package/dist/docs/guides/presentation.md +11 -10
  154. package/dist/docs/guides/session-hooks.md +16 -0
  155. package/dist/docs/guides/session.md +1 -1
  156. package/dist/docs/guides/settings.md +6 -2
  157. package/dist/docs/guides/setup.md +23 -2
  158. package/dist/docs/guides/speech-generation.md +1 -0
  159. package/dist/docs/guides/testing.md +2 -0
  160. package/dist/docs/guides/tick-controller.md +2 -0
  161. package/dist/docs/guides/type-safety.md +2 -1
  162. package/dist/docs/guides/ui-files-and-llms.md +3 -1
  163. package/dist/docs/guides/upgrading.md +16 -0
  164. package/dist/docs/guides/validators.md +27 -4
  165. package/dist/docs/guides/waiting-room.md +2 -0
  166. package/dist/docs/page-index.md +12 -10
  167. package/dist/docs/recipes/call-endpoint-from-ui.md +1 -0
  168. package/dist/docs/recipes/create-scenario-editor.md +2 -1
  169. package/dist/docs/recipes/create-setup.md +2 -1
  170. package/dist/docs/recipes/declare-api-uses.md +1 -0
  171. package/dist/docs/recipes/describe-setup-with-endpoint.md +69 -0
  172. package/dist/docs/recipes/index.md +3 -1
  173. package/dist/docs/recipes/share-logic-between-engine-and-ui.md +2 -2
  174. package/dist/docs/recipes/test-user-interface.md +1 -1
  175. package/dist/docs/recipes/validate-scenarios.md +9 -3
  176. package/dist/docs/recipes/write-setup-notes.md +58 -0
  177. package/dist/docs/troubleshooting.md +2 -1
  178. package/dist/execution/executor.d.ts +12 -0
  179. package/dist/execution/scenario-gates.d.ts +40 -0
  180. package/dist/host/protocol.d.ts +10 -1
  181. package/dist/host.js +1083 -467
  182. package/dist/playwright.js +17760 -16691
  183. package/dist/runtime/manifest-version.d.ts +1 -1
  184. package/dist/runtime.js +4 -2
  185. package/dist/schema.json +10 -1
  186. package/dist/setup/setup-notes.d.ts +42 -0
  187. package/dist/templates/package/package.json.liquid +15 -15
  188. package/dist/templates/starter-game/package.json +13 -13
  189. package/dist/utils/error-codes.d.ts +13 -1
  190. package/dist/validation/package-validation.d.ts +1 -1
  191. package/package.json +22 -23
  192. package/dist/cli-2GZYGRVL.js +0 -36
  193. package/dist/cli-5SM367K7.js +0 -30
  194. package/dist/cli-DDJYUKQG.js +0 -36
  195. package/dist/cli-LK3V4RI5.js +0 -36
  196. package/dist/cli-N24OHSAN.js +0 -36
  197. package/dist/cli-OMWC75CC.js +0 -256
  198. package/dist/cli-RCIWBCXD.js +0 -36
  199. package/dist/cli-UMEBPAZQ.js +0 -16
  200. package/dist/cli-VQ6HVQW4.js +0 -4010
  201. package/dist/cli-WR3NOY74.js +0 -36
  202. package/dist/dev/console/assets/index-CuMOOH9m.js +0 -204
package/dist/host.js CHANGED
@@ -189,6 +189,7 @@ var SURFACES = {
189
189
  "setTeamList",
190
190
  "setParticipantList",
191
191
  "setTeamLinks",
192
+ "setSessionJoinLink",
192
193
  "setAvailableOverlays",
193
194
  "setRunKind",
194
195
  "setScenarioName",
@@ -844,8 +845,8 @@ function markdownSpace(code3) {
844
845
  var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
845
846
  var unicodeWhitespace = regexCheck(/\s/);
846
847
  function regexCheck(regex) {
847
- return check;
848
- function check(code3) {
848
+ return check2;
849
+ function check2(code3) {
849
850
  return code3 !== null && code3 > -1 && regex.test(String.fromCharCode(code3));
850
851
  }
851
852
  }
@@ -1052,18 +1053,18 @@ function parseEntities(value, options) {
1052
1053
  let index2 = 0;
1053
1054
  let lines = -1;
1054
1055
  let queue = "";
1055
- let point3;
1056
+ let point4;
1056
1057
  let indent2;
1057
1058
  if (settings.position) {
1058
1059
  if ("start" in settings.position || "indent" in settings.position) {
1059
1060
  indent2 = settings.position.indent;
1060
- point3 = settings.position.start;
1061
+ point4 = settings.position.start;
1061
1062
  } else {
1062
- point3 = settings.position;
1063
+ point4 = settings.position;
1063
1064
  }
1064
1065
  }
1065
- let line = (point3 ? point3.line : 0) || 1;
1066
- let column = (point3 ? point3.column : 0) || 1;
1066
+ let line = (point4 ? point4.line : 0) || 1;
1067
+ let column = (point4 ? point4.column : 0) || 1;
1067
1068
  let previous4 = now();
1068
1069
  let character;
1069
1070
  index2--;
@@ -1228,7 +1229,7 @@ function parseEntities(value, options) {
1228
1229
  return {
1229
1230
  line,
1230
1231
  column,
1231
- offset: index2 + ((point3 ? point3.offset : 0) || 0)
1232
+ offset: index2 + ((point4 ? point4.offset : 0) || 0)
1232
1233
  };
1233
1234
  }
1234
1235
  function warning(code3, offset) {
@@ -1283,9 +1284,9 @@ function core(value, options) {
1283
1284
  return value;
1284
1285
  }
1285
1286
  return value.replace(surrogatePairsRegex, surrogate).replace(controlCharactersRegex, basic);
1286
- function surrogate(pair, index2, all2) {
1287
+ function surrogate(pair2, index2, all2) {
1287
1288
  return options.format(
1288
- (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536,
1289
+ (pair2.charCodeAt(0) - 55296) * 1024 + pair2.charCodeAt(1) - 56320 + 65536,
1289
1290
  all2.charCodeAt(index2 + 2),
1290
1291
  options
1291
1292
  );
@@ -1325,193 +1326,14 @@ function stringifyEntitiesLight(value, options) {
1325
1326
  return core(value, Object.assign({ format: formatBasic }, options));
1326
1327
  }
1327
1328
 
1328
- // ../node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
1329
- var convert = (
1330
- // Note: overloads in JSDoc can’t yet use different `@template`s.
1331
- /**
1332
- * @type {(
1333
- * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
1334
- * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
1335
- * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
1336
- * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
1337
- * ((test?: Test) => Check)
1338
- * )}
1339
- */
1340
- /**
1341
- * @param {Test} [test]
1342
- * @returns {Check}
1343
- */
1344
- (function(test) {
1345
- if (test === null || test === void 0) {
1346
- return ok2;
1347
- }
1348
- if (typeof test === "function") {
1349
- return castFactory(test);
1350
- }
1351
- if (typeof test === "object") {
1352
- return Array.isArray(test) ? anyFactory(test) : (
1353
- // Cast because `ReadonlyArray` goes into the above but `isArray`
1354
- // narrows to `Array`.
1355
- propertiesFactory(
1356
- /** @type {Props} */
1357
- test
1358
- )
1359
- );
1360
- }
1361
- if (typeof test === "string") {
1362
- return typeFactory(test);
1363
- }
1364
- throw new Error("Expected function, string, or object as test");
1365
- })
1366
- );
1367
- function anyFactory(tests) {
1368
- const checks = [];
1369
- let index2 = -1;
1370
- while (++index2 < tests.length) {
1371
- checks[index2] = convert(tests[index2]);
1372
- }
1373
- return castFactory(any);
1374
- function any(...parameters) {
1375
- let index3 = -1;
1376
- while (++index3 < checks.length) {
1377
- if (checks[index3].apply(this, parameters)) return true;
1378
- }
1379
- return false;
1380
- }
1381
- }
1382
- function propertiesFactory(check) {
1383
- const checkAsRecord = (
1384
- /** @type {Record<string, unknown>} */
1385
- check
1386
- );
1387
- return castFactory(all2);
1388
- function all2(node2) {
1389
- const nodeAsRecord = (
1390
- /** @type {Record<string, unknown>} */
1391
- /** @type {unknown} */
1392
- node2
1393
- );
1394
- let key;
1395
- for (key in check) {
1396
- if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
1397
- }
1398
- return true;
1399
- }
1400
- }
1401
- function typeFactory(check) {
1402
- return castFactory(type);
1403
- function type(node2) {
1404
- return node2 && node2.type === check;
1405
- }
1406
- }
1407
- function castFactory(testFunction) {
1408
- return check;
1409
- function check(value, index2, parent) {
1410
- return Boolean(
1411
- looksLikeANode(value) && testFunction.call(
1412
- this,
1413
- value,
1414
- typeof index2 === "number" ? index2 : void 0,
1415
- parent || void 0
1416
- )
1417
- );
1418
- }
1419
- }
1420
- function ok2() {
1421
- return true;
1422
- }
1423
- function looksLikeANode(value) {
1424
- return value !== null && typeof value === "object" && "type" in value;
1425
- }
1426
-
1427
- // ../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.js
1428
- function color(d) {
1429
- return d;
1430
- }
1431
-
1432
- // ../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.js
1433
- var empty = [];
1434
- var CONTINUE = true;
1435
- var EXIT = false;
1436
- var SKIP = "skip";
1437
- function visitParents(tree, test, visitor, reverse) {
1438
- let check;
1439
- if (typeof test === "function" && typeof visitor !== "function") {
1440
- reverse = visitor;
1441
- visitor = test;
1442
- } else {
1443
- check = test;
1444
- }
1445
- const is2 = convert(check);
1446
- const step = reverse ? -1 : 1;
1447
- factory(tree, void 0, [])();
1448
- function factory(node2, index2, parents) {
1449
- const value = (
1450
- /** @type {Record<string, unknown>} */
1451
- node2 && typeof node2 === "object" ? node2 : {}
1452
- );
1453
- if (typeof value.type === "string") {
1454
- const name = (
1455
- // `hast`
1456
- typeof value.tagName === "string" ? value.tagName : (
1457
- // `xast`
1458
- typeof value.name === "string" ? value.name : void 0
1459
- )
1460
- );
1461
- Object.defineProperty(visit2, "name", {
1462
- value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
1463
- });
1464
- }
1465
- return visit2;
1466
- function visit2() {
1467
- let result = empty;
1468
- let subresult;
1469
- let offset;
1470
- let grandparents;
1471
- if (!test || is2(node2, index2, parents[parents.length - 1] || void 0)) {
1472
- result = toResult(visitor(node2, parents));
1473
- if (result[0] === EXIT) {
1474
- return result;
1475
- }
1476
- }
1477
- if ("children" in node2 && node2.children) {
1478
- const nodeAsParent = (
1479
- /** @type {UnistParent} */
1480
- node2
1481
- );
1482
- if (nodeAsParent.children && result[0] !== SKIP) {
1483
- offset = (reverse ? nodeAsParent.children.length : -1) + step;
1484
- grandparents = parents.concat(nodeAsParent);
1485
- while (offset > -1 && offset < nodeAsParent.children.length) {
1486
- const child = nodeAsParent.children[offset];
1487
- subresult = factory(child, offset, grandparents)();
1488
- if (subresult[0] === EXIT) {
1489
- return subresult;
1490
- }
1491
- offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
1492
- }
1493
- }
1494
- }
1495
- return result;
1496
- }
1497
- }
1498
- }
1499
- function toResult(value) {
1500
- if (Array.isArray(value)) {
1501
- return value;
1502
- }
1503
- if (typeof value === "number") {
1504
- return [CONTINUE, value];
1505
- }
1506
- return value === null || value === void 0 ? empty : [value];
1507
- }
1508
-
1509
- // ../node_modules/.pnpm/mdast-util-directive@3.1.1/node_modules/mdast-util-directive/lib/index.js
1329
+ // ../node_modules/.pnpm/mdast-util-directive@3.2.0/node_modules/mdast-util-directive/lib/index.js
1510
1330
  var own = {}.hasOwnProperty;
1331
+ var emptyFromMarkdownOptions = {};
1511
1332
  var emptyOptions = {};
1512
1333
  var shortcut = /^[^\t\n\r "#'.<=>`}]+$/;
1513
1334
  var unquoted = /^[^\t\n\r "'<=>`}]+$/;
1514
- function directiveFromMarkdown() {
1335
+ function directiveFromMarkdown(options) {
1336
+ const settings = options || emptyFromMarkdownOptions;
1515
1337
  return {
1516
1338
  canContainEols: ["textDirective"],
1517
1339
  enter: {
@@ -1525,29 +1347,58 @@ function directiveFromMarkdown() {
1525
1347
  },
1526
1348
  exit: {
1527
1349
  directiveContainer: exit,
1350
+ directiveContainerAttributeClass: exitAttributeShortcut,
1528
1351
  directiveContainerAttributeClassValue: exitAttributeClassValue,
1352
+ directiveContainerAttributeId: exitAttributeShortcut,
1529
1353
  directiveContainerAttributeIdValue: exitAttributeIdValue,
1530
1354
  directiveContainerAttributeName: exitAttributeName,
1531
1355
  directiveContainerAttributeValue: exitAttributeValue,
1356
+ directiveContainerAttributeValueLiteral: exitAttributeValueLiteral,
1532
1357
  directiveContainerAttributes: exitAttributes,
1533
1358
  directiveContainerLabel: exitContainerLabel,
1534
1359
  directiveContainerName: exitName,
1360
+ directiveContainerSequence: exitSequence,
1535
1361
  directiveLeaf: exit,
1362
+ directiveLeafAttributeClass: exitAttributeShortcut,
1536
1363
  directiveLeafAttributeClassValue: exitAttributeClassValue,
1364
+ directiveLeafAttributeId: exitAttributeShortcut,
1537
1365
  directiveLeafAttributeIdValue: exitAttributeIdValue,
1538
1366
  directiveLeafAttributeName: exitAttributeName,
1539
1367
  directiveLeafAttributeValue: exitAttributeValue,
1368
+ directiveLeafAttributeValueLiteral: exitAttributeValueLiteral,
1540
1369
  directiveLeafAttributes: exitAttributes,
1370
+ directiveLeafLabel: exitLabel,
1541
1371
  directiveLeafName: exitName,
1372
+ directiveLeafSequence: exitSequence,
1542
1373
  directiveText: exit,
1374
+ directiveTextAttributeClass: exitAttributeShortcut,
1543
1375
  directiveTextAttributeClassValue: exitAttributeClassValue,
1376
+ directiveTextAttributeId: exitAttributeShortcut,
1544
1377
  directiveTextAttributeIdValue: exitAttributeIdValue,
1545
1378
  directiveTextAttributeName: exitAttributeName,
1546
1379
  directiveTextAttributeValue: exitAttributeValue,
1380
+ directiveTextAttributeValueLiteral: exitAttributeValueLiteral,
1547
1381
  directiveTextAttributes: exitAttributes,
1382
+ directiveTextLabel: exitLabel,
1383
+ directiveTextMarker: exitSequence,
1548
1384
  directiveTextName: exitName
1549
1385
  }
1550
1386
  };
1387
+ function exitSequence(token) {
1388
+ if (!settings.verbose) return;
1389
+ const node2 = this.stack[this.stack.length - 1];
1390
+ ok(node2, "expected `node`");
1391
+ ok(
1392
+ node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1393
+ );
1394
+ const place = { start: point(token.start), end: point(token.end) };
1395
+ if (node2.data && node2.data.position) {
1396
+ ok(node2.type === "containerDirective");
1397
+ node2.data.position.closing = place;
1398
+ } else {
1399
+ node2.data = { position: { opening: place } };
1400
+ }
1401
+ }
1551
1402
  }
1552
1403
  function directiveToMarkdown(options) {
1553
1404
  const settings = options || emptyOptions;
@@ -1585,8 +1436,23 @@ function directiveToMarkdown(options) {
1585
1436
  };
1586
1437
  function handleDirective(node2, _, state, info) {
1587
1438
  const tracker = state.createTracker(info);
1588
- const sequence = fence(node2);
1589
1439
  const exit4 = state.enter(node2.type);
1440
+ let content3;
1441
+ if (node2.type === "containerDirective") {
1442
+ const head = (node2.children || [])[0];
1443
+ const children = inlineDirectiveLabel(head) ? node2.children.slice(1) : node2.children;
1444
+ if (children && children.length > 0) {
1445
+ const current = tracker.current();
1446
+ content3 = state.containerFlow(
1447
+ { ...node2, children },
1448
+ {
1449
+ now: { line: current.now.line + 1, column: 1 + current.lineShift },
1450
+ lineShift: current.lineShift
1451
+ }
1452
+ );
1453
+ }
1454
+ }
1455
+ const sequence = fence(node2, content3 ? longestColonLine(content3) : 0);
1590
1456
  let value = tracker.move(sequence + (node2.name || ""));
1591
1457
  const attributesValue = attributes4(node2, state);
1592
1458
  const after = info.after.charCodeAt(0);
@@ -1619,14 +1485,8 @@ function directiveToMarkdown(options) {
1619
1485
  attributesValue || (after === 123 ? "{}" : "")
1620
1486
  );
1621
1487
  if (node2.type === "containerDirective") {
1622
- const head = (node2.children || [])[0];
1623
- let shallow = node2;
1624
- if (inlineDirectiveLabel(head)) {
1625
- shallow = Object.assign({}, node2, { children: node2.children.slice(1) });
1626
- }
1627
- if (shallow && shallow.children && shallow.children.length > 0) {
1628
- value += tracker.move("\n");
1629
- value += tracker.move(state.containerFlow(shallow, tracker.current()));
1488
+ if (content3) {
1489
+ value += tracker.move("\n" + content3);
1630
1490
  }
1631
1491
  value += tracker.move("\n" + sequence);
1632
1492
  }
@@ -1642,17 +1502,16 @@ function directiveToMarkdown(options) {
1642
1502
  let key;
1643
1503
  for (key in attributes5) {
1644
1504
  if (own.call(attributes5, key) && attributes5[key] !== void 0 && attributes5[key] !== null) {
1645
- const value = String(attributes5[key]);
1505
+ const value = encode(String(attributes5[key]));
1646
1506
  if (key === "id") {
1647
1507
  id = settings.preferShortcut !== false && shortcut.test(value) ? "#" + value : quoted("id", value, node2, state);
1648
1508
  } else if (key === "class") {
1649
1509
  const list3 = value.split(/[\t\n\r ]+/);
1650
1510
  const classesFullList = [];
1651
1511
  const classesList = [];
1652
- let index2 = -1;
1653
- while (++index2 < list3.length) {
1512
+ for (const item of list3) {
1654
1513
  ;
1655
- (settings.preferShortcut !== false && shortcut.test(list3[index2]) ? classesList : classesFullList).push(list3[index2]);
1514
+ (settings.preferShortcut !== false && shortcut.test(item) ? classesList : classesFullList).push(item);
1656
1515
  }
1657
1516
  classesFull = classesFullList.length > 0 ? quoted("class", classesFullList.join(" "), node2, state) : "";
1658
1517
  classes = classesList.length > 0 ? "." + classesList.join(".") : "";
@@ -1698,10 +1557,12 @@ function enter(type, token) {
1698
1557
  }
1699
1558
  function exitName(token) {
1700
1559
  const node2 = this.stack[this.stack.length - 1];
1560
+ ok(node2, "expected `node`");
1701
1561
  ok(
1702
1562
  node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1703
1563
  );
1704
1564
  node2.name = this.sliceSerialize(token);
1565
+ openingEnd(node2, token);
1705
1566
  }
1706
1567
  function enterContainerLabel(token) {
1707
1568
  this.enter(
@@ -1711,11 +1572,42 @@ function enterContainerLabel(token) {
1711
1572
  }
1712
1573
  function exitContainerLabel(token) {
1713
1574
  this.exit(token);
1575
+ const node2 = this.stack[this.stack.length - 1];
1576
+ ok(node2, "expected `node`");
1577
+ ok(node2.type === "containerDirective");
1578
+ openingEnd(node2, token);
1579
+ }
1580
+ function exitLabel(token) {
1581
+ const node2 = this.stack[this.stack.length - 1];
1582
+ ok(node2, "expected `node`");
1583
+ ok(node2.type === "leafDirective" || node2.type === "textDirective");
1584
+ openingEnd(node2, token);
1714
1585
  }
1715
1586
  function enterAttributes() {
1587
+ const node2 = this.stack[this.stack.length - 1];
1588
+ ok(node2, "expected `node`");
1589
+ ok(
1590
+ node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1591
+ );
1592
+ if (node2.data && node2.data.position) {
1593
+ this.data.directiveAttributePositions = {};
1594
+ }
1716
1595
  this.data.directiveAttributes = [];
1717
1596
  this.buffer();
1718
1597
  }
1598
+ function exitAttributeShortcut(token) {
1599
+ const positions = this.data.directiveAttributePositions;
1600
+ if (positions) {
1601
+ const list3 = this.data.directiveAttributes;
1602
+ ok(list3, "expected `directiveAttributes`");
1603
+ const tail = list3[list3.length - 1];
1604
+ ok(tail, "expected attribute");
1605
+ positions[tail[0]] = { start: point(token.start), end: point(token.end) };
1606
+ }
1607
+ }
1608
+ function exitAttributeValueLiteral(token) {
1609
+ attributeEnd(this, token);
1610
+ }
1719
1611
  function exitAttributeIdValue(token) {
1720
1612
  const list3 = this.data.directiveAttributes;
1721
1613
  ok(list3, "expected `directiveAttributes`");
@@ -1735,35 +1627,69 @@ function exitAttributeClassValue(token) {
1735
1627
  function exitAttributeValue(token) {
1736
1628
  const list3 = this.data.directiveAttributes;
1737
1629
  ok(list3, "expected `directiveAttributes`");
1738
- list3[list3.length - 1][1] = parseEntities(this.sliceSerialize(token), {
1739
- attribute: true
1740
- });
1630
+ const tail = list3[list3.length - 1];
1631
+ ok(tail, "expected attribute");
1632
+ tail[1] = parseEntities(this.sliceSerialize(token), { attribute: true });
1633
+ attributeEnd(this, token);
1741
1634
  }
1742
1635
  function exitAttributeName(token) {
1743
1636
  const list3 = this.data.directiveAttributes;
1744
1637
  ok(list3, "expected `directiveAttributes`");
1745
- list3.push([this.sliceSerialize(token), ""]);
1638
+ const name = this.sliceSerialize(token);
1639
+ list3.push([name, ""]);
1640
+ const positions = this.data.directiveAttributePositions;
1641
+ if (positions) {
1642
+ positions[name] = { start: point(token.start), end: point(token.end) };
1643
+ }
1746
1644
  }
1747
- function exitAttributes() {
1645
+ function exitAttributes(token) {
1748
1646
  const list3 = this.data.directiveAttributes;
1749
1647
  ok(list3, "expected `directiveAttributes`");
1750
1648
  const cleaned = {};
1751
- let index2 = -1;
1752
- while (++index2 < list3.length) {
1753
- const attribute = list3[index2];
1649
+ for (const attribute of list3) {
1754
1650
  if (attribute[0] === "class" && cleaned.class) {
1755
1651
  cleaned.class += " " + attribute[1];
1756
1652
  } else {
1757
1653
  cleaned[attribute[0]] = attribute[1];
1758
1654
  }
1759
1655
  }
1656
+ const positions = this.data.directiveAttributePositions;
1657
+ this.data.directiveAttributePositions = void 0;
1760
1658
  this.data.directiveAttributes = void 0;
1761
1659
  this.resume();
1762
1660
  const node2 = this.stack[this.stack.length - 1];
1661
+ ok(node2, "expected `node`");
1763
1662
  ok(
1764
1663
  node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1765
1664
  );
1766
1665
  node2.attributes = cleaned;
1666
+ if (positions) {
1667
+ ok(node2.data && node2.data.position, "expected `position`");
1668
+ node2.data.position.attributes = positions;
1669
+ }
1670
+ openingEnd(node2, token);
1671
+ }
1672
+ function openingEnd(node2, token) {
1673
+ if (node2.data && node2.data.position) {
1674
+ const { opening } = node2.data.position;
1675
+ ok(opening, "expected `opening`");
1676
+ opening.end = point(token.end);
1677
+ }
1678
+ }
1679
+ function attributeEnd(context, token) {
1680
+ const positions = context.data.directiveAttributePositions;
1681
+ if (positions) {
1682
+ const list3 = context.data.directiveAttributes;
1683
+ ok(list3, "expected `directiveAttributes`");
1684
+ const tail = list3[list3.length - 1];
1685
+ ok(tail, "expected attribute");
1686
+ const position2 = positions[tail[0]];
1687
+ ok(position2, "expected position");
1688
+ position2.end = point(token.end);
1689
+ }
1690
+ }
1691
+ function point(d) {
1692
+ return { line: d.line, column: d.column, offset: d.offset };
1767
1693
  }
1768
1694
  function exit(token) {
1769
1695
  this.exit(token);
@@ -1771,27 +1697,30 @@ function exit(token) {
1771
1697
  function peekDirective() {
1772
1698
  return ":";
1773
1699
  }
1700
+ function encode(value) {
1701
+ const result = [];
1702
+ let start = 0;
1703
+ let index2 = value.indexOf("&");
1704
+ while (index2 !== -1) {
1705
+ const code3 = value.charCodeAt(index2 + 1);
1706
+ if (code3 === 35 || asciiAlpha(code3)) {
1707
+ result.push(value.slice(start, index2), "&#x26;");
1708
+ start = index2 + 1;
1709
+ }
1710
+ index2 = value.indexOf("&", index2 + 1);
1711
+ }
1712
+ result.push(value.slice(start));
1713
+ return result.join("");
1714
+ }
1774
1715
  function inlineDirectiveLabel(node2) {
1775
1716
  return Boolean(
1776
1717
  node2 && node2.type === "paragraph" && node2.data && node2.data.directiveLabel
1777
1718
  );
1778
1719
  }
1779
- function fence(node2) {
1720
+ function fence(node2, longest) {
1780
1721
  let size = 0;
1781
1722
  if (node2.type === "containerDirective") {
1782
- visitParents(node2, function(node3, parents) {
1783
- if (node3.type === "containerDirective") {
1784
- let index2 = parents.length;
1785
- let nesting = 0;
1786
- while (index2--) {
1787
- if (parents[index2].type === "containerDirective") {
1788
- nesting++;
1789
- }
1790
- }
1791
- if (nesting > size) size = nesting;
1792
- }
1793
- });
1794
- size += 3;
1723
+ size = Math.max(3, longest + 1);
1795
1724
  } else if (node2.type === "leafDirective") {
1796
1725
  size = 2;
1797
1726
  } else {
@@ -1799,6 +1728,31 @@ function fence(node2) {
1799
1728
  }
1800
1729
  return ":".repeat(size);
1801
1730
  }
1731
+ function longestColonLine(value) {
1732
+ let longest = 0;
1733
+ let index2 = 0;
1734
+ while (index2 < value.length) {
1735
+ let size = 0;
1736
+ let code3 = value.charCodeAt(index2);
1737
+ while (code3 === 9 || code3 === 32) {
1738
+ code3 = value.charCodeAt(++index2);
1739
+ }
1740
+ while (code3 === 58) {
1741
+ size++;
1742
+ code3 = value.charCodeAt(++index2);
1743
+ }
1744
+ while (code3 === 9 || code3 === 32) {
1745
+ code3 = value.charCodeAt(++index2);
1746
+ }
1747
+ while (!(code3 === 10 || code3 === 13 || Number.isNaN(code3))) {
1748
+ size = 0;
1749
+ code3 = value.charCodeAt(++index2);
1750
+ }
1751
+ if (size > longest) longest = size;
1752
+ index2++;
1753
+ }
1754
+ return longest;
1755
+ }
1802
1756
 
1803
1757
  // ../node_modules/.pnpm/micromark-factory-space@2.1.0/node_modules/micromark-factory-space/index.js
1804
1758
  function factorySpace(effects, ok3, type, max) {
@@ -2462,46 +2416,255 @@ function escapeStringRegexp(string3) {
2462
2416
  return string3.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
2463
2417
  }
2464
2418
 
2465
- // ../node_modules/.pnpm/mdast-util-find-and-replace@3.0.3/node_modules/mdast-util-find-and-replace/lib/index.js
2466
- function findAndReplace(tree, list3, options) {
2467
- const settings = options || {};
2468
- const ignored = convert(settings.ignore || []);
2469
- const pairs = toPairs(list3);
2470
- let pairIndex = -1;
2471
- while (++pairIndex < pairs.length) {
2472
- visitParents(tree, "text", visitor);
2473
- }
2474
- function visitor(node2, parents) {
2475
- let index2 = -1;
2476
- let grandparent;
2477
- while (++index2 < parents.length) {
2478
- const parent = parents[index2];
2479
- const siblings = grandparent ? grandparent.children : void 0;
2480
- if (ignored(
2481
- parent,
2482
- siblings ? siblings.indexOf(parent) : void 0,
2483
- grandparent
2484
- )) {
2485
- return;
2486
- }
2487
- grandparent = parent;
2419
+ // ../node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
2420
+ var convert = (
2421
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
2422
+ /**
2423
+ * @type {(
2424
+ * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
2425
+ * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
2426
+ * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
2427
+ * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
2428
+ * ((test?: Test) => Check)
2429
+ * )}
2430
+ */
2431
+ /**
2432
+ * @param {Test} [test]
2433
+ * @returns {Check}
2434
+ */
2435
+ (function(test) {
2436
+ if (test === null || test === void 0) {
2437
+ return ok2;
2488
2438
  }
2489
- if (grandparent) {
2490
- return handler(node2, parents);
2439
+ if (typeof test === "function") {
2440
+ return castFactory(test);
2491
2441
  }
2492
- }
2493
- function handler(node2, parents) {
2494
- const parent = parents[parents.length - 1];
2495
- const find = pairs[pairIndex][0];
2496
- const replace2 = pairs[pairIndex][1];
2497
- let start = 0;
2498
- const siblings = parent.children;
2499
- const index2 = siblings.indexOf(node2);
2500
- let change = false;
2501
- let nodes = [];
2502
- find.lastIndex = 0;
2503
- let match = find.exec(node2.value);
2504
- while (match) {
2442
+ if (typeof test === "object") {
2443
+ return Array.isArray(test) ? anyFactory(test) : (
2444
+ // Cast because `ReadonlyArray` goes into the above but `isArray`
2445
+ // narrows to `Array`.
2446
+ propertiesFactory(
2447
+ /** @type {Props} */
2448
+ test
2449
+ )
2450
+ );
2451
+ }
2452
+ if (typeof test === "string") {
2453
+ return typeFactory(test);
2454
+ }
2455
+ throw new Error("Expected function, string, or object as test");
2456
+ })
2457
+ );
2458
+ function anyFactory(tests) {
2459
+ const checks = [];
2460
+ let index2 = -1;
2461
+ while (++index2 < tests.length) {
2462
+ checks[index2] = convert(tests[index2]);
2463
+ }
2464
+ return castFactory(any);
2465
+ function any(...parameters) {
2466
+ let index3 = -1;
2467
+ while (++index3 < checks.length) {
2468
+ if (checks[index3].apply(this, parameters)) return true;
2469
+ }
2470
+ return false;
2471
+ }
2472
+ }
2473
+ function propertiesFactory(check2) {
2474
+ const checkAsRecord = (
2475
+ /** @type {Record<string, unknown>} */
2476
+ check2
2477
+ );
2478
+ return castFactory(all2);
2479
+ function all2(node2) {
2480
+ const nodeAsRecord = (
2481
+ /** @type {Record<string, unknown>} */
2482
+ /** @type {unknown} */
2483
+ node2
2484
+ );
2485
+ let key;
2486
+ for (key in check2) {
2487
+ if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
2488
+ }
2489
+ return true;
2490
+ }
2491
+ }
2492
+ function typeFactory(check2) {
2493
+ return castFactory(type);
2494
+ function type(node2) {
2495
+ return node2 && node2.type === check2;
2496
+ }
2497
+ }
2498
+ function castFactory(testFunction) {
2499
+ return check2;
2500
+ function check2(value, index2, parent) {
2501
+ return Boolean(
2502
+ looksLikeANode(value) && testFunction.call(
2503
+ this,
2504
+ value,
2505
+ typeof index2 === "number" ? index2 : void 0,
2506
+ parent || void 0
2507
+ )
2508
+ );
2509
+ }
2510
+ }
2511
+ function ok2() {
2512
+ return true;
2513
+ }
2514
+ function looksLikeANode(value) {
2515
+ return value !== null && typeof value === "object" && "type" in value;
2516
+ }
2517
+
2518
+ // ../node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/color.js
2519
+ function color(d) {
2520
+ return d;
2521
+ }
2522
+
2523
+ // ../node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/index.js
2524
+ var empty = [];
2525
+ var CONTINUE = true;
2526
+ var EXIT = false;
2527
+ var SKIP = "skip";
2528
+ function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
2529
+ if (!tree || typeof tree !== "object") {
2530
+ throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
2531
+ }
2532
+ let preorder = true;
2533
+ let check2;
2534
+ let visitors;
2535
+ let enter2;
2536
+ let exit4;
2537
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
2538
+ check2 = /** @type {Test} */
2539
+ testOrEnterOrVisitors;
2540
+ visitors = enterOrVisitorsOrReverse;
2541
+ if (reverse) preorder = false;
2542
+ } else {
2543
+ visitors = /** @type {Visitors | Visitor} */
2544
+ testOrEnterOrVisitors;
2545
+ if (enterOrVisitorsOrReverse) preorder = false;
2546
+ }
2547
+ if (typeof visitors === "function") {
2548
+ enter2 = visitors;
2549
+ } else if (visitors && typeof visitors === "object") {
2550
+ if (visitors.enter === null || visitors.enter === void 0) {
2551
+ } else if (typeof visitors.enter === "function") {
2552
+ enter2 = visitors.enter;
2553
+ } else {
2554
+ throw new Error(
2555
+ "Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor"
2556
+ );
2557
+ }
2558
+ if (typeof visitors.exit === "function") {
2559
+ exit4 = visitors.exit;
2560
+ } else {
2561
+ throw new Error(
2562
+ "Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)"
2563
+ );
2564
+ }
2565
+ } else {
2566
+ throw new Error(
2567
+ "Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors"
2568
+ );
2569
+ }
2570
+ const is2 = convert(check2);
2571
+ const step = preorder ? 1 : -1;
2572
+ factory(tree, void 0, [])();
2573
+ function factory(node2, index2, parents) {
2574
+ const value = (
2575
+ /** @type {Record<string, unknown>} */
2576
+ node2 && typeof node2 === "object" ? node2 : {}
2577
+ );
2578
+ if (typeof value.type === "string") {
2579
+ const name = (
2580
+ // `hast`
2581
+ typeof value.tagName === "string" ? value.tagName : (
2582
+ // `xast`
2583
+ typeof value.name === "string" ? value.name : void 0
2584
+ )
2585
+ );
2586
+ Object.defineProperty(visit2, "name", {
2587
+ value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
2588
+ });
2589
+ }
2590
+ return visit2;
2591
+ function visit2() {
2592
+ const matches = !check2 || is2(node2, index2, parents[parents.length - 1] || void 0);
2593
+ let result = empty;
2594
+ if (enter2 && matches) {
2595
+ result = toResult(enter2(node2, parents, index2));
2596
+ if (result[0] === EXIT) {
2597
+ return result;
2598
+ }
2599
+ }
2600
+ if ("children" in node2 && node2.children) {
2601
+ const nodeAsParent = (
2602
+ /** @type {UnistParent} */
2603
+ node2
2604
+ );
2605
+ if (nodeAsParent.children && result[0] !== SKIP) {
2606
+ let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
2607
+ const grandparents = [...parents, nodeAsParent];
2608
+ while (offset > -1 && offset < nodeAsParent.children.length) {
2609
+ const child = nodeAsParent.children[offset];
2610
+ const subresult = factory(child, offset, grandparents)();
2611
+ if (subresult[0] === EXIT) {
2612
+ return subresult;
2613
+ }
2614
+ offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
2615
+ }
2616
+ }
2617
+ }
2618
+ if (exit4 && matches) {
2619
+ const exitResult = toResult(exit4(node2, parents, index2));
2620
+ if (exitResult[0] === SKIP) {
2621
+ throw new Error(
2622
+ "Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing"
2623
+ );
2624
+ }
2625
+ if (exitResult[0] === EXIT || typeof exitResult[1] === "number") {
2626
+ return exitResult;
2627
+ }
2628
+ }
2629
+ return result;
2630
+ }
2631
+ }
2632
+ }
2633
+ function toResult(value) {
2634
+ if (Array.isArray(value)) {
2635
+ return value;
2636
+ }
2637
+ if (typeof value === "number") {
2638
+ return [CONTINUE, value];
2639
+ }
2640
+ return value === null || value === void 0 ? empty : [value];
2641
+ }
2642
+
2643
+ // ../node_modules/.pnpm/mdast-util-find-and-replace@3.0.4/node_modules/mdast-util-find-and-replace/lib/index.js
2644
+ function findAndReplace(tree, list3, options) {
2645
+ const settings = options || {};
2646
+ const ignored = convert(settings.ignore || []);
2647
+ const pairs = toPairs(list3);
2648
+ let pairIndex = -1;
2649
+ while (++pairIndex < pairs.length) {
2650
+ visitParents(tree, visitor);
2651
+ }
2652
+ function visitor(node2, parents, index2) {
2653
+ if (node2.type === "text" && typeof index2 === "number") {
2654
+ return handler(node2, parents, index2);
2655
+ }
2656
+ if (ignored(node2, index2, parents[parents.length - 1])) return SKIP;
2657
+ }
2658
+ function handler(node2, parents, index2) {
2659
+ const parent = parents[parents.length - 1];
2660
+ const find = pairs[pairIndex][0];
2661
+ const replace2 = pairs[pairIndex][1];
2662
+ let start = 0;
2663
+ let change = false;
2664
+ let nodes = [];
2665
+ find.lastIndex = 0;
2666
+ let match = find.exec(node2.value);
2667
+ while (match) {
2505
2668
  const position2 = match.index;
2506
2669
  const matchObject = {
2507
2670
  index: match.index,
@@ -2555,7 +2718,13 @@ function toPairs(tupleOrList) {
2555
2718
  throw new TypeError("Expected find and replace tuple or list of tuples");
2556
2719
  }
2557
2720
  const result = [];
2558
- const list3 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
2721
+ const list3 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? (
2722
+ /** @type {FindAndReplaceList} */
2723
+ tupleOrList
2724
+ ) : [
2725
+ /** @type {FindAndReplaceTuple} */
2726
+ tupleOrList
2727
+ ];
2559
2728
  let index2 = -1;
2560
2729
  while (++index2 < list3.length) {
2561
2730
  const tuple = list3[index2];
@@ -3066,7 +3235,7 @@ var phrasing = (
3066
3235
  ])
3067
3236
  );
3068
3237
 
3069
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
3238
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
3070
3239
  function blockquote(node2, _, state, info) {
3071
3240
  const exit4 = state.enter("blockquote");
3072
3241
  const tracker = state.createTracker(info);
@@ -3083,7 +3252,7 @@ function map(line, _, blank) {
3083
3252
  return ">" + (blank ? "" : " ") + line;
3084
3253
  }
3085
3254
 
3086
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
3255
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
3087
3256
  function patternInScope(stack, pattern) {
3088
3257
  return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
3089
3258
  }
@@ -3103,7 +3272,7 @@ function listInScope(stack, list3, none) {
3103
3272
  return false;
3104
3273
  }
3105
3274
 
3106
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/break.js
3275
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/break.js
3107
3276
  function hardBreak(_, _1, state, info) {
3108
3277
  let index2 = -1;
3109
3278
  while (++index2 < state.unsafe.length) {
@@ -3139,7 +3308,7 @@ function longestStreak(value, substring) {
3139
3308
  return max;
3140
3309
  }
3141
3310
 
3142
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
3311
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
3143
3312
  function formatCodeAsIndented(node2, state) {
3144
3313
  return Boolean(
3145
3314
  state.options.fences === false && node2.value && // If there’s no info…
@@ -3149,7 +3318,7 @@ function formatCodeAsIndented(node2, state) {
3149
3318
  );
3150
3319
  }
3151
3320
 
3152
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
3321
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
3153
3322
  function checkFence(state) {
3154
3323
  const marker = state.options.fence || "`";
3155
3324
  if (marker !== "`" && marker !== "~") {
@@ -3160,7 +3329,7 @@ function checkFence(state) {
3160
3329
  return marker;
3161
3330
  }
3162
3331
 
3163
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/code.js
3332
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/code.js
3164
3333
  function code(node2, _, state, info) {
3165
3334
  const marker = checkFence(state);
3166
3335
  const raw = node2.value || "";
@@ -3212,7 +3381,7 @@ function map2(line, _, blank) {
3212
3381
  return (blank ? "" : " ") + line;
3213
3382
  }
3214
3383
 
3215
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
3384
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
3216
3385
  function checkQuote(state) {
3217
3386
  const marker = state.options.quote || '"';
3218
3387
  if (marker !== '"' && marker !== "'") {
@@ -3223,7 +3392,7 @@ function checkQuote(state) {
3223
3392
  return marker;
3224
3393
  }
3225
3394
 
3226
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/definition.js
3395
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/definition.js
3227
3396
  function definition(node2, _, state, info) {
3228
3397
  const quote = checkQuote(state);
3229
3398
  const suffix = quote === '"' ? "Quote" : "Apostrophe";
@@ -3279,7 +3448,7 @@ function definition(node2, _, state, info) {
3279
3448
  return value;
3280
3449
  }
3281
3450
 
3282
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
3451
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
3283
3452
  function checkEmphasis(state) {
3284
3453
  const marker = state.options.emphasis || "*";
3285
3454
  if (marker !== "*" && marker !== "_") {
@@ -3290,12 +3459,518 @@ function checkEmphasis(state) {
3290
3459
  return marker;
3291
3460
  }
3292
3461
 
3293
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
3462
+ // ../node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
3463
+ function classifyCharacter(code3) {
3464
+ if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
3465
+ return 1;
3466
+ }
3467
+ if (unicodePunctuation(code3)) {
3468
+ return 2;
3469
+ }
3470
+ }
3471
+
3472
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/character.js
3473
+ function firstCharacter(value) {
3474
+ const code3 = value.codePointAt(0);
3475
+ return code3 === void 0 ? "" : String.fromCodePoint(code3);
3476
+ }
3477
+ function lastCharacter(value) {
3478
+ const code3 = value.codePointAt(value.length - 2);
3479
+ return code3 !== void 0 && code3 > 65535 ? value.slice(-2) : value.slice(-1);
3480
+ }
3481
+
3482
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
3483
+ function encodeCharacterReference(code3) {
3484
+ return "&#x" + code3.toString(16).toUpperCase() + ";";
3485
+ }
3486
+
3487
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/encode-info.js
3488
+ function encodeInfo(outside, inside, marker) {
3489
+ const outsideKind = classifyCharacter(outside);
3490
+ const insideKind = classifyCharacter(inside);
3491
+ if (outsideKind === void 0) {
3492
+ return insideKind === void 0 ? (
3493
+ // Letter inside:
3494
+ // we have to encode *both* letters for `_` as it is looser.
3495
+ // it already forms for `*` (and GFMs `~`).
3496
+ marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false }
3497
+ ) : insideKind === 1 ? (
3498
+ // Whitespace inside: encode both (letter, whitespace).
3499
+ { inside: true, outside: true }
3500
+ ) : (
3501
+ // Punctuation inside: encode outer (letter)
3502
+ { inside: false, outside: true }
3503
+ );
3504
+ }
3505
+ if (outsideKind === 1) {
3506
+ return insideKind === void 0 ? (
3507
+ // Letter inside: already forms.
3508
+ { inside: false, outside: false }
3509
+ ) : insideKind === 1 ? (
3510
+ // Whitespace inside: encode both (whitespace).
3511
+ { inside: true, outside: true }
3512
+ ) : (
3513
+ // Punctuation inside: already forms.
3514
+ { inside: false, outside: false }
3515
+ );
3516
+ }
3517
+ return insideKind === void 0 ? (
3518
+ // Letter inside: already forms.
3519
+ { inside: false, outside: false }
3520
+ ) : insideKind === 1 ? (
3521
+ // Whitespace inside: encode inner (whitespace).
3522
+ { inside: true, outside: false }
3523
+ ) : (
3524
+ // Punctuation inside: already forms.
3525
+ { inside: false, outside: false }
3526
+ );
3527
+ }
3528
+
3529
+ // ../node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
3530
+ var htmlBlockNames = [
3531
+ "address",
3532
+ "article",
3533
+ "aside",
3534
+ "base",
3535
+ "basefont",
3536
+ "blockquote",
3537
+ "body",
3538
+ "caption",
3539
+ "center",
3540
+ "col",
3541
+ "colgroup",
3542
+ "dd",
3543
+ "details",
3544
+ "dialog",
3545
+ "dir",
3546
+ "div",
3547
+ "dl",
3548
+ "dt",
3549
+ "fieldset",
3550
+ "figcaption",
3551
+ "figure",
3552
+ "footer",
3553
+ "form",
3554
+ "frame",
3555
+ "frameset",
3556
+ "h1",
3557
+ "h2",
3558
+ "h3",
3559
+ "h4",
3560
+ "h5",
3561
+ "h6",
3562
+ "head",
3563
+ "header",
3564
+ "hr",
3565
+ "html",
3566
+ "iframe",
3567
+ "legend",
3568
+ "li",
3569
+ "link",
3570
+ "main",
3571
+ "menu",
3572
+ "menuitem",
3573
+ "nav",
3574
+ "noframes",
3575
+ "ol",
3576
+ "optgroup",
3577
+ "option",
3578
+ "p",
3579
+ "param",
3580
+ "search",
3581
+ "section",
3582
+ "summary",
3583
+ "table",
3584
+ "tbody",
3585
+ "td",
3586
+ "tfoot",
3587
+ "th",
3588
+ "thead",
3589
+ "title",
3590
+ "tr",
3591
+ "track",
3592
+ "ul"
3593
+ ];
3594
+ var htmlRawNames = ["pre", "script", "style", "textarea"];
3595
+
3596
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/html-kind.js
3597
+ function htmlKind(value) {
3598
+ if (value.charCodeAt(0) !== 60) return;
3599
+ const next = value.charCodeAt(1);
3600
+ if (next === 33) {
3601
+ const code4 = value.charCodeAt(2);
3602
+ if (code4 === 45) return 2;
3603
+ if (code4 === 91) return 5;
3604
+ if (asciiAlpha(code4)) return 4;
3605
+ return;
3606
+ }
3607
+ if (next === 63) return 3;
3608
+ const closing = next === 47;
3609
+ const start = closing ? 2 : 1;
3610
+ let end = start;
3611
+ let code3 = value.charCodeAt(end);
3612
+ if (!asciiAlpha(code3)) return;
3613
+ while (code3 === 45 || asciiAlphanumeric(code3)) {
3614
+ code3 = value.charCodeAt(++end);
3615
+ }
3616
+ const name = value.slice(start, end).toLowerCase();
3617
+ if (!closing && code3 !== 47 && htmlRawNames.includes(name)) {
3618
+ return 1;
3619
+ }
3620
+ return htmlBlockNames.includes(name) ? 6 : 7;
3621
+ }
3622
+
3623
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
3624
+ var builtins = /* @__PURE__ */ new Map([
3625
+ ["*", false],
3626
+ ["_", true]
3627
+ ]);
3628
+ function candidates(tokens, involved, runOf) {
3629
+ const related = /* @__PURE__ */ new Set();
3630
+ for (const token of tokens) {
3631
+ const siblings = runOf.get(token);
3632
+ if (siblings && token.attention && involved.some((d) => d.attention === token.attention)) {
3633
+ for (const sibling of siblings.tokens) {
3634
+ related.add(sibling.attention);
3635
+ }
3636
+ }
3637
+ }
3638
+ const ordered = [];
3639
+ for (const token of tokens) {
3640
+ if (token.attention && related.delete(token.attention)) {
3641
+ ordered.push(token.attention);
3642
+ }
3643
+ }
3644
+ ordered.reverse();
3645
+ return ordered;
3646
+ }
3647
+ function check(tokens, before, after) {
3648
+ const runs = [];
3649
+ const wrong = /* @__PURE__ */ new Map();
3650
+ const runOf = /* @__PURE__ */ new Map();
3651
+ let index2 = 0;
3652
+ while (index2 < tokens.length) {
3653
+ if (!tokens[index2].attention) {
3654
+ index2++;
3655
+ continue;
3656
+ }
3657
+ const marker = tokens[index2].value.charAt(0);
3658
+ const strict = builtins.get(marker);
3659
+ let end = index2 + 1;
3660
+ while (end < tokens.length && tokens[end].attention && tokens[end].value.charAt(0) === marker) {
3661
+ end++;
3662
+ }
3663
+ const head = index2 ? tokens[index2 - 1].value : before;
3664
+ const previous4 = classifyCharacter(head.charCodeAt(head.length - 1));
3665
+ const next = classifyCharacter(
3666
+ (end < tokens.length ? tokens[end].value : after).charCodeAt(0)
3667
+ );
3668
+ const open = !next || next === 2 && Boolean(previous4);
3669
+ const close = !previous4 || previous4 === 2 && Boolean(next);
3670
+ const run = {
3671
+ tokens: tokens.slice(index2, end),
3672
+ markers: [],
3673
+ start: 0,
3674
+ end: 0,
3675
+ // Underscores are strict, they cannot open or close inside words.
3676
+ open: strict ? open && (Boolean(previous4) || !close) : open,
3677
+ close: strict ? close && (Boolean(next) || !open) : close,
3678
+ // All builtins can split runs.
3679
+ split: strict !== void 0
3680
+ };
3681
+ for (const token of run.tokens) {
3682
+ wrong.set(token, [...run.tokens]);
3683
+ runOf.set(token, run);
3684
+ let size = token.value.length;
3685
+ while (size--) run.markers.push(token);
3686
+ }
3687
+ run.end = run.markers.length;
3688
+ runs.push(run);
3689
+ index2 = end;
3690
+ }
3691
+ pair(runs, wrong);
3692
+ index2 = -1;
3693
+ while (++index2 < tokens.length) {
3694
+ const involved = wrong.get(tokens[index2]);
3695
+ if (involved) return { attention: candidates(tokens, involved, runOf), index: index2 };
3696
+ }
3697
+ }
3698
+ function encode2(tokens, start) {
3699
+ const token = tokens[start ? 0 : tokens.length - 1];
3700
+ if (!token || token.attention) return;
3701
+ const character = start ? firstCharacter(token.value) : lastCharacter(token.value);
3702
+ const reference = encodeCharacterReference(
3703
+ /** @type {number} */
3704
+ character.codePointAt(0)
3705
+ );
3706
+ if (start) {
3707
+ token.value = reference + token.value.slice(character.length);
3708
+ } else {
3709
+ let value = token.value.slice(0, token.value.length - character.length);
3710
+ let escapes = 0;
3711
+ while (value.charCodeAt(value.length - 1 - escapes) === 92) {
3712
+ escapes++;
3713
+ }
3714
+ if (escapes % 2) value += "\\";
3715
+ token.value = value + reference;
3716
+ }
3717
+ }
3718
+ function improve(items, chosen, mistake, before, after) {
3719
+ for (const attention4 of mistake.attention) {
3720
+ const current = chosen.get(attention4) || attention4.sequences[0];
3721
+ for (const sequence of attention4.sequences) {
3722
+ if (sequence === current) continue;
3723
+ const trial = new Map(chosen);
3724
+ trial.set(attention4, sequence);
3725
+ const tokens = render(items, trial, before, after);
3726
+ const next = check(tokens, before, after);
3727
+ if (!next || next.index > mistake.index) {
3728
+ return { chosen: trial, mistake: next, tokens };
3729
+ }
3730
+ }
3731
+ }
3732
+ }
3733
+ function pair(runs, wrong) {
3734
+ const openersByMarker = /* @__PURE__ */ new Map();
3735
+ for (const closer of runs) {
3736
+ const marker = closer.tokens[0].value.charAt(0);
3737
+ let openers = openersByMarker.get(marker);
3738
+ if (!openers) {
3739
+ openers = [];
3740
+ openersByMarker.set(marker, openers);
3741
+ }
3742
+ let open = closer.close ? openers.length : 0;
3743
+ while (open-- && closer.start < closer.end) {
3744
+ const opener = openers[open];
3745
+ const openerSize = opener.end - opener.start;
3746
+ const closerSize = closer.end - closer.start;
3747
+ if (closer.split ? (
3748
+ // The rule of 3, on the sizes that are left.
3749
+ (opener.close || closer.open) && closerSize % 3 && !((openerSize + closerSize) % 3)
3750
+ ) : (
3751
+ // Others pair whole runs of the same size.
3752
+ openerSize !== opener.markers.length || openerSize !== closerSize
3753
+ )) {
3754
+ continue;
3755
+ }
3756
+ const size = closer.split ? openerSize > 1 && closerSize > 1 ? 2 : 1 : closerSize;
3757
+ const opening = opener.markers.slice(opener.end - size, opener.end);
3758
+ const closing = closer.markers.slice(closer.start, closer.start + size);
3759
+ const openToken = opening[0];
3760
+ const closeToken = closing[0];
3761
+ if (
3762
+ // Whole sequences:
3763
+ // the markers of a sequence are next to each other,
3764
+ // so if the first and last marker are of one sequence of that size,
3765
+ // all markers are exactly that sequence.
3766
+ 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.
3767
+ openToken.attention === closeToken.attention
3768
+ ) {
3769
+ wrong.delete(openToken);
3770
+ wrong.delete(closeToken);
3771
+ } else {
3772
+ const involved = [.../* @__PURE__ */ new Set([...opening, ...closing])];
3773
+ for (const token of involved) {
3774
+ const list3 = wrong.get(token);
3775
+ if (list3) list3.push(...involved);
3776
+ }
3777
+ }
3778
+ opener.end -= size;
3779
+ closer.start += size;
3780
+ if (opener.start === opener.end) openers.splice(open, 1);
3781
+ open = openers.length;
3782
+ }
3783
+ if (closer.open && closer.start < closer.end) openers.push(closer);
3784
+ }
3785
+ }
3786
+ function attentionSequences(type, markers, sizes) {
3787
+ if (markers.length === 0) {
3788
+ throw new Error(
3789
+ "Cannot serialize `" + type + "` as attention without markers, expected one or more markers"
3790
+ );
3791
+ }
3792
+ if (sizes.length === 0) {
3793
+ throw new Error(
3794
+ "Cannot serialize `" + type + "` as attention without sizes, expected one or more sizes"
3795
+ );
3796
+ }
3797
+ for (const size of sizes) {
3798
+ if (!Number.isSafeInteger(size) || size < 1) {
3799
+ throw new Error(
3800
+ "Cannot serialize `" + type + "` as attention with `" + size + "` as size, expected positive integer"
3801
+ );
3802
+ }
3803
+ }
3804
+ const sequences = [];
3805
+ for (const marker of markers) {
3806
+ if (marker.length !== 1) {
3807
+ throw new Error(
3808
+ "Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected a single ascii character"
3809
+ );
3810
+ }
3811
+ if (!asciiPunctuation(marker.charCodeAt(0))) {
3812
+ throw new Error(
3813
+ "Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected ascii punctuation"
3814
+ );
3815
+ }
3816
+ for (const size of sizes) {
3817
+ sequences.push(marker.repeat(size));
3818
+ }
3819
+ }
3820
+ return sequences;
3821
+ }
3822
+ function phrasing2(parent, state, info) {
3823
+ const indexStack = state.indexStack;
3824
+ const children = parent.children || [];
3825
+ const results = [];
3826
+ let index2 = -1;
3827
+ let before = info.before;
3828
+ indexStack.push(-1);
3829
+ let tracker = state.createTracker(info);
3830
+ while (++index2 < children.length) {
3831
+ const child = children[index2];
3832
+ let after;
3833
+ indexStack[indexStack.length - 1] = index2;
3834
+ if (index2 + 1 < children.length) {
3835
+ let handle3 = state.handle.handlers[children[index2 + 1].type];
3836
+ if (handle3 && handle3.peek) handle3 = handle3.peek;
3837
+ after = handle3 ? firstCharacter(
3838
+ handle3(children[index2 + 1], parent, state, {
3839
+ before: "",
3840
+ after: "",
3841
+ ...tracker.current()
3842
+ })
3843
+ ) : "";
3844
+ } else {
3845
+ after = info.after;
3846
+ }
3847
+ const previous4 = results[results.length - 1];
3848
+ if (typeof previous4 === "string" && (before === "\r" || before === "\n") && child.type === "html" && htmlKind(child.value) !== 7) {
3849
+ results[results.length - 1] = previous4.replace(/(\r?\n|\r)$/, " ");
3850
+ before = " ";
3851
+ tracker = state.createTracker(info);
3852
+ tracker.move(serialize2(results, info.before, info.after));
3853
+ }
3854
+ const handle2 = state.handle.handlers[child.type];
3855
+ if (handle2 && handle2.attention) {
3856
+ const item = attentionItem(
3857
+ /** @type {PhrasingParents} */
3858
+ child,
3859
+ handle2.attention,
3860
+ state,
3861
+ tracker
3862
+ );
3863
+ results.push(item);
3864
+ before = lastCharacter(item.sequences[0]);
3865
+ } else {
3866
+ const value = state.handle(child, parent, state, {
3867
+ ...tracker.current(),
3868
+ after,
3869
+ before
3870
+ });
3871
+ if (!value) continue;
3872
+ tracker.move(value);
3873
+ results.push(value);
3874
+ before = lastCharacter(value);
3875
+ }
3876
+ }
3877
+ indexStack.pop();
3878
+ return results;
3879
+ }
3880
+ function attentionItem(node2, attention4, state, tracker) {
3881
+ const { construct, markers, sizes } = attention4(node2, state);
3882
+ const sequences = attentionSequences(node2.type, markers, sizes);
3883
+ const sequence = sequences[0];
3884
+ const exit4 = state.enter(construct);
3885
+ tracker.move(sequence);
3886
+ const children = phrasing2(node2, state, {
3887
+ ...tracker.current(),
3888
+ before: sequence,
3889
+ after: sequence
3890
+ });
3891
+ tracker.move(serialize2(children, sequence, sequence));
3892
+ tracker.move(sequence);
3893
+ exit4();
3894
+ return { children, sequences };
3895
+ }
3896
+ function render(items, chosen, before, after) {
3897
+ const tokens = [];
3898
+ let encodeAfter;
3899
+ let previous4 = lastCharacter(before);
3900
+ let index2 = -1;
3901
+ while (++index2 < items.length) {
3902
+ const item = items[index2];
3903
+ if (typeof item === "string") {
3904
+ const token = { value: item, attention: void 0 };
3905
+ if (encodeAfter && encodeAfter === firstCharacter(item)) {
3906
+ encode2([token], true);
3907
+ }
3908
+ encodeAfter = void 0;
3909
+ tokens.push(token);
3910
+ if (token.value) previous4 = lastCharacter(token.value);
3911
+ continue;
3912
+ }
3913
+ const sequence = chosen.get(item) || item.sequences[0];
3914
+ const marker = sequence.charAt(0);
3915
+ const next = items[index2 + 1];
3916
+ const outsideBefore = previous4;
3917
+ const outsideAfter = firstCharacter(
3918
+ next === void 0 ? after : typeof next === "string" ? next : chosen.get(next) || next.sequences[0]
3919
+ );
3920
+ const inside = render(item.children, chosen, sequence, sequence);
3921
+ const head = inside.length > 0 ? inside[0].value : "";
3922
+ const open = encodeInfo(
3923
+ outsideBefore.charCodeAt(outsideBefore.length - 1),
3924
+ head.charCodeAt(0),
3925
+ marker
3926
+ );
3927
+ if (open.inside) encode2(inside, true);
3928
+ const tail = inside.length > 0 ? lastCharacter(inside[inside.length - 1].value) : "";
3929
+ const close = encodeInfo(
3930
+ outsideAfter.charCodeAt(0),
3931
+ tail.charCodeAt(tail.length - 1),
3932
+ marker
3933
+ );
3934
+ if (close.inside) encode2(inside, false);
3935
+ if (open.outside && outsideBefore !== "\n" && outsideBefore !== "\r") {
3936
+ encode2(tokens, false);
3937
+ }
3938
+ if (close.outside) encodeAfter = outsideAfter;
3939
+ tokens.push({ value: sequence, attention: item }, ...inside, {
3940
+ value: sequence,
3941
+ attention: item
3942
+ });
3943
+ previous4 = sequence.charAt(sequence.length - 1);
3944
+ }
3945
+ return tokens;
3946
+ }
3947
+ function serialize2(items, before, after) {
3948
+ let chosen = /* @__PURE__ */ new Map();
3949
+ const initial = render(items, chosen, before, after);
3950
+ let tokens = initial;
3951
+ let mistake = check(tokens, before, after);
3952
+ while (mistake) {
3953
+ const next = improve(items, chosen, mistake, before, after);
3954
+ if (!next) {
3955
+ tokens = initial;
3956
+ break;
3957
+ }
3958
+ chosen = next.chosen;
3959
+ tokens = next.tokens;
3960
+ mistake = next.mistake;
3961
+ }
3962
+ let result = "";
3963
+ for (const token of tokens) result += token.value;
3964
+ return result;
3965
+ }
3966
+
3967
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
3294
3968
  emphasis.attention = attention;
3295
3969
  emphasis.peek = peek;
3296
3970
  function emphasis(node2, _, state, info) {
3297
3971
  const exit4 = state.enter("phrasing");
3298
- const value = state.containerPhrasing({ type: "root", children: [node2] }, info);
3972
+ const item = attentionItem(node2, attention, state, state.createTracker(info));
3973
+ const value = serialize2([item], info.before, info.after);
3299
3974
  exit4();
3300
3975
  return value;
3301
3976
  }
@@ -3311,30 +3986,38 @@ function peek(_, _1, state) {
3311
3986
  return state.options.emphasis || "*";
3312
3987
  }
3313
3988
 
3314
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
3315
- function encodeCharacterReference(code3) {
3316
- return "&#x" + code3.toString(16).toUpperCase() + ";";
3317
- }
3318
-
3319
- // ../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js
3320
- function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
3989
+ // ../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.js
3990
+ function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
3991
+ let check2;
3992
+ let visitors;
3321
3993
  let reverse;
3322
- let test;
3323
- let visitor;
3324
- if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
3325
- test = void 0;
3326
- visitor = testOrVisitor;
3327
- reverse = visitorOrReverse;
3328
- } else {
3329
- test = testOrVisitor;
3330
- visitor = visitorOrReverse;
3994
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
3995
+ check2 = /** @type {Test} */
3996
+ testOrEnterOrVisitors;
3997
+ visitors = enterOrVisitorsOrReverse;
3331
3998
  reverse = maybeReverse;
3999
+ } else {
4000
+ visitors = /** @type {Visitor | Visitors} */
4001
+ testOrEnterOrVisitors;
4002
+ reverse = enterOrVisitorsOrReverse;
3332
4003
  }
3333
- visitParents(tree, test, overload, reverse);
3334
- function overload(node2, parents) {
3335
- const parent = parents[parents.length - 1];
3336
- const index2 = parent ? parent.children.indexOf(node2) : void 0;
3337
- return visitor(node2, index2, parent);
4004
+ if (typeof visitors === "function") {
4005
+ visitParents(tree, check2, wrap(visitors), reverse);
4006
+ } else {
4007
+ visitParents(tree, check2, wrapVisitors(visitors), reverse);
4008
+ }
4009
+ }
4010
+ function wrapVisitors(visitors) {
4011
+ if (!visitors || typeof visitors !== "object") return visitors;
4012
+ return {
4013
+ enter: typeof visitors.enter === "function" ? wrap(visitors.enter) : visitors.enter,
4014
+ exit: typeof visitors.exit === "function" ? wrap(visitors.exit) : visitors.exit
4015
+ };
4016
+ }
4017
+ function wrap(visitor) {
4018
+ return overload;
4019
+ function overload(node2, parents, index2) {
4020
+ return visitor(node2, index2, parents[parents.length - 1]);
3338
4021
  }
3339
4022
  }
3340
4023
 
@@ -3375,7 +4058,7 @@ function node(value) {
3375
4058
  return Boolean(value && typeof value === "object");
3376
4059
  }
3377
4060
 
3378
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
4061
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
3379
4062
  function formatHeadingAsSetext(node2, state) {
3380
4063
  let literalWithBreak = false;
3381
4064
  visit(node2, function(node3) {
@@ -3389,7 +4072,7 @@ function formatHeadingAsSetext(node2, state) {
3389
4072
  );
3390
4073
  }
3391
4074
 
3392
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/heading.js
4075
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/heading.js
3393
4076
  function heading(node2, _, state, info) {
3394
4077
  const rank = Math.max(Math.min(6, node2.depth || 1), 1);
3395
4078
  const tracker = state.createTracker(info);
@@ -3432,7 +4115,7 @@ function heading(node2, _, state, info) {
3432
4115
  return value;
3433
4116
  }
3434
4117
 
3435
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/html.js
4118
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/html.js
3436
4119
  html.peek = htmlPeek;
3437
4120
  function html(node2) {
3438
4121
  return node2.value || "";
@@ -3441,7 +4124,7 @@ function htmlPeek() {
3441
4124
  return "<";
3442
4125
  }
3443
4126
 
3444
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image.js
4127
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/image.js
3445
4128
  image.peek = imagePeek;
3446
4129
  function image(node2, _, state, info) {
3447
4130
  const quote = checkQuote(state);
@@ -3498,7 +4181,7 @@ function imagePeek() {
3498
4181
  return "!";
3499
4182
  }
3500
4183
 
3501
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
4184
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
3502
4185
  imageReference.peek = imageReferencePeek;
3503
4186
  function imageReference(node2, _, state, info) {
3504
4187
  const type = node2.referenceType;
@@ -3539,7 +4222,7 @@ function imageReferencePeek() {
3539
4222
  return "!";
3540
4223
  }
3541
4224
 
3542
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
4225
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
3543
4226
  inlineCode.peek = inlineCodePeek;
3544
4227
  function inlineCode(node2, _, state) {
3545
4228
  let value = node2.value || "";
@@ -3570,7 +4253,7 @@ function inlineCodePeek() {
3570
4253
  return "`";
3571
4254
  }
3572
4255
 
3573
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
4256
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
3574
4257
  function formatLinkAsAutolink(node2, state) {
3575
4258
  const raw = toString(node2);
3576
4259
  return Boolean(
@@ -3585,7 +4268,7 @@ function formatLinkAsAutolink(node2, state) {
3585
4268
  );
3586
4269
  }
3587
4270
 
3588
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link.js
4271
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/link.js
3589
4272
  link.peek = linkPeek;
3590
4273
  function link(node2, _, state, info) {
3591
4274
  const quote = checkQuote(state);
@@ -3613,19 +4296,28 @@ function link(node2, _, state, info) {
3613
4296
  const exit4 = state.enter("link");
3614
4297
  let subexit = state.enter("label");
3615
4298
  let value = tracker.move("[");
3616
- value += tracker.move(
3617
- state.containerPhrasing(node2, {
3618
- before: value,
3619
- after: "](",
3620
- ...tracker.current()
3621
- })
3622
- );
3623
- value += tracker.move("](");
4299
+ const text5 = state.containerPhrasing(node2, {
4300
+ before: value,
4301
+ after: "](",
4302
+ ...tracker.current()
4303
+ });
4304
+ value += tracker.move(text5);
3624
4305
  subexit();
4306
+ value += tracker.move("](");
4307
+ const enclose = /[\0- \u007F]/.test(node2.url);
4308
+ const last = info.before.charAt(info.before.length - 1);
4309
+ let title = node2.title || void 0;
4310
+ if (!title && !enclose && (last === "\n" || last === "\r")) {
4311
+ let index2 = 0;
4312
+ while (index2 < text5.length && text5.charCodeAt(index2) !== 93) {
4313
+ index2 += text5.charCodeAt(index2) === 92 ? 2 : 1;
4314
+ }
4315
+ if (text5.charCodeAt(index2 + 1) === 58) title = "";
4316
+ }
3625
4317
  if (
3626
4318
  // If there’s no url but there is a title…
3627
- !node2.url && node2.title || // If there are control characters or whitespace.
3628
- /[\0- \u007F]/.test(node2.url)
4319
+ !node2.url && typeof title === "string" || // If there are control characters or whitespace.
4320
+ enclose
3629
4321
  ) {
3630
4322
  subexit = state.enter("destinationLiteral");
3631
4323
  value += tracker.move("<");
@@ -3638,17 +4330,17 @@ function link(node2, _, state, info) {
3638
4330
  value += tracker.move(
3639
4331
  state.safe(node2.url, {
3640
4332
  before: value,
3641
- after: node2.title ? " " : ")",
4333
+ after: typeof title === "string" ? " " : ")",
3642
4334
  ...tracker.current()
3643
4335
  })
3644
4336
  );
3645
4337
  }
3646
4338
  subexit();
3647
- if (node2.title) {
4339
+ if (typeof title === "string") {
3648
4340
  subexit = state.enter(`title${suffix}`);
3649
4341
  value += tracker.move(" " + quote);
3650
4342
  value += tracker.move(
3651
- state.safe(node2.title, {
4343
+ state.safe(title, {
3652
4344
  before: value,
3653
4345
  after: quote,
3654
4346
  ...tracker.current()
@@ -3665,7 +4357,7 @@ function linkPeek(node2, _, state) {
3665
4357
  return formatLinkAsAutolink(node2, state) ? "<" : "[";
3666
4358
  }
3667
4359
 
3668
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
4360
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
3669
4361
  linkReference.peek = linkReferencePeek;
3670
4362
  function linkReference(node2, _, state, info) {
3671
4363
  const type = node2.referenceType;
@@ -3706,7 +4398,7 @@ function linkReferencePeek() {
3706
4398
  return "[";
3707
4399
  }
3708
4400
 
3709
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
4401
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
3710
4402
  function checkBullet(state) {
3711
4403
  const marker = state.options.bullet || "*";
3712
4404
  if (marker !== "*" && marker !== "+" && marker !== "-") {
@@ -3717,7 +4409,7 @@ function checkBullet(state) {
3717
4409
  return marker;
3718
4410
  }
3719
4411
 
3720
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
4412
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
3721
4413
  function checkBulletOther(state) {
3722
4414
  const bullet = checkBullet(state);
3723
4415
  const bulletOther = state.options.bulletOther;
@@ -3737,7 +4429,7 @@ function checkBulletOther(state) {
3737
4429
  return bulletOther;
3738
4430
  }
3739
4431
 
3740
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
4432
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
3741
4433
  function checkBulletOrdered(state) {
3742
4434
  const marker = state.options.bulletOrdered || ".";
3743
4435
  if (marker !== "." && marker !== ")") {
@@ -3748,7 +4440,7 @@ function checkBulletOrdered(state) {
3748
4440
  return marker;
3749
4441
  }
3750
4442
 
3751
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
4443
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
3752
4444
  function checkRule(state) {
3753
4445
  const marker = state.options.rule || "*";
3754
4446
  if (marker !== "*" && marker !== "-" && marker !== "_") {
@@ -3759,7 +4451,7 @@ function checkRule(state) {
3759
4451
  return marker;
3760
4452
  }
3761
4453
 
3762
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list.js
4454
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/list.js
3763
4455
  function list(node2, parent, state, info) {
3764
4456
  const exit4 = state.enter("list");
3765
4457
  const bulletCurrent = state.bulletCurrent;
@@ -3799,7 +4491,7 @@ function list(node2, parent, state, info) {
3799
4491
  return value;
3800
4492
  }
3801
4493
 
3802
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
4494
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
3803
4495
  function checkListItemIndent(state) {
3804
4496
  const style = state.options.listItemIndent || "one";
3805
4497
  if (style !== "tab" && style !== "one" && style !== "mixed") {
@@ -3810,7 +4502,7 @@ function checkListItemIndent(state) {
3810
4502
  return style;
3811
4503
  }
3812
4504
 
3813
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
4505
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
3814
4506
  function listItem(node2, parent, state, info) {
3815
4507
  const listItemIndent = checkListItemIndent(state);
3816
4508
  let bullet = state.bulletCurrent || checkBullet(state);
@@ -3839,7 +4531,7 @@ function listItem(node2, parent, state, info) {
3839
4531
  }
3840
4532
  }
3841
4533
 
3842
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
4534
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
3843
4535
  function paragraph(node2, _, state, info) {
3844
4536
  const exit4 = state.enter("paragraph");
3845
4537
  const subexit = state.enter("phrasing");
@@ -3849,7 +4541,7 @@ function paragraph(node2, _, state, info) {
3849
4541
  return value;
3850
4542
  }
3851
4543
 
3852
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/root.js
4544
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/root.js
3853
4545
  function root(node2, _, state, info) {
3854
4546
  const hasPhrasing = node2.children.some(function(d) {
3855
4547
  return phrasing(d);
@@ -3861,7 +4553,7 @@ function root(node2, _, state, info) {
3861
4553
  return value;
3862
4554
  }
3863
4555
 
3864
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
4556
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
3865
4557
  function checkStrong(state) {
3866
4558
  const marker = state.options.strong || "*";
3867
4559
  if (marker !== "*" && marker !== "_") {
@@ -3872,12 +4564,13 @@ function checkStrong(state) {
3872
4564
  return marker;
3873
4565
  }
3874
4566
 
3875
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/strong.js
4567
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/strong.js
3876
4568
  strong.attention = attention2;
3877
4569
  strong.peek = peek2;
3878
4570
  function strong(node2, _, state, info) {
3879
4571
  const exit4 = state.enter("phrasing");
3880
- const value = state.containerPhrasing({ type: "root", children: [node2] }, info);
4572
+ const item = attentionItem(node2, attention2, state, state.createTracker(info));
4573
+ const value = serialize2([item], info.before, info.after);
3881
4574
  exit4();
3882
4575
  return value;
3883
4576
  }
@@ -3893,10 +4586,10 @@ function peek2(_, _1, state) {
3893
4586
  return state.options.strong || "*";
3894
4587
  }
3895
4588
 
3896
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/text.js
4589
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/text.js
3897
4590
  function text(node2, parent, state, info) {
3898
4591
  const siblings = parent ? parent.children : [];
3899
- const index2 = siblings.indexOf(node2);
4592
+ const index2 = state.indexStack[state.indexStack.length - 1];
3900
4593
  return state.safe(node2.value, {
3901
4594
  ...info,
3902
4595
  afterNode: siblings[index2 + 1],
@@ -3904,7 +4597,7 @@ function text(node2, parent, state, info) {
3904
4597
  });
3905
4598
  }
3906
4599
 
3907
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
4600
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
3908
4601
  function checkRuleRepetition(state) {
3909
4602
  const repetition = state.options.ruleRepetition || 3;
3910
4603
  if (repetition < 3) {
@@ -3915,13 +4608,13 @@ function checkRuleRepetition(state) {
3915
4608
  return repetition;
3916
4609
  }
3917
4610
 
3918
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
4611
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
3919
4612
  function thematicBreak(_, _1, state) {
3920
4613
  const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
3921
4614
  return state.options.ruleSpaces ? value.slice(0, -1) : value;
3922
4615
  }
3923
4616
 
3924
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/index.js
4617
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/index.js
3925
4618
  var handle = {
3926
4619
  blockquote,
3927
4620
  break: hardBreak,
@@ -3945,73 +4638,6 @@ var handle = {
3945
4638
  thematicBreak
3946
4639
  };
3947
4640
 
3948
- // ../node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
3949
- var htmlBlockNames = [
3950
- "address",
3951
- "article",
3952
- "aside",
3953
- "base",
3954
- "basefont",
3955
- "blockquote",
3956
- "body",
3957
- "caption",
3958
- "center",
3959
- "col",
3960
- "colgroup",
3961
- "dd",
3962
- "details",
3963
- "dialog",
3964
- "dir",
3965
- "div",
3966
- "dl",
3967
- "dt",
3968
- "fieldset",
3969
- "figcaption",
3970
- "figure",
3971
- "footer",
3972
- "form",
3973
- "frame",
3974
- "frameset",
3975
- "h1",
3976
- "h2",
3977
- "h3",
3978
- "h4",
3979
- "h5",
3980
- "h6",
3981
- "head",
3982
- "header",
3983
- "hr",
3984
- "html",
3985
- "iframe",
3986
- "legend",
3987
- "li",
3988
- "link",
3989
- "main",
3990
- "menu",
3991
- "menuitem",
3992
- "nav",
3993
- "noframes",
3994
- "ol",
3995
- "optgroup",
3996
- "option",
3997
- "p",
3998
- "param",
3999
- "search",
4000
- "section",
4001
- "summary",
4002
- "table",
4003
- "tbody",
4004
- "td",
4005
- "tfoot",
4006
- "th",
4007
- "thead",
4008
- "title",
4009
- "tr",
4010
- "track",
4011
- "ul"
4012
- ];
4013
- var htmlRawNames = ["pre", "script", "style", "textarea"];
4014
-
4015
4641
  // ../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js
4016
4642
  function decodeNumericCharacterReference(value, base) {
4017
4643
  const code3 = Number.parseInt(value, base);
@@ -4048,16 +4674,6 @@ function decode($0, $1, $2) {
4048
4674
  return decodeNamedCharacterReference($2) || $0;
4049
4675
  }
4050
4676
 
4051
- // ../node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
4052
- function classifyCharacter(code3) {
4053
- if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
4054
- return 1;
4055
- }
4056
- if (unicodePunctuation(code3)) {
4057
- return 2;
4058
- }
4059
- }
4060
-
4061
4677
  // ../node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.js
4062
4678
  function gfmTableFromMarkdown() {
4063
4679
  return {
@@ -4276,10 +4892,10 @@ function listItemWithTaskListItem(node2, parent, state, info) {
4276
4892
  ...tracker.current()
4277
4893
  });
4278
4894
  if (checkable) {
4279
- value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check);
4895
+ value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check2);
4280
4896
  }
4281
4897
  return value;
4282
- function check($0) {
4898
+ function check2($0) {
4283
4899
  return $0 + checkbox;
4284
4900
  }
4285
4901
  }
@@ -4853,10 +5469,10 @@ function tokenizeAttention(effects, ok3) {
4853
5469
  return ok3(code3);
4854
5470
  }
4855
5471
  }
4856
- function movePoint(point3, offset) {
4857
- point3.column += offset;
4858
- point3.offset += offset;
4859
- point3._bufferIndex += offset;
5472
+ function movePoint(point4, offset) {
5473
+ point4.column += offset;
5474
+ point4.offset += offset;
5475
+ point4._bufferIndex += offset;
4860
5476
  }
4861
5477
 
4862
5478
  // ../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/autolink.js
@@ -8699,10 +9315,10 @@ function initializeDocument(effects) {
8699
9315
  }
8700
9316
  const indexBeforeExits = self.events.length;
8701
9317
  let indexBeforeFlow = indexBeforeExits;
8702
- let point3;
9318
+ let point4;
8703
9319
  while (indexBeforeFlow--) {
8704
9320
  if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
8705
- point3 = self.events[indexBeforeFlow][1].end;
9321
+ point4 = self.events[indexBeforeFlow][1].end;
8706
9322
  break;
8707
9323
  }
8708
9324
  }
@@ -8710,7 +9326,7 @@ function initializeDocument(effects) {
8710
9326
  let index2 = indexBeforeExits;
8711
9327
  while (index2 < self.events.length) {
8712
9328
  self.events[index2][1].end = {
8713
- ...point3
9329
+ ...point4
8714
9330
  };
8715
9331
  index2++;
8716
9332
  }
@@ -8817,11 +9433,11 @@ function initializeDocument(effects) {
8817
9433
  const indexBeforeExits = self.events.length;
8818
9434
  let indexBeforeFlow = indexBeforeExits;
8819
9435
  let seen;
8820
- let point3;
9436
+ let point4;
8821
9437
  while (indexBeforeFlow--) {
8822
9438
  if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
8823
9439
  if (seen) {
8824
- point3 = self.events[indexBeforeFlow][1].end;
9440
+ point4 = self.events[indexBeforeFlow][1].end;
8825
9441
  break;
8826
9442
  }
8827
9443
  seen = true;
@@ -8831,7 +9447,7 @@ function initializeDocument(effects) {
8831
9447
  index2 = indexBeforeExits;
8832
9448
  while (index2 < self.events.length) {
8833
9449
  self.events[index2][1].end = {
8834
- ...point3
9450
+ ...point4
8835
9451
  };
8836
9452
  index2++;
8837
9453
  }
@@ -9118,7 +9734,7 @@ var disable = {
9118
9734
 
9119
9735
  // ../node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/create-tokenizer.js
9120
9736
  function createTokenizer(parser, initialize, from) {
9121
- let point3 = {
9737
+ let point4 = {
9122
9738
  _bufferIndex: -1,
9123
9739
  _index: 0,
9124
9740
  line: from && from.line || 1,
@@ -9181,7 +9797,7 @@ function createTokenizer(parser, initialize, from) {
9181
9797
  line,
9182
9798
  column,
9183
9799
  offset
9184
- } = point3;
9800
+ } = point4;
9185
9801
  return {
9186
9802
  _bufferIndex,
9187
9803
  _index,
@@ -9195,15 +9811,15 @@ function createTokenizer(parser, initialize, from) {
9195
9811
  accountForPotentialSkip();
9196
9812
  }
9197
9813
  function main() {
9198
- while (point3._index < chunks.length) {
9199
- const chunk = chunks[point3._index];
9814
+ while (point4._index < chunks.length) {
9815
+ const chunk = chunks[point4._index];
9200
9816
  if (typeof chunk === "string") {
9201
- const chunkIndex = point3._index;
9202
- if (point3._bufferIndex < 0) {
9203
- point3._bufferIndex = 0;
9817
+ const chunkIndex = point4._index;
9818
+ if (point4._bufferIndex < 0) {
9819
+ point4._bufferIndex = 0;
9204
9820
  }
9205
- while (point3._index === chunkIndex && point3._bufferIndex < chunk.length) {
9206
- go(chunk.charCodeAt(point3._bufferIndex));
9821
+ while (point4._index === chunkIndex && point4._bufferIndex < chunk.length) {
9822
+ go(chunk.charCodeAt(point4._bufferIndex));
9207
9823
  }
9208
9824
  } else {
9209
9825
  go(chunk);
@@ -9217,24 +9833,24 @@ function createTokenizer(parser, initialize, from) {
9217
9833
  }
9218
9834
  function consume(code3) {
9219
9835
  if (markdownLineEnding(code3)) {
9220
- point3.line++;
9221
- point3.column = 1;
9222
- point3.offset += code3 === -3 ? 2 : 1;
9836
+ point4.line++;
9837
+ point4.column = 1;
9838
+ point4.offset += code3 === -3 ? 2 : 1;
9223
9839
  accountForPotentialSkip();
9224
9840
  } else if (code3 !== -1) {
9225
- point3.column++;
9226
- point3.offset++;
9841
+ point4.column++;
9842
+ point4.offset++;
9227
9843
  }
9228
- if (point3._bufferIndex < 0) {
9229
- point3._index++;
9844
+ if (point4._bufferIndex < 0) {
9845
+ point4._index++;
9230
9846
  } else {
9231
- point3._bufferIndex++;
9232
- if (point3._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
9847
+ point4._bufferIndex++;
9848
+ if (point4._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
9233
9849
  // strings.
9234
9850
  /** @type {string} */
9235
- chunks[point3._index].length) {
9236
- point3._bufferIndex = -1;
9237
- point3._index++;
9851
+ chunks[point4._index].length) {
9852
+ point4._bufferIndex = -1;
9853
+ point4._index++;
9238
9854
  }
9239
9855
  }
9240
9856
  context.previous = code3;
@@ -9358,7 +9974,7 @@ function createTokenizer(parser, initialize, from) {
9358
9974
  restore
9359
9975
  };
9360
9976
  function restore() {
9361
- point3 = startPoint;
9977
+ point4 = startPoint;
9362
9978
  context.previous = startPrevious;
9363
9979
  context.currentConstruct = startCurrentConstruct;
9364
9980
  context.events.length = startEventsIndex;
@@ -9367,9 +9983,9 @@ function createTokenizer(parser, initialize, from) {
9367
9983
  }
9368
9984
  }
9369
9985
  function accountForPotentialSkip() {
9370
- if (point3.line in columnStart && point3.column < 2) {
9371
- point3.column = columnStart[point3.line];
9372
- point3.offset += columnStart[point3.line] - 1;
9986
+ if (point4.line in columnStart && point4.column < 2) {
9987
+ point4.column = columnStart[point4.line];
9988
+ point4.offset += columnStart[point4.line] - 1;
9373
9989
  }
9374
9990
  }
9375
9991
  }
@@ -9567,15 +10183,15 @@ function stringifyPosition(value) {
9567
10183
  return position(value);
9568
10184
  }
9569
10185
  if ("line" in value || "column" in value) {
9570
- return point(value);
10186
+ return point2(value);
9571
10187
  }
9572
10188
  return "";
9573
10189
  }
9574
- function point(point3) {
9575
- return index(point3 && point3.line) + ":" + index(point3 && point3.column);
10190
+ function point2(point4) {
10191
+ return index(point4 && point4.line) + ":" + index(point4 && point4.column);
9576
10192
  }
9577
10193
  function position(pos) {
9578
- return point(pos && pos.start) + "-" + point(pos && pos.end);
10194
+ return point2(pos && pos.start) + "-" + point2(pos && pos.end);
9579
10195
  }
9580
10196
  function index(value) {
9581
10197
  return value && typeof value === "number" ? value : 1;
@@ -9753,12 +10369,12 @@ function compiler(options) {
9753
10369
  handler.call(context, void 0, tail[0]);
9754
10370
  }
9755
10371
  tree.position = {
9756
- start: point2(events.length > 0 ? events[0][1].start : {
10372
+ start: point3(events.length > 0 ? events[0][1].start : {
9757
10373
  line: 1,
9758
10374
  column: 1,
9759
10375
  offset: 0
9760
10376
  }),
9761
- end: point2(events.length > 0 ? events[events.length - 2][1].end : {
10377
+ end: point3(events.length > 0 ? events[events.length - 2][1].end : {
9762
10378
  line: 1,
9763
10379
  column: 1,
9764
10380
  offset: 0
@@ -9897,7 +10513,7 @@ function compiler(options) {
9897
10513
  this.stack.push(node2);
9898
10514
  this.tokenStack.push([token, errorHandler || void 0]);
9899
10515
  node2.position = {
9900
- start: point2(token.start),
10516
+ start: point3(token.start),
9901
10517
  // @ts-expect-error: `end` will be patched later.
9902
10518
  end: void 0
9903
10519
  };
@@ -9926,7 +10542,7 @@ function compiler(options) {
9926
10542
  handler.call(this, token, open[0]);
9927
10543
  }
9928
10544
  }
9929
- node2.position.end = point2(token.end);
10545
+ node2.position.end = point3(token.end);
9930
10546
  }
9931
10547
  function resume() {
9932
10548
  return toString(this.stack.pop());
@@ -10007,7 +10623,7 @@ function compiler(options) {
10007
10623
  if (!tail || tail.type !== "text") {
10008
10624
  tail = text5();
10009
10625
  tail.position = {
10010
- start: point2(token.start),
10626
+ start: point3(token.start),
10011
10627
  // @ts-expect-error: we’ll add `end` later.
10012
10628
  end: void 0
10013
10629
  };
@@ -10018,13 +10634,13 @@ function compiler(options) {
10018
10634
  function onexitdata(token) {
10019
10635
  const tail = this.stack.pop();
10020
10636
  tail.value += this.sliceSerialize(token);
10021
- tail.position.end = point2(token.end);
10637
+ tail.position.end = point3(token.end);
10022
10638
  }
10023
10639
  function onexitlineending(token) {
10024
10640
  const context = this.stack[this.stack.length - 1];
10025
10641
  if (this.data.atHardBreak) {
10026
10642
  const tail = context.children[context.children.length - 1];
10027
- tail.position.end = point2(token.end);
10643
+ tail.position.end = point3(token.end);
10028
10644
  this.data.atHardBreak = void 0;
10029
10645
  return;
10030
10646
  }
@@ -10139,7 +10755,7 @@ function compiler(options) {
10139
10755
  }
10140
10756
  function onexitcharacterreference(token) {
10141
10757
  const tail = this.stack.pop();
10142
- tail.position.end = point2(token.end);
10758
+ tail.position.end = point3(token.end);
10143
10759
  }
10144
10760
  function onexitautolinkprotocol(token) {
10145
10761
  onexitdata.call(this, token);
@@ -10278,7 +10894,7 @@ function compiler(options) {
10278
10894
  };
10279
10895
  }
10280
10896
  }
10281
- function point2(d) {
10897
+ function point3(d) {
10282
10898
  return {
10283
10899
  line: d.line,
10284
10900
  column: d.column,
@@ -10413,7 +11029,7 @@ function trough() {
10413
11029
  }
10414
11030
  values = output;
10415
11031
  if (fn) {
10416
- wrap(fn, next)(...output);
11032
+ wrap2(fn, next)(...output);
10417
11033
  } else {
10418
11034
  callback(null, ...output);
10419
11035
  }
@@ -10429,7 +11045,7 @@ function trough() {
10429
11045
  return pipeline;
10430
11046
  }
10431
11047
  }
10432
- function wrap(middleware, callback) {
11048
+ function wrap2(middleware, callback) {
10433
11049
  let called;
10434
11050
  return wrapped;
10435
11051
  function wrapped(...parameters) {