nolo-cli 0.112.0-alpha.2 → 0.113.0-alpha.1

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 (38) hide show
  1. package/{_executeModel-S7OU2QIO.js → _executeModel-7CUOUYCK.js} +11 -11
  2. package/{agentEmailCommands-PNEZCF6T.js → agentEmailCommands-STTPGUSF.js} +10 -10
  3. package/{agentMachineCommands-SIVJRNKN.js → agentMachineCommands-U6A4SUS4.js} +1 -1
  4. package/{agentRecordCommands-6POMYCA7.js → agentRecordCommands-IXNQ4QO6.js} +10 -10
  5. package/{agentRunCommand-ZA32A4RF.js → agentRunCommand-EL6GF4K2.js} +10 -10
  6. package/{agentSlice-UTLXHAFW.js → agentSlice-5QKQ27CG.js} +1 -1
  7. package/{chatQueueReduxAdapter-LXYPUM6T.js → chatQueueReduxAdapter-CIDX55K5.js} +2 -2
  8. package/{chunk-NJBXVHED.js → chunk-2ERGVBM6.js} +2 -2
  9. package/{chunk-FZGV4FGK.js → chunk-6GFOD3TK.js} +260 -140
  10. package/{chunk-TDGDSTGC.js → chunk-CFEFBUXO.js} +9 -9
  11. package/{chunk-FZK3Z2MJ.js → chunk-FMFAK4YB.js} +1 -1
  12. package/{chunk-4RMFGFRH.js → chunk-FSABYU7L.js} +3 -3
  13. package/{chunk-WKWF4RJH.js → chunk-GTLZXAWO.js} +8 -8
  14. package/{chunk-L4KM22WM.js → chunk-ILEKGDX5.js} +4 -4
  15. package/{chunk-XRTLTE4O.js → chunk-PIJHSZZM.js} +3 -3
  16. package/{chunk-YP7H6FE4.js → chunk-PJAZHZG5.js} +2 -2
  17. package/{chunk-5PJTI4EP.js → chunk-POV53AWS.js} +1 -1
  18. package/{chunk-6S3QIHMN.js → chunk-QT43HLXZ.js} +5 -5
  19. package/{chunk-G2TIDKFM.js → chunk-UJEJG66W.js} +4 -4
  20. package/{chunk-WTDSXQIV.js → chunk-WFH72XIR.js} +2 -2
  21. package/{chunk-K4A446HZ.js → chunk-XTTNBYM3.js} +1 -1
  22. package/{chunk-YYYAN2NH.js → chunk-ZNBV3AKY.js} +2 -2
  23. package/{contentThunks-BKHGW5JF.js → contentThunks-OMUPXTLL.js} +3 -3
  24. package/{createAgentAutomationAction-5VG5HN7Z.js → createAgentAutomationAction-4AJ7ZJDW.js} +3 -3
  25. package/{createDialogAction-MA7HM3BD.js → createDialogAction-76FLQXOB.js} +4 -4
  26. package/{createPageAction-G7IYJMTT.js → createPageAction-MULKS35T.js} +4 -4
  27. package/{dialogSlice-ORVLG3AA.js → dialogSlice-V62ONOCY.js} +2 -2
  28. package/{docStore-JFRTM66X.js → docStore-AHFTDQ6D.js} +1 -1
  29. package/{handleSendMessageAction-GALALRRM.js → handleSendMessageAction-VTB6HOV2.js} +2 -2
  30. package/index.js +15 -15
  31. package/{machineCommands-SLKZBMRB.js → machineCommands-ZHNU3X4I.js} +10 -10
  32. package/{machineWsRunDispatch-4JISAOO2.js → machineWsRunDispatch-7EB4E3MD.js} +10 -10
  33. package/package.json +1 -1
  34. package/{readlineWorkspace-7PJTQ3F2.js → readlineWorkspace-4P62FKBU.js} +10 -10
  35. package/{runAgentClientLoop-6DAWYFWZ.js → runAgentClientLoop-MVYHOKMV.js} +9 -9
  36. package/{streamAgentChatTurn-T7B7IVHX.js → streamAgentChatTurn-2PK6NXKQ.js} +10 -10
  37. package/{tools-CGRUHWCA.js → tools-FYMWUIED.js} +7 -7
  38. package/{updateDialogTitleAction-QMSKYS55.js → updateDialogTitleAction-FKXIYYIO.js} +3 -3
