markstream-octane 0.0.56-beta.4 → 0.1.0-beta.2

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.
@@ -1113,23 +1113,23 @@
1113
1113
  --markstream-diff-removed-inline-border: transparent;
1114
1114
  --markstream-diff-added-gutter: linear-gradient(
1115
1115
  90deg,
1116
- var(--markstream-diff-added-fg) 0 var(--stream-monaco-gutter-marker-width, 4px),
1117
- rgb(20 184 166 / 0.08) var(--stream-monaco-gutter-marker-width, 4px) 100%
1116
+ var(--markstream-diff-added-fg) 0 var(--markstream-gutter-marker-width, 4px),
1117
+ rgb(20 184 166 / 0.08) var(--markstream-gutter-marker-width, 4px) 100%
1118
1118
  );
1119
1119
  --markstream-diff-removed-gutter: repeating-linear-gradient(
1120
1120
  180deg,
1121
1121
  var(--markstream-diff-removed-fg) 0 2px,
1122
1122
  transparent 2px 4px
1123
1123
  )
1124
- left / var(--stream-monaco-gutter-marker-width, 4px) 100% no-repeat,
1124
+ left / var(--markstream-gutter-marker-width, 4px) 100% no-repeat,
1125
1125
  linear-gradient(90deg, rgb(255 54 88 / 0.08) 0 100%);
1126
1126
  --markstream-diff-added-line-fill: rgb(231 248 244 / 0.96);
1127
1127
  --markstream-diff-removed-line-fill: rgb(255 241 241 / 0.98);
1128
1128
  }
1129
1129
 