@@ -2308,7 +2308,7 @@ function regexCheck(regex) {
2308
2308
 
2309
2309
  // node_modules/micromark-factory-space/index.js
2310
2310
  function factorySpace(effects, ok3, type, max) {
2311
- const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
2311
+ const limit = max ? max - 1 : Infinity;
2312
2312
  let size = 0;
2313
2313
  return start;
2314
2314
  function start(code2) {
@@ -2327,6 +2327,29 @@ function factorySpace(effects, ok3, type, max) {
2327
2327
  return ok3(code2);
2328
2328
  }
2329
2329
  }
2330
+ function factorySpaceMinMax(effects, ok3, nok, type, min, max) {
2331
+ let size = 0;
2332
+ return start;
2333
+ function start(code2) {
2334
+ if (max > 0 && markdownSpace(code2)) {
2335
+ effects.enter(type);
2336
+ return prefix(code2);
2337
+ }
2338
+ return after(code2);
2339
+ }
2340
+ function prefix(code2) {
2341
+ if (markdownSpace(code2) && size < max) {
2342
+ effects.consume(code2);
2343
+ size++;
2344
+ return prefix;
2345
+ }
2346
+ effects.exit(type);
2347
+ return after(code2);
2348
+ }
2349
+ function after(code2) {
2350
+ return size >= min ? ok3(code2) : nok(code2);
2351
+ }
2352
+ }
2330
2353
 
2331
2354
  // node_modules/micromark/lib/initialize/content.js
2332
2355
  var content = {
@@ -2378,6 +2401,104 @@ function initializeContent(effects) {
2378
2401
  }
2379
2402
  }
2380
2403
 
2404
+ // node_modules/micromark-util-edit-map/index.js
2405
+ var EditMap = class {
2406
+ /**
2407
+ * Create a new edit map.
2408
+ *
2409
+ * @returns
2410
+ * New instance.
2411
+ */
2412
+ constructor() {
2413
+ this.index = /* @__PURE__ */ new Map();
2414
+ this.map = [];
2415
+ }
2416
+ /**
2417
+ * Create an edit: a remove and/or add at a certain place.
2418
+ *
2419
+ * @param {number} index
2420
+ * Index at which to apply the edit.
2421
+ * @param {number} remove
2422
+ * Count of items to remove at the index.
2423
+ * @param {Array<Event>} add
2424
+ * Items to add at the index.
2425
+ * @returns {undefined}
2426
+ * Nothing.
2427
+ */
2428
+ add(index2, remove, add) {
2429
+ addImplementation(this, index2, remove, add, false);
2430
+ }
2431
+ /**
2432
+ * Create an edit: but insert `add` before existing additions, instead of
2433
+ * after them.
2434
+ *
2435
+ * @param {number} index
2436
+ * Index at which to apply the edit.
2437
+ * @param {number} remove
2438
+ * Count of items to remove at the index.
2439
+ * @param {Array<Event>} add
2440
+ * Items to add at the index.
2441
+ * @returns {undefined}
2442
+ * Nothing.
2443
+ */
2444
+ addBefore(index2, remove, add) {
2445
+ addImplementation(this, index2, remove, add, true);
2446
+ }
2447
+ /**
2448
+ * Done, change the events.
2449
+ *
2450
+ * @param {Array<Event>} events
2451
+ * List of events to apply the edits to.
2452
+ * @returns {undefined}
2453
+ * Nothing.
2454
+ */
2455
+ consume(events) {
2456
+ this.map.sort(function(a, b) {
2457
+ return a[0] - b[0];
2458
+ });
2459
+ if (this.map.length === 0) {
2460
+ return;
2461
+ }
2462
+ let index2 = this.map.length;
2463
+ const vecs = [];
2464
+ while (index2 > 0) {
2465
+ index2 -= 1;
2466
+ vecs.push(events.slice(this.map[index2][0] + this.map[index2][1]), this.map[index2][2]);
2467
+ events.length = this.map[index2][0];
2468
+ }
2469
+ vecs.push(events.slice());
2470
+ events.length = 0;
2471
+ let slice = vecs.pop();
2472
+ while (slice) {
2473
+ for (const element of slice) {
2474
+ events.push(element);
2475
+ }
2476
+ slice = vecs.pop();
2477
+ }
2478
+ this.map.length = 0;
2479
+ this.index.clear();
2480
+ }
2481
+ };
2482
+ function addImplementation(editMap, at, remove, add, before) {
2483
+ if (remove === 0 && add.length === 0) {
2484
+ return;
2485
+ }
2486
+ const existing = editMap.index.get(at);
2487
+ if (existing) {
2488
+ existing[1] += remove;
2489
+ if (before) {
2490
+ add.push(...existing[2]);
2491
+ existing[2] = add;
2492
+ } else {
2493
+ existing[2].push(...add);
2494
+ }
2495
+ return;
2496
+ }
2497
+ const change = [at, remove, add];
2498
+ editMap.map.push(change);
2499
+ editMap.index.set(at, change);
2500
+ }
2501
+
2381
2502
  // node_modules/micromark/lib/initialize/document.js
2382
2503
  var document = {
2383
2504
  tokenize: initializeDocument
@@ -2425,8 +2546,10 @@ function initializeDocument(effects) {
2425
2546
  };
2426
2547
  index2++;
2427
2548
  }
2428
- splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
2429
- self.events.length = index2;
2549
+ const editMap = new EditMap();
2550
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
2551
+ editMap.add(indexBeforeExits, index2 - indexBeforeExits, []);
2552
+ editMap.consume(self.events);
2430
2553
  return checkNewContainers(code2);
2431
2554
  }
2432
2555
  return start(code2);
@@ -2445,7 +2568,9 @@ function initializeDocument(effects) {
2445
2568
  return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code2);
2446
2569
  }
2447
2570
  function thereIsANewContainer(code2) {
2448
- if (childFlow) closeFlow();
2571
+ if (childFlow) {
2572
+ closeFlow();
2573
+ }
2449
2574
  exitContainers(continued);
2450
2575
  return documentContinued(code2);
2451
2576
  }
@@ -2465,7 +2590,9 @@ function initializeDocument(effects) {
2465
2590
  }
2466
2591
  function flowStart(code2) {
2467
2592
  if (code2 === null) {
2468
- if (childFlow) closeFlow();
2593
+ if (childFlow) {
2594
+ closeFlow();
2595
+ }
2469
2596
  exitContainers(0);
2470
2597
  effects.consume(code2);
2471
2598
  return;
@@ -2497,9 +2624,13 @@ function initializeDocument(effects) {
2497
2624
  }
2498
2625
  function writeToChild(token, endOfFile) {
2499
2626
  const stream = self.sliceStream(token);
2500
- if (endOfFile) stream.push(null);
2627
+ if (endOfFile) {
2628
+ stream.push(null);
2629
+ }
2501
2630
  token.previous = childToken;
2502
- if (childToken) childToken.next = token;
2631
+ if (childToken) {
2632
+ childToken.next = token;
2633
+ }
2503
2634
  childToken = token;
2504
2635
  childFlow.defineSkip(token.start);
2505
2636
  childFlow.write(stream);
@@ -2536,8 +2667,10 @@ function initializeDocument(effects) {
2536
2667
  };
2537
2668
  index2++;
2538
2669
  }
2539
- splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
2540
- self.events.length = index2;
2670
+ const editMap = new EditMap();
2671
+ editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));
2672
+ editMap.add(indexBeforeExits, index2 - indexBeforeExits, []);
2673
+ editMap.consume(self.events);
2541
2674
  }
2542
2675
  }