1130
1130
  :where(.markstream-octane) .code-block-container.is-dark {
1131
- --markstream-code-fallback-bg: #111827;
1132
- --markstream-code-fallback-fg: hsl(0 0% 93%);
1131
+ --markstream-code-fallback-bg: var(--code-bg);
1132
+ --markstream-code-fallback-fg: var(--code-fg);
1133
1133
  --markstream-code-border-color: rgb(55 65 81 / 0.3);
1134
1134
  --markstream-code-fallback-selection-bg: rgba(255, 255, 255, 0.08);
1135
1135
  --markstream-diff-frame-border: rgb(82 82 91 / 0.56);
@@ -1173,15 +1173,15 @@
1173
1173
  --markstream-diff-removed-inline-border: transparent;
1174
1174
  --markstream-diff-added-gutter: linear-gradient(
1175
1175
  90deg,
1176
- var(--markstream-diff-added-fg) 0 var(--stream-monaco-gutter-marker-width, 4px),
1177
- rgb(94 234 212 / 0.2) var(--stream-monaco-gutter-marker-width, 4px) 100%
1176
+ var(--markstream-diff-added-fg) 0 var(--markstream-gutter-marker-width, 4px),
1177
+ rgb(94 234 212 / 0.2) var(--markstream-gutter-marker-width, 4px) 100%
1178
1178
  );
1179
1179
  --markstream-diff-removed-gutter: repeating-linear-gradient(
1180
1180
  180deg,
1181
1181
  var(--markstream-diff-removed-fg) 0 2px,
1182
1182
  transparent 2px 4px
1183
1183
  )
1184
- left / var(--stream-monaco-gutter-marker-width, 4px) 100% no-repeat,
1184
+ left / var(--markstream-gutter-marker-width, 4px) 100% no-repeat,
1185
1185
  linear-gradient(90deg, rgb(253 164 175 / 0.18) 0 100%);
1186
1186
  --markstream-diff-added-line-fill: linear-gradient(
1187
1187
  90deg,
@@ -1199,22 +1199,6 @@
1199
1199
  transition: height 180ms ease, max-height 180ms ease;
1200
1200
  }
1201
1201
 
1202
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor,
1203
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .monaco-editor-background,
1204
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .margin,
1205
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .lines-content {
1206
- background: var(--vscode-editor-background, var(--markstream-code-fallback-bg)) !important;
1207
- }
1208
-
1209
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor,
1210
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .margin,
1211
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .view-lines,
1212
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .view-line,
1213
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .view-line span,
1214
- :where(.markstream-octane) .code-block-container.is-plain-text:not(.is-diff) .monaco-editor .line-numbers {
1215
- color: var(--vscode-editor-foreground, var(--markstream-code-fallback-fg)) !important;
1216
- }
1217
-
1218
1202
  :where(.markstream-octane) .code-action-btn {
1219
1203
  cursor: pointer;
1220
1204
  opacity: 0.7;
@@ -1293,126 +1277,6 @@
1293
1277
  --vscode-widget-shadow: var(--markstream-diff-widget-shadow);
1294
1278
  }
1295
1279
 
1296
- :where(.markstream-octane) .code-block-container .monaco-diff-editor .diffOverview {
1297
- background-color: var(--vscode-editor-background, #111827);
1298
- }
1299
-
1300
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-diff-editor .diffOverview,
1301
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .decorationsOverviewRuler {
1302
- display: none !important;
1303
- width: 0 !important;
1304
- min-width: 0 !important;
1305
- max-width: 0 !important;
1306
- border: 0 !important;
1307
- background: transparent !important;
1308
- opacity: 0 !important;
1309
- pointer-events: none !important;
1310
- overflow: hidden !important;
1311
- }
1312
-
1313
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-diff-editor {
1314
- border: 0 !important;
1315
- border-radius: 0 !important;
1316
- box-shadow: none !important;
1317
- }
1318
-
1319
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:not(.stream-monaco-clickable) > *:not(a) {
1320
- visibility: hidden !important;
1321
- }
1322
-
1323
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines-compact .text {
1324
- opacity: 0 !important;
1325
- }
1326
-
1327
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root {
1328
- --stream-monaco-gutter-gap: var(--markstream-diff-gutter-gap) !important;
1329
- --stream-monaco-line-number: var(--markstream-diff-line-number) !important;
1330
- --stream-monaco-line-number-active: var(--markstream-diff-line-number-active) !important;
1331
- --stream-monaco-added-fg: var(--markstream-diff-added-fg) !important;
1332
- --stream-monaco-removed-fg: var(--markstream-diff-removed-fg) !important;
1333
- --stream-monaco-added-line: var(--markstream-diff-added-line) !important;
1334
- --stream-monaco-removed-line: var(--markstream-diff-removed-line) !important;
1335
- --stream-monaco-added-inline: var(--markstream-diff-added-inline) !important;
1336
- --stream-monaco-removed-inline: var(--markstream-diff-removed-inline) !important;
1337
- --stream-monaco-added-inline-border: var(--markstream-diff-added-inline-border) !important;
1338
- --stream-monaco-removed-inline-border: var(--markstream-diff-removed-inline-border) !important;
1339
- --stream-monaco-added-line-fill: var(--markstream-diff-added-line-fill) !important;
1340
- --stream-monaco-removed-line-fill: var(--markstream-diff-removed-line-fill) !important;
1341
- --stream-monaco-added-gutter: var(--markstream-diff-added-gutter) !important;
1342
- --stream-monaco-removed-gutter: var(--markstream-diff-removed-gutter) !important;
1343
- --stream-monaco-added-line-shadow: none !important;
1344
- --stream-monaco-removed-line-shadow: none !important;
1345
- --stream-monaco-unchanged-bg: var(--markstream-diff-unchanged-bg) !important;
1346
- --stream-monaco-unchanged-fg: var(--markstream-diff-unchanged-fg) !important;
1347
- }
1348
-
1349
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:not(.stream-monaco-unchanged-bridge-source),
1350
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge {
1351
- --stream-monaco-unchanged-bg: var(--markstream-diff-unchanged-bg) !important;
1352
- --stream-monaco-unchanged-fg: var(--markstream-diff-unchanged-fg) !important;
1353
- background: var(--stream-monaco-unchanged-bg) !important;
1354
- color: var(--stream-monaco-unchanged-fg) !important;
1355
- }
1356
-
1357
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge {
1358
- right: calc(
1359
- var(--stream-monaco-gutter-marker-width) - var(--stream-monaco-unchanged-rail-width) / 2 + (var(--stream-monaco-gutter-gap) * 2)
1360
- ) !important;
1361
- width: auto !important;
1362
- }
1363
-
1364
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary,
1365
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:hover,
1366
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:focus-visible,
1367
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
1368
- background: var(--stream-monaco-unchanged-bg) !important;
1369
- color: var(--markstream-diff-unchanged-fg) !important;
1370
- padding-left: calc(
1371
- var(--stream-monaco-gutter-marker-width) + (var(--stream-monaco-gutter-gap) * 2)
1372
- ) !important;
1373
- padding-right: calc(
1374
- var(--stream-monaco-gutter-marker-width) + (var(--stream-monaco-gutter-gap) * 2)
1375
- ) !important;
1376
- }
1377
-
1378
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail,
1379
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-rail,
1380
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal,
1381
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:hover,
1382
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:focus-visible,
1383
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal.stream-monaco-focus-visible {
1384
- background: var(--stream-monaco-unchanged-bg) !important;
1385
- }
1386
-
1387
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail {
1388
- border-right-color: var(--markstream-diff-unchanged-divider) !important;
1389
- }
1390
-
1391
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal {
1392
- border-bottom-color: transparent !important;
1393
- }
1394
-
1395
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail.stream-monaco-unchanged-rail-both .stream-monaco-unchanged-reveal:first-child {
1396
- border-bottom-color: var(--markstream-diff-unchanged-divider) !important;
1397
- }
1398
-
1399
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail.stream-monaco-unchanged-rail-top-only .stream-monaco-unchanged-reveal,
1400
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail.stream-monaco-unchanged-rail-bottom-only .stream-monaco-unchanged-reveal {
1401
- border-bottom: 0 !important;
1402
- }
1403
-
1404
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-meta,
1405
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-count,
1406
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-metadata-label,
1407
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-meta,
1408
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-count,
1409
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-metadata-label,
1410
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal,
1411
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:hover,
1412
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:focus-visible,
1413
- :where(.markstream-octane) .code-block-container .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal.stream-monaco-focus-visible {
1414
- color: var(--markstream-diff-unchanged-fg) !important;
1415
- }
1416
1280
 
1417
1281
  :where(.markstream-octane) .code-block-content {
1418
1282
  display: grid;
@@ -1524,10 +1388,10 @@
1524
1388
  -o-tab-size: var(--markstream-pre-tab-size, 4);
1525
1389
  tab-size: var(--markstream-pre-tab-size, 4);
1526
1390
 
1527
- --markstream-pre-diff-gutter-marker-width: var(--stream-monaco-gutter-marker-width, 4px);
1528
- --markstream-pre-diff-gutter-gap: var(--stream-monaco-gutter-gap, 8px);
1529
- --markstream-pre-diff-code-gap: var(--stream-monaco-diff-code-gap, 7.8px);
1530
- --markstream-pre-diff-code-padding: var(--stream-monaco-diff-code-padding, 0px);
1391
+ --markstream-pre-diff-gutter-marker-width: var(--markstream-gutter-marker-width, 4px);
1392
+ --markstream-pre-diff-gutter-gap: var(--markstream-gutter-gap, 8px);
1393
+ --markstream-pre-diff-code-gap: var(--markstream-diff-code-gap, 7.8px);
1394
+ --markstream-pre-diff-code-padding: var(--markstream-diff-code-padding, 0px);
1531
1395
  --markstream-diff-added-fg: var(--diff-added-fg, #2f8f68);
1532
1396
  --markstream-diff-removed-fg: var(--diff-removed-fg, #c24141);
1533
1397
  --markstream-diff-added-line-fill: var(--diff-added-bg, rgb(47 143 104 / 12%));
@@ -1543,21 +1407,21 @@
1543
1407
  transparent var(--markstream-pre-diff-gutter-marker-width) 100%
1544
1408
  );
1545
1409
  --markstream-pre-diff-line-number-width: var(
1546
- --stream-monaco-line-number-width,
1410
+ --markstream-line-number-width,
1547
1411
  39px
1548
1412
  );
1549
- --markstream-pre-diff-line-number-padding-left: var(--stream-monaco-line-number-padding-left, 15.6px);
1550
- --markstream-pre-diff-line-number-padding-right: var(--stream-monaco-line-number-padding-right, 7.8px);
1413
+ --markstream-pre-diff-line-number-padding-left: var(--markstream-line-number-padding-left, 15.6px);
1414
+ --markstream-pre-diff-line-number-padding-right: var(--markstream-line-number-padding-right, 7.8px);
1551
1415
  --markstream-pre-diff-line-number-gap-to-code: var(
1552
- --stream-monaco-original-line-number-gap-to-code,
1553
- var(--stream-monaco-line-number-gap-to-code, var(--markstream-pre-diff-code-gap))
1416
+ --markstream-original-line-number-gap-to-code,
1417
+ var(--markstream-line-number-gap-to-code, var(--markstream-pre-diff-code-gap))
1554
1418
  );
1555
1419
  --markstream-pre-diff-line-number-left: var(
1556
- --stream-monaco-line-number-left,
1420
+ --markstream-line-number-left,
1557
1421
  var(--markstream-pre-diff-gutter-marker-width)
1558
1422
  );
1559
1423
  --markstream-pre-diff-line-number-border: var(
1560
- --stream-monaco-gutter-guide,
1424
+ --markstream-gutter-guide,
1561
1425
  var(--markstream-diff-gutter-guide, hsl(var(--ms-border, 214 32% 91%) / 0.72))
1562
1426
  );
1563
1427
  --markstream-pre-diff-line-number-align: var(--markstream-diff-line-number-align, right);
@@ -1574,11 +1438,11 @@
1574
1438
 
1575
1439
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview.markstream-pre--diff-inline {
1576
1440
  --markstream-pre-diff-line-number-gap-to-code: var(
1577
- --stream-monaco-modified-line-number-gap-to-code,
1578
- var(--stream-monaco-line-number-gap-to-code, var(--markstream-pre-diff-code-gap))
1441
+ --markstream-modified-line-number-gap-to-code,
1442
+ var(--markstream-line-number-gap-to-code, var(--markstream-pre-diff-code-gap))
1579
1443
  );
1580
1444
  --markstream-pre-diff-line-number-left: var(
1581
- --stream-monaco-line-number-left,
1445
+ --markstream-line-number-left,
1582
1446
  var(--markstream-pre-diff-gutter-marker-width)
1583
1447
  );
1584
1448
  }
@@ -1617,11 +1481,11 @@
1617
1481
 
1618
1482
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-pane--modified {
1619
1483
  --markstream-pre-diff-line-number-gap-to-code: var(
1620
- --stream-monaco-modified-line-number-gap-to-code,
1621
- var(--stream-monaco-line-number-gap-to-code, var(--markstream-pre-diff-code-gap))
1484
+ --markstream-modified-line-number-gap-to-code,
1485
+ var(--markstream-line-number-gap-to-code, var(--markstream-pre-diff-code-gap))
1622
1486
  );
1623
1487
  --markstream-pre-diff-line-number-left: var(
1624
- --stream-monaco-line-number-left,
1488
+ --markstream-line-number-left,
1625
1489
  var(--markstream-pre-diff-gutter-marker-width)
1626
1490
  );
1627
1491
  box-shadow: inset 1px 0 var(--markstream-diff-pane-divider, rgb(148 163 184 / 0.18));
@@ -1677,7 +1541,7 @@
1677
1541
  box-shadow: inset -1px 0 var(--markstream-pre-diff-line-number-border);
1678
1542
  padding-left: var(--markstream-pre-diff-line-number-padding-left, 15.6px);
1679
1543
  padding-right: var(--markstream-pre-diff-line-number-padding-right, 7.8px);
1680
- color: var(--stream-monaco-line-number, var(--markstream-diff-line-number, #6b7280));
1544
+ color: var(--markstream-line-number, var(--markstream-diff-line-number, #6b7280));
1681
1545
  font-variant-numeric: tabular-nums;
1682
1546
  line-height: var(--markstream-pre-diff-line-height, 18px);
1683
1547
  text-align: var(--markstream-pre-diff-line-number-align, right);
@@ -1687,13 +1551,13 @@
1687
1551
  }
1688
1552
 
1689
1553
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--added > .markstream-pre__diff-number {
1690
- background: var(--stream-monaco-added-line-fill, var(--markstream-diff-added-line-fill, transparent));
1691
- color: var(--stream-monaco-added-fg, var(--markstream-diff-added-fg, var(--markstream-diff-line-number, #6b7280)));
1554
+ background: var(--markstream-added-line-fill, var(--markstream-diff-added-line-fill, transparent));
1555
+ color: var(--markstream-added-fg, var(--markstream-diff-added-fg, var(--markstream-diff-line-number, #6b7280)));
1692
1556
  }
1693
1557
 
1694
1558
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--removed > .markstream-pre__diff-number {
1695
- background: var(--stream-monaco-removed-line-fill, var(--markstream-diff-removed-line-fill, transparent));
1696
- color: var(--stream-monaco-removed-fg, var(--markstream-diff-removed-fg, var(--markstream-diff-line-number, #6b7280)));
1559
+ background: var(--markstream-removed-line-fill, var(--markstream-diff-removed-line-fill, transparent));
1560
+ color: var(--markstream-removed-fg, var(--markstream-diff-removed-fg, var(--markstream-diff-line-number, #6b7280)));
1697
1561
  }
1698
1562
 
1699
1563
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-content {
@@ -1719,27 +1583,27 @@
1719
1583
  }
1720
1584
 
1721
1585
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--hunk {
1722
- color: var(--stream-monaco-unchanged-fg, var(--markstream-diff-unchanged-fg, var(--markstream-diff-line-number, currentColor)));
1586
+ color: var(--markstream-unchanged-fg, var(--markstream-diff-unchanged-fg, var(--markstream-diff-line-number, currentColor)));
1723
1587
  }
1724
1588
 
1725
1589
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--hunk::before {
1726
- background: var(--stream-monaco-unchanged-bg, var(--markstream-diff-unchanged-bg, transparent));
1590
+ background: var(--markstream-unchanged-bg, var(--markstream-diff-unchanged-bg, transparent));
1727
1591
  }
1728
1592
 
1729
1593
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--added::before {
1730
- background: var(--stream-monaco-added-line-fill, var(--markstream-diff-added-line-fill, transparent));
1594
+ background: var(--markstream-added-line-fill, var(--markstream-diff-added-line-fill, transparent));
1731
1595
  }
1732
1596
 
1733
1597
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--removed::before {
1734
- background: var(--stream-monaco-removed-line-fill, var(--markstream-diff-removed-line-fill, transparent));
1598
+ background: var(--markstream-removed-line-fill, var(--markstream-diff-removed-line-fill, transparent));
1735
1599
  }
1736
1600
 
1737
1601
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--added > .markstream-pre__diff-rail {
1738
- background: var(--stream-monaco-added-gutter, var(--markstream-diff-added-gutter, currentColor));
1602
+ background: var(--markstream-added-gutter, var(--markstream-diff-added-gutter, currentColor));
1739
1603
  }
1740
1604
 
1741
1605
  :where(.markstream-octane) .code-fallback-plain.markstream-pre--diff-preview .markstream-pre__diff-line--removed > .markstream-pre__diff-rail {
1742
- background: var(--stream-monaco-removed-gutter, var(--markstream-diff-removed-gutter, currentColor));
1606
+ background: var(--markstream-removed-gutter, var(--markstream-diff-removed-gutter, currentColor));
1743
1607
  }
1744
1608
 
1745
1609
  :where(.markstream-octane) .code-loading-placeholder {
@@ -1790,7 +1654,7 @@
1790
1654
  }
1791
1655
 
1792
1656
  /* Standalone Pre uses the renderer's semantic surface. The enhanced fallback
1793
- keeps its Monaco-theme override in .code-fallback-plain. */
1657
+ keeps its runtime-theme override in .code-fallback-plain. */
1794
1658
  .markstream-octane pre[data-markstream-pre='1']:not(.code-fallback-plain):not(.markstream-pre--diff-preview) {
1795
1659
  box-sizing: border-box;
1796
1660
  width: 100%;
@@ -1,2 +1,2 @@
1
1
  // octane-no-slot: compiler-assigned hook slots are already present.
2
- import{BLOCKED_HTML_TAGS as e,NON_STRUCTURING_HTML_TAGS as t,convertHtmlAttrsToProps as n,getHtmlTagFromContent as r,getMarkdown as o,isCustomHtmlComponentTag as i,isHtmlTagBlocked as a,isHtmlTagHardBlocked as s,mergeCustomHtmlTags as l,normalizeCustomHtmlTagName as c,parseMarkdownToStructure as d,sanitizeHtmlAttrs as u,sanitizeHtmlTokenAttrs as p,sanitizeImageSrc as m,shouldOpenLinkInNewTab as h,shouldRenderUnknownHtmlTagAsText as g,stripCustomHtmlWrapper as f,tokenAttrsToRecord as y,tokenizeHtml as k}from"stream-markdown-parser";import*as $ from"octane/server";import{Fragment as x,createElement as b,createScopedElement as w,createScopedValue as v,hookSlots as N,mapSlot as S,positionalChildren as C,puMemo as _,ssrArm as B,ssrAttr as q,ssrAttrs as K,ssrChild as T,ssrChildText as P,ssrComponent as A,ssrControl as j,ssrForBlock as I,ssrInnerHtml as E,ssrInputAttrs as H,ssrSnapshotSpread as D,ssrStyle as O}from"octane/server";import{normalizeShikiLanguage as M}from"markstream-core";var L="__global__",W="__MARKSTREAM_OCTANE_CUSTOM_COMPONENTS_STORE__",F=(()=>{const e=globalThis;if(e[W])return e[W];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[W]=t,t})();function R(){F.revision++;for(const e of Array.from(F.listeners))try{e()}catch{}}function U(e,t){"string"==typeof e?F.scopedComponents[e]={...t||{}}:F.scopedComponents[L]={...e},R()}function z(e){const t=F.scopedComponents[L]||{};if(!e)return t;const n=F.scopedComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?{...t,...n}:t:n}function G(e){if(e===L)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete F.scopedComponents[e],R()}function V(){delete F.scopedComponents[L],R()}function X(e){return e?.markstreamDisplay}function Y(e,t){return e.markstreamDisplay=t,e}function Z(e){return e}function J(e){return e}function Q(e){if(!e)return{};const t={};for(const[n,r]of Object.entries(e)){const e=c(n);e&&(t[e]=r)}return t}function ee(e){const t="number"==typeof e?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function te(e){const t="number"==typeof e?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}var ne=/* @__PURE__ */new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function re(e,t={}){const n={},r=new Set(t.omit??[]);if(!e||"object"!=typeof e)return n;const o=Object.getOwnPropertyDescriptors(e);for(const[i,a]of Object.entries(o))ne.has(i)||r.has(i)||a.enumerable&&"value"in a&&(n[i]=a.value);return n}var oe=/* @__PURE__ */new Set(["table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function ie(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[t,n])=>t?(e["for"===t?"htmlFor":"class"===t?"className":t]=n??!0,e):e,{})}function ae(e,t,n,r){if("function"!=typeof r)throw new TypeError("renderNodeChildren expected a function, received "+typeof r);if(!Array.isArray(e)||0===e.length)return null;const o=[];for(let i=0;i<e.length;i++){const a=e[i];if(a){if("label_open"===a.type){const s=[];for(i++;i<e.length;){const t=e[i];if("label_close"===t?.type)break;t&&s.push(t),i++}const l=`${n}-label-${i}`;o.push($.createElement("label",{key:l,...ie(a.attrs)},ae(s,t,`${l}-child`,r)));continue}"label_close"!==a.type&&o.push(r(a,`${n}-${i}`,t))}}return o}function se(e,t,n,r){return ae(e,t,`${n}-inline`,r)}function le(e,t,n){const o=c(e.type),i=(n??[]).map(e=>c(e)).filter(Boolean),a="html_inline"===o||"html_block"===o;if(!a&&!i.includes(o))return null;const s=a?c(e.tag)||r(e.content):c(e.tag)||o;if(!s)return null;const l=i.includes(s),d=t[s]??t[o]??null,u=l||a?d:null;return{tag:s,isWhitelisted:l,component:u,display:X(u)}}function ce(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function de(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const r of t.split(";")){const e=r.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const o=ce(e.slice(0,t).trim()),i=e.slice(t+1).trim();o&&(n[o]=i)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}var ue=k,pe=u;function me(e,t){return i(e,t)}function he(e,t,n=!1){const r=Object.entries(t??{}),o=r.length>0?r.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function ge(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function fe(e,t){return t.nodeComponents?.[e]||t.nodeComponents?.[e.toLowerCase()]}function ye(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return String(e);if(Array.isArray(e))return e.map(ye).join("");if(!$.isValidElement(e))return"";const t=e;if("string"!=typeof t.type)return ye(t.props.children);const n=Object.entries(t.props).filter(([e,t])=>"children"!==e&&"key"!==e&&"ref"!==e&&null!=t&&"boolean"!=typeof t).map(([e,t])=>` ${"className"===e?"class":e}="${String(t)}"`).join("");return`<${t.type}${n}>${ye(t.props.children)}</${t.type}>`}function ke(e){return Object.entries(e).map(([e,t])=>[e,""===t?null:t])}function $e(e){const t=e.sourceNode,n=!0!==e.ctx?.final&&(!1===e.ctx?.final||Boolean(t?.loading));return{loading:n,autoClosed:n||Boolean(t?.autoClosed)}}function xe(e,t,r){return function(e,t){return Boolean(t.propComponents?.[e]||t.propComponents?.[e.toLowerCase()])}(e,r)?n(t):t}function be(e,t,n,r,o,i,a,s=$e(o)){const l=c(e),d=i??function(e){return e.map(ye).join("")}(n),u={type:l,tag:l,attrs:ke(t),content:d,raw:a??`${he(e,t)}${d}</${e}>`,loading:s.loading,autoClosed:s.autoClosed};if(o.ctx&&o.renderNode)return o.renderNode(u,r,o.ctx);const p=fe(e,o);return p?$.createElement(p,{key:r,node:u}):null}function we(t,n,r="safe",o={}){if(!t)return[];if("escape"===r)return[t];try{const i=ue(t);let l=0;const c=o.keyPrefix??"ms-html",d=[],u=[];for(const t of i){if("text"===t.type){if(d.length>0&&d[d.length-1].hardBlocked)continue;(d.length>0?d[d.length-1].children:u).push(t.content??""),d.length>0&&d[d.length-1].sourceParts.push(t.content??"");continue}const i=t.tagName;if(void 0===i)return null;if("self_closing"===t.type){const p=t.attrs||{},m=he(i,p,!0),h=me(i,n),g=Boolean(fe(i,o));if(e.has(i.toLowerCase())||!h&&!g&&s(i,r))continue;if(!h&&!g&&a(i,r)){(d.length>0?d[d.length-1].children:u).push(m),d.length>0&&d[d.length-1].sourceParts.push(m);continue}const f=pe(p,r,i),y=f.key,k=null!=y&&""!==y?y:`${c}-${l++}`,x=h?n[i]||n[i.toLowerCase()]:void 0,b=d.length>0?d[d.length-1].children:u;if(g)b.push(be(i,p,[],k,o,"",m,{loading:!1,autoClosed:!1}));else if(x){const e=xe(i,f,o);b.push($.createElement(x,{...e,key:k}))}else b.push($.createElement(i,{...de(f),key:k,suppressHydrationWarning:!0}));d.length>0&&d[d.length-1].sourceParts.push(m);continue}if("tag_open"===t.type){const l=d.length>0&&d[d.length-1].hardBlocked,c=me(i,n),u=Boolean(fe(i,o));d.push({tagName:i,children:[],attrs:t.attrs,sourceParts:[],customComponent:c||u,hardBlocked:l||e.has(i.toLowerCase())||!c&&!u&&s(i,r),softBlocked:!l&&!c&&!u&&a(i,r)});continue}const p=i.toLowerCase();let m=-1;for(let e=d.length-1;e>=0;e--)if(d[e].tagName.toLowerCase()===p){m=e;break}if(-1!==m)for(;d.length>m;){const e=d.pop();if(!e)continue;const t=e.sourceParts.join(""),i=`${he(e.tagName,e.attrs)}${t}</${e.tagName}>`;let a;if(e.hardBlocked)a=null;else if(e.softBlocked)a=[he(e.tagName,e.attrs),...e.children,`</${e.tagName}>`];else{const s=pe(e.attrs||{},r,e.tagName),d=s.key,u=null!=d&&""!==d?d:`${c}-${l++}`,m=e.customComponent?n[e.tagName]||n[e.tagName.toLowerCase()]:void 0;if(Boolean(fe(e.tagName,o))){const n=e.tagName.toLowerCase()===p?{loading:!1,autoClosed:!1}:$e(o);a=be(e.tagName,e.attrs||{},e.children,u,o,t,i,n)}else a=m?$.createElement(m,{...xe(e.tagName,s,o),key:u},...e.children):$.createElement(e.tagName,{...de(s),key:u,suppressHydrationWarning:!0},...e.children)}d.length>0?ge(d[d.length-1].children,a):ge(u,a),d.length>0&&!e.hardBlocked&&d[d.length-1].sourceParts.push(i)}}for(;d.length>0;){const e=d.pop();if(!e||e.hardBlocked)continue;const t=e.sourceParts.join(""),i=`${he(e.tagName,e.attrs)}${t}`;if(e.softBlocked){ge(u,[he(e.tagName,e.attrs),...e.children,`</${e.tagName}>`]),d.length>0&&d[d.length-1].sourceParts.push(i);continue}const a=pe(e.attrs||{},r,e.tagName),s=a.key,p=null!=s&&""!==s?s:`${c}-${l++}`,m=e.customComponent?n[e.tagName]||n[e.tagName.toLowerCase()]:void 0;let h;h=Boolean(fe(e.tagName,o))?be(e.tagName,e.attrs||{},e.children,p,o,t,i,$e(o)):m?$.createElement(m,{...xe(e.tagName,a,o),key:p},...e.children):$.createElement(e.tagName,{...de(a),key:p,suppressHydrationWarning:!0},...e.children),u.push(h),d.length>0&&d[d.length-1].sourceParts.push(i)}return u}catch{return null}}var ve,Ne={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",d2lang:"d2",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Se(e){const t=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[r]=n.split(":");return r.toLowerCase()}(e);return Ne[t]??t}var Ce=!1;function _e(e,t,n){const r=function(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}(e);if(!r)return null;if(globalThis.__MARKSTREAM_OCTANE_DISABLE_SYNC_KATEX__)return null;const o=function(){if(ve)return ve;if(Ce)return null;Ce=!0;try{const e=function(){try{const e=Reflect.get(globalThis,"process"),t="function"==typeof e?.getBuiltinModule?e.getBuiltinModule("module"):null;return"function"==typeof t?.createRequire?t.createRequire(import.meta.url):null}catch{return null}}();if(!e)return null;const t=e("katex");try{e("katex/contrib/mhchem")}catch{}return ve=t}catch{return null}}();if(!o)return null;try{return o.renderToString(r,{displayMode:t,throwOnError:n})}catch{return null}}var Be=/* @__PURE__ */Symbol(/* @__PURE__ */N(1)),qe=o();function Ke(e){return String(String(e??"").split(/\s+/g)[0]??"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}var Te=function(e,t,n,r,o){const i=Ke(t.language),a=String(t.code??t.raw??""),s=function(e){const t=Se(String(e??""));return t&&"plaintext"!==t?t.charAt(0).toUpperCase()+t.slice(1):"Text"}(t.language);return`${(()=>{const o=`${e} ${e}--ssr`,l=n.fallback;return`<div${q("class",o,"div","opaque")}${q("data-ssr-fallback",l,"div","opaque")}>${T(!1!==n.showHeader&&v(()=>w("div",{className:`${e}__header`},()=>v(()=>w("span",{className:`${e}__language`},()=>s)))),r)}<div${q("class",`${e}__body`,"div","opaque")}>${(()=>{const e=`language-${i}`,n=!0===t.loading,o=i?`Code block: ${i}`:"Code block",s=i;return`<pre${q("class",e,"pre","opaque")}${q("aria-busy",n,"pre","opaque")}${q("aria-label",o,"pre","opaque")}${q("data-language",s,"pre","opaque")} tabindex="0"><code translate="no">${P(a,r)}</code></pre>`})()}</div></div>`})()}`};function Pe(e,t,n,r,o={}){const i=re(r.codeBlockProps);return $.createElement(e,{key:n,node:t,loading:Boolean(t.loading),stream:r.codeBlockStream,customId:r.customId,isDark:r.isDark,darkTheme:r.codeBlockThemes?.darkTheme,lightTheme:r.codeBlockThemes?.lightTheme,themes:r.codeBlockThemes?.themes,langs:r.codeBlockThemes?.langs,minWidth:r.codeBlockThemes?.minWidth,maxWidth:r.codeBlockThemes?.maxWidth,onCopy:r.events.onCopy,...i,...o,ctx:r,renderNode:Nt,indexKey:n,typewriter:r.typewriter,fade:r.fade})}function Ae(e,t,n,r,o={}){return $.createElement(e,{key:n,node:t,isDark:r.isDark,...o})}var je=function(e,t,n,r,o,i){const a=String(e?.language||"").trim(),s=a?String(a.split(/\s+/)[0]??"").split(":")[0].toLowerCase():"",l=Se(s),c=function(e,t){const n=t.trim().toLowerCase();if(!n)return null;for(const r of[n,Se(n),M(n)]){const t=r&&e[r];if(t)return t}return null}(r,s);if("mermaid"===l){const o=function(e,t){const n={...t.mermaidProps||{}};return null==te(n.estimatedPreviewHeightPx)&&(n.estimatedPreviewHeightPx=function(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}(function(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),r=function(e){for(const t of e.split(/\r?\n/)){const e=t.trim();if(e&&!e.startsWith("%%"))return e.match(/^([A-Z][\w-]*)\b/i)?.[1]?.toLowerCase()||""}return""}(e);return"gantt"===r?220+28*n:"sequencediagram"===r?180+26*n:"classdiagram"===r||"statediagram"===r||"erdiagram"===r?180+24*n:"flowchart"===r||"graph"===r?170+28*n:200+22*n}(String(e?.code??"")),void 0,"none"===n.maxHeight?null:te(n.maxHeight)??void 0)),n}(e,n),i=c||r.mermaid;return i?Ae(i,e,t,n,o):v(()=>b(pt,{key:t,node:e,isDark:n.isDark,loading:Boolean(e.loading),...o}))}if("infographic"===l){const o=function(e,t){const n={...t.infographicProps||{}};return null==ee(n.estimatedPreviewHeightPx)&&(n.estimatedPreviewHeightPx=function(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}(function(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}(String(e?.code??"")),void 0,"none"===n.maxHeight?null:ee(n.maxHeight)??void 0)),n}(e,n),i=c||r.infographic;return i?Ae(i,e,t,n,o):v(()=>b(ht,{key:t,node:e,isDark:n.isDark,loading:Boolean(e.loading),...o}))}if("d2"===l||"d2lang"===l){const o=c||r.d2;return o?Ae(o,e,t,n,n.d2Props||{}):v(()=>b(mt,{key:t,node:e,isDark:n.isDark,loading:Boolean(e.loading),...n.d2Props||{}}))}if(c)return Pe(c,e,t,n);const d=r.code_block;if(d)return Pe(d,e,t,n);if(n.renderCodeBlocksAsPre){const r=re(n.codeBlockProps,{omit:["langs"]});return v(()=>b(ct,{key:t,node:e,showLineNumbers:!0===r.showLineNumbers}))}return`${A(o,dt,{node:e,loading:_(()=>Boolean(e.loading),[Boolean,e.loading],Be),stream:n.codeBlockStream,monacoOptions:n.codeBlockThemes?.monacoOptions,themes:n.codeBlockThemes?.themes,minWidth:n.codeBlockThemes?.minWidth,maxWidth:n.codeBlockThemes?.maxWidth,isDark:n.isDark,...re(n.codeBlockProps,{omit:["langs"]})},!1,t)}`},Ie=function(e,t,n){const{node:r,children:o}=e;return`<span${q("class","text-node whitespace-pre-wrap break-words"+(r.center?" text-node-center":""),"span","opaque")}>${P(o??r.content,t)}</span>`};function Ee(e){return"text"===e?.type&&""===String(e?.content??"").trim()}function He(e,t,n,r){const o=e.filter(e=>!Ee(e)),i=o.length>0&&o.every(e=>"image"===e.type||function(e){const t=function(e){return"link"===e?.type&&Array.isArray(e?.children)?e.children.filter(e=>!Ee(e)):[]}(e);return 1===t.length&&"image"===t[0]?.type}(e));if(!i||o.length<=1)return ae(e,n,r,t);const a=[];for(let s=0;s<e.length;s++){const t=e[s];if(!Ee(t)){a.push(t);continue}const n=a.length>0,r=e.slice(s+1).some(e=>!Ee(e));n&&r&&a.push({...t,content:" ",raw:" "})}return a.map((e,o)=>i&&Ee(e)?String(e?.content??""):t(e,`${r}-${o}`,n))}function De(e){const{node:t,ctx:n,renderNode:r,indexKey:o,children:i}=e;if(!n||!r)return $.createElement("p",{dir:"auto",className:"paragraph-node"},i);const a=t.children??[],s={...n.customComponents??z(n.customId),...n.htmlComponents??{},...n.streamingComponents??{}},l=[],c=[],d=()=>{if(!c.length)return;const e=l.length;l.push($.createElement("p",{key:`${String(o??"paragraph")}-inline-${e}`,dir:"auto",className:"paragraph-node"},He(c.slice(),r,n,`${String(o??"paragraph")}-${e}`))),c.length=0};return a.forEach((e,t)=>{const i="escape"!==(n.htmlPolicy??"safe")||"html_inline"!==e.type&&"html_block"!==e.type;oe.has(e.type)||i&&function(e,t,n){return"block"===le(e,t,n)?.display}(e,s,n.customHtmlTags)?(d(),l.push(r(e,`${String(o??"paragraph")}-block-${t}`,n))):c.push(e)}),d(),l.length?$.createElement($.Fragment,{},l):$.createElement("p",{dir:"auto",className:"paragraph-node"},He(a,r,n,String(o??"paragraph")))}var Oe=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a,children:s}=e,l=Math.min(6,Math.max(1,Number(r.level)||1)),c=`h${l}`,{class:d,className:u,style:p,...m}=r?.attrs??{};return`${A(t,c,{dir:"auto",className:["heading-node","font-semibold",`heading-${l}`,d,u].filter(Boolean).join(" "),..."object"==typeof p&&null!=p?{style:p}:{},...m,children:s??(o&&i?ae(r.children,o,String(a??`heading-${l}`),i):null)})}`},Me=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a,children:s}=e;return`${(()=>{const e=r.cite;return`<blockquote class="blockquote-node" dir="auto"${q("cite",e,"blockquote","opaque")}>${P(s??(o&&i?ae(r.children,o,String(a??"blockquote"),i):null),t)}</blockquote>`})()}`};function Le(e,t,n){const{node:r,ctx:o,renderNode:i,value:a,indexKey:s,children:l}=e;return`<li class="list-item pl-1.5 my-2" dir="auto"${q("value",null==a?void 0:a,"li","opaque")}>${P(l??(o&&i?ae(r.children,o,String(s??"list-item"),i):null),t)}</li>`}var We=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e,s=r.ordered?"ol":"ul",l=r.ordered&&r.start?r.start:void 0,c=o&&z(o.customId).list_item||Le;return`${A(t,s,{className:r.ordered?"list-node my-5 pl-[calc(13/8*1em)] list-decimal":"list-node my-5 pl-[calc(13/8*1em)] list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]",start:l,children:r.items?.map((e,t)=>b(c,{key:`${String(a??"list")}-${t}`,node:e,value:r.ordered?(r.start??1)+t:void 0,ctx:o,renderNode:i,indexKey:`${String(a??"list")}-${t}`,customId:o?.customId,isDark:o?.isDark,typewriter:o?.typewriter}))})}`},Fe=function(e,t,n){let r,o;const{node:i,ctx:a,renderNode:s,indexKey:l}=e,c=Array.isArray(i?.header?.cells)?i.header.cells:[],d=Boolean(i?.loading),u=Array.isArray(i?.rows)?i.rows:[],p=e=>"right"===e?"text-right":"center"===e?"text-center":"text-left";function m(e,t,n,r){return`<th${q("class",`font-semibold p-[calc(4/7*1em)] ${p(e.align)}`,"th","opaque")} dir="auto">${P(a&&s?se(e.children,a,`${String(l??"table")}-th-${t}`,s):null,n)}</th>`}function h(e,t,n,r){return`<tr${q("class",t<u.length-1?"border-[var(--table-border,#cbd5e1)] border-b":"border-[var(--table-border,#cbd5e1)]","tr","opaque")}>${P(e.cells?.map((e,n)=>w("td",{key:`cell-${t}-${n}`,className:`p-[calc(4/7*1em)] ${p(e.align)}`,dir:"auto"},()=>a&&s?se(e.children,a,`${String(l??"table")}-row-${t}-${n}`,s):null)),n)}</tr>`}return`<div class="table-node-wrapper"${q("data-index-key",l,"div","opaque")}>${(()=>{const e=d;return`<table${q("class","my-8 text-sm table-node"+(d?" table-node--loading":""),"table","opaque")}${q("aria-busy",e,"table","opaque")}><thead class="border-[var(--table-border,#cbd5e1)]"><tr class="border-b">${S((r=c.map,c),r)?j("f180afb2",()=>{const e=c;if(0===e.length)return I("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=B(((e,t)=>`header-${t}`)(0,r),()=>m(o,r,t))}return I(n,!0)}):T(S(c,r,(e,t)=>w("th",{key:`header-${t}`,className:`font-semibold p-[calc(4/7*1em)] ${p(e.align)}`,dir:"auto"},()=>a&&s?se(e.children,a,`${String(l??"table")}-th-${t}`,s):null)),t)}</tr></thead><tbody>${S((o=u.map,u),o)?j("f180aiq1",()=>{const e=u;if(0===e.length)return I("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=B(((e,t)=>`row-${t}`)(0,r),()=>h(o,r,t))}return I(n,!0)}):T(S(u,o,(e,t)=>w("tr",{key:`row-${t}`,className:t<u.length-1?"border-[var(--table-border,#cbd5e1)] border-b":"border-[var(--table-border,#cbd5e1)]"},()=>e.cells?.map((e,n)=>w("td",{key:`cell-${t}-${n}`,className:`p-[calc(4/7*1em)] ${p(e.align)}`,dir:"auto"},()=>a&&s?se(e.children,a,`${String(l??"table")}-row-${t}-${n}`,s):null)))),t)}</tbody></table>`})()}${T(d&&b("div",{className:"table-node__loading",role:"status","aria-live":"polite"},b("span",{className:"table-node__spinner","aria-hidden":"true"}),b("span",{className:"sr-only"},"Loading")),t)}</div>`},Re=function(e,t,n){let r;const{node:o,ctx:i,renderNode:a,indexKey:s}=e,l=Array.isArray(o.items)?o.items:[];function c(e,t,n,r){return`<div class="mb-4"><dt class="definition-term font-semibold">${P(i&&a?se(e.term,i,`${String(s??"definition")}-term-${t}`,a):null,n)}</dt><dd class="definition-desc ml-4">${P(i&&a?se(e.definition,i,`${String(s??"definition")}-desc-${t}`,a):null,n)}</dd></div>`}return`<dl class="definition-list"${q("data-index-key",s,"dl","opaque")}>${S((r=l.map,l),r)?j("f180bcyy",()=>{const e=l;if(0===e.length)return I("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=B(((e,t)=>`${String(s??"definition")}-${t}`)(0,r),()=>c(o,r,t))}return I(n,!0)}):T(S(l,r,(e,t)=>w("div",{key:`${String(s??"definition")}-${t}`,className:"mb-4"},()=>C([w("dt",{className:"definition-term font-semibold"},()=>i&&a?se(e.term,i,`${String(s??"definition")}-term-${t}`,a):null),w("dd",{className:"definition-desc ml-4"},()=>i&&a?se(e.definition,i,`${String(s??"definition")}-desc-${t}`,a):null)]))),t)}</dl>`},Ue=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e;return`<div${q("id",`fnref--${r.id}`,"div","opaque")} class="footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2"><div class="flex-1">${P(o&&i?ae(r.children,o,String(a??`footnote-${r.id}`),i):null,t)}</div></div>`},ze=function(e,t,n){const{node:r}=e,o=`#fnref--${r.id}`;return`<sup${q("id",`fnref-${r.id}`,"sup","opaque")} class="footnote-reference">${(()=>{const e=D({href:o}),n=`查看脚注 ${r.id}`;return`<span${K([[!0,e],[!1,"title",n],[!1,"className","footnote-link cursor-pointer"]],"span","opaque",!1)}>${E([[null!=e&&Object.prototype.propertyIsEnumerable.call(e,"dangerouslySetInnerHTML"),null!=e?e.dangerouslySetInnerHTML:void 0]],()=>`\n [\n ${T(r.id,t)}\n ]\n `,!0,[])??`\n [\n ${T(r.id,t)}\n ]\n `}</span>`})()}</sup>`},Ge=function(e,t,n){const{node:r}=e;return`${(()=>{const e=`#fnref-${r.id}`,t=`返回引用 ${r.id}`;return`<a class="footnote-anchor text-sm hover:underline cursor-pointer"${q("href",e,"a","opaque")}${q("title",t,"a","opaque")}>\n ↩︎\n </a>`})()}`},Ve=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a,isDark:s}=e,l=String(r.kind||"note"),c=r.title&&String(r.title).trim().length?String(r.title):l.charAt(0).toUpperCase()+l.slice(1),d=`admonition-${String(a??l)}`,u=!r.collapsible||(r.open??!0),p={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"};return`${(()=>{const e=a;return`<div${q("class",`admonition admonition-${l}${s?" is-dark":""}`,"div","opaque")}${q("data-index-key",e,"div","opaque")}><div${q("id",d,"div","opaque")} class="admonition-header">${T(p[l]&&w("span",{className:"admonition-icon"},()=>p[l]),t)}<span class="admonition-title">${P(c,t)}</span>${T(r.collapsible&&v(()=>w("span",{className:"admonition-toggle","aria-expanded":u,"aria-controls":`${d}-content`},()=>w("span",{},()=>u?"▼":"▶"))),t)}</div>${T(u&&v(()=>w("div",{id:`${d}-content`,className:"admonition-content","aria-labelledby":d},()=>o&&i?ae(r.children,o,String(a??d),i):null)),t)}</div>`})()}`},Xe=function(e,t,n){const{node:r}=e;return`<span class="checkbox-node"><input type="checkbox" disabled="" class="checkbox-input" readonly=""${H([[!1,"checked",Boolean(r.checked)]])}/></span>`},Ye=function(e,t,n){const{node:r}=e;return`<span class="emoji-node">${P(r.name??r.markup,t)}</span>`},Ze=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<strong class="strong-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"strong")}-strong`,a):null),t)}</strong>`},Je=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<em class="emphasis-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"emphasis")}-emphasis`,a):null),t)}</em>`},Qe=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<del class="strikethrough-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"strikethrough")}-strikethrough`,a):null),t)}</del>`},et=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<mark class="highlight-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"highlight")}-highlight`,a):null),t)}</mark>`},tt=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<ins class="insert-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"insert")}-insert`,a):null),t)}</ins>`},nt=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<sub class="subscript-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"subscript")}-subscript`,a):null),t)}</sub>`},rt=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<sup class="superscript-node">${P(o??(i&&a?ae(r.children,i,`${String(s??"superscript")}-superscript`,a):null),t)}</sup>`},ot=function(e,t,n){return"<br/>"},it=function(e,t,n){return'<hr class="thematic-break-node"/>'},at=function(e,t,n){const{node:r,children:o}=e;return`<code class="inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full">${P(o??r.code,t)}</code>`},st=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e,s=void 0!==e.underlineBottom?"number"==typeof e.underlineBottom?`${e.underlineBottom}px`:String(e.underlineBottom):"-3px",l=e.animationOpacity??.35,c=Math.max(.12,Math.min(.5*l,l)),d={"--link-color":e.color??"#0366d6","--underline-height":`${e.underlineHeight??2}px`,"--underline-bottom":s,"--underline-opacity":String(l),"--underline-rest-opacity":String(c),"--underline-duration":`${e.animationDuration??1.6}s`,"--underline-timing":e.animationTiming??"ease-in-out","--underline-iteration":"number"==typeof e.animationIteration?String(e.animationIteration):e.animationIteration??"infinite"},p=u({href:String(r.href??"")}).href,m="string"==typeof r.title&&r.title.trim().length>0?r.title:String(p??""),g=h(p);return r.loading?v(()=>w("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:d},()=>w("span",{className:"link-text-wrapper relative inline-flex"},()=>C([w("span",{className:"leading-[normal] link-text"},()=>v(()=>b(Ie,{node:{type:"text",content:String(r.text??"")},ctx:o,indexKey:`${String(a??"link")}-loading`,typewriter:e.typewriter}))),b("span",{className:"link-loading-indicator","aria-hidden":"true"})])))):`${(()=>{const n=m,s=`Link: ${m}`,l=g?"_blank":void 0,c=g?"noopener noreferrer":void 0,u=d;return`<a class="link-node"${q("href",p||void 0,"a","opaque")}${q("title",n,"a","opaque")}${q("aria-label",s,"a","opaque")}${q("target",l,"a","opaque")}${q("rel",c,"a","opaque")}${O(u)}>${T(o&&i?ae(r.children,o,String(a??"link"),i):v(()=>b(Ie,{node:{type:"text",content:String(r.text??"")},ctx:o,indexKey:`${String(a??"link")}-fallback`,typewriter:e.typewriter})),t)}</a>`})()}`},lt=function(e,t,n){const r=e,o=m(r.node.src)||m(r.fallbackSrc);return o?`${(()=>{const e=o,t=String(r.node.alt??r.node.title??""),n=String(r.node.title??r.node.alt??""),i=!1===r.lazy?"eager":"lazy",a=r.node.alt??"Preview image";return`<img${q("src",e,"img","opaque")}${q("alt",t,"img","opaque")}${q("title",n,"img","opaque")} class="image-node__img is-loaded"${q("loading",i,"img","opaque")} decoding="async" tabindex="0"${q("aria-label",a,"img","opaque")}/>`})()}`:null};function ct({node:e},t,n){const r=Ke(e?.language),o=`language-${r}`,i=r?`Code block: ${r}`:"Code block";return`${(()=>{const n=o,a=!0===e?.loading,s=i,l=r;return`<pre${q("class",n,"pre","opaque")}${q("aria-busy",a,"pre","opaque")}${q("aria-label",s,"pre","opaque")}${q("data-language",l,"pre","opaque")} tabindex="0"><code translate="no">${P(String(e?.code??""),t)}</code></pre>`})()}`}function dt(e){return Te("code-block-node",e.node,{showHeader:e.showHeader,fallback:"code-block"})}function ut(e){return Te("markdown-code-block-node",e.node,{showHeader:e.showHeader,fallback:"markdown-code-block"})}function pt(e){return Te("mermaid-block-node",e.node,{showHeader:e.showHeader,fallback:"mermaid"})}function mt(e){return Te("d2-block-node",e.node,{showHeader:e.showHeader,fallback:"d2"})}function ht(e){return Te("infographic-block-node",e.node,{showHeader:e.showHeader,fallback:"infographic"})}var gt=function({node:e},t,n){const r=_e(String(e.content??""),!0,Boolean(e.loading));return r?`<div class="math-block text-center overflow-x-auto relative min-h-[40px]"><div>${E([[!0,{__html:r}]],()=>"",!1,[])??""}</div></div>`:w("div",{className:"math-block text-center overflow-x-auto relative min-h-[40px]"},()=>w("div",{},()=>String(e.raw??e.content??"")))},ft=function({node:e},t,n){const r="$$"===e.markup,o=_e(String(e.content??""),r,Boolean(e.loading));return o?`<span class="math-inline-wrapper"><span class="math-inline">${E([[!0,{__html:o}]],()=>"",!1,[])??""}</span></span>`:w("span",{className:"math-inline-wrapper"},()=>w("span",{className:"math-inline"},()=>String(e.raw??e.content??"")))},yt=function(e,t,n){const{node:r}=e;return`${(()=>{const e=r.id;return`<span class="reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]" role="button" tabindex="0"${q("data-reference-id",e,"span","opaque")}>${P(r.id,t)}</span>`})()}`},kt=function(e,r,o){const i=String(e.node?.tag??"").trim().toLowerCase(),s=c(i),l=Array.isArray(e.node?.children)?e.node.children:[],d=s?e.ctx?.htmlComponents?.[s]:void 0;if(l.length>0&&i&&!t.has(i)&&!a(i,e.ctx?.htmlPolicy??"safe")&&e.ctx&&e.renderNode){const t=ae(l,e.ctx,`${String(e.indexKey??"html-block")}-structured`,e.renderNode);if(d){const r=p(e.node?.attrs??null,e.ctx?.htmlPolicy??"safe",s);return $.createElement(d,n(y(r)),t)}return $.createElement(i,function(e,t="safe",n){const r={...de(ie(p(e??void 0,t,n))||{})},o="string"==typeof r.className?r.className.trim():"";return r.className=o?`html-block-node ${o}`:"html-block-node",r}(e.node?.attrs??null,e.ctx?.htmlPolicy??"safe",i),t)}const u={...e.ctx?.customComponents??z(e.customId),...e.ctx?.htmlComponents??{}},m=we(String(e.node.content??""),u,e.ctx?.htmlPolicy??"safe",{ctx:e.ctx,keyPrefix:String(e.indexKey??"html-block"),nodeComponents:e.ctx?.streamingComponents,propComponents:e.ctx?.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});return null==m?w(x,{},()=>C([String(e.node.content??"")])):`${T(w(x,{},()=>C([m])),r)}`},$t=function(e,t,r){const o=e.ctx?.htmlPolicy??"safe",i=String(e.node?.tag??"").trim().toLowerCase(),s=c(i),l=Array.isArray(e.node?.children)?e.node.children:[],d=s?e.ctx?.htmlComponents?.[s]:void 0;if(l.length>0&&i&&"escape"!==o&&!a(i,o)&&e.ctx&&e.renderNode&&d){const t=ae(l,e.ctx,`${String(e.indexKey??"html-inline")}-structured`,e.renderNode),r=p(e.node?.attrs??null,o,s);return $.createElement(d,n(y(r)),t)}const u={...e.ctx?.customComponents??z(e.customId),...e.ctx?.htmlComponents??{}},m=we(String(e.node.content??""),u,o,{ctx:e.ctx,keyPrefix:String(e.indexKey??"html-inline"),nodeComponents:e.ctx?.streamingComponents,propComponents:e.ctx?.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});return null==m?w(x,{},()=>C([String(e.node.content??"")])):`${T(w(x,{},()=>C([m])),t)}`},xt=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e,s=r.attrs?Array.isArray(r.attrs)?ie(r.attrs):r.attrs:void 0;return`${(()=>{const e=`vmr-container vmr-container-${r.name}`,n=D(s);return`<div${K([[!1,"className",e],[!0,n]],"div","opaque",!1)}>${E([[null!=n&&Object.prototype.propertyIsEnumerable.call(n,"dangerouslySetInnerHTML"),null!=n?n.dangerouslySetInnerHTML:void 0]],()=>`${T(o&&i&&Array.isArray(r.children)?r.children.map((e,t)=>w($.Fragment,{key:`${String(a??"vmr-container")}-${t}`},()=>i(e,`${String(a??"vmr-container")}-${t}`,o))):null,t)}`,!1,[])??`${T(o&&i&&Array.isArray(r.children)?r.children.map((e,t)=>w($.Fragment,{key:`${String(a??"vmr-container")}-${t}`},()=>i(e,`${String(a??"vmr-container")}-${t}`,o))):null,t)}`}</div>`})()}`};function bt(e){return null}function wt(e){return null}var vt=function(e,t,n){const{node:r}=e;return`<div class="unknown-node text-sm text-gray-500 italic">\n Unsupported node type:\n ${T(String(r?.type),t)}</div>`};function Nt(e,t,r){const o=r.customComponents??z(r.customId),i=r.streamingComponents??{},a=r.htmlComponents??{},s=function(e){if("html_block"===e.type||"html_inline"===e.type)return"";const t=c(e.type),n=c(e.tag);return t&&n&&t===n?t:""}(e),l=s?i[s]:null,d=s&&!l?a[s]:null,u="code_block"===e.type?null:o[e.type];if(l)return $.createElement(l,{key:t,node:e,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter,fade:r.fade});if(d)return function(e,t,r,o,i){const a=n(y(p(t.attrs??void 0,o.htmlPolicy??"safe",i))),s=Array.isArray(t.children)?ae(t.children,o,`${String(r)}-html`,Nt):t.content??null;return $.createElement(e,{...a,key:r},s)}(d,e,t,r,s);if(u)return $.createElement(u,{key:t,node:e,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter,fade:r.fade});if("html_block"===e.type||"html_inline"===e.type){const n=le(e,{...o,...i},r.customHtmlTags),a=n?.tag??"",s=n?.isWhitelisted??!1,l=n?.component??null;if(s&&l){const n={...e,type:a,tag:a,content:f(e.content,a)};return $.createElement(l,{key:t,node:n,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter,fade:r.fade})}const c=String(e.content??e.raw??"");if(!s&&g(c,a))return"html_inline"===e.type?v(()=>b(Ie,{key:t,node:{type:"text",content:c,raw:c},ctx:r,indexKey:t,typewriter:r.typewriter})):v(()=>b(De,{key:t,node:{type:"paragraph",children:[{type:"text",content:c,raw:c}],raw:c},ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}))}switch(e.type){case"text":return v(()=>b(Ie,{key:t,node:e,ctx:r,indexKey:t,typewriter:r.typewriter}));case"text_special":return v(()=>b(Ie,{key:t,node:{type:"text",content:e.content??"",center:e.center},ctx:r,indexKey:t,typewriter:r.typewriter}));case"paragraph":return v(()=>b(De,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"heading":return v(()=>b(Oe,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"blockquote":return v(()=>b(Me,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"list":return v(()=>b(We,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"list_item":return v(()=>b(Le,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"table":return v(()=>b(Fe,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"definition_list":return v(()=>b(Re,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"footnote":return v(()=>b(Ue,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"footnote_reference":return v(()=>b(ze,{key:t,node:e}));case"footnote_anchor":return v(()=>b(Ge,{key:t,node:e}));case"admonition":return v(()=>b(Ve,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,isDark:r.isDark,typewriter:r.typewriter}));case"hardbreak":return v(()=>b(ot,{key:t,node:e,typewriter:r.typewriter}));case"link":return v(()=>b(st,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,isDark:r.isDark,showTooltip:"boolean"==typeof r.showTooltips?r.showTooltips:void 0,typewriter:r.typewriter}));case"image":return v(()=>b(lt,{key:t,node:e}));case"inline_code":return v(()=>b(at,{key:t,node:e,ctx:r,indexKey:t,typewriter:r.typewriter}));case"code_block":return je(e,t,r,o);case"strong":return v(()=>w(Ze,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-strong`,Nt)));case"emphasis":return v(()=>w(Je,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-em`,Nt)));case"strikethrough":return v(()=>w(Qe,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-strike`,Nt)));case"highlight":return v(()=>w(et,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-highlight`,Nt)));case"insert":return v(()=>w(tt,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-insert`,Nt)));case"subscript":return v(()=>w(nt,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-sub`,Nt)));case"superscript":return v(()=>w(rt,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-sup`,Nt)));case"checkbox":case"checkbox_input":return v(()=>b(Xe,{key:t,node:e,typewriter:r.typewriter}));case"emoji":return v(()=>b(Ye,{key:t,node:e,typewriter:r.typewriter}));case"thematic_break":return v(()=>b(it,{key:t,node:e}));case"math_inline":return v(()=>b(ft,{key:t,node:e}));case"math_block":return v(()=>b(gt,{key:t,node:e}));case"reference":return v(()=>b(yt,{key:t,node:e,ctx:r,typewriter:r.typewriter}));case"html_block":return v(()=>b(kt,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter,fade:r.fade,customId:r.customId}));case"html_inline":return v(()=>b($t,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter,fade:r.fade,customId:r.customId}));case"vmr_container":return v(()=>b(xt,{key:t,node:e,ctx:r,renderNode:Nt,indexKey:t,typewriter:r.typewriter}));case"label_open":case"label_close":return null;default:return v(()=>b(vt,{key:t,node:e}))}}var St=function(e,t,n){let r;const i=z(e.customId),a=Q(e.streamingComponents),s=Q(e.htmlComponents),c=e.parseOptions??{},u=c.customHtmlTags??[],p=l(e.customHtmlTags,Array.isArray(u)?u:[],Object.keys(a)),m=e.customId?`server-renderer-${e.customId}`:"server-renderer",h=p.length>0?o(m,{customHtmlTags:p}):o(m),g=e.customMarkdownIt?e.customMarkdownIt(h):h,f=e.final??c.final,y=null==f&&0===p.length?c:{...c,...null!=f?{final:f}:{},...p.length>0?{customHtmlTags:p}:{}},k=Array.isArray(e.nodes)&&e.nodes.length?e.nodes.map(e=>({...e})):e.content?d(e.content,g??qe,y):[],$=null!=e.indexKey?String(e.indexKey):"markdown-renderer",x=function(e,t,n,r,o,i,a){return{customId:e.customId,final:a,customComponents:t,customHtmlTags:i,htmlPolicy:e.htmlPolicy??"safe",isDark:e.isDark,indexKey:o,typewriter:e.typewriter,fade:e.fade,showTooltips:e.showTooltips,streamingComponents:n,htmlComponents:r,renderCodeBlocksAsPre:e.renderCodeBlocksAsPre,codeBlockStream:e.codeBlockStream,codeBlockProps:{..."boolean"==typeof e.showTooltips?{showTooltips:e.showTooltips}:{},...e.codeBlockProps||{}},mermaidProps:{...e.mermaidProps||{}},d2Props:{...e.d2Props||{}},infographicProps:{...e.infographicProps||{}},codeBlockThemes:{themes:e.themes,langs:e.langs,darkTheme:e.codeBlockDarkTheme,lightTheme:e.codeBlockLightTheme,monacoOptions:e.codeBlockMonacoOptions,minWidth:e.codeBlockMinWidth,maxWidth:e.codeBlockMaxWidth},events:{onCopy:e.onCopy,onHandleArtifactClick:e.onHandleArtifactClick}}}(e,i,a,s,$,p,f);function b(e,t,n,r){return`${(()=>{const r=t,o=e.type;return`<div class="node-slot"${q("data-node-index",r,"div","opaque")}${q("data-node-type",o,"div","opaque")}><div class="node-content">${P(Nt(e,`${$}-${t}`,x),n)}</div></div>`})()}`}return`${(()=>{const n="markstream-octane markdown-renderer"+(e.isDark?" dark":""),o=e.customId;return`<div${q("class",n,"div","opaque")}${q("data-custom-id",o,"div","opaque")}>${S((r=k.map,k),r)?j("f182gb9l",()=>{const e=k;if(0===e.length)return I("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=B(((e,t)=>`${$}-${t}`)(0,r),()=>b(o,r,t))}return I(n,!0)}):T(S(k,r,(e,t)=>w("div",{key:`${$}-${t}`,className:"node-slot","data-node-index":t,"data-node-type":e.type},()=>w("div",{className:"node-content"},()=>Nt(e,`${$}-${t}`,x)))),t)}</div>`})()}`};export{Ve as AdmonitionNode,Me as BlockquoteNode,Xe as CheckboxNode,dt as CodeBlockNode,dt as OctaneCodeBlockNode,mt as D2BlockNode,Re as DefinitionListNode,Ye as EmojiNode,Je as EmphasisNode,vt as FallbackComponent,Ge as FootnoteAnchorNode,Ue as FootnoteNode,ze as FootnoteReferenceNode,ot as HardBreakNode,Oe as HeadingNode,et as HighlightNode,kt as HtmlBlockNode,$t as HtmlInlineNode,wt as HtmlPreviewFrame,lt as ImageNode,ht as InfographicBlockNode,at as InlineCodeNode,tt as InsertNode,st as LinkNode,Le as ListItemNode,We as ListNode,ut as MarkdownCodeBlockNode,gt as MathBlockNode,ft as MathInlineNode,pt as MermaidBlockNode,St as NodeRenderer,St as default,De as ParagraphNode,ct as PreCodeNode,yt as ReferenceNode,Qe as StrikethroughNode,Ze as StrongNode,nt as SubscriptNode,rt as SuperscriptNode,Fe as TableNode,Ie as TextNode,it as ThematicBreakNode,bt as Tooltip,xt as VmrContainerNode,V as clearGlobalCustomComponents,J as defineHtmlComponents,Z as defineStreamingComponents,X as getCustomComponentDisplay,z as getCustomNodeComponents,G as removeCustomComponents,Nt as renderNode,U as setCustomComponents,Y as withMarkstreamComponentDisplay};
2
+ import{BLOCKED_HTML_TAGS as e,NON_STRUCTURING_HTML_TAGS as t,convertHtmlAttrsToProps as n,getHtmlTagFromContent as r,getMarkdown as o,isCustomHtmlComponentTag as i,isHtmlTagBlocked as a,isHtmlTagHardBlocked as s,mergeCustomHtmlTags as c,normalizeCustomHtmlTagName as l,parseMarkdownToStructure as d,sanitizeHtmlAttrs as u,sanitizeHtmlTokenAttrs as p,sanitizeImageSrc as m,shouldOpenLinkInNewTab as h,shouldRenderUnknownHtmlTagAsText as g,stripCustomHtmlWrapper as f,tokenAttrsToRecord as y,tokenizeHtml as k}from"stream-markdown-parser";import*as x from"octane/server";import{Fragment as $,createElement as w,createScopedElement as v,createScopedValue as b,hookSlots as N,mapSlot as S,positionalChildren as C,puMemo as B,ssrArm as _,ssrAttr as j,ssrAttrs as T,ssrChild as M,ssrChildText as q,ssrComponent as K,ssrControl as A,ssrForBlock as P,ssrInnerHtml as H,ssrInputAttrs as O,ssrSnapshotSpread as I,ssrStyle as E}from"octane/server";import{normalizeShikiLanguage as D}from"markstream-core";var L="__global__",W="__MARKSTREAM_OCTANE_CUSTOM_COMPONENTS_STORE__",V=(()=>{const e=globalThis;if(e[W])return e[W];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[W]=t,t})();function z(){V.revision++;for(const e of Array.from(V.listeners))try{e()}catch{}}function F(e,t){"string"==typeof e?V.scopedComponents[e]={...t||{}}:V.scopedComponents[L]={...e},z()}function R(e){const t=V.scopedComponents[L]||{};if(!e)return t;const n=V.scopedComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?{...t,...n}:t:n}function U(e){if(e===L)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete V.scopedComponents[e],z()}function J(){delete V.scopedComponents[L],z()}function X(e){return e?.markstreamDisplay}function Z(e,t){return e.markstreamDisplay=t,e}function G(e){return e}function Y(e){return e}function Q(e){if(!e)return{};const t={};for(const[n,r]of Object.entries(e)){const e=l(n);e&&(t[e]=r)}return t}function ee(e){const t="number"==typeof e?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function te(e){const t="number"==typeof e?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}var ne=/* @__PURE__ */new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function re(e,t={}){const n={},r=new Set(t.omit??[]);if(!e||"object"!=typeof e)return n;const o=Object.getOwnPropertyDescriptors(e);for(const[i,a]of Object.entries(o))ne.has(i)||r.has(i)||a.enumerable&&"value"in a&&(n[i]=a.value);return n}var oe=/* @__PURE__ */new Set(["table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function ie(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[t,n])=>t?(e["for"===t?"htmlFor":"class"===t?"className":t]=n??!0,e):e,{})}function ae(e,t,n,r){if("function"!=typeof r)throw new TypeError("renderNodeChildren expected a function, received "+typeof r);if(!Array.isArray(e)||0===e.length)return null;const o=[];for(let i=0;i<e.length;i++){const a=e[i];if(a){if("label_open"===a.type){const s=[];for(i++;i<e.length;){const t=e[i];if("label_close"===t?.type)break;t&&s.push(t),i++}const c=`${n}-label-${i}`;o.push(x.createElement("label",{key:c,...ie(a.attrs)},ae(s,t,`${c}-child`,r)));continue}"label_close"!==a.type&&o.push(r(a,`${n}-${i}`,t))}}return o}function se(e,t,n,r){return ae(e,t,`${n}-inline`,r)}function ce(e,t,n){const o=l(e.type),i=(n??[]).map(e=>l(e)).filter(Boolean),a="html_inline"===o||"html_block"===o;if(!a&&!i.includes(o))return null;const s=a?l(e.tag)||r(e.content):l(e.tag)||o;if(!s)return null;const c=i.includes(s),d=t[s]??t[o]??null,u=c||a?d:null;return{tag:s,isWhitelisted:c,component:u,display:X(u)}}function le(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function de(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const r of t.split(";")){const e=r.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const o=le(e.slice(0,t).trim()),i=e.slice(t+1).trim();o&&(n[o]=i)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}var ue=k,pe=u;function me(e,t){return i(e,t)}function he(e,t,n=!1){const r=Object.entries(t??{}),o=r.length>0?r.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function ge(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function fe(e,t){return t.nodeComponents?.[e]||t.nodeComponents?.[e.toLowerCase()]}function ye(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return String(e);if(Array.isArray(e))return e.map(ye).join("");if(!x.isValidElement(e))return"";const t=e;if("string"!=typeof t.type)return ye(t.props.children);const n=Object.entries(t.props).filter(([e,t])=>"children"!==e&&"key"!==e&&"ref"!==e&&null!=t&&"boolean"!=typeof t).map(([e,t])=>` ${"className"===e?"class":e}="${String(t)}"`).join("");return`<${t.type}${n}>${ye(t.props.children)}</${t.type}>`}function ke(e){return Object.entries(e).map(([e,t])=>[e,""===t?null:t])}function xe(e){const t=e.sourceNode,n=!0!==e.ctx?.final&&(!1===e.ctx?.final||Boolean(t?.loading));return{loading:n,autoClosed:n||Boolean(t?.autoClosed)}}function $e(e,t,r){return function(e,t){return Boolean(t.propComponents?.[e]||t.propComponents?.[e.toLowerCase()])}(e,r)?n(t):t}function we(e,t,n,r,o,i,a,s=xe(o)){const c=l(e),d=i??function(e){return e.map(ye).join("")}(n),u={type:c,tag:c,attrs:ke(t),content:d,raw:a??`${he(e,t)}${d}</${e}>`,loading:s.loading,autoClosed:s.autoClosed};if(o.ctx&&o.renderNode)return o.renderNode(u,r,o.ctx);const p=fe(e,o);return p?x.createElement(p,{key:r,node:u}):null}function ve(t,n,r="safe",o={}){if(!t)return[];if("escape"===r)return[t];try{const i=ue(t);let c=0;const l=o.keyPrefix??"ms-html",d=[],u=[];for(const t of i){if("text"===t.type){if(d.length>0&&d[d.length-1].hardBlocked)continue;(d.length>0?d[d.length-1].children:u).push(t.content??""),d.length>0&&d[d.length-1].sourceParts.push(t.content??"");continue}const i=t.tagName;if(void 0===i)return null;if("self_closing"===t.type){const p=t.attrs||{},m=he(i,p,!0),h=me(i,n),g=Boolean(fe(i,o));if(e.has(i.toLowerCase())||!h&&!g&&s(i,r))continue;if(!h&&!g&&a(i,r)){(d.length>0?d[d.length-1].children:u).push(m),d.length>0&&d[d.length-1].sourceParts.push(m);continue}const f=pe(p,r,i),y=f.key,k=null!=y&&""!==y?y:`${l}-${c++}`,$=h?n[i]||n[i.toLowerCase()]:void 0,w=d.length>0?d[d.length-1].children:u;if(g)w.push(we(i,p,[],k,o,"",m,{loading:!1,autoClosed:!1}));else if($){const e=$e(i,f,o);w.push(x.createElement($,{...e,key:k}))}else w.push(x.createElement(i,{...de(f),key:k,suppressHydrationWarning:!0}));d.length>0&&d[d.length-1].sourceParts.push(m);continue}if("tag_open"===t.type){const c=d.length>0&&d[d.length-1].hardBlocked,l=me(i,n),u=Boolean(fe(i,o));d.push({tagName:i,children:[],attrs:t.attrs,sourceParts:[],customComponent:l||u,hardBlocked:c||e.has(i.toLowerCase())||!l&&!u&&s(i,r),softBlocked:!c&&!l&&!u&&a(i,r)});continue}const p=i.toLowerCase();let m=-1;for(let e=d.length-1;e>=0;e--)if(d[e].tagName.toLowerCase()===p){m=e;break}if(-1!==m)for(;d.length>m;){const e=d.pop();if(!e)continue;const t=e.sourceParts.join(""),i=`${he(e.tagName,e.attrs)}${t}</${e.tagName}>`;let a;if(e.hardBlocked)a=null;else if(e.softBlocked)a=[he(e.tagName,e.attrs),...e.children,`</${e.tagName}>`];else{const s=pe(e.attrs||{},r,e.tagName),d=s.key,u=null!=d&&""!==d?d:`${l}-${c++}`,m=e.customComponent?n[e.tagName]||n[e.tagName.toLowerCase()]:void 0;if(Boolean(fe(e.tagName,o))){const n=e.tagName.toLowerCase()===p?{loading:!1,autoClosed:!1}:xe(o);a=we(e.tagName,e.attrs||{},e.children,u,o,t,i,n)}else a=m?x.createElement(m,{...$e(e.tagName,s,o),key:u},...e.children):x.createElement(e.tagName,{...de(s),key:u,suppressHydrationWarning:!0},...e.children)}d.length>0?ge(d[d.length-1].children,a):ge(u,a),d.length>0&&!e.hardBlocked&&d[d.length-1].sourceParts.push(i)}}for(;d.length>0;){const e=d.pop();if(!e||e.hardBlocked)continue;const t=e.sourceParts.join(""),i=`${he(e.tagName,e.attrs)}${t}`;if(e.softBlocked){ge(u,[he(e.tagName,e.attrs),...e.children,`</${e.tagName}>`]),d.length>0&&d[d.length-1].sourceParts.push(i);continue}const a=pe(e.attrs||{},r,e.tagName),s=a.key,p=null!=s&&""!==s?s:`${l}-${c++}`,m=e.customComponent?n[e.tagName]||n[e.tagName.toLowerCase()]:void 0;let h;h=Boolean(fe(e.tagName,o))?we(e.tagName,e.attrs||{},e.children,p,o,t,i,xe(o)):m?x.createElement(m,{...$e(e.tagName,a,o),key:p},...e.children):x.createElement(e.tagName,{...de(a),key:p,suppressHydrationWarning:!0},...e.children),u.push(h),d.length>0&&d[d.length-1].sourceParts.push(i)}return u}catch{return null}}var be,Ne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n',Se={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",d2lang:"d2",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"},Ce={"":Ne,plain:Ne,text:Ne,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n',typescript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n'};function Be(e){const t=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[r]=n.split(":");return r.toLowerCase()}(e);return Se[t]??t}Array.from(/* @__PURE__ */new Set([...Object.keys(Se),...Object.values(Se),...Object.keys(Ce),...Object.keys({javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",cpp:"C++",csharp:"C#",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid",d2:"D2"}),"c","diff","go","java","php","ruby","rust","sql","yaml"]));var _e=!1;function je(e,t,n){const r=function(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}(e);if(!r)return null;if(globalThis.__MARKSTREAM_OCTANE_DISABLE_SYNC_KATEX__)return null;const o=function(){if(be)return be;if(_e)return null;_e=!0;try{const e=function(){try{const e=Reflect.get(globalThis,"process"),t="function"==typeof e?.getBuiltinModule?e.getBuiltinModule("module"):null;return"function"==typeof t?.createRequire?t.createRequire(import.meta.url):null}catch{return null}}();if(!e)return null;const t=e("katex");try{e("katex/contrib/mhchem")}catch{}return be=t}catch{return null}}();if(!o)return null;try{return o.renderToString(r,{displayMode:t,throwOnError:n})}catch{return null}}var Te=/* @__PURE__ */Symbol(/* @__PURE__ */N(1)),Me=o();function qe(e){return String(String(e??"").split(/\s+/g)[0]??"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}var Ke=function(e,t,n,r,o){const i=qe(t.language),a=String(t.code??t.raw??""),s=function(e){const t=Be(String(e??""));return t&&"plaintext"!==t?t.charAt(0).toUpperCase()+t.slice(1):"Text"}(t.language);return`${(()=>{const o=`${e} ${e}--ssr`,c=n.fallback;return`<div${j("class",o,"div","opaque")}${j("data-ssr-fallback",c,"div","opaque")}>${M(!1!==n.showHeader&&b(()=>v("div",{className:`${e}__header`},()=>b(()=>v("span",{className:`${e}__language`},()=>s)))),r)}<div${j("class",`${e}__body`,"div","opaque")}>${(()=>{const e=`language-${i}`,n=!0===t.loading,o=i?`Code block: ${i}`:"Code block",s=i;return`<pre${j("class",e,"pre","opaque")}${j("aria-busy",n,"pre","opaque")}${j("aria-label",o,"pre","opaque")}${j("data-language",s,"pre","opaque")} tabindex="0"><code translate="no">${q(a,r)}</code></pre>`})()}</div></div>`})()}`};function Ae(e,t,n,r,o={}){const i=re(r.codeBlockProps);return x.createElement(e,{key:n,node:t,loading:Boolean(t.loading),stream:r.codeBlockStream,customId:r.customId,isDark:r.isDark,darkTheme:r.codeBlockThemes?.darkTheme,lightTheme:r.codeBlockThemes?.lightTheme,themes:r.codeBlockThemes?.themes,minWidth:r.codeBlockThemes?.minWidth,maxWidth:r.codeBlockThemes?.maxWidth,onCopy:r.events.onCopy,...i,codeBlockOptions:r.codeBlockOptions,...o,ctx:r,renderNode:St,indexKey:n,typewriter:r.typewriter,fade:r.fade})}function Pe(e,t,n,r,o={}){return x.createElement(e,{key:n,node:t,isDark:r.isDark,...o})}var He=function(e,t,n,r,o,i){const a=String(e?.language||"").trim(),s=a?String(a.split(/\s+/)[0]??"").split(":")[0].toLowerCase():"",c=Be(s),l=function(e,t){const n=t.trim().toLowerCase();if(!n)return null;for(const r of[n,Be(n),D(n)]){const t=r&&e[r];if(t)return t}return null}(r,s);if("mermaid"===c){const o=function(e,t){const n={...t.mermaidProps||{}};return null==te(n.estimatedPreviewHeightPx)&&(n.estimatedPreviewHeightPx=function(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}(function(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),r=function(e){for(const t of e.split(/\r?\n/)){const e=t.trim();if(e&&!e.startsWith("%%"))return e.match(/^([A-Z][\w-]*)\b/i)?.[1]?.toLowerCase()||""}return""}(e);return"gantt"===r?220+28*n:"sequencediagram"===r?180+26*n:"classdiagram"===r||"statediagram"===r||"erdiagram"===r?180+24*n:"flowchart"===r||"graph"===r?170+28*n:200+22*n}(String(e?.code??"")),void 0,"none"===n.maxHeight?null:te(n.maxHeight)??void 0)),n}(e,n),i=l||r.mermaid;return i?Pe(i,e,t,n,o):b(()=>w(mt,{key:t,node:e,isDark:n.isDark,loading:Boolean(e.loading),...o}))}if("infographic"===c){const o=function(e,t){const n={...t.infographicProps||{}};return null==ee(n.estimatedPreviewHeightPx)&&(n.estimatedPreviewHeightPx=function(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}(function(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}(String(e?.code??"")),void 0,"none"===n.maxHeight?null:ee(n.maxHeight)??void 0)),n}(e,n),i=l||r.infographic;return i?Pe(i,e,t,n,o):b(()=>w(gt,{key:t,node:e,isDark:n.isDark,loading:Boolean(e.loading),...o}))}if("d2"===c||"d2lang"===c){const o=l||r.d2;return o?Pe(o,e,t,n,n.d2Props||{}):b(()=>w(ht,{key:t,node:e,isDark:n.isDark,loading:Boolean(e.loading),...n.d2Props||{}}))}if(l)return Ae(l,e,t,n);const d=r.code_block;if(d)return Ae(d,e,t,n);if(n.renderCodeBlocksAsPre){const r=re(n.codeBlockProps).showLineNumbers,o=n.codeBlockOptions?.disableLineNumbers,i=n.codeBlockOptions?.overflow;return b(()=>w(ut,{key:t,node:e,style:i?{whiteSpace:"scroll"===i?"pre":"pre-wrap"}:void 0,showLineNumbers:"boolean"==typeof r?r:"boolean"==typeof o&&!o}))}return`${K(o,pt,{node:e,loading:B(()=>Boolean(e.loading),[Boolean,e.loading],Te),stream:n.codeBlockStream,themes:n.codeBlockThemes?.themes,darkTheme:n.codeBlockThemes?.darkTheme,lightTheme:n.codeBlockThemes?.lightTheme,minWidth:n.codeBlockThemes?.minWidth,maxWidth:n.codeBlockThemes?.maxWidth,isDark:n.isDark,...re(n.codeBlockProps),codeBlockOptions:n.codeBlockOptions},!1,t)}`},Oe=function(e,t,n){const{node:r,children:o}=e;return`<span${j("class","text-node whitespace-pre-wrap break-words"+(r.center?" text-node-center":""),"span","opaque")}>${q(o??r.content,t)}</span>`};function Ie(e){return"text"===e?.type&&""===String(e?.content??"").trim()}function Ee(e,t,n,r){const o=e.filter(e=>!Ie(e)),i=o.length>0&&o.every(e=>"image"===e.type||function(e){const t=function(e){return"link"===e?.type&&Array.isArray(e?.children)?e.children.filter(e=>!Ie(e)):[]}(e);return 1===t.length&&"image"===t[0]?.type}(e));if(!i||o.length<=1)return ae(e,n,r,t);const a=[];for(let s=0;s<e.length;s++){const t=e[s];if(!Ie(t)){a.push(t);continue}const n=a.length>0,r=e.slice(s+1).some(e=>!Ie(e));n&&r&&a.push({...t,content:" ",raw:" "})}return a.map((e,o)=>i&&Ie(e)?String(e?.content??""):t(e,`${r}-${o}`,n))}function De(e){const{node:t,ctx:n,renderNode:r,indexKey:o,children:i}=e;if(!n||!r)return x.createElement("p",{dir:"auto",className:"paragraph-node"},i);const a=t.children??[],s={...n.customComponents??R(n.customId),...n.htmlComponents??{},...n.streamingComponents??{}},c=[],l=[],d=()=>{if(!l.length)return;const e=c.length;c.push(x.createElement("p",{key:`${String(o??"paragraph")}-inline-${e}`,dir:"auto",className:"paragraph-node"},Ee(l.slice(),r,n,`${String(o??"paragraph")}-${e}`))),l.length=0};return a.forEach((e,t)=>{const i="escape"!==(n.htmlPolicy??"safe")||"html_inline"!==e.type&&"html_block"!==e.type;oe.has(e.type)||i&&function(e,t,n){return"block"===ce(e,t,n)?.display}(e,s,n.customHtmlTags)?(d(),c.push(r(e,`${String(o??"paragraph")}-block-${t}`,n))):l.push(e)}),d(),c.length?x.createElement(x.Fragment,{},c):x.createElement("p",{dir:"auto",className:"paragraph-node"},Ee(a,r,n,String(o??"paragraph")))}var Le=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a,children:s}=e,c=Math.min(6,Math.max(1,Number(r.level)||1)),l=`h${c}`,{class:d,className:u,style:p,...m}=r?.attrs??{};return`${K(t,l,{dir:"auto",className:["heading-node","font-semibold",`heading-${c}`,d,u].filter(Boolean).join(" "),..."object"==typeof p&&null!=p?{style:p}:{},...m,children:s??(o&&i?ae(r.children,o,String(a??`heading-${c}`),i):null)})}`},We=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a,children:s}=e;return`${(()=>{const e=r.cite;return`<blockquote class="blockquote-node" dir="auto"${j("cite",e,"blockquote","opaque")}>${q(s??(o&&i?ae(r.children,o,String(a??"blockquote"),i):null),t)}</blockquote>`})()}`};function Ve(e,t,n){const{node:r,ctx:o,renderNode:i,value:a,indexKey:s,children:c}=e;return`<li class="list-item pl-1.5 my-2" dir="auto"${j("value",null==a?void 0:a,"li","opaque")}>${q(c??(o&&i?ae(r.children,o,String(s??"list-item"),i):null),t)}</li>`}var ze=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e,s=r.ordered?"ol":"ul",c=r.ordered&&r.start?r.start:void 0,l=o&&R(o.customId).list_item||Ve;return`${K(t,s,{className:r.ordered?"list-node my-5 pl-[calc(13/8*1em)] list-decimal":"list-node my-5 pl-[calc(13/8*1em)] list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]",start:c,children:r.items?.map((e,t)=>w(l,{key:`${String(a??"list")}-${t}`,node:e,value:r.ordered?(r.start??1)+t:void 0,ctx:o,renderNode:i,indexKey:`${String(a??"list")}-${t}`,customId:o?.customId,isDark:o?.isDark,typewriter:o?.typewriter}))})}`},Fe=function(e,t,n){let r,o;const{node:i,ctx:a,renderNode:s,indexKey:c}=e,l=Array.isArray(i?.header?.cells)?i.header.cells:[],d=Boolean(i?.loading),u=Array.isArray(i?.rows)?i.rows:[],p=e=>"right"===e?"text-right":"center"===e?"text-center":"text-left";function m(e,t,n,r){return`<th${j("class",`font-semibold p-[calc(4/7*1em)] ${p(e.align)}`,"th","opaque")} dir="auto">${q(a&&s?se(e.children,a,`${String(c??"table")}-th-${t}`,s):null,n)}</th>`}function h(e,t,n,r){return`<tr${j("class",t<u.length-1?"border-[var(--table-border,#cbd5e1)] border-b":"border-[var(--table-border,#cbd5e1)]","tr","opaque")}>${q(e.cells?.map((e,n)=>v("td",{key:`cell-${t}-${n}`,className:`p-[calc(4/7*1em)] ${p(e.align)}`,dir:"auto"},()=>a&&s?se(e.children,a,`${String(c??"table")}-row-${t}-${n}`,s):null)),n)}</tr>`}return`<div class="table-node-wrapper"${j("data-index-key",c,"div","opaque")}>${(()=>{const e=d;return`<table${j("class","my-8 text-sm table-node"+(d?" table-node--loading":""),"table","opaque")}${j("aria-busy",e,"table","opaque")}><thead class="border-[var(--table-border,#cbd5e1)]"><tr class="border-b">${S((r=l.map,l),r)?A("f180ain9",()=>{const e=l;if(0===e.length)return P("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=_(((e,t)=>`header-${t}`)(0,r),()=>m(o,r,t))}return P(n,!0)}):M(S(l,r,(e,t)=>v("th",{key:`header-${t}`,className:`font-semibold p-[calc(4/7*1em)] ${p(e.align)}`,dir:"auto"},()=>a&&s?se(e.children,a,`${String(c??"table")}-th-${t}`,s):null)),t)}</tr></thead><tbody>${S((o=u.map,u),o)?A("f180am28",()=>{const e=u;if(0===e.length)return P("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=_(((e,t)=>`row-${t}`)(0,r),()=>h(o,r,t))}return P(n,!0)}):M(S(u,o,(e,t)=>v("tr",{key:`row-${t}`,className:t<u.length-1?"border-[var(--table-border,#cbd5e1)] border-b":"border-[var(--table-border,#cbd5e1)]"},()=>e.cells?.map((e,n)=>v("td",{key:`cell-${t}-${n}`,className:`p-[calc(4/7*1em)] ${p(e.align)}`,dir:"auto"},()=>a&&s?se(e.children,a,`${String(c??"table")}-row-${t}-${n}`,s):null)))),t)}</tbody></table>`})()}${M(d&&w("div",{className:"table-node__loading",role:"status","aria-live":"polite"},w("span",{className:"table-node__spinner","aria-hidden":"true"}),w("span",{className:"sr-only"},"Loading")),t)}</div>`},Re=function(e,t,n){let r;const{node:o,ctx:i,renderNode:a,indexKey:s}=e,c=Array.isArray(o.items)?o.items:[];function l(e,t,n,r){return`<div class="mb-4"><dt class="definition-term font-semibold">${q(i&&a?se(e.term,i,`${String(s??"definition")}-term-${t}`,a):null,n)}</dt><dd class="definition-desc ml-4">${q(i&&a?se(e.definition,i,`${String(s??"definition")}-desc-${t}`,a):null,n)}</dd></div>`}return`<dl class="definition-list"${j("data-index-key",s,"dl","opaque")}>${S((r=c.map,c),r)?A("f180bzmw",()=>{const e=c;if(0===e.length)return P("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=_(((e,t)=>`${String(s??"definition")}-${t}`)(0,r),()=>l(o,r,t))}return P(n,!0)}):M(S(c,r,(e,t)=>v("div",{key:`${String(s??"definition")}-${t}`,className:"mb-4"},()=>C([v("dt",{className:"definition-term font-semibold"},()=>i&&a?se(e.term,i,`${String(s??"definition")}-term-${t}`,a):null),v("dd",{className:"definition-desc ml-4"},()=>i&&a?se(e.definition,i,`${String(s??"definition")}-desc-${t}`,a):null)]))),t)}</dl>`},Ue=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e;return`<div${j("id",`fnref--${r.id}`,"div","opaque")} class="footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2"><div class="flex-1">${q(o&&i?ae(r.children,o,String(a??`footnote-${r.id}`),i):null,t)}</div></div>`},Je=function(e,t,n){const{node:r}=e,o=`#fnref--${r.id}`;return`<sup${j("id",`fnref-${r.id}`,"sup","opaque")} class="footnote-reference">${(()=>{const e=I({href:o}),n=`查看脚注 ${r.id}`;return`<span${T([[!0,e],[!1,"title",n],[!1,"className","footnote-link cursor-pointer"]],"span","opaque",!1)}>${H([[null!=e&&Object.prototype.propertyIsEnumerable.call(e,"dangerouslySetInnerHTML"),null!=e?e.dangerouslySetInnerHTML:void 0]],()=>`\n [\n ${M(r.id,t)}\n ]\n `,!0,[])??`\n [\n ${M(r.id,t)}\n ]\n `}</span>`})()}</sup>`},Xe=function(e,t,n){const{node:r}=e;return`${(()=>{const e=`#fnref-${r.id}`,t=`返回引用 ${r.id}`;return`<a class="footnote-anchor text-sm hover:underline cursor-pointer"${j("href",e,"a","opaque")}${j("title",t,"a","opaque")}>\n ↩︎\n </a>`})()}`},Ze=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a,isDark:s}=e,c=String(r.kind||"note"),l=r.title&&String(r.title).trim().length?String(r.title):c.charAt(0).toUpperCase()+c.slice(1),d=`admonition-${String(a??c)}`,u=!r.collapsible||(r.open??!0),p={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"};return`${(()=>{const e=a;return`<div${j("class",`admonition admonition-${c}${s?" is-dark":""}`,"div","opaque")}${j("data-index-key",e,"div","opaque")}><div${j("id",d,"div","opaque")} class="admonition-header">${M(p[c]&&v("span",{className:"admonition-icon"},()=>p[c]),t)}<span class="admonition-title">${q(l,t)}</span>${M(r.collapsible&&b(()=>v("span",{className:"admonition-toggle","aria-expanded":u,"aria-controls":`${d}-content`},()=>v("span",{},()=>u?"▼":"▶"))),t)}</div>${M(u&&b(()=>v("div",{id:`${d}-content`,className:"admonition-content","aria-labelledby":d},()=>o&&i?ae(r.children,o,String(a??d),i):null)),t)}</div>`})()}`},Ge=function(e,t,n){const{node:r}=e;return`<span class="checkbox-node"><input type="checkbox" disabled="" class="checkbox-input" readonly=""${O([[!1,"checked",Boolean(r.checked)]])}/></span>`},Ye=function(e,t,n){const{node:r}=e;return`<span class="emoji-node">${q(r.name??r.markup,t)}</span>`},Qe=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<strong class="strong-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"strong")}-strong`,a):null),t)}</strong>`},et=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<em class="emphasis-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"emphasis")}-emphasis`,a):null),t)}</em>`},tt=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<del class="strikethrough-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"strikethrough")}-strikethrough`,a):null),t)}</del>`},nt=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<mark class="highlight-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"highlight")}-highlight`,a):null),t)}</mark>`},rt=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<ins class="insert-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"insert")}-insert`,a):null),t)}</ins>`},ot=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<sub class="subscript-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"subscript")}-subscript`,a):null),t)}</sub>`},it=function(e,t,n){const{node:r,children:o,ctx:i,renderNode:a,indexKey:s}=e;return`<sup class="superscript-node">${q(o??(i&&a?ae(r.children,i,`${String(s??"superscript")}-superscript`,a):null),t)}</sup>`},at=function(e,t,n){return"<br/>"},st=function(e,t,n){return'<hr class="thematic-break-node"/>'},ct=function(e,t,n){const{node:r,children:o}=e;return`<code class="inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full">${q(o??r.code,t)}</code>`},lt=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e,s=void 0!==e.underlineBottom?"number"==typeof e.underlineBottom?`${e.underlineBottom}px`:String(e.underlineBottom):"-3px",c=e.animationOpacity??.35,l=Math.max(.12,Math.min(.5*c,c)),d={"--link-color":e.color??"#0366d6","--underline-height":`${e.underlineHeight??2}px`,"--underline-bottom":s,"--underline-opacity":String(c),"--underline-rest-opacity":String(l),"--underline-duration":`${e.animationDuration??1.6}s`,"--underline-timing":e.animationTiming??"ease-in-out","--underline-iteration":"number"==typeof e.animationIteration?String(e.animationIteration):e.animationIteration??"infinite"},p=u({href:String(r.href??"")}).href,m="string"==typeof r.title&&r.title.trim().length>0?r.title:String(p??""),g=h(p);return r.loading?b(()=>v("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:d},()=>v("span",{className:"link-text-wrapper relative inline-flex"},()=>C([v("span",{className:"leading-[normal] link-text"},()=>b(()=>w(Oe,{node:{type:"text",content:String(r.text??"")},ctx:o,indexKey:`${String(a??"link")}-loading`,typewriter:e.typewriter}))),w("span",{className:"link-loading-indicator","aria-hidden":"true"})])))):`${(()=>{const n=m,s=`Link: ${m}`,c=g?"_blank":void 0,l=g?"noopener noreferrer":void 0,u=d;return`<a class="link-node"${j("href",p||void 0,"a","opaque")}${j("title",n,"a","opaque")}${j("aria-label",s,"a","opaque")}${j("target",c,"a","opaque")}${j("rel",l,"a","opaque")}${E(u)}>${M(o&&i?ae(r.children,o,String(a??"link"),i):b(()=>w(Oe,{node:{type:"text",content:String(r.text??"")},ctx:o,indexKey:`${String(a??"link")}-fallback`,typewriter:e.typewriter})),t)}</a>`})()}`},dt=function(e,t,n){const r=e,o=m(r.node.src)||m(r.fallbackSrc);return o?`${(()=>{const e=o,t=String(r.node.alt??r.node.title??""),n=String(r.node.title??r.node.alt??""),i=!1===r.lazy?"eager":"lazy",a=r.node.alt??"Preview image";return`<img${j("src",e,"img","opaque")}${j("alt",t,"img","opaque")}${j("title",n,"img","opaque")} class="image-node__img is-loaded"${j("loading",i,"img","opaque")} decoding="async" tabindex="0"${j("aria-label",a,"img","opaque")}/>`})()}`:null};function ut({node:e,style:t},n,r){const o=qe(e?.language),i=`language-${o}`,a=o?`Code block: ${o}`:"Code block";return`${(()=>{const r=i,s=!0===e?.loading,c=a,l=o,d=t;return`<pre${j("class",r,"pre","opaque")}${j("aria-busy",s,"pre","opaque")}${j("aria-label",c,"pre","opaque")}${j("data-language",l,"pre","opaque")}${E(d)} tabindex="0"><code translate="no">${q(String(e?.code??""),n)}</code></pre>`})()}`}function pt(e){return Ke("code-block-node",e.node,{showHeader:e.showHeader,fallback:"code-block"})}function mt(e){return Ke("mermaid-block-node",e.node,{showHeader:e.showHeader,fallback:"mermaid"})}function ht(e){return Ke("d2-block-node",e.node,{showHeader:e.showHeader,fallback:"d2"})}function gt(e){return Ke("infographic-block-node",e.node,{showHeader:e.showHeader,fallback:"infographic"})}var ft=function({node:e},t,n){const r=je(String(e.content??""),!0,Boolean(e.loading));return r?`<div class="math-block text-center overflow-x-auto relative min-h-[40px]"><div>${H([[!0,{__html:r}]],()=>"",!1,[])??""}</div></div>`:v("div",{className:"math-block text-center overflow-x-auto relative min-h-[40px]"},()=>v("div",{},()=>String(e.raw??e.content??"")))},yt=function({node:e},t,n){const r="$$"===e.markup,o=je(String(e.content??""),r,Boolean(e.loading));return o?`<span class="math-inline-wrapper"><span class="math-inline">${H([[!0,{__html:o}]],()=>"",!1,[])??""}</span></span>`:v("span",{className:"math-inline-wrapper"},()=>v("span",{className:"math-inline"},()=>String(e.raw??e.content??"")))},kt=function(e,t,n){const{node:r}=e;return`${(()=>{const e=r.id;return`<span class="reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]" role="button" tabindex="0"${j("data-reference-id",e,"span","opaque")}>${q(r.id,t)}</span>`})()}`},xt=function(e,r,o){const i=String(e.node?.tag??"").trim().toLowerCase(),s=l(i),c=Array.isArray(e.node?.children)?e.node.children:[],d=s?e.ctx?.htmlComponents?.[s]:void 0;if(c.length>0&&i&&!t.has(i)&&!a(i,e.ctx?.htmlPolicy??"safe")&&e.ctx&&e.renderNode){const t=ae(c,e.ctx,`${String(e.indexKey??"html-block")}-structured`,e.renderNode);if(d){const r=p(e.node?.attrs??null,e.ctx?.htmlPolicy??"safe",s);return x.createElement(d,n(y(r)),t)}return x.createElement(i,function(e,t="safe",n){const r={...de(ie(p(e??void 0,t,n))||{})},o="string"==typeof r.className?r.className.trim():"";return r.className=o?`html-block-node ${o}`:"html-block-node",r}(e.node?.attrs??null,e.ctx?.htmlPolicy??"safe",i),t)}const u={...e.ctx?.customComponents??R(e.customId),...e.ctx?.htmlComponents??{}},m=ve(String(e.node.content??""),u,e.ctx?.htmlPolicy??"safe",{ctx:e.ctx,keyPrefix:String(e.indexKey??"html-block"),nodeComponents:e.ctx?.streamingComponents,propComponents:e.ctx?.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});return null==m?v($,{},()=>C([String(e.node.content??"")])):`${M(v($,{},()=>C([m])),r)}`},$t=function(e,t,r){const o=e.ctx?.htmlPolicy??"safe",i=String(e.node?.tag??"").trim().toLowerCase(),s=l(i),c=Array.isArray(e.node?.children)?e.node.children:[],d=s?e.ctx?.htmlComponents?.[s]:void 0;if(c.length>0&&i&&"escape"!==o&&!a(i,o)&&e.ctx&&e.renderNode&&d){const t=ae(c,e.ctx,`${String(e.indexKey??"html-inline")}-structured`,e.renderNode),r=p(e.node?.attrs??null,o,s);return x.createElement(d,n(y(r)),t)}const u={...e.ctx?.customComponents??R(e.customId),...e.ctx?.htmlComponents??{}},m=ve(String(e.node.content??""),u,o,{ctx:e.ctx,keyPrefix:String(e.indexKey??"html-inline"),nodeComponents:e.ctx?.streamingComponents,propComponents:e.ctx?.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});return null==m?v($,{},()=>C([String(e.node.content??"")])):`${M(v($,{},()=>C([m])),t)}`},wt=function(e,t,n){const{node:r,ctx:o,renderNode:i,indexKey:a}=e,s=r.attrs?Array.isArray(r.attrs)?ie(r.attrs):r.attrs:void 0;return`${(()=>{const e=`vmr-container vmr-container-${r.name}`,n=I(s);return`<div${T([[!1,"className",e],[!0,n]],"div","opaque",!1)}>${H([[null!=n&&Object.prototype.propertyIsEnumerable.call(n,"dangerouslySetInnerHTML"),null!=n?n.dangerouslySetInnerHTML:void 0]],()=>`${M(o&&i&&Array.isArray(r.children)?r.children.map((e,t)=>v(x.Fragment,{key:`${String(a??"vmr-container")}-${t}`},()=>i(e,`${String(a??"vmr-container")}-${t}`,o))):null,t)}`,!1,[])??`${M(o&&i&&Array.isArray(r.children)?r.children.map((e,t)=>v(x.Fragment,{key:`${String(a??"vmr-container")}-${t}`},()=>i(e,`${String(a??"vmr-container")}-${t}`,o))):null,t)}`}</div>`})()}`};function vt(e){return null}function bt(e){return null}var Nt=function(e,t,n){const{node:r}=e;return`<div class="unknown-node text-sm text-gray-500 italic">\n Unsupported node type:\n ${M(String(r?.type),t)}</div>`};function St(e,t,r){const o=r.customComponents??R(r.customId),i=r.streamingComponents??{},a=r.htmlComponents??{},s=function(e){if("html_block"===e.type||"html_inline"===e.type)return"";const t=l(e.type),n=l(e.tag);return t&&n&&t===n?t:""}(e),c=s?i[s]:null,d=s&&!c?a[s]:null,u="code_block"===e.type?null:o[e.type];if(c)return x.createElement(c,{key:t,node:e,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter,fade:r.fade});if(d)return function(e,t,r,o,i){const a=n(y(p(t.attrs??void 0,o.htmlPolicy??"safe",i))),s=Array.isArray(t.children)?ae(t.children,o,`${String(r)}-html`,St):t.content??null;return x.createElement(e,{...a,key:r},s)}(d,e,t,r,s);if(u)return x.createElement(u,{key:t,node:e,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter,fade:r.fade});if("html_block"===e.type||"html_inline"===e.type){const n=ce(e,{...o,...i},r.customHtmlTags),a=n?.tag??"",s=n?.isWhitelisted??!1,c=n?.component??null;if(s&&c){const n={...e,type:a,tag:a,content:f(e.content,a)};return x.createElement(c,{key:t,node:n,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter,fade:r.fade})}const l=String(e.content??e.raw??"");if(!s&&g(l,a))return"html_inline"===e.type?b(()=>w(Oe,{key:t,node:{type:"text",content:l,raw:l},ctx:r,indexKey:t,typewriter:r.typewriter})):b(()=>w(De,{key:t,node:{type:"paragraph",children:[{type:"text",content:l,raw:l}],raw:l},ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}))}switch(e.type){case"text":return b(()=>w(Oe,{key:t,node:e,ctx:r,indexKey:t,typewriter:r.typewriter}));case"text_special":return b(()=>w(Oe,{key:t,node:{type:"text",content:e.content??"",center:e.center},ctx:r,indexKey:t,typewriter:r.typewriter}));case"paragraph":return b(()=>w(De,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"heading":return b(()=>w(Le,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"blockquote":return b(()=>w(We,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"list":return b(()=>w(ze,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"list_item":return b(()=>w(Ve,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"table":return b(()=>w(Fe,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"definition_list":return b(()=>w(Re,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"footnote":return b(()=>w(Ue,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"footnote_reference":return b(()=>w(Je,{key:t,node:e}));case"footnote_anchor":return b(()=>w(Xe,{key:t,node:e}));case"admonition":return b(()=>w(Ze,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,isDark:r.isDark,typewriter:r.typewriter}));case"hardbreak":return b(()=>w(at,{key:t,node:e,typewriter:r.typewriter}));case"link":return b(()=>w(lt,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,isDark:r.isDark,showTooltip:"boolean"==typeof r.showTooltips?r.showTooltips:void 0,typewriter:r.typewriter}));case"image":return b(()=>w(dt,{key:t,node:e}));case"inline_code":return b(()=>w(ct,{key:t,node:e,ctx:r,indexKey:t,typewriter:r.typewriter}));case"code_block":return He(e,t,r,o);case"strong":return b(()=>v(Qe,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-strong`,St)));case"emphasis":return b(()=>v(et,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-em`,St)));case"strikethrough":return b(()=>v(tt,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-strike`,St)));case"highlight":return b(()=>v(nt,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-highlight`,St)));case"insert":return b(()=>v(rt,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-insert`,St)));case"subscript":return b(()=>v(ot,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-sub`,St)));case"superscript":return b(()=>v(it,{key:t,node:e},()=>ae(e.children,r,`${String(t)}-sup`,St)));case"checkbox":case"checkbox_input":return b(()=>w(Ge,{key:t,node:e,typewriter:r.typewriter}));case"emoji":return b(()=>w(Ye,{key:t,node:e,typewriter:r.typewriter}));case"thematic_break":return b(()=>w(st,{key:t,node:e}));case"math_inline":return b(()=>w(yt,{key:t,node:e}));case"math_block":return b(()=>w(ft,{key:t,node:e}));case"reference":return b(()=>w(kt,{key:t,node:e,ctx:r,typewriter:r.typewriter}));case"html_block":return b(()=>w(xt,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter,fade:r.fade,customId:r.customId}));case"html_inline":return b(()=>w($t,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter,fade:r.fade,customId:r.customId}));case"vmr_container":return b(()=>w(wt,{key:t,node:e,ctx:r,renderNode:St,indexKey:t,typewriter:r.typewriter}));case"label_open":case"label_close":return null;default:return b(()=>w(Nt,{key:t,node:e}))}}var Ct=function(e,t,n){let r;const i=R(e.customId),a=Q(e.streamingComponents),s=Q(e.htmlComponents),l=e.parseOptions??{},u=l.customHtmlTags??[],p=c(e.customHtmlTags,Array.isArray(u)?u:[],Object.keys(a)),m=e.customId?`server-renderer-${e.customId}`:"server-renderer",h=p.length>0?o(m,{customHtmlTags:p}):o(m),g=e.customMarkdownIt?e.customMarkdownIt(h):h,f=e.final??l.final,y=null==f&&0===p.length?l:{...l,...null!=f?{final:f}:{},...p.length>0?{customHtmlTags:p}:{}},k=Array.isArray(e.nodes)&&e.nodes.length?e.nodes.map(e=>({...e})):e.content?d(e.content,g??Me,y):[],x=null!=e.indexKey?String(e.indexKey):"markdown-renderer",$=function(e,t,n,r,o,i,a){return{customId:e.customId,final:a,customComponents:t,customHtmlTags:i,htmlPolicy:e.htmlPolicy??"safe",isDark:e.isDark,indexKey:o,typewriter:e.typewriter,fade:e.fade,showTooltips:e.showTooltips,streamingComponents:n,htmlComponents:r,renderCodeBlocksAsPre:e.renderCodeBlocksAsPre,codeBlockStream:e.codeBlockStream,codeBlockOptions:e.codeBlockOptions,codeBlockProps:{..."boolean"==typeof e.showTooltips?{showTooltips:e.showTooltips}:{},...e.codeBlockProps||{}},mermaidProps:{...e.mermaidProps||{}},d2Props:{...e.d2Props||{}},infographicProps:{...e.infographicProps||{}},codeBlockThemes:{themes:e.themes,darkTheme:e.codeBlockDarkTheme,lightTheme:e.codeBlockLightTheme,minWidth:e.codeBlockMinWidth,maxWidth:e.codeBlockMaxWidth},events:{onCopy:e.onCopy,onHandleArtifactClick:e.onHandleArtifactClick}}}(e,i,a,s,x,p,f);function w(e,t,n,r){return`${(()=>{const r=t,o=e.type;return`<div class="node-slot"${j("data-node-index",r,"div","opaque")}${j("data-node-type",o,"div","opaque")}><div class="node-content">${q(St(e,`${x}-${t}`,$),n)}</div></div>`})()}`}return`${(()=>{const n="markstream-octane markdown-renderer"+(e.isDark?" dark":""),o=e.customId;return`<div${j("class",n,"div","opaque")}${j("data-custom-id",o,"div","opaque")}>${S((r=k.map,k),r)?A("f182gcxa",()=>{const e=k;if(0===e.length)return P("",!1);let n="";for(let r=0;r<e.length;r++){const o=e[r];n+=_(((e,t)=>`${x}-${t}`)(0,r),()=>w(o,r,t))}return P(n,!0)}):M(S(k,r,(e,t)=>v("div",{key:`${x}-${t}`,className:"node-slot","data-node-index":t,"data-node-type":e.type},()=>v("div",{className:"node-content"},()=>St(e,`${x}-${t}`,$)))),t)}</div>`})()}`};export{Ze as AdmonitionNode,We as BlockquoteNode,Ge as CheckboxNode,pt as CodeBlockNode,pt as OctaneCodeBlockNode,ht as D2BlockNode,Re as DefinitionListNode,Ye as EmojiNode,et as EmphasisNode,Nt as FallbackComponent,Xe as FootnoteAnchorNode,Ue as FootnoteNode,Je as FootnoteReferenceNode,at as HardBreakNode,Le as HeadingNode,nt as HighlightNode,xt as HtmlBlockNode,$t as HtmlInlineNode,bt as HtmlPreviewFrame,dt as ImageNode,gt as InfographicBlockNode,ct as InlineCodeNode,rt as InsertNode,lt as LinkNode,Ve as ListItemNode,ze as ListNode,ft as MathBlockNode,yt as MathInlineNode,mt as MermaidBlockNode,Ct as NodeRenderer,Ct as default,De as ParagraphNode,ut as PreCodeNode,kt as ReferenceNode,tt as StrikethroughNode,Qe as StrongNode,ot as SubscriptNode,it as SuperscriptNode,Fe as TableNode,Oe as TextNode,st as ThematicBreakNode,vt as Tooltip,wt as VmrContainerNode,J as clearGlobalCustomComponents,Y as defineHtmlComponents,G as defineStreamingComponents,X as getCustomComponentDisplay,R as getCustomNodeComponents,U as removeCustomComponents,St as renderNode,F as setCustomComponents,Z as withMarkstreamComponentDisplay};