2543
2676
  function exitContainers(size) {
@@ -2592,24 +2725,17 @@ var attention = {
2592
2725
  };
2593
2726
  function resolveAllAttention(events, context) {
2594
2727
  let index2 = -1;
2595
- let open;
2596
- let group;
2597
- let text4;
2598
- let openingSequence;
2599
- let closingSequence;
2600
- let use;
2601
2728
  let nextEvents;
2602
- let offset;
2603
2729
  while (++index2 < events.length) {
2604
2730
  if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) {
2605
- open = index2;
2731
+ let open = index2;
2606
2732
  while (open--) {
2607
2733
  if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && // If the markers are the same:
2608
2734
  context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) {
2609
2735
  if ((events[open][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) {
2610
2736
  continue;
2611
2737
  }
2612
- use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1;
2738
+ const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1;
2613
2739
  const start = {
2614
2740
  ...events[open][1].end
2615
2741
  };
@@ -2618,21 +2744,21 @@ function resolveAllAttention(events, context) {
2618
2744
  };
2619
2745
  movePoint(start, -use);
2620
2746
  movePoint(end, use);
2621
- openingSequence = {
2747
+ const openingSequence = {
2622
2748
  type: use > 1 ? "strongSequence" : "emphasisSequence",
2623
2749
  start,
2624
2750
  end: {
2625
2751
  ...events[open][1].end
2626
2752
  }
2627
2753
  };
2628
- closingSequence = {
2754
+ const closingSequence = {
2629
2755
  type: use > 1 ? "strongSequence" : "emphasisSequence",
2630
2756
  start: {
2631
2757
  ...events[index2][1].start
2632
2758
  },
2633
2759
  end
2634
2760
  };
2635
- text4 = {
2761
+ const text4 = {
2636
2762
  type: use > 1 ? "strongText" : "emphasisText",
2637
2763
  start: {
2638
2764
  ...events[open][1].end
@@ -2641,7 +2767,7 @@ function resolveAllAttention(events, context) {
2641
2767
  ...events[index2][1].start
2642
2768
  }
2643
2769
  };
2644
- group = {
2770
+ const group = {
2645
2771
  type: use > 1 ? "strong" : "emphasis",
2646
2772
  start: {
2647
2773
  ...openingSequence.start
@@ -2663,11 +2789,10 @@ function resolveAllAttention(events, context) {
2663
2789
  nextEvents = push(nextEvents, [["enter", group, context], ["enter", openingSequence, context], ["exit", openingSequence, context], ["enter", text4, context]]);
2664
2790
  nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index2), context));
2665
2791
  nextEvents = push(nextEvents, [["exit", text4, context], ["enter", closingSequence, context], ["exit", closingSequence, context], ["exit", group, context]]);
2792
+ let offset = 0;
2666
2793
  if (events[index2][1].end.offset - events[index2][1].start.offset) {
2667
2794
  offset = 2;
2668
2795
  nextEvents = push(nextEvents, [["enter", events[index2][1], context], ["exit", events[index2][1], context]]);
2669
- } else {
2670
- offset = 0;
2671
2796
  }
2672
2797
  splice(events, open - 1, index2 - open + 3, nextEvents);
2673
2798
  index2 = open + nextEvents.length - offset - 2;
@@ -2702,8 +2827,8 @@ function tokenizeAttention(effects, ok3) {
2702
2827
  }
2703
2828
  const token = effects.exit("attentionSequence");
2704
2829
  const after = classifyCharacter(code2);
2705
- const open = !after || after === 2 && before || attentionMarkers2.includes(code2);
2706
- const close = !before || before === 2 && after || attentionMarkers2.includes(previous3);
2830
+ const open = !after || after === 2 && before || attentionMarkers2.includes(code2) && code2 !== 42 && code2 !== 95;
2831
+ const close = !before || before === 2 && after || attentionMarkers2.includes(previous3) && previous3 !== 42 && previous3 !== 95;
2707
2832
  token._open = Boolean(marker === 42 ? open : open && (before || !close));
2708
2833
  token._close = Boolean(marker === 42 ? close : close && (after || !open));
2709
2834
  return ok3(code2);
@@ -2980,11 +3105,29 @@ function tokenizeCharacterReference(effects, ok3, nok) {
2980
3105
  }
2981
3106
  }
2982
3107
 
2983
- // node_modules/micromark-core-commonmark/lib/code-fenced.js
3108
+ // node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js
2984
3109
  var nonLazyContinuation = {
2985
3110
  partial: true,
2986
3111
  tokenize: tokenizeNonLazyContinuation
2987
3112
  };
3113
+ function tokenizeNonLazyContinuation(effects, ok3, nok) {
3114
+ const self = this;
3115
+ return start;
3116
+ function start(code2) {
3117
+ if (code2 === null) {
3118
+ return nok(code2);
3119
+ }
3120
+ effects.enter("lineEnding");
3121
+ effects.consume(code2);
3122
+ effects.exit("lineEnding");
3123
+ return after;
3124
+ }
3125
+ function after(code2) {
3126
+ return self.parser.lazy[self.now().line] ? nok(code2) : ok3(code2);
3127
+ }
3128
+ }
3129
+
3130
+ // node_modules/micromark-core-commonmark/lib/code-fenced.js
2988
3131
  var codeFenced = {
2989
3132
  concrete: true,
2990
3133
  name: "codeFenced",
@@ -3146,22 +3289,6 @@ function tokenizeCodeFenced(effects, ok3, nok) {
3146
3289
  }
3147
3290
  }
3148
3291
  }
3149
- function tokenizeNonLazyContinuation(effects, ok3, nok) {
3150
- const self = this;
3151
- return start;
3152
- function start(code2) {
3153
- if (code2 === null) {
3154
- return nok(code2);
3155
- }
3156
- effects.enter("lineEnding");
3157
- effects.consume(code2);
3158
- effects.exit("lineEnding");
3159
- return lineStart;
3160
- }
3161
- function lineStart(code2) {
3162
- return self.parser.lazy[self.now().line] ? nok(code2) : ok3(code2);
3163
- }
3164
- }
3165
3292
 
3166
3293
  // node_modules/micromark-core-commonmark/lib/code-indented.js
3167
3294
  var codeIndented = {
@@ -3173,15 +3300,10 @@ var furtherStart = {
3173
3300
  tokenize: tokenizeFurtherStart
3174
3301
  };
3175
3302
  function tokenizeCodeIndented(effects, ok3, nok) {
3176
- const self = this;
3177
3303
  return start;
3178
3304
  function start(code2) {
3179
3305
  effects.enter("codeIndented");
3180
- return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2);
3181
- }
3182
- function afterPrefix(code2) {
3183
- const tail = self.events[self.events.length - 1];
3184
- return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code2) : nok(code2);
3306
+ return factorySpaceMinMax(effects, atBreak, nok, "linePrefix", 4, 4)(code2);
3185
3307
  }
3186
3308
  function atBreak(code2) {
3187
3309
  if (code2 === null) {
@@ -3219,11 +3341,10 @@ function tokenizeFurtherStart(effects, ok3, nok) {
3219
3341
  effects.exit("lineEnding");
3220
3342
  return furtherStart2;
3221
3343
  }
3222
- return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2);
3344
+ return factorySpaceMinMax(effects, ok3, onNotEnoughPrefix, "linePrefix", 4, 4)(code2);
3223
3345
  }
3224
- function afterPrefix(code2) {
3225
- const tail = self.events[self.events.length - 1];
3226
- return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok3(code2) : markdownLineEnding(code2) ? furtherStart2(code2) : nok(code2);
3346
+ function onNotEnoughPrefix(code2) {
3347
+ return markdownLineEnding(code2) ? furtherStart2(code2) : nok(code2);
3227
3348
  }
3228
3349
  }
3229
3350
 
@@ -4109,8 +4230,6 @@ var headingAtx = {
4109
4230
  function resolveHeadingAtx(events, context) {
4110
4231
  let contentEnd = events.length - 2;
4111
4232
  let contentStart = 3;
4112
- let content3;
4113
- let text4;
4114
4233
  if (events[contentStart][1].type === "whitespace") {
4115
4234
  contentStart += 2;
4116
4235
  }
@@ -4121,12 +4240,12 @@ function resolveHeadingAtx(events, context) {
4121
4240
  contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;
4122
4241
  }
4123
4242
  if (contentEnd > contentStart) {
4124
- content3 = {
4243
+ const content3 = {
4125
4244
  type: "atxHeadingText",
4126
4245
  start: events[contentStart][1].start,
4127
4246
  end: events[contentEnd][1].end
4128
4247
  };
4129
- text4 = {
4248
+ const text4 = {
4130
4249
  type: "chunkText",
4131
4250
  start: events[contentStart][1].start,
4132
4251
  end: events[contentEnd][1].end,
@@ -4269,10 +4388,6 @@ var blankLineBefore = {
4269
4388
  partial: true,
4270
4389
  tokenize: tokenizeBlankLineBefore
4271
4390
  };
4272
- var nonLazyContinuationStart = {
4273
- partial: true,
4274
- tokenize: tokenizeNonLazyContinuationStart
4275
- };
4276
4391
  function resolveToHtmlFlow(events) {
4277
4392
  let index2 = events.length;
4278
4393
  while (index2--) {
@@ -4534,7 +4649,7 @@ function tokenizeHtmlFlow(effects, ok3, nok) {
4534
4649
  return continuation;
4535
4650
  }
4536
4651
  function continuationStart(code2) {
4537
- return effects.check(nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code2);
4652
+ return effects.check(nonLazyContinuation, continuationStartNonLazy, continuationAfter)(code2);
4538
4653
  }
4539
4654
  function continuationStartNonLazy(code2) {
4540
4655
  effects.enter("lineEnding");
@@ -4611,22 +4726,6 @@ function tokenizeHtmlFlow(effects, ok3, nok) {
4611
4726
  return ok3(code2);
4612
4727
  }
4613
4728
  }
4614
- function tokenizeNonLazyContinuationStart(effects, ok3, nok) {
4615
- const self = this;
4616
- return start;
4617
- function start(code2) {
4618
- if (markdownLineEnding(code2)) {
4619
- effects.enter("lineEnding");
4620
- effects.consume(code2);
4621
- effects.exit("lineEnding");
4622
- return after;
4623
- }
4624
- return nok(code2);
4625
- }
4626
- function after(code2) {
4627
- return self.parser.lazy[self.now().line] ? nok(code2) : ok3(code2);
4628
- }
4629
- }
4630
4729
  function tokenizeBlankLineBefore(effects, ok3, nok) {
4631
4730
  return start;
4632
4731
  function start(code2) {
@@ -4979,12 +5078,11 @@ function resolveAllLabelEnd(events) {
4979
5078
  function resolveToLabelEnd(events, context) {
4980
5079
  let index2 = events.length;
4981
5080
  let offset = 0;
4982
- let token;
4983
5081
  let open;
4984
5082
  let close;
4985
5083
  let media;
4986
5084
  while (index2--) {
4987
- token = events[index2][1];
5085
+ const token = events[index2][1];
4988
5086
  if (open) {
4989
5087
  if (token.type === "link" || token.type === "labelLink" && token._inactive) {
4990
5088
  break;
@@ -5043,14 +5141,14 @@ function resolveToLabelEnd(events, context) {
5043
5141
  }
5044
5142
  function tokenizeLabelEnd(effects, ok3, nok) {
5045
5143
  const self = this;
5046
- let index2 = self.events.length;
5144
+ const labelStarts = self._labelStarts;
5047
5145
  let labelStart;
5048
5146
  let defined;
5049
- while (index2--) {
5050
- if ((self.events[index2][1].type === "labelImage" || self.events[index2][1].type === "labelLink") && !self.events[index2][1]._balanced) {
5051
- labelStart = self.events[index2][1];
5052
- break;
5147
+ if (labelStarts) {
5148
+ while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) {
5149
+ labelStarts.pop();
5053
5150
  }
5151
+ labelStart = labelStarts[labelStarts.length - 1];
5054
5152
  }
5055
5153
  return start;
5056
5154
  function start(code2) {
@@ -5084,6 +5182,7 @@ function tokenizeLabelEnd(effects, ok3, nok) {
5084
5182
  return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code2);
5085
5183
  }
5086
5184
  function labelEndOk(code2) {
5185
+ labelStarts.pop();
5087
5186
  return ok3(code2);
5088
5187
  }
5089
5188
  function labelEndNok(code2) {
@@ -5177,6 +5276,7 @@ var labelStartImage = {
5177
5276
  };
5178
5277
  function tokenizeLabelStartImage(effects, ok3, nok) {
5179
5278
  const self = this;
5279
+ let labelImage;
5180
5280
  return start;
5181
5281
  function start(code2) {
5182
5282
  effects.enter("labelImage");
@@ -5190,13 +5290,18 @@ function tokenizeLabelStartImage(effects, ok3, nok) {
5190
5290
  effects.enter("labelMarker");
5191
5291
  effects.consume(code2);
5192
5292
  effects.exit("labelMarker");
5193
- effects.exit("labelImage");
5293
+ labelImage = effects.exit("labelImage");
5194
5294
  return after;
5195
5295
  }
5196
5296
  return nok(code2);
5197
5297
  }
5198
5298
  function after(code2) {
5199
- return code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code2) : ok3(code2);
5299
+ if (code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs) {
5300
+ return nok(code2);
5301
+ }
5302
+ self._labelStarts = self._labelStarts || [];
5303
+ self._labelStarts.push(labelImage);
5304
+ return ok3(code2);
5200
5305
  }
5201
5306
  }
5202
5307
 
@@ -5208,17 +5313,23 @@ var labelStartLink = {
5208
5313
  };
5209
5314
  function tokenizeLabelStartLink(effects, ok3, nok) {
5210
5315
  const self = this;
5316
+ let labelLink;
5211
5317
  return start;
5212
5318
  function start(code2) {
5213
5319
  effects.enter("labelLink");
5214
5320
  effects.enter("labelMarker");
5215
5321
  effects.consume(code2);
5216
5322
  effects.exit("labelMarker");
5217
- effects.exit("labelLink");
5323
+ labelLink = effects.exit("labelLink");
5218
5324
  return after;
5219
5325
  }
5220
5326
  function after(code2) {
5221
- return code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code2) : ok3(code2);
5327
+ if (code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs) {
5328
+ return nok(code2);
5329
+ }
5330
+ self._labelStarts = self._labelStarts || [];
5331
+ self._labelStarts.push(labelLink);
5332
+ return ok3(code2);
5222
5333
  }
5223
5334
  }
5224
5335
 
@@ -5413,6 +5524,7 @@ var setextUnderline = {
5413
5524
  tokenize: tokenizeSetextUnderline
5414
5525
  };
5415
5526
  function resolveToSetextUnderline(events, context) {
5527
+ const editMap = new EditMap();
5416
5528
  let index2 = events.length;
5417
5529
  let content3;
5418
5530
  let text4;
@@ -5428,7 +5540,7 @@ function resolveToSetextUnderline(events, context) {
5428
5540
  }
5429
5541
  } else {
5430
5542
  if (events[index2][1].type === "content") {
5431
- events.splice(index2, 1);
5543
+ editMap.add(index2, 1, []);
5432
5544
  }
5433
5545
  if (!definition2 && events[index2][1].type === "definition") {
5434
5546
  definition2 = index2;
@@ -5446,15 +5558,16 @@ function resolveToSetextUnderline(events, context) {
5446
5558
  };
5447
5559
  events[text4][1].type = "setextHeadingText";
5448
5560
  if (definition2) {
5449
- events.splice(text4, 0, ["enter", heading, context]);
5450
- events.splice(definition2 + 1, 0, ["exit", events[content3][1], context]);
5561
+ editMap.add(text4, 0, [["enter", heading, context]]);
5562
+ editMap.add(definition2 + 1, 0, [["exit", events[content3][1], context]]);
5451
5563
  events[content3][1].end = {
5452
5564
  ...events[definition2][1].end
5453
5565
  };
5454
5566
  } else {
5455
5567
  events[content3][1] = heading;
5456
5568
  }
5457
- events.push(["exit", heading, context]);
5569
+ editMap.add(events.length, 0, [["exit", heading, context]]);
5570
+ editMap.consume(events);
5458
5571
  return events;
5459
5572
  }
5460
5573
  function tokenizeSetextUnderline(effects, ok3, nok) {
@@ -5614,6 +5727,7 @@ function createResolver(extraResolver) {
5614
5727
  }
5615
5728
  }
5616
5729
  function resolveAllLineSuffixes(events, context) {
5730
+ const editMap = new EditMap();
5617
5731
  let eventIndex = 0;
5618
5732
  while (++eventIndex <= events.length) {
5619
5733
  if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") {
@@ -5631,7 +5745,9 @@ function resolveAllLineSuffixes(events, context) {
5631
5745
  size++;
5632
5746
  bufferIndex--;
5633
5747
  }
5634
- if (bufferIndex) break;
5748
+ if (bufferIndex) {
5749
+ break;
5750
+ }
5635
5751
  bufferIndex = -1;
5636
5752
  } else if (chunk === -2) {
5637
5753
  tabs = true;
@@ -5665,13 +5781,13 @@ function resolveAllLineSuffixes(events, context) {
5665
5781
  if (data.start.offset === data.end.offset) {
5666
5782
  Object.assign(data, token);
5667
5783
  } else {
5668
- events.splice(eventIndex, 0, ["enter", token, context], ["exit", token, context]);
5669
- eventIndex += 2;
5784
+ editMap.add(eventIndex, 0, [["enter", token, context], ["exit", token, context]]);
5670
5785
  }
5671
5786
  }
5672
5787
  eventIndex++;
5673
5788
  }
5674
5789
  }
5790
+ editMap.consume(events);
5675
5791
  return events;
5676
5792
  }
5677
5793
 
@@ -5829,11 +5945,10 @@ function createTokenizer(parser, initialize, from) {
5829
5945
  accountForPotentialSkip();
5830
5946
  }
5831
5947
  function main() {
5832
- let chunkIndex;
5833
5948
  while (point3._index < chunks.length) {
5834
5949
  const chunk = chunks[point3._index];
5835
5950
  if (typeof chunk === "string") {
5836
- chunkIndex = point3._index;
5951
+ const chunkIndex = point3._index;
5837
5952
  if (point3._bufferIndex < 0) {
5838
5953
  point3._bufferIndex = 0;
5839
5954
  }
@@ -6041,30 +6156,34 @@ function serializeChunks(chunks, expandTabs) {
6041
6156
  let value;
6042
6157
  if (typeof chunk === "string") {
6043
6158
  value = chunk;
6044
- } else switch (chunk) {
6045
- case -5: {
6046
- value = "\r";
6047
- break;
6048
- }
6049
- case -4: {
6050
- value = "\n";
6051
- break;
6052
- }
6053
- case -3: {
6054
- value = "\r\n";
6055
- break;
6056
- }
6057
- case -2: {
6058
- value = expandTabs ? " " : " ";
6059
- break;
6060
- }
6061
- case -1: {
6062
- if (!expandTabs && atTab) continue;
6063
- value = " ";
6064
- break;
6065
- }
6066
- default: {
6067
- value = String.fromCharCode(chunk);
6159
+ } else {
6160
+ switch (chunk) {
6161
+ case -5: {
6162
+ value = "\r";
6163
+ break;
6164
+ }
6165
+ case -4: {
6166
+ value = "\n";
6167
+ break;
6168
+ }
6169
+ case -3: {
6170
+ value = "\r\n";
6171
+ break;
6172
+ }
6173
+ case -2: {
6174
+ value = expandTabs ? " " : " ";
6175
+ break;
6176
+ }
6177
+ case -1: {
6178
+ if (!expandTabs && atTab) {
6179
+ continue;
6180
+ }
6181
+ value = " ";
6182
+ break;
6183
+ }
6184
+ default: {
6185
+ value = String.fromCharCode(chunk);
6186
+ }
6068
6187
  }
6069
6188
  }
6070
6189
  atTab = chunk === -2;
@@ -6115,14 +6234,9 @@ function preprocess() {
6115
6234
  let atCarriageReturn;
6116
6235
  return preprocessor;
6117
6236
  function preprocessor(value, encoding, end) {
6118
- const chunks = [];
6119
- let match;
6120
- let next;
6121
- let startPosition;
6122
- let endPosition;
6123
- let code2;
6124
6237
  value = buffer + (typeof value === "string" ? value.toString() : new TextDecoder(encoding || void 0).decode(value));
6125
- startPosition = 0;
6238
+ const chunks = [];
6239
+ let startPosition = 0;
6126
6240
  buffer = "";
6127
6241
  if (start) {
6128
6242
  if (value.charCodeAt(0) === 65279) {
@@ -6132,9 +6246,9 @@ function preprocess() {
6132
6246
  }
6133
6247
  while (startPosition < value.length) {
6134
6248
  search.lastIndex = startPosition;
6135
- match = search.exec(value);
6136
- endPosition = match && match.index !== void 0 ? match.index : value.length;
6137
- code2 = value.charCodeAt(endPosition);
6249
+ const match = search.exec(value);
6250
+ const endPosition = match && match.index !== void 0 ? match.index : value.length;
6251
+ const code2 = value.charCodeAt(endPosition);
6138
6252
  if (!match) {
6139
6253
  buffer = value.slice(startPosition);
6140
6254
  break;
@@ -6158,9 +6272,11 @@ function preprocess() {
6158
6272
  break;
6159
6273
  }
6160
6274
  case 9: {
6161
- next = Math.ceil(column / 4) * 4;
6275
+ const next = Math.ceil(column / 4) * 4;
6162
6276
  chunks.push(-2);
6163
- while (column++ < next) chunks.push(-1);
6277
+ while (column++ < next) {
6278
+ chunks.push(-1);
6279
+ }
6164
6280
  break;
6165
6281
  }
6166
6282
  case 10: {
@@ -6177,8 +6293,12 @@ function preprocess() {
6177
6293
  startPosition = endPosition + 1;
6178
6294
  }
6179
6295
  if (end) {
6180
- if (atCarriageReturn) chunks.push(-5);
6181
- if (buffer) chunks.push(buffer);
6296
+ if (atCarriageReturn) {
6297
+ chunks.push(-5);
6298
+ }
6299
+ if (buffer) {
6300
+ chunks.push(buffer);
6301
+ }
6182
6302
  chunks.push(null);
6183
6303
  }
6184
6304
  return chunks;
@@ -8308,7 +8428,7 @@ function gfmStrikethrough(options) {
8308
8428
  }
8309
8429
 
8310
8430
  // node_modules/micromark-extension-gfm-table/lib/edit-map.js
8311
- var EditMap = class {
8431
+ var EditMap2 = class {
8312
8432
  /**
8313
8433
  * Create a new edit map.
8314
8434
  */
@@ -8329,7 +8449,7 @@ var EditMap = class {
8329
8449
  * Nothing.
8330
8450
  */
8331
8451
  add(index2, remove, add) {
8332
- addImplementation(this, index2, remove, add);
8452
+ addImplementation2(this, index2, remove, add);
8333
8453
  }
8334
8454
  // To do: add this when moving to `micromark`.
8335
8455
  // /**
@@ -8378,7 +8498,7 @@ var EditMap = class {
8378
8498
  this.index.clear();
8379
8499
  }
8380
8500
  };
8381
- function addImplementation(editMap, at, remove, add) {
8501
+ function addImplementation2(editMap, at, remove, add) {
8382
8502
  if (remove === 0 && add.length === 0) {
8383
8503
  return;
8384
8504
  }
@@ -8663,7 +8783,7 @@ function resolveTable(events, context) {
8663
8783
  let currentTable;
8664
8784
  let currentBody;
8665
8785
  let currentCell;
8666
- const map = new EditMap();
8786
+ const map = new EditMap2();
8667
8787
  while (++index2 < events.length) {
8668
8788
  const event = events[index2];
8669
8789
  const token = event[1];