@vite-hub/workspace 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/{abort-BCwpdrN0.js → abort-CQGxJBqa.js} +1 -2
  2. package/dist/{asset-registry-DfBV5kmw.js → asset-registry-0CdRAjIV.js} +2 -3
  3. package/dist/blob-database/postgres.d.ts +2 -3
  4. package/dist/blob-database/postgres.js +1 -2
  5. package/dist/{blob-database-sources-DDZ1wV9w.js → blob-database-sources-CQPAyCz3.js} +1 -2
  6. package/dist/blob-database.d.ts +2 -8
  7. package/dist/blob-database.js +12 -15
  8. package/dist/checkout.d.ts +1 -2
  9. package/dist/checkout.js +3 -4
  10. package/dist/cloudflare.d.ts +1 -5
  11. package/dist/cloudflare.js +1 -2
  12. package/dist/{config-B-863EgC.js → config-CsgNNVAI.js} +1 -2
  13. package/dist/{config-hxABr_Gg.d.ts → config-DeA287c0.d.ts} +1 -5
  14. package/dist/{config-DiyPi3Ff.js → config-jo5QgE1w.js} +18 -27
  15. package/dist/{discard-CNNtCozM.js → discard-BkoLmmmN.js} +1 -2
  16. package/dist/durability.d.ts +2 -5
  17. package/dist/durability.js +4 -5
  18. package/dist/{error-diagnostics-Cth97txN.js → error-diagnostics-B4me-ouV.js} +1 -2
  19. package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
  20. package/dist/{errors-DXCZjdUU.d.ts → errors-CnFDXxeJ.d.ts} +0 -2
  21. package/dist/{file-C1DYoGz3.js → file-BrNAXQgY.js} +4 -8
  22. package/dist/{file-metadata-Dv2JZwal.js → file-metadata-Bpsvjw_X.js} +2 -3
  23. package/dist/{files-iHyik8jj.js → files--z2dLC5z.js} +3 -4
  24. package/dist/files.d.ts +6 -10
  25. package/dist/files.js +6 -6
  26. package/dist/{github-CFHl6RI0.js → github-k--_LCrX.js} +7 -9
  27. package/dist/{glob-BitxqDhb.js → glob-BEutagp1.js} +3 -4
  28. package/dist/{glob-Buxfvmyy.js → glob-BreFjNAV.js} +3 -4
  29. package/dist/{history-schema-BBWbpDk4.d.ts → history-schema-BR4UDPHL.d.ts} +0 -2
  30. package/dist/{history-schema-postgres-U_ueRvmO.js → history-schema-postgres-DZepCSBq.js} +0 -1
  31. package/dist/{host-Dmr2Ctem.js → host-C8yZizfk.js} +11 -14
  32. package/dist/{hosted-BktlvkF2.js → hosted-8BTKAtMX.js} +15 -18
  33. package/dist/{hosted-vercel-blob-D0IPAjb1.js → hosted-vercel-blob-B6kygYqn.js} +10 -12
  34. package/dist/hosted-vercel-blob.d.ts +1 -3
  35. package/dist/hosted-vercel-blob.js +1 -2
  36. package/dist/hosted.d.ts +1 -3
  37. package/dist/hosted.js +1 -2
  38. package/dist/index.d.ts +7 -25
  39. package/dist/index.js +18 -22
  40. package/dist/internal/path.d.ts +1 -1
  41. package/dist/internal/path.js +1 -2
  42. package/dist/internal/workspace.d.ts +1 -5
  43. package/dist/internal/workspace.js +2 -3
  44. package/dist/{lifecycle-D6WN2dd_.js → lifecycle-IReZfi0b.js} +9 -10
  45. package/dist/lineage.d.ts +1 -3
  46. package/dist/lineage.js +1 -2
  47. package/dist/loader.d.ts +1 -7
  48. package/dist/loader.js +4 -6
  49. package/dist/{mcp-resources-TtxLNSL6.js → mcp-resources-DeJnbOaw.js} +4 -5
  50. package/dist/{memory-DjzwSng2.js → memory-BlSRrBH1.js} +7 -9
  51. package/dist/{metadata-target-CR0aDtvS.js → metadata-target-CaGLY4ay.js} +15 -23
  52. package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
  53. package/dist/{operation-definition-CI2PJGqu.d.ts → operation-definition-CqZkx1Rm.d.ts} +0 -4
  54. package/dist/{operations-dtcU5LkD.js → operations-CtRDU3cA.js} +14 -24
  55. package/dist/{operations-Cib30_dt.js → operations-DfbqHWAe.js} +7 -8
  56. package/dist/operations.d.ts +2 -6
  57. package/dist/operations.js +2 -2
  58. package/dist/{path-BlIBpI7U.js → path-Bb9OIc_F.js} +2 -3
  59. package/dist/{path-zHxQUbqa.d.ts → path-C0uZxDdW.d.ts} +0 -2
  60. package/dist/{path-DrSIenjj.js → path-CuYE8-X6.js} +2 -4
  61. package/dist/{plugins-DKCBrH31.d.ts → plugins-CLc32jvL.d.ts} +1 -3
  62. package/dist/{provider-Fc3M6bEx.js → provider-CN14ewvx.js} +15 -20
  63. package/dist/providers/github/store.d.ts +2 -4
  64. package/dist/providers/github/store.js +1 -2
  65. package/dist/{registry-DpB5PBA4.d.ts → registry-B0g19sdy.d.ts} +1 -5
  66. package/dist/{registry-CedQvQxW.js → registry-BbUg9vJB.js} +4 -5
  67. package/dist/{registry-CLL0TY0L.d.ts → registry-s2Ob9PeX.d.ts} +2 -4
  68. package/dist/{request-scope-Bcv2kD8h.js → request-scope-CXCI_wCb.js} +2 -3
  69. package/dist/{results-DgkZUmTL.js → results-z-HpV9EP.js} +1 -2
  70. package/dist/{rolldown-runtime-rQ84J-ij.js → rolldown-runtime-DnNXxpGL.js} +2 -3
  71. package/dist/{rule-keys-Bsz6jTTF.js → rule-keys-BLEbi1h5.js} +2 -3
  72. package/dist/{rules-OHaPFopX.js → rules-BPDXypZV.js} +6 -8
  73. package/dist/runtime/assets.d.ts +2 -3
  74. package/dist/runtime/assets.js +5 -6
  75. package/dist/runtime/empty-assets-registry.d.ts +1 -3
  76. package/dist/runtime/empty-assets-registry.js +1 -2
  77. package/dist/runtime/empty-registry.d.ts +2 -4
  78. package/dist/runtime/empty-registry.js +1 -2
  79. package/dist/runtime/registry.d.ts +1 -1
  80. package/dist/runtime/registry.js +2 -3
  81. package/dist/runtime/request.d.ts +1 -3
  82. package/dist/runtime/request.js +2 -3
  83. package/dist/runtime/state.d.ts +5 -5
  84. package/dist/runtime/state.js +9 -10
  85. package/dist/runtime/workspace.d.ts +1 -1
  86. package/dist/runtime/workspace.js +1 -2
  87. package/dist/runtime.d.ts +8 -24
  88. package/dist/runtime.js +21 -24
  89. package/dist/{search-BqNV9LnO.js → search-C_nVorq7.js} +3 -4
  90. package/dist/{server-CFtrOPk6.js → server-aa1a4rkV.js} +8 -10
  91. package/dist/server.d.ts +3 -4
  92. package/dist/server.js +1 -2
  93. package/dist/{shared-BgDjxY3J.js → shared-C20Wh1mp.js} +12 -19
  94. package/dist/source-metadata.d.ts +2 -6
  95. package/dist/source-metadata.js +4 -5
  96. package/dist/{state-DBV6VHS6.d.ts → state-BdDfBtOR.d.ts} +5 -15
  97. package/dist/{store-BRMdD8Ft.js → store-cx3OqNTi.js} +11 -14
  98. package/dist/{sync-BezGVzrW.js → sync-BBfR4g5y.js} +6 -7
  99. package/dist/test.d.ts +1 -1
  100. package/dist/test.js +1 -2
  101. package/dist/{types-9DMtFjaa.d.ts → types-Bel5IDmF.d.ts} +0 -2
  102. package/dist/{use-Dv973swc.d.ts → use-CpphIBof.d.ts} +1 -5
  103. package/dist/{use-Dm2tbI5F.js → use-D0DyTMxM.js} +12 -14
  104. package/dist/{use-tools-CMUthOdy.d.ts → use-tools-CAK10LTc.d.ts} +2 -4
  105. package/dist/{use-tools-C1qvhzme.js → use-tools-CHduR5k6.js} +7 -10
  106. package/dist/{utils-C0Au2R16.js → utils-DXP9xfXo.js} +7 -9
  107. package/dist/vite.d.ts +2 -20
  108. package/dist/vite.js +559 -399
  109. package/dist/{vitehub-grants-C8IAl5-M.js → vitehub-grants-Co713QTg.js} +2 -4
  110. package/dist/{workspace-Cw4ycIW-.d.ts → workspace-BOuxrZrP.d.ts} +1 -3
  111. package/dist/{workspace-CFrwWhEm.js → workspace-CLuPkyZR.js} +26 -35
  112. package/package.json +24 -24
package/dist/vite.js CHANGED
@@ -1,18 +1,18 @@
1
- import { n as __exportAll$1, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-rQ84J-ij.js";
2
- import { t as createMemoryWorkspaceStore } from "./memory-DjzwSng2.js";
3
- import { t as normalizeSafeWorkspacePath } from "./path-DrSIenjj.js";
4
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Cth97txN.js";
1
+ import { n as __exportAll$1, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DnNXxpGL.js";
2
+ import { S as resolve$1, _ as redactInspectionText, a as createNoExternalAddition, b as isAbsolute$1, c as isProductionBuild, d as resolveViteHubProjectRoot, f as shouldSkipViteProviderBuild, g as requireViteHubDevServerUrl, h as readViteHubDevTargetOption, i as createNativePackageLoading, l as isServerEnvironment, m as fetchViteHubDevEndpoint, n as callOperationFromCli, o as createViteHubEnvImportAliases, p as discoverViteHubDevServer, s as generatedViteHubWatchIgnoredAddition, t as workspaceOperations, u as publishViteHubDevServer, v as relativeDefinitionFile, x as relative$1, y as dirname$1 } from "./operations-CtRDU3cA.js";
3
+ import { t as internalErrorDiagnostics } from "./error-diagnostics-kKXseq8d.js";
4
+ import { n as isRecordOrFunction, t as isRecord$1 } from "./object-CAK6UYR5.js";
5
+ import { a as refreshWorkspaceDevToken, c as workspaceDevHeader, d as workspaceDevTokenHeader, f as workspaceDevTokenServerId, n as ensureWorkspaceDevToken, o as runWorkspaceDevCommand, p as isViteHubSecretEqual, r as readWorkspaceDevToken, s as validateWorkspaceDevToken, u as workspaceDevRoute } from "./server-aa1a4rkV.js";
6
+ import { n as syncWorkspaceDefinition } from "./lifecycle-IReZfi0b.js";
7
+ import { a as normalizeWorkspaceSources, n as createSourceContext } from "./config-jo5QgE1w.js";
8
+ import { t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
9
+ import { t as createMemoryWorkspaceStore } from "./memory-BlSRrBH1.js";
10
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
5
11
  import { assertNoSymlinks, checkoutFailure, conflictMarkerPatterns, folderOf, formatWorkspaceStatus, ignoredName, localCheckoutStatus, pullWorkspaces, pushWorkspaces, resolveWorkspaceConflicts, workspaceLockFile, workspaceStatus } from "./checkout.js";
6
- import { n as isRecordOrFunction, t as isRecord$1 } from "./object-Da1zyPCR.js";
7
- import { t as internalErrorDiagnostics } from "./error-diagnostics-C0KyI408.js";
8
- import { n as isWorkspaceStore, r as normalizeWorkspaceStoreOptions } from "./provider-Fc3M6bEx.js";
9
- import { i as installHostedWorkspaceRuntime } from "./hosted-BktlvkF2.js";
10
- import { a as normalizeWorkspaceSources, n as createSourceContext } from "./config-DiyPi3Ff.js";
11
- import { c as workspaceRegistryLoadError, n as normalizeWorkspaceDefinition } from "./registry-CedQvQxW.js";
12
- import { n as installHostedVercelBlobWorkspaceRuntime } from "./hosted-vercel-blob-D0IPAjb1.js";
13
- import { S as resolve$1, _ as redactInspectionText, a as createNoExternalAddition, b as isAbsolute$1, c as isProductionBuild, d as resolveViteHubProjectRoot, f as shouldSkipViteProviderBuild, g as requireViteHubDevServerUrl, h as readViteHubDevTargetOption, i as createNativePackageLoading, l as isServerEnvironment, m as fetchViteHubDevEndpoint, n as callOperationFromCli, o as createViteHubEnvImportAliases, p as discoverViteHubDevServer, s as generatedViteHubWatchIgnoredAddition, t as workspaceOperations, u as publishViteHubDevServer, v as relativeDefinitionFile, x as relative$1, y as dirname$1 } from "./operations-dtcU5LkD.js";
14
- import { a as refreshWorkspaceDevToken, c as workspaceDevHeader, d as workspaceDevTokenHeader, f as workspaceDevTokenServerId, n as ensureWorkspaceDevToken, o as runWorkspaceDevCommand, p as isViteHubSecretEqual, r as readWorkspaceDevToken, s as validateWorkspaceDevToken, u as workspaceDevRoute } from "./server-CFtrOPk6.js";
15
- import { n as syncWorkspaceDefinition } from "./lifecycle-D6WN2dd_.js";
12
+ import { n as isWorkspaceStore, r as normalizeWorkspaceStoreOptions } from "./provider-CN14ewvx.js";
13
+ import { c as workspaceRegistryLoadError, n as normalizeWorkspaceDefinition } from "./registry-BbUg9vJB.js";
14
+ import { i as installHostedWorkspaceRuntime } from "./hosted-8BTKAtMX.js";
15
+ import { n as installHostedVercelBlobWorkspaceRuntime } from "./hosted-vercel-blob-B6kygYqn.js";
16
16
  import { createRequire, isBuiltin } from "node:module";
17
17
  import { formatRuntimeDiagnosticError } from "@vite-hub/runtime";
18
18
  import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -27,7 +27,7 @@ import { promisify } from "node:util";
27
27
  import { resolveModulePath } from "exsolve";
28
28
  import { createJiti } from "jiti";
29
29
  import { execFile } from "node:child_process";
30
- //#region src/config.ts
30
+ // src/config.ts
31
31
  const workspaceConfigKeys = /* @__PURE__ */ new Set([
32
32
  "assets",
33
33
  "projectRoot",
@@ -48,8 +48,7 @@ function normalizeWorkspaceOptions(options, input = {}) {
48
48
  store: normalizeWorkspaceStoreOptions(resolvedOptions.store, input) || { driver: "local" }
49
49
  };
50
50
  }
51
- //#endregion
52
- //#region ../internal/src/invariant.ts
51
+ // ../internal/src/invariant.ts
53
52
  const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
54
53
  docsBase: "https://vitehub.dev/docs/development/diagnostics",
55
54
  codes: { INTERNAL_INVARIANT_FAILED: {
@@ -68,8 +67,7 @@ function invariantError(what) {
68
67
  function invariant(condition, what) {
69
68
  if (!condition) throw invariantError(what);
70
69
  }
71
- //#endregion
72
- //#region ../internal/src/build/client-output.ts
70
+ // ../internal/src/build/client-output.ts
73
71
  function hasStaticIndex(clientDir) {
74
72
  return existsSync(resolve$1(clientDir, "index.html"));
75
73
  }
@@ -106,8 +104,7 @@ async function copyClientOutput(clientDir, targetDir, excludedDirs = []) {
106
104
  filter
107
105
  });
108
106
  }
109
- //#endregion
110
- //#region ../internal/src/build/provider-output-config.ts
107
+ // ../internal/src/build/provider-output-config.ts
111
108
  function isProviderJsonArray(value, ancestors) {
112
109
  if (Object.getPrototypeOf(value) !== Array.prototype || ancestors.has(value)) return false;
113
110
  if (Reflect.ownKeys(value).length !== value.length + 1) return false;
@@ -245,13 +242,11 @@ async function cleanProviderOutputConfig(file, ownership) {
245
242
  if (!changed) return;
246
243
  await persistProviderJsonRecord(file, next, true);
247
244
  }
248
- //#endregion
249
- //#region ../internal/src/build/user-entry.ts
245
+ // ../internal/src/build/user-entry.ts
250
246
  function toSafeAppName(rootDir) {
251
247
  return basename(rootDir).replace(/[^a-z0-9-]+/gi, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").toLowerCase();
252
248
  }
253
- //#endregion
254
- //#region ../internal/src/build/cloudflare.ts
249
+ // ../internal/src/build/cloudflare.ts
255
250
  function createDefaultCloudflareOutputRoot(rootDir) {
256
251
  return resolve(rootDir, "dist", toSafeAppName(rootDir));
257
252
  }
@@ -268,8 +263,7 @@ async function writeCloudflareWranglerConfig(options) {
268
263
  removeIfEmpty: true
269
264
  });
270
265
  }
271
- //#endregion
272
- //#region ../internal/src/build/bundle-options.ts
266
+ // ../internal/src/build/bundle-options.ts
273
267
  const encodedAliasPrefixMarker = "\0vitehub-prefix:";
274
268
  const encodedAliasExactMarker = "\0vitehub-exact:";
275
269
  /** Select the runtime constants from one resolved Vite configuration. */
@@ -281,8 +275,7 @@ function resolveViteHubBundleDefines(config) {
281
275
  }
282
276
  return defines;
283
277
  }
284
- //#endregion
285
- //#region ../internal/src/build/ast-walk.ts
278
+ // ../internal/src/build/ast-walk.ts
286
279
  /** The oxc parser grammar for a file, from its extension. Defaults to TypeScript. */
287
280
  function moduleLanguage(file) {
288
281
  if (/\.(?:c|m)?tsx$/i.test(file)) return "tsx";
@@ -305,8 +298,7 @@ function walk(node, visit, parent) {
305
298
  } else if (isNode(child)) walk(child, visit, node);
306
299
  }
307
300
  }
308
- //#endregion
309
- //#region ../internal/src/build/rolldown.ts
301
+ // ../internal/src/build/rolldown.ts
310
302
  const viteRawPrefix = "\0vitehub-vite-raw:";
311
303
  const markdownTemplatePrefix = "\0vitehub-markdown-template:";
312
304
  const markdownTemplateFileSuffix = ".template.md";
@@ -903,8 +895,7 @@ async function bundleEsmEntry(entryFile, outfile, options = {}) {
903
895
  await writeFile(outfile, chunk.code, { signal: options.signal });
904
896
  options.signal?.throwIfAborted();
905
897
  }
906
- //#endregion
907
- //#region ../internal/src/build/paths.ts
898
+ // ../internal/src/build/paths.ts
908
899
  function resolveRuntimeModule(packageDir, modulePath) {
909
900
  const distFile = resolve$1(packageDir, "dist", `${modulePath}.js`);
910
901
  return existsSync(distFile) ? distFile : resolve$1(packageDir, "src", `${modulePath}.ts`);
@@ -944,8 +935,7 @@ function realpathIfExists(path) {
944
935
  return resolve$1(path);
945
936
  }
946
937
  }
947
- //#endregion
948
- //#region ../internal/src/build/runtime-package-files.ts
938
+ // ../internal/src/build/runtime-package-files.ts
949
939
  const alwaysPublishedFile = /^(?:package\.json|(?:readme|copying|licen[cs]e)(?:\..*[^~$])?)$/i;
950
940
  const rootExcluded = /* @__PURE__ */ new Set([
951
941
  "package-lock.json",
@@ -1104,8 +1094,7 @@ async function copyRuntimePackageFiles(packageDir, targetDir) {
1104
1094
  await unlessGone(() => copyFile(join(packageDir, path), target));
1105
1095
  }
1106
1096
  }
1107
- //#endregion
1108
- //#region ../internal/src/build/provider-output-sources.ts
1097
+ // ../internal/src/build/provider-output-sources.ts
1109
1098
  /** Removes retained provider output after readers release it, tolerating transient filesystem contention. */
1110
1099
  async function removeProviderOutputArtifactDir(path) {
1111
1100
  await rm(path, {
@@ -1115,8 +1104,7 @@ async function removeProviderOutputArtifactDir(path) {
1115
1104
  retryDelay: 50
1116
1105
  });
1117
1106
  }
1118
- //#endregion
1119
- //#region ../internal/src/build/vercel-config.ts
1107
+ // ../internal/src/build/vercel-config.ts
1120
1108
  function createDefaultVercelOutputRoot(rootDir) {
1121
1109
  return resolve(rootDir, ".vercel", "output");
1122
1110
  }
@@ -1139,8 +1127,7 @@ function createNodeFunctionConfig(extra = {}) {
1139
1127
  ...extra
1140
1128
  };
1141
1129
  }
1142
- //#endregion
1143
- //#region ../internal/src/build/runtime-package-resolution.ts
1130
+ // ../internal/src/build/runtime-package-resolution.ts
1144
1131
  /** Locates package metadata through exports, an entry's ancestors, or the project's dependency roots. */
1145
1132
  function createRuntimePackageResolver(readPackageName) {
1146
1133
  return async (name, resolver, fromDir) => {
@@ -1181,8 +1168,7 @@ function isPackageResolutionMiss(error) {
1181
1168
  const code = error?.code;
1182
1169
  return code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED";
1183
1170
  }
1184
- //#endregion
1185
- //#region ../internal/src/build/runtime-package-directory.ts
1171
+ // ../internal/src/build/runtime-package-directory.ts
1186
1172
  /** Update a staged copy, then publish it with rollback on failure or cancellation. */
1187
1173
  async function updateRuntimePackageDirectory(options) {
1188
1174
  const stagingRoot = await mkdtemp(join(dirname(options.directory), ".vitehub-runtime-packages-"));
@@ -1229,8 +1215,7 @@ async function updateRuntimePackageDirectory(options) {
1229
1215
  });
1230
1216
  }
1231
1217
  }
1232
- //#endregion
1233
- //#region ../internal/src/build/vercel-runtime-packages.ts
1218
+ // ../internal/src/build/vercel-runtime-packages.ts
1234
1219
  const runtimeExportConditions = /* @__PURE__ */ new Set([
1235
1220
  "default",
1236
1221
  "import",
@@ -1444,8 +1429,7 @@ function parsePackageJson(value, path) {
1444
1429
  if (typeof value !== "object" || value === null || Array.isArray(value)) throw internalErrorDiagnostics.INTERNAL_B0047({ message: `Expected ${path} to contain a JSON object.` });
1445
1430
  return value;
1446
1431
  }
1447
- //#endregion
1448
- //#region ../internal/src/build/provider-output-catalog.ts
1432
+ // ../internal/src/build/provider-output-catalog.ts
1449
1433
  var ProviderOutputCatalog = class {
1450
1434
  bundleDefines = {};
1451
1435
  #appliedCloudflareContributions = /* @__PURE__ */ new Map();
@@ -1673,8 +1657,7 @@ function useProviderOutputCatalog(config) {
1673
1657
  providerOutputCatalogs.set(config, catalog);
1674
1658
  return catalog;
1675
1659
  }
1676
- //#endregion
1677
- //#region ../internal/src/build/deployment-output.ts
1660
+ // ../internal/src/build/deployment-output.ts
1678
1661
  const providerDeploymentOutputRegistry = globalThis;
1679
1662
  const providerDeploymentOutputWrites = providerDeploymentOutputRegistry.__vitehubProviderDeploymentOutputWrites ??= /* @__PURE__ */ new Map();
1680
1663
  const providerDeploymentOutputFinalizations = providerDeploymentOutputRegistry.__vitehubProviderDeploymentOutputFinalizations ??= /* @__PURE__ */ new WeakMap();
@@ -2686,8 +2669,7 @@ async function finalizeProviderDeploymentOutputs(catalog, options = {}) {
2686
2669
  if (providerDeploymentOutputFinalizations.get(catalog) === active) providerDeploymentOutputFinalizations.delete(catalog);
2687
2670
  }
2688
2671
  }
2689
- //#endregion
2690
- //#region ../internal/src/definition-catalog.ts
2672
+ // ../internal/src/definition-catalog.ts
2691
2673
  const sourceFilePattern = /\.(?:c|m)?[jt]sx?$/i;
2692
2674
  const declarationFilePattern = /\.d\.(?:c|m)?[jt]sx?$/i;
2693
2675
  const testFilePattern = /\.(?:test|spec)\.(?:c|m)?[jt]sx?$/i;
@@ -2834,8 +2816,7 @@ async function writeFileIfChanged(file, contents) {
2834
2816
  await mkdir(resolve$1(file, ".."), { recursive: true });
2835
2817
  await writeFile(file, contents, "utf8");
2836
2818
  }
2837
- //#endregion
2838
- //#region ../internal/src/dev-endpoint.ts
2819
+ // ../internal/src/dev-endpoint.ts
2839
2820
  function firstHeader(value) {
2840
2821
  return Array.isArray(value) ? value[0] : value;
2841
2822
  }
@@ -3074,8 +3055,7 @@ function hostFromNitroPreset(value) {
3074
3055
  if (normalized === "node" || normalized.startsWith("node-")) return "node";
3075
3056
  if (normalized.startsWith("vercel")) return "vercel";
3076
3057
  }
3077
- //#endregion
3078
- //#region ../internal/src/hosting.ts
3058
+ // ../internal/src/hosting.ts
3079
3059
  /**
3080
3060
  * Returns the Nitro preset name that this build targets, as the developer wrote it.
3081
3061
  * The order is `nitro.preset`, `hosting`, `NITRO_PRESET`, `SERVER_PRESET`, then `VITEHUB_HOST`.
@@ -3097,8 +3077,7 @@ function getHostingProvider(hosting) {
3097
3077
  const host = hostFromNitroPreset(hosting);
3098
3078
  if (host === "cloudflare" || host === "netlify" || host === "vercel") return host;
3099
3079
  }
3100
- //#endregion
3101
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/utils/helpers.js
3080
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/utils/helpers.js
3102
3081
  function dedupePlugins(defaultPlugins, userPlugins) {
3103
3082
  const plugins = /* @__PURE__ */ new Map();
3104
3083
  for (const plugin of defaultPlugins) plugins.set(plugin.name, plugin);
@@ -3114,8 +3093,7 @@ function dedupePlugins(defaultPlugins, userPlugins) {
3114
3093
  function defineComarkPlugin(fn) {
3115
3094
  return fn;
3116
3095
  }
3117
- //#endregion
3118
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/syntax/brackets.js
3096
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/syntax/brackets.js
3119
3097
  function findClosingBracket(str, openIndex) {
3120
3098
  if (str[openIndex] !== "[") return -1;
3121
3099
  let index = openIndex + 1;
@@ -3142,8 +3120,7 @@ function parseBracketContent(str, startIndex) {
3142
3120
  endIndex: close + 1
3143
3121
  };
3144
3122
  }
3145
- //#endregion
3146
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/sanitize.js
3123
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/sanitize.js
3147
3124
  const unsafeProtocols = ["javascript:", "vbscript:"];
3148
3125
  function isUnsafeProtocol(url, allowDataImage) {
3149
3126
  if (unsafeProtocols.includes(url.protocol)) return true;
@@ -3202,7 +3179,8 @@ const URL_PROPS = /* @__PURE__ */ new Set([
3202
3179
  "poster",
3203
3180
  "cite",
3204
3181
  "background",
3205
- "ping"
3182
+ "ping",
3183
+ "longdesc"
3206
3184
  ]);
3207
3185
  const URL_PROP_SUFFIX = /(?:href|src|url|uri|link)s?$/;
3208
3186
  function isUrlProp(name) {
@@ -3214,13 +3192,74 @@ function normalizePropName(attribute) {
3214
3192
  function isUrlPropKey(key) {
3215
3193
  return isUrlProp(normalizePropName(key));
3216
3194
  }
3217
- //#endregion
3218
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/html-attributes.js
3219
- const HTML_SINK_PROPS = /* @__PURE__ */ new Set([
3195
+ const tagSelectors = ["as", "is"];
3196
+ const componentOptionKeys = /* @__PURE__ */ new Set([
3197
+ "template",
3198
+ "render",
3199
+ "ssrrender",
3200
+ "setup",
3201
+ "extends",
3202
+ "mixins",
3203
+ "__v_isvnode",
3204
+ "__isteleport",
3205
+ "__issuspense",
3206
+ "__iskeepalive"
3207
+ ]);
3208
+ const htmlSinkProps = /* @__PURE__ */ new Set([
3220
3209
  "innerhtml",
3221
3210
  "dangerouslysetinnerhtml",
3222
3211
  "textcontent"
3223
3212
  ]);
3213
+ function isHtmlSinkKey(key) {
3214
+ return htmlSinkProps.has(key.replace(/^[.^]/, "").toLowerCase());
3215
+ }
3216
+ function isVNodeMarkerKey(key) {
3217
+ return key.replace(/^(?::|v-bind:)/, "").toLowerCase() === "__v_isvnode";
3218
+ }
3219
+ function isUnsafeRendererProp(attribute, value) {
3220
+ return isComponentSelectorViolation(attribute, value) || hasUnsafeObjectKeys(value);
3221
+ }
3222
+ function isComponentSelectorViolation(attribute, value) {
3223
+ const name = normalizePropName(attribute);
3224
+ if (tagSelectors.includes(name)) return value != null && typeof value !== "string";
3225
+ if (name !== "tag") return false;
3226
+ return typeof value === "function" || typeof value === "object" && value !== null && !Array.isArray(value);
3227
+ }
3228
+ function ownsComponentOptions(value) {
3229
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
3230
+ for (const key of Object.keys(value)) if (componentOptionKeys.has(key.toLowerCase())) return true;
3231
+ return false;
3232
+ }
3233
+ function ownsHtmlSink(value) {
3234
+ if (Array.isArray(value)) return false;
3235
+ for (const key of Object.keys(value)) if (isHtmlSinkKey(key)) return true;
3236
+ return false;
3237
+ }
3238
+ const unsafeObjectKeysCache = /* @__PURE__ */ new WeakMap();
3239
+ function hasUnsafeObjectKeys(value) {
3240
+ if (typeof value !== "object" || value === null) return false;
3241
+ const cached = unsafeObjectKeysCache.get(value);
3242
+ if (cached !== void 0) return cached;
3243
+ const seen = /* @__PURE__ */ new Set();
3244
+ const pending = [value];
3245
+ let found = false;
3246
+ while (pending.length && !found) {
3247
+ const current = pending.pop();
3248
+ if (typeof current !== "object" || current === null || seen.has(current)) continue;
3249
+ const known = unsafeObjectKeysCache.get(current);
3250
+ if (known !== void 0) {
3251
+ found = known;
3252
+ continue;
3253
+ }
3254
+ seen.add(current);
3255
+ if (ownsComponentOptions(current) || ownsHtmlSink(current)) found = true;
3256
+ else for (const item of Object.values(current)) pending.push(item);
3257
+ }
3258
+ unsafeObjectKeysCache.set(value, found);
3259
+ if (!found) for (const object of seen) unsafeObjectKeysCache.set(object, false);
3260
+ return found;
3261
+ }
3262
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/html-attributes.js
3224
3263
  function resolveAttributes(attrs, renderData, options = {}) {
3225
3264
  const result = {};
3226
3265
  for (const key in attrs) {
@@ -3228,8 +3267,7 @@ function resolveAttributes(attrs, renderData, options = {}) {
3228
3267
  const value = attrs[key];
3229
3268
  const isBinding = key.charCodeAt(0) === 58;
3230
3269
  const outKey = isBinding ? key.slice(1) : key;
3231
- const lowerOutKey = outKey.replace(/^[.^]/, "").toLowerCase();
3232
- if (HTML_SINK_PROPS.has(lowerOutKey)) continue;
3270
+ if (isHtmlSinkKey(outKey) || isVNodeMarkerKey(outKey)) continue;
3233
3271
  let outValue;
3234
3272
  let resultKey = key;
3235
3273
  if (options.parseJson && isBinding) {
@@ -3247,6 +3285,7 @@ function resolveAttributes(attrs, renderData, options = {}) {
3247
3285
  resultKey = outKey;
3248
3286
  } else outValue = value;
3249
3287
  } else outValue = value;
3288
+ if (options.parseJson && isUnsafeRendererProp(outKey, outValue)) continue;
3250
3289
  if (isBinding && isUrlPropKey(outKey) && typeof outValue === "string" && isUnsafeUrlValue(outValue)) continue;
3251
3290
  result[resultKey] = outValue;
3252
3291
  }
@@ -3284,8 +3323,7 @@ function htmlAttributes(attributes, { verbatim = false } = {}) {
3284
3323
  }
3285
3324
  return parts.join(" ");
3286
3325
  }
3287
- //#endregion
3288
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/transform-node.js
3326
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/transform-node.js
3289
3327
  function applyNodeTransforms(transforms, node, props, renderData, parent) {
3290
3328
  if (!transforms) return void 0;
3291
3329
  const list = typeof transforms === "function" ? [transforms] : transforms;
@@ -3311,8 +3349,7 @@ function applyNodeTransforms(transforms, node, props, renderData, parent) {
3311
3349
  props: nextProps
3312
3350
  };
3313
3351
  }
3314
- //#endregion
3315
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/utils/index.js
3352
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/utils/index.js
3316
3353
  function textContent(node, options) {
3317
3354
  return collectText(node, options?.decodeHTML);
3318
3355
  }
@@ -3478,8 +3515,7 @@ function get(data, key) {
3478
3515
  else return;
3479
3516
  return value;
3480
3517
  }
3481
- //#endregion
3482
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/syntax/props.js
3518
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/syntax/props.js
3483
3519
  const bracketPairs = {
3484
3520
  "[": "]",
3485
3521
  "{": "}",
@@ -3573,8 +3609,7 @@ function searchProps(content, index = 0) {
3573
3609
  index
3574
3610
  };
3575
3611
  }
3576
- //#endregion
3577
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/syntax/block-params.js
3612
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/syntax/block-params.js
3578
3613
  const RE_BLOCK_NAME = /^[a-z$][$\w.-]*/i;
3579
3614
  function parseBlockParams(str) {
3580
3615
  str = str.trim();
@@ -3606,8 +3641,7 @@ function parseBlockParams(str) {
3606
3641
  if (unparsedRemaining) result.remaining = unparsedRemaining;
3607
3642
  return result;
3608
3643
  }
3609
- //#endregion
3610
- //#region ../../node_modules/.pnpm/js-yaml@5.5.0/node_modules/js-yaml/dist/js-yaml.mjs
3644
+ // ../../node_modules/.pnpm/js-yaml@5.5.0/node_modules/js-yaml/dist/js-yaml.mjs
3611
3645
  /*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */
3612
3646
  /**
3613
3647
  * Returned by a scalar resolver when the source does not match its tag.
@@ -6939,8 +6973,7 @@ COLLECTION_STYLE.FLOW;
6939
6973
  CHOMPING_MODE.CLIP;
6940
6974
  CHOMPING_MODE.STRIP;
6941
6975
  CHOMPING_MODE.KEEP;
6942
- //#endregion
6943
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/yaml.js
6976
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/yaml.js
6944
6977
  function parseYaml(content) {
6945
6978
  const documents = loadAll(content, { schema: JSON_SCHEMA });
6946
6979
  if (documents.length > 1) throw new YAMLException("expected a single document in the stream, but found more");
@@ -6968,8 +7001,7 @@ function stringifyYaml(data, options) {
6968
7001
  }
6969
7002
  return lines.join("\n");
6970
7003
  }
6971
- //#endregion
6972
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/indent.js
7004
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/indent.js
6973
7005
  function dedentLine(state, line, columns) {
6974
7006
  const lineStart = state.bMarks[line];
6975
7007
  const max = state.eMarks[line];
@@ -7024,8 +7056,7 @@ function restoreLines(state, from, bMarks, bsCount, sCount, tShift) {
7024
7056
  state.tShift[line] = tShift[i];
7025
7057
  }
7026
7058
  }
7027
- //#endregion
7028
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/components.js
7059
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/components.js
7029
7060
  const RE_COMPONENT_NAME = /^[a-z$][\w$-]*/i;
7030
7061
  function isValidComponentName(name) {
7031
7062
  return RE_COMPONENT_NAME.test(name);
@@ -7369,8 +7400,7 @@ var components_default = defineComarkPlugin(() => ({
7369
7400
  name: "components",
7370
7401
  markdownItPlugins: [markdownItComponents]
7371
7402
  }));
7372
- //#endregion
7373
- //#region ../../node_modules/.pnpm/markdown-exit@2.1.0/node_modules/markdown-exit/dist/chunk-CXurZ27M.js
7403
+ // ../../node_modules/.pnpm/markdown-exit@2.1.3/node_modules/markdown-exit/dist/chunk-CXurZ27M.js
7374
7404
  var __defProp = Object.defineProperty;
7375
7405
  var __exportAll = (all, symbols) => {
7376
7406
  let target = {};
@@ -7381,8 +7411,7 @@ var __exportAll = (all, symbols) => {
7381
7411
  if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
7382
7412
  return target;
7383
7413
  };
7384
- //#endregion
7385
- //#region ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/decode.mjs
7414
+ // ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/decode.mjs
7386
7415
  const decodeCache = {};
7387
7416
  function getDecodeCache(exclude) {
7388
7417
  let cache = decodeCache[exclude];
@@ -7452,8 +7481,7 @@ function decode(string, exclude) {
7452
7481
  }
7453
7482
  decode.defaultChars = ";/?:@&=+$,#";
7454
7483
  decode.componentChars = "";
7455
- //#endregion
7456
- //#region ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/encode.mjs
7484
+ // ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/encode.mjs
7457
7485
  const encodeCache = {};
7458
7486
  function getEncodeCache(exclude) {
7459
7487
  let cache = encodeCache[exclude];
@@ -7506,8 +7534,7 @@ function encode(string, exclude, keepEscaped) {
7506
7534
  }
7507
7535
  encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
7508
7536
  encode.componentChars = "-_.!~*'()";
7509
- //#endregion
7510
- //#region ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/format.mjs
7537
+ // ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/format.mjs
7511
7538
  function format(url) {
7512
7539
  let result = "";
7513
7540
  result += url.protocol || "";
@@ -7521,8 +7548,7 @@ function format(url) {
7521
7548
  result += url.hash || "";
7522
7549
  return result;
7523
7550
  }
7524
- //#endregion
7525
- //#region ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/parse.mjs
7551
+ // ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/parse.mjs
7526
7552
  function Url() {
7527
7553
  this.protocol = null;
7528
7554
  this.slashes = null;
@@ -7693,16 +7719,14 @@ Url.prototype.parseHost = function(host) {
7693
7719
  }
7694
7720
  if (host) this.hostname = host;
7695
7721
  };
7696
- //#endregion
7697
- //#region ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/index.mjs
7722
+ // ../../node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/index.mjs
7698
7723
  var mdurl_exports = /* @__PURE__ */ __exportAll$1({
7699
7724
  decode: () => decode,
7700
7725
  encode: () => encode,
7701
7726
  format: () => format,
7702
7727
  parse: () => urlParse
7703
7728
  });
7704
- //#endregion
7705
- //#region ../../node_modules/.pnpm/uc.micro@3.0.0/node_modules/uc.micro/build/index.mjs
7729
+ // ../../node_modules/.pnpm/uc.micro@3.0.0/node_modules/uc.micro/build/index.mjs
7706
7730
  var build_exports = /* @__PURE__ */ __exportAll$1({
7707
7731
  Any: () => Any,
7708
7732
  Cc: () => Cc,
@@ -7717,8 +7741,7 @@ const Cf = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\
7717
7741
  const P = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/;
7718
7742
  const S = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/;
7719
7743
  const Z = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
7720
- //#endregion
7721
- //#region ../../node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js
7744
+ // ../../node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js
7722
7745
  /**
7723
7746
  * Map of named character references.
7724
7747
  *
@@ -9851,8 +9874,7 @@ const characterEntities = {
9851
9874
  zwj: "‍",
9852
9875
  zwnj: "‌"
9853
9876
  };
9854
- //#endregion
9855
- //#region ../../node_modules/.pnpm/markdown-exit@2.1.0/node_modules/markdown-exit/dist/index.core-Ccg4mWUA.js
9877
+ // ../../node_modules/.pnpm/markdown-exit@2.1.3/node_modules/markdown-exit/dist/index.core-BrabpolG.js
9856
9878
  var import_punycode = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
9857
9879
  /** Highest positive signed 32-bit float value */
9858
9880
  const maxInt = 2147483647;
@@ -10527,8 +10549,8 @@ var StateBlock = class {
10527
10549
  const s = this.src;
10528
10550
  const len = s.length;
10529
10551
  for (let start = 0; start < len;) {
10530
- const lineEnd = s.indexOf("\n", start);
10531
- const end = lineEnd === -1 ? len : lineEnd;
10552
+ const lineEnd$1 = s.indexOf("\n", start);
10553
+ const end = lineEnd$1 === -1 ? len : lineEnd$1;
10532
10554
  let indent = 0;
10533
10555
  let offset = 0;
10534
10556
  let pos = start;
@@ -10678,11 +10700,16 @@ var StateInline = class {
10678
10700
  */
10679
10701
  _prev_delimiters = [];
10680
10702
  /**
10681
- * backtick length => last seen position
10703
+ * backtick run length => position of its last run, built lazily on first use
10682
10704
  */
10683
10705
  backticks = {};
10684
10706
  backticksScanned = false;
10685
10707
  /**
10708
+ * Set when html comment / PI / declaration / CDATA has no terminator,
10709
+ * to skip further scans of these constructs
10710
+ */
10711
+ skipHtmlSpecial = false;
10712
+ /**
10686
10713
  * Counter used to disable inline linkify-it execution
10687
10714
  * inside `<a>` and markdown links
10688
10715
  */
@@ -11331,10 +11358,7 @@ var html_blocks_default = [
11331
11358
  "track",
11332
11359
  "ul"
11333
11360
  ];
11334
- const open_tag = `<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`;
11335
- const close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
11336
- const HTML_TAG_RE$1 = /* @__PURE__ */ new RegExp(`^(?:${open_tag}|${close_tag}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
11337
- const HTML_OPEN_CLOSE_TAG_RE = /* @__PURE__ */ new RegExp(`^(?:${open_tag}|${close_tag})`);
11361
+ const HTML_OPEN_CLOSE_TAG_RE = /* @__PURE__ */ new RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`);
11338
11362
  const HTML_SEQUENCES = [
11339
11363
  [
11340
11364
  /^<(script|pre|style|textarea)(?=(\s|>|$))/i,
@@ -11635,129 +11659,141 @@ function paragraph(state, startLine, endLine) {
11635
11659
  state.parentType = oldParentType;
11636
11660
  return true;
11637
11661
  }
11662
+ const MAX_LABEL_LENGTH = 999;
11663
+ function countCodePoints(str) {
11664
+ let length = str.length;
11665
+ for (let i = 0; i < str.length - 1; i++) {
11666
+ const high = str.charCodeAt(i);
11667
+ if (high < 55296 || high > 56319) continue;
11668
+ const low = str.charCodeAt(i + 1);
11669
+ if (low >= 56320 && low <= 57343) {
11670
+ length--;
11671
+ i++;
11672
+ }
11673
+ }
11674
+ return length;
11675
+ }
11676
+ function lineEnd(state, line) {
11677
+ return Math.min(state.eMarks[line] + 1, state.src.length);
11678
+ }
11679
+ function getNextLinePos(state, nextLine) {
11680
+ const endLine = state.lineMax;
11681
+ if (nextLine >= endLine || state.isEmpty(nextLine)) return -1;
11682
+ let isContinuation = false;
11683
+ if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
11684
+ if (state.sCount[nextLine] < 0) isContinuation = true;
11685
+ if (!isContinuation) {
11686
+ const terminatorRules = state.md.block.ruler.getRules("reference");
11687
+ const oldParentType = state.parentType;
11688
+ state.parentType = "reference";
11689
+ let terminate = false;
11690
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
11691
+ terminate = true;
11692
+ break;
11693
+ }
11694
+ state.parentType = oldParentType;
11695
+ if (terminate) return -1;
11696
+ }
11697
+ return state.bMarks[nextLine] + state.tShift[nextLine];
11698
+ }
11638
11699
  function reference(state, startLine, endLine, silent) {
11700
+ const src = state.src;
11639
11701
  let pos = state.bMarks[startLine] + state.tShift[startLine];
11640
- let max = state.eMarks[startLine];
11641
11702
  let nextLine = startLine + 1;
11642
11703
  if (state.sCount[startLine] - state.blkIndent >= 4) return false;
11643
- if (state.src.charCodeAt(pos) !== 91) return false;
11644
- function getNextLine(nextLine$1) {
11645
- const endLine$1 = state.lineMax;
11646
- if (nextLine$1 >= endLine$1 || state.isEmpty(nextLine$1)) return null;
11647
- let isContinuation = false;
11648
- if (state.sCount[nextLine$1] - state.blkIndent > 3) isContinuation = true;
11649
- if (state.sCount[nextLine$1] < 0) isContinuation = true;
11650
- if (!isContinuation) {
11651
- const terminatorRules = state.md.block.ruler.getRules("reference");
11652
- const oldParentType = state.parentType;
11653
- state.parentType = "reference";
11654
- let terminate = false;
11655
- for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine$1, endLine$1, true)) {
11656
- terminate = true;
11657
- break;
11658
- }
11659
- state.parentType = oldParentType;
11660
- if (terminate) return null;
11661
- }
11662
- const pos$1 = state.bMarks[nextLine$1] + state.tShift[nextLine$1];
11663
- const max$1 = state.eMarks[nextLine$1];
11664
- return state.src.slice(pos$1, max$1 + 1);
11665
- }
11666
- let str = state.src.slice(pos, max + 1);
11667
- max = str.length;
11704
+ if (src.charCodeAt(pos) !== 91) return false;
11705
+ let max = lineEnd(state, startLine);
11706
+ let rawLabel = "";
11668
11707
  let labelEnd = -1;
11669
- for (pos = 1; pos < max; pos++) {
11670
- const ch = str.charCodeAt(pos);
11708
+ let segmentStart = ++pos;
11709
+ while (pos < max) {
11710
+ if (rawLabel.length + pos - segmentStart > MAX_LABEL_LENGTH * 2) return false;
11711
+ let ch = src.charCodeAt(pos);
11671
11712
  if (ch === 91) return false;
11672
- else if (ch === 93) {
11713
+ if (ch === 93) {
11673
11714
  labelEnd = pos;
11674
11715
  break;
11675
- } else if (ch === 10) {
11676
- const lineContent = getNextLine(nextLine);
11677
- if (lineContent !== null) {
11678
- str += lineContent;
11679
- max = str.length;
11680
- nextLine++;
11681
- }
11682
- } else if (ch === 92) {
11683
- pos++;
11684
- if (pos < max && str.charCodeAt(pos) === 10) {
11685
- const lineContent = getNextLine(nextLine);
11686
- if (lineContent !== null) {
11687
- str += lineContent;
11688
- max = str.length;
11689
- nextLine++;
11690
- }
11691
- }
11692
11716
  }
11717
+ if (ch === 92) ch = src.charCodeAt(++pos);
11718
+ if (ch === 10 && pos < max) {
11719
+ const nextPos = getNextLinePos(state, nextLine);
11720
+ if (nextPos < 0) return false;
11721
+ rawLabel += src.slice(segmentStart, max);
11722
+ pos = segmentStart = nextPos;
11723
+ max = lineEnd(state, nextLine++);
11724
+ continue;
11725
+ }
11726
+ pos++;
11693
11727
  }
11694
- if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) return false;
11695
- for (pos = labelEnd + 2; pos < max; pos++) {
11696
- const ch = str.charCodeAt(pos);
11728
+ if (labelEnd < 0 || src.charCodeAt(labelEnd + 1) !== 58) return false;
11729
+ rawLabel += src.slice(segmentStart, labelEnd);
11730
+ if (rawLabel.length > MAX_LABEL_LENGTH && countCodePoints(rawLabel) > MAX_LABEL_LENGTH) return false;
11731
+ pos = labelEnd + 2;
11732
+ while (pos < max) {
11733
+ const ch = src.charCodeAt(pos);
11697
11734
  if (ch === 10) {
11698
- const lineContent = getNextLine(nextLine);
11699
- if (lineContent !== null) {
11700
- str += lineContent;
11701
- max = str.length;
11702
- nextLine++;
11703
- }
11704
- } else if (isSpace(ch)) {} else break;
11735
+ const nextPos = getNextLinePos(state, nextLine);
11736
+ if (nextPos < 0) break;
11737
+ pos = nextPos;
11738
+ max = lineEnd(state, nextLine++);
11739
+ } else if (isSpace(ch)) pos++;
11740
+ else break;
11705
11741
  }
11706
- const destRes = state.md.helpers.parseLinkDestination(str, pos, max);
11742
+ const destRes = state.md.helpers.parseLinkDestination(src, pos, max);
11707
11743
  if (!destRes.ok) return false;
11708
11744
  const href = state.md.normalizeLink(destRes.str);
11709
11745
  if (!state.md.validateLink(href)) return false;
11710
11746
  pos = destRes.pos;
11711
11747
  const destEndPos = pos;
11748
+ const destEndMax = max;
11712
11749
  const destEndLineNo = nextLine;
11713
- const start = pos;
11714
- for (; pos < max; pos++) {
11715
- const ch = str.charCodeAt(pos);
11750
+ while (pos < max) {
11751
+ const ch = src.charCodeAt(pos);
11716
11752
  if (ch === 10) {
11717
- const lineContent = getNextLine(nextLine);
11718
- if (lineContent !== null) {
11719
- str += lineContent;
11720
- max = str.length;
11721
- nextLine++;
11722
- }
11723
- } else if (isSpace(ch)) {} else break;
11753
+ const nextPos = getNextLinePos(state, nextLine);
11754
+ if (nextPos < 0) break;
11755
+ pos = nextPos;
11756
+ max = lineEnd(state, nextLine++);
11757
+ } else if (isSpace(ch)) pos++;
11758
+ else break;
11724
11759
  }
11725
- let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);
11760
+ const titleStart = pos;
11761
+ let titleRes = state.md.helpers.parseLinkTitle(src, pos, max);
11726
11762
  while (titleRes.can_continue) {
11727
- const lineContent = getNextLine(nextLine);
11728
- if (lineContent === null) break;
11729
- str += lineContent;
11730
- pos = max;
11731
- max = str.length;
11732
- nextLine++;
11733
- titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);
11763
+ const nextPos = getNextLinePos(state, nextLine);
11764
+ if (nextPos < 0) break;
11765
+ pos = nextPos;
11766
+ max = lineEnd(state, nextLine++);
11767
+ titleRes = state.md.helpers.parseLinkTitle(src, pos, max, titleRes);
11734
11768
  }
11735
11769
  let title;
11736
- if (pos < max && start !== pos && titleRes.ok) {
11770
+ if (titleStart !== destEndPos && titleRes.ok) {
11737
11771
  title = titleRes.str;
11738
11772
  pos = titleRes.pos;
11739
11773
  } else {
11740
11774
  title = "";
11741
11775
  pos = destEndPos;
11776
+ max = destEndMax;
11742
11777
  nextLine = destEndLineNo;
11743
11778
  }
11744
11779
  while (pos < max) {
11745
- if (!isSpace(str.charCodeAt(pos))) break;
11780
+ if (!isSpace(src.charCodeAt(pos))) break;
11746
11781
  pos++;
11747
11782
  }
11748
- if (pos < max && str.charCodeAt(pos) !== 10) {
11783
+ if (pos < max && src.charCodeAt(pos) !== 10) {
11749
11784
  if (title) {
11750
11785
  title = "";
11751
11786
  pos = destEndPos;
11787
+ max = destEndMax;
11752
11788
  nextLine = destEndLineNo;
11753
11789
  while (pos < max) {
11754
- if (!isSpace(str.charCodeAt(pos))) break;
11790
+ if (!isSpace(src.charCodeAt(pos))) break;
11755
11791
  pos++;
11756
11792
  }
11757
11793
  }
11758
11794
  }
11759
- if (pos < max && str.charCodeAt(pos) !== 10) return false;
11760
- const label = normalizeReference(str.slice(1, labelEnd));
11795
+ if (pos < max && src.charCodeAt(pos) !== 10) return false;
11796
+ const label = normalizeReference(rawLabel);
11761
11797
  if (!label) return false;
11762
11798
  /* istanbul ignore if */
11763
11799
  if (silent) return true;
@@ -12065,6 +12101,7 @@ function linkify$1(state) {
12065
12101
  for (let j = 0, l = blockTokens.length; j < l; j++) {
12066
12102
  if (blockTokens[j].type !== "inline" || !linkify$2.test(blockTokens[j].content)) continue;
12067
12103
  const tokens = blockTokens[j].children;
12104
+ const replacements = [];
12068
12105
  let htmlLinkLevel = 0;
12069
12106
  for (let i = tokens.length - 1; i >= 0; i--) {
12070
12107
  const currentToken = tokens[i];
@@ -12125,19 +12162,38 @@ function linkify$1(state) {
12125
12162
  token.level = level;
12126
12163
  nodes.push(token);
12127
12164
  }
12128
- tokens.splice(i, 1, ...nodes);
12165
+ replacements.push({
12166
+ index: i,
12167
+ nodes
12168
+ });
12169
+ }
12170
+ }
12171
+ if (replacements.length > 0) {
12172
+ let newTokensLength = tokens.length;
12173
+ for (const replacement of replacements) newTokensLength += replacement.nodes.length - 1;
12174
+ const newTokens = new Array(newTokensLength);
12175
+ let replacementIndex = 0;
12176
+ let newTokenIndex = 0;
12177
+ replacements.reverse();
12178
+ for (let i = 0; i < tokens.length; i++) {
12179
+ const replacement = replacements[replacementIndex];
12180
+ if (replacement?.index === i) {
12181
+ for (const node of replacement.nodes) newTokens[newTokenIndex++] = node;
12182
+ replacementIndex++;
12183
+ } else newTokens[newTokenIndex++] = tokens[i];
12129
12184
  }
12185
+ blockTokens[j].children = newTokens;
12130
12186
  }
12131
12187
  }
12132
12188
  }
12133
- const NEWLINES_RE = /\r\n?|\n/g;
12189
+ const UNNORMALIZED_NEWLINE_RE = /\r\n?/g;
12134
12190
  const NULL_RE = /\0/g;
12135
12191
  function normalize(state) {
12136
12192
  let str = state.src;
12137
12193
  const hasCR = str.includes("\r");
12138
12194
  const hasNull = str.includes("\0");
12139
12195
  if (!hasCR && !hasNull) return;
12140
- if (hasCR) str = str.replace(NEWLINES_RE, "\n");
12196
+ if (hasCR) str = str.replace(UNNORMALIZED_NEWLINE_RE, "\n");
12141
12197
  if (hasNull) str = str.replace(NULL_RE, "�");
12142
12198
  state.src = str;
12143
12199
  }
@@ -12184,6 +12240,14 @@ function replace(state) {
12184
12240
  const QUOTE_TEST_RE = /['"]/;
12185
12241
  const QUOTE_RE = /['"]/g;
12186
12242
  const APOSTROPHE = "’";
12243
+ const MAX_OPENERS = 1e3;
12244
+ function truncateStack(stack, heads, length) {
12245
+ while (stack.length > length) {
12246
+ const item = stack.pop();
12247
+ if (item.isSingleQuote) heads.single = item.prevSameQuoteIdx;
12248
+ else heads.double = item.prevSameQuoteIdx;
12249
+ }
12250
+ }
12187
12251
  function addReplacement(replacements, tokenIdx, pos, ch) {
12188
12252
  if (!replacements[tokenIdx]) replacements[tokenIdx] = [];
12189
12253
  replacements[tokenIdx].push({
@@ -12205,12 +12269,16 @@ function applyReplacements(str, replacements) {
12205
12269
  function process_inlines(tokens, state) {
12206
12270
  let j;
12207
12271
  const stack = [];
12272
+ const heads = {
12273
+ single: -1,
12274
+ double: -1
12275
+ };
12208
12276
  const replacements = {};
12209
12277
  for (let i = 0; i < tokens.length; i++) {
12210
12278
  const token = tokens[i];
12211
12279
  const thisLevel = tokens[i].level;
12212
12280
  for (j = stack.length - 1; j >= 0; j--) if (stack[j].level <= thisLevel) break;
12213
- stack.length = j + 1;
12281
+ truncateStack(stack, heads, j + 1);
12214
12282
  if (token.type !== "text") continue;
12215
12283
  const text$1 = token.content;
12216
12284
  let pos = 0;
@@ -12262,11 +12330,10 @@ function process_inlines(tokens, state) {
12262
12330
  if (isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
12263
12331
  continue;
12264
12332
  }
12265
- if (canClose) for (j = stack.length - 1; j >= 0; j--) {
12266
- let item = stack[j];
12267
- if (stack[j].level < thisLevel) break;
12268
- if (item.single === isSingle && stack[j].level === thisLevel) {
12269
- item = stack[j];
12333
+ if (canClose) {
12334
+ j = isSingle ? heads.single : heads.double;
12335
+ if (j >= 0 && stack[j].level === thisLevel) {
12336
+ const item = stack[j];
12270
12337
  let openQuote;
12271
12338
  let closeQuote;
12272
12339
  if (isSingle) {
@@ -12277,18 +12344,23 @@ function process_inlines(tokens, state) {
12277
12344
  closeQuote = state.md.options.quotes[1];
12278
12345
  }
12279
12346
  addReplacement(replacements, i, t.index, closeQuote);
12280
- addReplacement(replacements, item.token, item.pos, openQuote);
12281
- stack.length = j;
12347
+ addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote);
12348
+ truncateStack(stack, heads, j);
12282
12349
  continue OUTER;
12283
12350
  }
12284
12351
  }
12285
- if (canOpen) stack.push({
12286
- token: i,
12287
- pos: t.index,
12288
- single: isSingle,
12289
- level: thisLevel
12290
- });
12291
- else if (canClose && isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
12352
+ if (canOpen) {
12353
+ if (stack.length >= MAX_OPENERS) return;
12354
+ stack.push({
12355
+ tokenIdx: i,
12356
+ contentPos: t.index,
12357
+ isSingleQuote: isSingle,
12358
+ level: thisLevel,
12359
+ prevSameQuoteIdx: isSingle ? heads.single : heads.double
12360
+ });
12361
+ if (isSingle) heads.single = stack.length - 1;
12362
+ else heads.double = stack.length - 1;
12363
+ } else if (canClose && isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
12292
12364
  }
12293
12365
  }
12294
12366
  Object.keys(replacements).forEach((tokenIdx) => {
@@ -12554,43 +12626,54 @@ function autolink(state, silent) {
12554
12626
  }
12555
12627
  return false;
12556
12628
  }
12629
+ function buildLastRuns(src) {
12630
+ const lastRuns = {};
12631
+ let pos = 0;
12632
+ while (true) {
12633
+ pos = src.indexOf("`", pos);
12634
+ if (pos === -1) break;
12635
+ const start = pos;
12636
+ while (src.charCodeAt(++pos) === 96);
12637
+ lastRuns[pos - start] = start;
12638
+ }
12639
+ return lastRuns;
12640
+ }
12557
12641
  function backtick(state, silent) {
12558
- let pos = state.pos;
12642
+ const start = state.pos;
12559
12643
  const src = state.src;
12560
- if (src.charCodeAt(pos) !== 96) return false;
12561
- const start = pos;
12562
- pos++;
12644
+ if (src.charCodeAt(start) !== 96) return false;
12563
12645
  const max = state.posMax;
12646
+ let pos = start + 1;
12564
12647
  while (pos < max && src.charCodeAt(pos) === 96) pos++;
12565
12648
  const marker = src.slice(start, pos);
12566
12649
  const openerLength = marker.length;
12567
- if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
12568
- if (!silent) state.pending += marker;
12569
- state.pos += openerLength;
12570
- return true;
12571
- }
12572
- let matchEnd = pos;
12573
- let matchStart;
12574
- while (true) {
12575
- matchStart = src.indexOf("`", matchEnd);
12576
- if (matchStart === -1) break;
12577
- matchEnd = matchStart + 1;
12578
- while (matchEnd < max && src.charCodeAt(matchEnd) === 96) matchEnd++;
12579
- const closerLength = matchEnd - matchStart;
12580
- if (closerLength === openerLength) {
12581
- if (!silent) {
12582
- const token = state.push("code_inline", "code", 0);
12583
- token.markup = marker;
12584
- token.content = src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
12650
+ if (!state.backticksScanned) {
12651
+ state.backticks = buildLastRuns(src);
12652
+ state.backticksScanned = true;
12653
+ }
12654
+ if ((state.backticks[openerLength] ?? -1) >= pos) {
12655
+ let matchEnd = pos;
12656
+ while (true) {
12657
+ const matchStart = src.indexOf("`", matchEnd);
12658
+ if (matchStart === -1 || matchStart >= max) break;
12659
+ matchEnd = matchStart + 1;
12660
+ while (src.charCodeAt(matchEnd) === 96) matchEnd++;
12661
+ if (matchEnd > max) break;
12662
+ if (matchEnd - matchStart === openerLength) {
12663
+ if (!silent) {
12664
+ const token = state.push("code_inline", "code", 0);
12665
+ token.markup = marker;
12666
+ let content = src.slice(pos, matchStart).replace(/\n/g, " ");
12667
+ if (content.startsWith(" ") && content.endsWith(" ") && /[^ ]/.test(content)) content = content.slice(1, -1);
12668
+ token.content = content;
12669
+ }
12670
+ state.pos = matchEnd;
12671
+ return true;
12585
12672
  }
12586
- state.pos = matchEnd;
12587
- return true;
12588
12673
  }
12589
- state.backticks[closerLength] = matchStart;
12590
12674
  }
12591
- state.backticksScanned = true;
12592
12675
  if (!silent) state.pending += marker;
12593
- state.pos += openerLength;
12676
+ state.pos = pos;
12594
12677
  return true;
12595
12678
  }
12596
12679
  function processDelimiters(delimiters) {
@@ -12830,22 +12913,53 @@ function isLetter$1(ch) {
12830
12913
  const lc = ch | 32;
12831
12914
  return lc >= 97 && lc <= 122;
12832
12915
  }
12916
+ function scanSpecial(state, pos) {
12917
+ const src = state.src;
12918
+ let start;
12919
+ let terminator;
12920
+ if (src.startsWith("<!--", pos)) {
12921
+ if (src.startsWith(">", pos + 4)) return pos + 5;
12922
+ if (src.startsWith("->", pos + 4)) return pos + 6;
12923
+ start = pos + 4;
12924
+ terminator = "-->";
12925
+ } else if (src.startsWith("<![CDATA[", pos)) {
12926
+ start = pos + 9;
12927
+ terminator = "]]>";
12928
+ } else if (src.charCodeAt(pos + 1) === 63) {
12929
+ start = pos + 2;
12930
+ terminator = "?>";
12931
+ } else if (isLetter$1(src.charCodeAt(pos + 2))) {
12932
+ start = pos + 3;
12933
+ terminator = ">";
12934
+ } else return -1;
12935
+ if (state.skipHtmlSpecial) return -1;
12936
+ const end = src.indexOf(terminator, start);
12937
+ if (end < 0) {
12938
+ state.skipHtmlSpecial = true;
12939
+ return -1;
12940
+ }
12941
+ return end + terminator.length;
12942
+ }
12833
12943
  function html_inline(state, silent) {
12834
12944
  if (!state.md.options.html) return false;
12835
12945
  const max = state.posMax;
12836
12946
  const pos = state.pos;
12837
12947
  if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) return false;
12948
+ let end;
12838
12949
  const ch = state.src.charCodeAt(pos + 1);
12839
- if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter$1(ch)) return false;
12840
- const match = state.src.slice(pos).match(HTML_TAG_RE$1);
12841
- if (!match) return false;
12950
+ if (ch === 33 || ch === 63) end = scanSpecial(state, pos);
12951
+ else if (ch === 47 || isLetter$1(ch)) {
12952
+ const match = state.src.slice(pos).match(HTML_OPEN_CLOSE_TAG_RE);
12953
+ end = match ? pos + match[0].length : -1;
12954
+ } else return false;
12955
+ if (end < 0) return false;
12842
12956
  if (!silent) {
12843
12957
  const token = state.push("html_inline", "", 0);
12844
- token.content = match[0];
12958
+ token.content = state.src.slice(pos, end);
12845
12959
  if (isLinkOpen(token.content)) state.linkLevel++;
12846
12960
  if (isLinkClose(token.content)) state.linkLevel--;
12847
12961
  }
12848
- state.pos += match[0].length;
12962
+ state.pos = end;
12849
12963
  return true;
12850
12964
  }
12851
12965
  function image(state, silent) {
@@ -13014,7 +13128,12 @@ function link$2(state, silent) {
13014
13128
  state.posMax = max;
13015
13129
  return true;
13016
13130
  }
13017
- const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
13131
+ function isAsciiAlpha$1(code$1) {
13132
+ return code$1 >= 65 && code$1 <= 90 || code$1 >= 97 && code$1 <= 122;
13133
+ }
13134
+ function isSchemeChar(code$1) {
13135
+ return code$1 >= 65 && code$1 <= 90 || code$1 >= 97 && code$1 <= 122 || code$1 >= 48 && code$1 <= 57 || code$1 === 43 || code$1 === 45 || code$1 === 46;
13136
+ }
13018
13137
  function linkify(state, silent) {
13019
13138
  if (!state.md.options.linkify) return false;
13020
13139
  if (state.linkLevel > 0) return false;
@@ -13024,20 +13143,22 @@ function linkify(state, silent) {
13024
13143
  if (state.src.charCodeAt(pos) !== 58) return false;
13025
13144
  if (state.src.charCodeAt(pos + 1) !== 47) return false;
13026
13145
  if (state.src.charCodeAt(pos + 2) !== 47) return false;
13027
- const match = state.pending.match(SCHEME_RE);
13028
- if (!match) return false;
13029
- const proto = match[1];
13030
- const link$1 = requireLinkify(state.md.linkify).matchAtStart(state.src.slice(pos - proto.length));
13146
+ const protoMin = pos - Math.min(10, state.pending.length, pos);
13147
+ let protoStart = pos;
13148
+ while (protoStart > protoMin && isSchemeChar(state.src.charCodeAt(protoStart - 1))) protoStart--;
13149
+ if (protoStart === pos || !isAsciiAlpha$1(state.src.charCodeAt(protoStart))) return false;
13150
+ const protoLength = pos - protoStart;
13151
+ const link$1 = requireLinkify(state.md.linkify).matchAtStart(state.src.slice(protoStart));
13031
13152
  if (!link$1) return false;
13032
13153
  let url = link$1.url;
13033
- if (url.length <= proto.length) return false;
13154
+ if (url.length <= protoLength) return false;
13034
13155
  let urlEnd = url.length;
13035
13156
  while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) urlEnd--;
13036
13157
  if (urlEnd !== url.length) url = url.slice(0, urlEnd);
13037
13158
  const fullUrl = state.md.normalizeLink(url);
13038
13159
  if (!state.md.validateLink(fullUrl)) return false;
13039
13160
  if (!silent) {
13040
- state.pending = state.pending.slice(0, -proto.length);
13161
+ state.pending = state.pending.slice(0, -protoLength);
13041
13162
  const token_o = state.push("link_open", "a", 1);
13042
13163
  token_o.attrs = [["href", fullUrl]];
13043
13164
  token_o.markup = "linkify";
@@ -13048,7 +13169,7 @@ function linkify(state, silent) {
13048
13169
  token_c.markup = "linkify";
13049
13170
  token_c.info = "auto";
13050
13171
  }
13051
- state.pos += url.length - proto.length;
13172
+ state.pos += url.length - protoLength;
13052
13173
  return true;
13053
13174
  }
13054
13175
  function newline(state, silent) {
@@ -13318,7 +13439,12 @@ function normalizeLink(url) {
13318
13439
  parsed.hostname = import_punycode.default.toASCII(parsed.hostname);
13319
13440
  } catch {}
13320
13441
  }
13321
- return encode(format(parsed));
13442
+ if (parsed.auth) parsed.auth = encode(parsed.auth);
13443
+ if (parsed.hostname) parsed.hostname = encode(parsed.hostname);
13444
+ if (parsed.pathname) parsed.pathname = encode(parsed.pathname);
13445
+ if (parsed.search) parsed.search = encode(parsed.search);
13446
+ if (parsed.hash) parsed.hash = encode(parsed.hash);
13447
+ return format(parsed);
13322
13448
  }
13323
13449
  function normalizeLinkText(url) {
13324
13450
  const parsed = urlParse(url, true);
@@ -13956,8 +14082,7 @@ var MarkdownExit = class extends Parser {
13956
14082
  static StateInline = StateInline;
13957
14083
  };
13958
14084
  var index_core_default = callable(MarkdownExit);
13959
- //#endregion
13960
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/attributes.js
14085
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/attributes.js
13961
14086
  const TEXT_TOKENS = /* @__PURE__ */ new Set([
13962
14087
  "text",
13963
14088
  "text_special",
@@ -14100,8 +14225,7 @@ var attributes_default = defineComarkPlugin(() => ({
14100
14225
  name: "attributes",
14101
14226
  markdownItPlugins: [markdownItAttributes]
14102
14227
  }));
14103
- //#endregion
14104
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/task-list.js
14228
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/task-list.js
14105
14229
  function attrSet(token, name, value) {
14106
14230
  const index = token.attrIndex(name);
14107
14231
  const attr = [name, value];
@@ -14178,8 +14302,7 @@ var task_list_default = defineComarkPlugin(() => ({
14178
14302
  name: "task-list",
14179
14303
  markdownItPlugins: [markdownItTaskList]
14180
14304
  }));
14181
- //#endregion
14182
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/alert.js
14305
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/alert.js
14183
14306
  const markers = {
14184
14307
  "!TIP": {
14185
14308
  type: "tip",
@@ -14235,8 +14358,7 @@ var alert_default = defineComarkPlugin(() => ({
14235
14358
  });
14236
14359
  }
14237
14360
  }));
14238
- //#endregion
14239
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/html.js
14361
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/html.js
14240
14362
  var html_default = defineComarkPlugin((opts = {}) => {
14241
14363
  return {
14242
14364
  name: "html",
@@ -14389,8 +14511,7 @@ function htmlToTokens(str) {
14389
14511
  if (textStart < len) pushText(tokens, str.slice(textStart));
14390
14512
  return tokens;
14391
14513
  }
14392
- //#endregion
14393
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/frontmatter.js
14514
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/frontmatter.js
14394
14515
  const FRONTMATTER_DELIMITER_DEFAULT = "---";
14395
14516
  const CR = "\r";
14396
14517
  function parseFrontmatter(content) {
@@ -14419,8 +14540,7 @@ function renderFrontmatter(data, content, yamlOptions) {
14419
14540
  if (content) return "---\n" + fm + "\n---\n\n" + content.trim();
14420
14541
  return fm;
14421
14542
  }
14422
- //#endregion
14423
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/frontmatter.js
14543
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/frontmatter.js
14424
14544
  var frontmatter_default = defineComarkPlugin(() => ({
14425
14545
  name: "frontmatter",
14426
14546
  pre(state) {
@@ -14431,8 +14551,7 @@ var frontmatter_default = defineComarkPlugin(() => ({
14431
14551
  if (content && frontmatterText) state.parsedLines = (state.parsedLines ?? 0) + frontmatterText.split("\n").length + 1;
14432
14552
  }
14433
14553
  }));
14434
- //#endregion
14435
- //#region ../../node_modules/.pnpm/linkify-it@6.1.0/node_modules/linkify-it/build/index.mjs
14554
+ // ../../node_modules/.pnpm/linkify-it@6.1.0/node_modules/linkify-it/build/index.mjs
14436
14555
  var REBuilder = class {
14437
14556
  src_Any = Any.source;
14438
14557
  src_Cc = Cc.source;
@@ -14960,8 +15079,7 @@ var LinkifyIt = class {
14960
15079
  if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) match.url = `mailto:${match.url}`;
14961
15080
  }
14962
15081
  };
14963
- //#endregion
14964
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/linkify.js
15082
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/linkify.js
14965
15083
  const markdownItPlugins = /* @__PURE__ */ new Map();
14966
15084
  function markdownItLinkify(options) {
14967
15085
  const key = JSON.stringify(options);
@@ -14979,8 +15097,7 @@ var linkify_default = defineComarkPlugin((options = {}) => ({
14979
15097
  name: "linkify",
14980
15098
  markdownItPlugins: [markdownItLinkify(options)]
14981
15099
  }));
14982
- //#endregion
14983
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/bracket-math.js
15100
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/bracket-math.js
14984
15101
  function findBracketClose(text, from, close, end = text.length) {
14985
15102
  for (let pos = from; pos + 1 < end; pos++) {
14986
15103
  if (text.charCodeAt(pos) !== 92) continue;
@@ -15251,6 +15368,8 @@ function healRegion(text, o) {
15251
15368
  let htmlLt = -1;
15252
15369
  let starInWord = false;
15253
15370
  let starDisabled = false;
15371
+ let starSkippedLen = 0;
15372
+ let starSkippedDepth = -1;
15254
15373
  let noParenClose = -1;
15255
15374
  let noBracketClose = -1;
15256
15375
  for (let i = 0; i < len; i++) {
@@ -15259,6 +15378,7 @@ function healRegion(text, o) {
15259
15378
  if (c === 10) {
15260
15379
  lineStart = i + 1;
15261
15380
  starInWord = false;
15381
+ starSkippedLen = 0;
15262
15382
  htmlLt = -1;
15263
15383
  continue;
15264
15384
  }
@@ -15274,6 +15394,7 @@ function healRegion(text, o) {
15274
15394
  }
15275
15395
  if (c === 32 || c === 9 || c === 13) {
15276
15396
  starInWord = false;
15397
+ starSkippedLen = 0;
15277
15398
  continue;
15278
15399
  }
15279
15400
  if (c === 92) {
@@ -15360,19 +15481,29 @@ function healRegion(text, o) {
15360
15481
  const enabled = n === 1 ? o.italic : n === 2 ? o.bold : o.boldItalic;
15361
15482
  if (c === 42) {
15362
15483
  const inWord = attachedLeft && isAlnum(prev) && isAlnum(next);
15363
- if (!inWord || starInWord) {
15484
+ if (inWord && !starInWord) {
15485
+ starSkippedLen = n;
15486
+ starSkippedDepth = frames.length;
15487
+ } else {
15364
15488
  if (attachedLeft && top !== null && top.k === F_STAR && (!inWord || top.len === n)) {
15365
15489
  closeRun(frames, F_STAR, n);
15490
+ starSkippedLen = 0;
15366
15491
  starInWord = true;
15367
15492
  i += n - 1;
15368
15493
  continue;
15369
15494
  }
15495
+ if (attachedLeft && !inWord && starSkippedLen === n && starSkippedDepth === frames.length && !isOpeningPunct(prev)) {
15496
+ starSkippedLen = 0;
15497
+ i += n - 1;
15498
+ continue;
15499
+ }
15370
15500
  if (openRight && enabled) {
15371
15501
  frames.push({
15372
15502
  k: F_STAR,
15373
15503
  len: n,
15374
15504
  pos: i
15375
15505
  });
15506
+ starSkippedLen = 0;
15376
15507
  starInWord = true;
15377
15508
  i += n - 1;
15378
15509
  continue;
@@ -15729,6 +15860,13 @@ function isAlnum(cp) {
15729
15860
  if (c <= 127) return c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122;
15730
15861
  return ALNUM_CP_RE.test(cp);
15731
15862
  }
15863
+ const OPENING_PUNCT_RE = /\p{Ps}|\p{Pi}/u;
15864
+ function isOpeningPunct(cp) {
15865
+ if (cp === "") return false;
15866
+ const c = cp.charCodeAt(0);
15867
+ if (c <= 127) return c === 40 || c === 91 || c === 123;
15868
+ return OPENING_PUNCT_RE.test(cp);
15869
+ }
15732
15870
  function isAsciiAlpha(c) {
15733
15871
  return c >= 97 && c <= 122 || c >= 65 && c <= 90;
15734
15872
  }
@@ -15875,8 +16013,7 @@ function closeTables(markdown) {
15875
16013
  if (!hasSeparator) lines.splice(start + 1, 0, generateSeparator());
15876
16014
  return lines.join("\n");
15877
16015
  }
15878
- //#endregion
15879
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/utils/trace.js
16016
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/utils/trace.js
15880
16017
  const noopSpan = { end: () => {} };
15881
16018
  const noopTracer = {
15882
16019
  startSpan: () => noopSpan,
@@ -15897,8 +16034,7 @@ function withSpan(tracer, name, fn, options) {
15897
16034
  }
15898
16035
  });
15899
16036
  }
15900
- //#endregion
15901
- //#region ../../node_modules/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js
16037
+ // ../../node_modules/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js
15902
16038
  /**
15903
16039
  * List of legacy HTML named character references that don’t need a trailing semicolon.
15904
16040
  *
@@ -16012,8 +16148,7 @@ const characterEntitiesLegacy = [
16012
16148
  "yen",
16013
16149
  "yuml"
16014
16150
  ];
16015
- //#endregion
16016
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/entities.js
16151
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/entities.js
16017
16152
  const own = Object.prototype.hasOwnProperty;
16018
16153
  const legacy = new Set(characterEntitiesLegacy);
16019
16154
  const C1 = {
@@ -16099,8 +16234,7 @@ function decodeHTMLAttribute(input) {
16099
16234
  }
16100
16235
  return out + input.slice(last);
16101
16236
  }
16102
- //#endregion
16103
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/utils.js
16237
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/utils.js
16104
16238
  function isSpaceCode$1(c) {
16105
16239
  return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
16106
16240
  }
@@ -16232,8 +16366,7 @@ function parseHtmlAttributes(attrsStr) {
16232
16366
  }
16233
16367
  return attrs;
16234
16368
  }
16235
- //#endregion
16236
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/unwrap.js
16369
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/unwrap.js
16237
16370
  function resolveUnwrapTags(unwrap) {
16238
16371
  if (!unwrap) return [];
16239
16372
  if (unwrap === true) return ["p"];
@@ -16264,8 +16397,7 @@ function applyUnwrap(nodes, tags) {
16264
16397
  else merged.push(node);
16265
16398
  return merged;
16266
16399
  }
16267
- //#endregion
16268
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/tree-utils.js
16400
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/tree-utils.js
16269
16401
  const MAX_HIGHLIGHT_LINES = 1e3;
16270
16402
  function parseCodeblockInfo(info) {
16271
16403
  if (!info) return {};
@@ -16357,8 +16489,7 @@ function mergeAdjacentTextNodes(nodes) {
16357
16489
  }
16358
16490
  return merged;
16359
16491
  }
16360
- //#endregion
16361
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/heading-id.js
16492
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/heading-id.js
16362
16493
  function createHeadingIdTracker(option = true) {
16363
16494
  if (option === false) return void 0;
16364
16495
  return {
@@ -16401,8 +16532,7 @@ function nextHeadingId(text, level, tracker) {
16401
16532
  usedIds.add(id);
16402
16533
  return id;
16403
16534
  }
16404
- //#endregion
16405
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/parse/tree.js
16535
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/parse/tree.js
16406
16536
  const inlineTags$1 = /* @__PURE__ */ new Set([
16407
16537
  "strong",
16408
16538
  "em",
@@ -16584,10 +16714,13 @@ function processChildren(tokens, start, closeType, state, nestHtml = false) {
16584
16714
  nextIndex: i
16585
16715
  };
16586
16716
  }
16587
- function processPossibleAttributesSyntax(tokens, value) {
16588
- const extractedAttributes = extractAttributes(tokens, value.nextIndex);
16717
+ function processPossibleAttributesSyntax(tokens, value, skipEmptyText = true) {
16718
+ const extractedAttributes = extractAttributes(tokens, value.nextIndex, skipEmptyText);
16589
16719
  if (value.nextIndex < extractedAttributes.nextIndex) {
16590
- value.node[1] = Object.assign(value.node[1], extractedAttributes.attrs);
16720
+ const attrs = extractedAttributes.attrs;
16721
+ const current = value.node[1];
16722
+ if (typeof current.class === "string" && typeof attrs.class === "string") attrs.class = `${current.class} ${attrs.class}`;
16723
+ value.node[1] = Object.assign(current, attrs);
16591
16724
  value.nextIndex = extractedAttributes.nextIndex;
16592
16725
  }
16593
16726
  return value;
@@ -16882,15 +17015,10 @@ const processors = {
16882
17015
  },
16883
17016
  mdc_inline_component(tokens, start) {
16884
17017
  const token = tokens[start];
16885
- const tokenAttrs = processAttributes(token.attrs);
16886
- const { attrs, nextIndex } = extractAttributes(tokens, start + 1, false);
16887
- return {
16888
- node: [token.tag, {
16889
- ...tokenAttrs,
16890
- ...attrs
16891
- }],
16892
- nextIndex
16893
- };
17018
+ return processPossibleAttributesSyntax(tokens, {
17019
+ node: [token.tag, { ...processAttributes(token.attrs) }],
17020
+ nextIndex: start + 1
17021
+ }, false);
16894
17022
  },
16895
17023
  image(tokens, start) {
16896
17024
  const token = tokens[start];
@@ -17033,8 +17161,7 @@ function tokenListToTree(tokens, options = {}) {
17033
17161
  }
17034
17162
  return nodes;
17035
17163
  }
17036
- //#endregion
17037
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/core.js
17164
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/core.js
17038
17165
  const MAX_SHARED_PARSERS = 32;
17039
17166
  let nextPluginId = 0;
17040
17167
  const pluginIds = /* @__PURE__ */ new WeakMap();
@@ -17136,8 +17263,7 @@ function createMarkdownParser$1(options = {}) {
17136
17263
  };
17137
17264
  return parseFn;
17138
17265
  }
17139
- //#endregion
17140
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/index.js
17266
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/index.js
17141
17267
  let warnedLinkifyOption = false;
17142
17268
  function resolveParserOptions(options) {
17143
17269
  const { autoClose = true, tracer = noopTracer, linkify: linkifyOption, ...rest } = options;
@@ -17177,8 +17303,7 @@ function createMarkdownParser(options = {}) {
17177
17303
  async function parseMarkdown(markdown, options = {}) {
17178
17304
  return await createMarkdownParser(options)(markdown);
17179
17305
  }
17180
- //#endregion
17181
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/state.js
17306
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/state.js
17182
17307
  function findHandler(ctx, node) {
17183
17308
  const name = node[0];
17184
17309
  const userHandler = (Object.hasOwn(ctx.handlers, name) ? ctx.handlers[name] : void 0) || (Object.hasOwn(ctx.handlers, pascalCase(name)) ? ctx.handlers[pascalCase(name)] : void 0);
@@ -17192,7 +17317,7 @@ async function one$1(node, state, parent, atLineStart = false) {
17192
17317
  "&": void 0,
17193
17318
  "\"": void 0
17194
17319
  });
17195
- if (parent?.[1].$?.html === 1 && parent[1].$?.block === 1) return node;
17320
+ if (parent?.[1].$?.html === 1 && parent[1].$?.block === 1) return state.context.rawHtmlText === "verbatim" ? node : escapeRawHtmlText(node, String(parent[0]));
17196
17321
  return escapeTextNode(node, atLineStart);
17197
17322
  }
17198
17323
  if (node[0] === null) return await state.handlers.comment(node, state, parent);
@@ -17307,6 +17432,37 @@ const COLON_PREV_CHARS = /* @__PURE__ */ new Set([
17307
17432
  ")",
17308
17433
  ">"
17309
17434
  ]);
17435
+ const TEXT_ONLY_TAGS = {
17436
+ script: "<\\/",
17437
+ style: "<\\/",
17438
+ textarea: "&lt;/"
17439
+ };
17440
+ function escapeRawHtmlText(text, tag) {
17441
+ if (!text.includes("<")) return text;
17442
+ const lowerTag = tag.toLowerCase();
17443
+ const closerEscape = Object.hasOwn(TEXT_ONLY_TAGS, lowerTag) ? TEXT_ONLY_TAGS[lowerTag] : void 0;
17444
+ if (closerEscape) {
17445
+ const lower = text.toLowerCase();
17446
+ const closer = `</${lowerTag}`;
17447
+ let result = "";
17448
+ let last = 0;
17449
+ for (let index = lower.indexOf(closer); index !== -1; index = lower.indexOf(closer, last)) {
17450
+ result += text.slice(last, index) + closerEscape;
17451
+ last = index + 2;
17452
+ }
17453
+ return result + text.slice(last);
17454
+ }
17455
+ let result = "";
17456
+ let last = 0;
17457
+ for (let index = text.indexOf("<"); index !== -1; index = text.indexOf("<", index + 1)) {
17458
+ const next = text.charCodeAt(index + 1);
17459
+ if (next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 33 || next === 47 || next === 63) {
17460
+ result += text.slice(last, index) + "&lt;";
17461
+ last = index + 1;
17462
+ }
17463
+ }
17464
+ return result + text.slice(last);
17465
+ }
17310
17466
  function escapeTextNode(text, atLineStart = false) {
17311
17467
  const escaped = escapeInline(text);
17312
17468
  if (!atLineStart && !escaped.includes("\n")) return escaped;
@@ -17325,6 +17481,7 @@ function buildNextIndex(source, charCode) {
17325
17481
  }
17326
17482
  return next;
17327
17483
  }
17484
+ const OPEN_TAG_START = /<\/?[a-z][a-z0-9-]*[\s/]/iy;
17328
17485
  function escapeInline(text) {
17329
17486
  let nextGt;
17330
17487
  return text.replace(inlineSyntax, (char, offset, source) => {
@@ -17333,7 +17490,10 @@ function escapeInline(text) {
17333
17490
  const next = source.charCodeAt(offset + 1);
17334
17491
  if (!(next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 33 || next === 63 || next === 47)) return char;
17335
17492
  nextGt ??= buildNextIndex(source, 62);
17336
- if (nextGt[offset + 1] === -1) return char;
17493
+ if (nextGt[offset + 1] === -1) {
17494
+ OPEN_TAG_START.lastIndex = offset;
17495
+ if (!OPEN_TAG_START.test(source)) return char;
17496
+ }
17337
17497
  return `\\${char}`;
17338
17498
  }
17339
17499
  if (char === "&" && !/^&#?[a-zA-Z0-9]+;/.test(source.slice(offset))) return char;
@@ -17364,8 +17524,7 @@ function escapeLeadingBlock(line) {
17364
17524
  if (line[0] === ":") return `\\${line}`;
17365
17525
  return line;
17366
17526
  }
17367
- //#endregion
17368
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/fence.js
17527
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/fence.js
17369
17528
  function pickFence(content) {
17370
17529
  let maxBackticks = 0;
17371
17530
  let maxTildes = 0;
@@ -17380,8 +17539,7 @@ function pickFence(content) {
17380
17539
  const char = maxBackticks <= maxTildes ? "`" : "~";
17381
17540
  return char.repeat(Math.max(3, (char === "`" ? maxBackticks : maxTildes) + 1));
17382
17541
  }
17383
- //#endregion
17384
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/attributes.js
17542
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/attributes.js
17385
17543
  const IMPLICIT_ATTRS = {
17386
17544
  blockquote: { drop: ["as"] },
17387
17545
  ol: { drop: ["start"] },
@@ -17451,18 +17609,23 @@ function comarkYamlAttributes(attributes, style = "codeblock") {
17451
17609
  const fence = pickFence(yamlContent);
17452
17610
  return `${fence}yaml [props]\n${yamlContent}\n${fence}`;
17453
17611
  }
17454
- //#endregion
17455
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/code.js
17612
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/code.js
17456
17613
  function code(node, _state) {
17457
17614
  const [_, attributes] = node;
17458
17615
  const attrs = userBlockAttrs("code", attributes);
17459
17616
  const attrsString = Object.keys(attrs).length > 0 ? comarkAttributes(attrs) : "";
17460
17617
  const content = textContent(node);
17461
- const fence = content.includes("`") ? "``" : "`";
17462
- return `${fence}${content}${fence}${attrsString}`;
17618
+ const fence = pickInlineFence(content);
17619
+ const edgeBacktick = content.startsWith("`") || content.endsWith("`");
17620
+ const edgeSpaces = content.startsWith(" ") && content.endsWith(" ") && /[^ ]/.test(content);
17621
+ const pad = edgeBacktick || edgeSpaces ? " " : "";
17622
+ return `${fence}${pad}${content}${pad}${fence}${attrsString}`;
17463
17623
  }
17464
- //#endregion
17465
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/pre.js
17624
+ function pickInlineFence(content) {
17625
+ const longest = (content.match(/`+/g) ?? []).reduce((max, run) => Math.max(max, run.length), 0);
17626
+ return "`".repeat(longest + 1);
17627
+ }
17628
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/pre.js
17466
17629
  function pre(node, state) {
17467
17630
  const [_, attributes, ...children] = node;
17468
17631
  const codeClasses = children[0]?.[1]?.class;
@@ -17494,20 +17657,18 @@ function formatHighlights(highlights) {
17494
17657
  }
17495
17658
  return ranges.join(",");
17496
17659
  }
17497
- //#endregion
17498
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/hr.js
17660
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/hr.js
17499
17661
  function hr(_n, state, parent) {
17500
17662
  if (parent?.[0] === "p") return ":hr";
17501
17663
  return "---" + state.context.blockSeparator;
17502
17664
  }
17503
- //#endregion
17504
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/heading.js
17665
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/heading.js
17505
17666
  const trackers = /* @__PURE__ */ new WeakMap();
17506
17667
  function autoHeadingId(node, level, state, id) {
17507
- let tracker = trackers.get(state);
17668
+ let tracker = trackers.get(state.context);
17508
17669
  if (tracker === void 0) {
17509
17670
  tracker = createHeadingIdTracker(state.context.headingIds) ?? null;
17510
- trackers.set(state, tracker);
17671
+ trackers.set(state.context, tracker);
17511
17672
  }
17512
17673
  if (!tracker) return void 0;
17513
17674
  const autoId = nextHeadingId(node.slice(2).filter((child) => !(Array.isArray(child) && child[1]?.$?.permalink === "separate")).map((child) => textContent(child)).join(""), level, tracker);
@@ -17527,8 +17688,7 @@ async function heading(node, state) {
17527
17688
  const suffix = attrs ? ` ${attrs}` : "";
17528
17689
  return "#".repeat(level) + " " + content + suffix + state.context.blockSeparator;
17529
17690
  }
17530
- //#endregion
17531
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/p.js
17691
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/p.js
17532
17692
  async function p(node, state, parent) {
17533
17693
  const children = node.slice(2);
17534
17694
  let result = "";
@@ -17538,8 +17698,44 @@ async function p(node, state, parent) {
17538
17698
  if (parent?.[0] === "li") return result;
17539
17699
  return result + state.context.blockSeparator;
17540
17700
  }
17541
- //#endregion
17542
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/a.js
17701
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/link.js
17702
+ const SPECIAL_SCHEME = /^(?:https?|wss?|ftp|file):$/;
17703
+ function isBalanced(value, open, close, escapes) {
17704
+ let depth = 0;
17705
+ for (let i = 0; i < value.length; i++) if (escapes && value[i] === "\\") i++;
17706
+ else if (value[i] === open) depth++;
17707
+ else if (value[i] === close && --depth < 0) return false;
17708
+ return depth === 0;
17709
+ }
17710
+ function linkDestination(url) {
17711
+ if (url === void 0 || url === null || url === "") return "<>";
17712
+ let value = String(url);
17713
+ if (value.includes("\\")) try {
17714
+ const parsed = new URL(value);
17715
+ if (SPECIAL_SCHEME.test(parsed.protocol)) value = parsed.href;
17716
+ } catch {}
17717
+ const escapeParens = !isBalanced(value, "(", ")", false);
17718
+ let result = "";
17719
+ for (let i = 0; i < value.length; i++) {
17720
+ const char = value[i];
17721
+ const code = value.charCodeAt(i);
17722
+ if (code <= 32 || code === 127) result += `%${code.toString(16).toUpperCase().padStart(2, "0")}`;
17723
+ else if (char === "\\" || char === "<" || char === ">" || escapeParens && (char === "(" || char === ")") || char === "&" && /^&#?[a-z0-9]+;/i.test(value.slice(i, i + 34))) result += `\\${char}`;
17724
+ else result += char;
17725
+ }
17726
+ return result;
17727
+ }
17728
+ function linkTitle(title) {
17729
+ return String(title).replace(/["\\<&]/g, "\\$&");
17730
+ }
17731
+ function imageAlt(alt) {
17732
+ const value = String(alt);
17733
+ return isBalanced(value, "[", "]", true) ? value : value.replace(/(?<!\\)[[\]]/g, "\\$&");
17734
+ }
17735
+ function isAutolinkSafe(url) {
17736
+ return /^[a-z][a-z0-9+.-]{1,31}:[^\s<>\\]*$/i.test(url);
17737
+ }
17738
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/a.js
17543
17739
  async function a(node, state, parent) {
17544
17740
  const [_, attrs] = node;
17545
17741
  if (attrs.$?.permalink === "separate") return "";
@@ -17547,11 +17743,10 @@ async function a(node, state, parent) {
17547
17743
  const { href, ...rest } = attrs;
17548
17744
  const attrsString = Object.keys(rest).length > 0 ? comarkAttributes(rest) : "";
17549
17745
  const content = await state.flow(node, state);
17550
- if (content === href && !attrsString) return `<${href}>`;
17551
- return `[${content}](${href})${attrsString}`;
17746
+ if (content === href && !attrsString && isAutolinkSafe(href)) return `<${href}>`;
17747
+ return `[${content}](${linkDestination(href)})${attrsString}`;
17552
17748
  }
17553
- //#endregion
17554
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/ul.js
17749
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/ul.js
17555
17750
  async function ul(node, state) {
17556
17751
  const children = node.slice(2);
17557
17752
  const revert = state.applyContext({
@@ -17572,8 +17767,7 @@ async function ul(node, state) {
17572
17767
  else result = result + state.context.blockSeparator;
17573
17768
  return result;
17574
17769
  }
17575
- //#endregion
17576
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/ol.js
17770
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/ol.js
17577
17771
  async function ol(node, state) {
17578
17772
  const children = node.slice(2);
17579
17773
  const start = Number(node[1].start);
@@ -17596,8 +17790,7 @@ async function ol(node, state) {
17596
17790
  else result = result + state.context.blockSeparator;
17597
17791
  return result;
17598
17792
  }
17599
- //#endregion
17600
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/li.js
17793
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/li.js
17601
17794
  const blockElements = /* @__PURE__ */ new Set([
17602
17795
  "pre",
17603
17796
  "blockquote",
@@ -17666,8 +17859,7 @@ function takeCheckbox(children) {
17666
17859
  }
17667
17860
  }
17668
17861
  }
17669
- //#endregion
17670
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/html.js
17862
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/html.js
17671
17863
  const textBlocks = /* @__PURE__ */ new Set([
17672
17864
  "p",
17673
17865
  "h1",
@@ -17772,8 +17964,7 @@ function paddNoneHtmlContent(content, state, tag) {
17772
17964
  }
17773
17965
  return (content.trim().startsWith("<") ? "" : "") + content + (content.trim().endsWith(">") ? "" : "");
17774
17966
  }
17775
- //#endregion
17776
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/strong.js
17967
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/strong.js
17777
17968
  async function strong(node, state) {
17778
17969
  const [_, attrs, ...children] = node;
17779
17970
  let content = "";
@@ -17782,8 +17973,7 @@ async function strong(node, state) {
17782
17973
  const attrsString = Object.keys(attrs).length > 0 ? comarkAttributes(attrs) : "";
17783
17974
  return `**${content}**${attrsString}`;
17784
17975
  }
17785
- //#endregion
17786
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/emphesis.js
17976
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/emphesis.js
17787
17977
  async function emphesis(node, state) {
17788
17978
  const [_, attrs, ...children] = node;
17789
17979
  let content = "";
@@ -17792,8 +17982,7 @@ async function emphesis(node, state) {
17792
17982
  const attrsString = Object.keys(attrs).length > 0 ? comarkAttributes(attrs) : "";
17793
17983
  return `*${content}*${attrsString}`;
17794
17984
  }
17795
- //#endregion
17796
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/blockquote.js
17985
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/blockquote.js
17797
17986
  async function blockquote(node, state) {
17798
17987
  const children = node.slice(2);
17799
17988
  let childResult = "";
@@ -17806,16 +17995,15 @@ async function blockquote(node, state) {
17806
17995
  if (node[1].as) return `> [!${String(node[1].as).toUpperCase()}]\n` + content + state.context.blockSeparator;
17807
17996
  return content + state.context.blockSeparator;
17808
17997
  }
17809
- //#endregion
17810
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/img.js
17998
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/img.js
17811
17999
  function img(node, _state) {
17812
18000
  const [_, attrs] = node;
17813
18001
  const { title, src, alt = "", ...rest } = attrs;
17814
18002
  const attrsString = Object.keys(rest).length > 0 ? comarkAttributes(rest) : "";
17815
- return `${title ? `![${alt}](${src} "${title}")` : `![${alt}](${src})`}${attrsString}`;
18003
+ const destination = linkDestination(src);
18004
+ return `${title ? `![${imageAlt(alt)}](${destination} "${linkTitle(title)}")` : `![${imageAlt(alt)}](${destination})`}${attrsString}`;
17816
18005
  }
17817
- //#endregion
17818
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/del.js
18006
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/del.js
17819
18007
  async function del(node, state) {
17820
18008
  const [_, attrs, ...children] = node;
17821
18009
  let content = "";
@@ -17824,8 +18012,7 @@ async function del(node, state) {
17824
18012
  const attrsString = Object.keys(attrs).length > 0 ? comarkAttributes(attrs) : "";
17825
18013
  return `~~${content}~~${attrsString}`;
17826
18014
  }
17827
- //#endregion
17828
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/mdc.js
18015
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/mdc.js
17829
18016
  const INLINE_HTML_ELEMENTS = /* @__PURE__ */ new Set([
17830
18017
  "a",
17831
18018
  "strong",
@@ -17866,8 +18053,7 @@ async function mdc(node, state, parent) {
17866
18053
  const afterList = Array.isArray(prev) && (prev[0] === "ul" || prev[0] === "ol");
17867
18054
  return inline ? result : indent(result, { level: parent && !afterList ? 1 : 0 });
17868
18055
  }
17869
- //#endregion
17870
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/br.js
18056
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/br.js
17871
18057
  function isSpaceCode(c) {
17872
18058
  return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
17873
18059
  }
@@ -17886,13 +18072,11 @@ function br(node, state, parent) {
17886
18072
  const open = prevSpace ? ":br" : " :br";
17887
18073
  return nextSpace ? open : `${open} `;
17888
18074
  }
17889
- //#endregion
17890
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/component.js
18075
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/component.js
17891
18076
  function component(node, state, parent) {
17892
18077
  return state.context.format === "markdown/comark" ? state.handlers.mdc(node, state, parent) : state.handlers.html(node, state, parent);
17893
18078
  }
17894
- //#endregion
17895
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/template.js
18079
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/template.js
17896
18080
  async function template(node, state, parent) {
17897
18081
  const [_, attrs] = node;
17898
18082
  if (typeof attrs.name !== "string") return component(node, state, parent);
@@ -17904,8 +18088,7 @@ async function template(node, state, parent) {
17904
18088
  const extraAttrs = comarkAttributes(rest);
17905
18089
  return `#${attrs.name}${extraAttrs}\n${content}` + state.context.blockSeparator;
17906
18090
  }
17907
- //#endregion
17908
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/table.js
18091
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/table.js
17909
18092
  const TABLE_SECTIONS = /* @__PURE__ */ new Set([
17910
18093
  "thead",
17911
18094
  "tbody",
@@ -18028,8 +18211,7 @@ function th(_node, _state) {
18028
18211
  function td(_node, _state) {
18029
18212
  return "";
18030
18213
  }
18031
- //#endregion
18032
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/comment.js
18214
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/comment.js
18033
18215
  function comment(node, state, parent) {
18034
18216
  if (node[0] === null) {
18035
18217
  const inline = state.context.inline === true || parent?.[0] === "p" || (parent?.some((child, index) => index > 1 && typeof child === "string") ?? false);
@@ -18037,8 +18219,7 @@ function comment(node, state, parent) {
18037
18219
  }
18038
18220
  return state.context.format === "markdown/comark" ? state.handlers.mdc(node, state, parent) : state.handlers.html(node, state, parent);
18039
18221
  }
18040
- //#endregion
18041
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/math.js
18222
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/math.js
18042
18223
  function math(node, state, parent) {
18043
18224
  const className = node[1].class;
18044
18225
  const classes = typeof className === "string" ? className.split(" ") : [];
@@ -18057,8 +18238,7 @@ function math(node, state, parent) {
18057
18238
  if (markup === "\\[") return `\\[\n${content}\n\\]${state.context.blockSeparator}`;
18058
18239
  return `$$\n${content}\n$$${state.context.blockSeparator}`;
18059
18240
  }
18060
- //#endregion
18061
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/mermaid.js
18241
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/mermaid.js
18062
18242
  function mermaid(node, state, parent) {
18063
18243
  const [_, attributes] = node;
18064
18244
  if (typeof attributes.content !== "string") return component(node, state, parent);
@@ -18068,8 +18248,7 @@ function mermaid(node, state, parent) {
18068
18248
  const fence = pickFence(body);
18069
18249
  return `${fence}mermaid${attrs ? ` ${attrs}` : ""}\n${body}\n${fence}${state.context.blockSeparator}`;
18070
18250
  }
18071
- //#endregion
18072
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/internal/stringify/handlers/index.js
18251
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/internal/stringify/handlers/index.js
18073
18252
  const handlers = {
18074
18253
  code,
18075
18254
  pre,
@@ -18104,8 +18283,7 @@ const handlers = {
18104
18283
  math,
18105
18284
  mermaid
18106
18285
  };
18107
- //#endregion
18108
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/render/index.js
18286
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/render/index.js
18109
18287
  async function render(document, context = {}) {
18110
18288
  const state = createState(handlers, {
18111
18289
  ...context,
@@ -18123,8 +18301,7 @@ async function renderMarkdown(document, options) {
18123
18301
  });
18124
18302
  return renderFrontmatter(document.frontmatter || {}, content, options?.frontmatterOptions);
18125
18303
  }
18126
- //#endregion
18127
- //#region ../../node_modules/.pnpm/comark@0.9.0_katex@0.19.1_shiki@4.5.0/node_modules/comark/dist/plugins/binding.js
18304
+ // ../../node_modules/.pnpm/comark@0.9.2_katex@0.19.1_shiki@4.6.0/node_modules/comark/dist/plugins/binding.js
18128
18305
  const markdownItInlineBinding = (md, options = {}) => {
18129
18306
  const tag = options.tag || "binding";
18130
18307
  md.inline.ruler.after("entity", "mdc_inline_binding", (state, silent) => {
@@ -18156,8 +18333,7 @@ var binding_default = defineComarkPlugin((opts = {}) => {
18156
18333
  markdownItPlugins: [((md) => markdownItInlineBinding(md, opts))]
18157
18334
  };
18158
18335
  });
18159
- //#endregion
18160
- //#region ../markdown-template/dist/prepare-B9amb4_J.js
18336
+ // ../markdown-template/dist/prepare-er_eo8pi.js
18161
18337
  const dynamicError = { why: ({ message }) => message === void 0 ? "" : String(message) };
18162
18338
  const markdownTemplateErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
18163
18339
  docsBase: "https://vitehub.dev/docs/markdown-template/diagnostics",
@@ -18472,8 +18648,7 @@ function validateBranches(template) {
18472
18648
  }
18473
18649
  if (stack.some((entry) => entry.tag === "if" || entry.tag === "else-if" || entry.tag === "else")) throw markdownTemplateErrorDiagnostics.MARKDOWN_TEMPLATE_R0029({ message: "[vitehub] Markdown template if block is missing a closing :: line." });
18474
18650
  }
18475
- //#endregion
18476
- //#region ../markdown-template/dist/render-BJDteOoz.js
18651
+ // ../markdown-template/dist/render-Mm1YBgGT.js
18477
18652
  const ordered = (compare) => (value, expected) => (typeof value === "number" && typeof expected === "number" || typeof value === "string" && typeof expected === "string") && compare(value, expected);
18478
18653
  const comparisons = {
18479
18654
  eq: (value, expected) => value === expected,
@@ -18778,8 +18953,7 @@ function parseMarkdownTemplateRequest(id) {
18778
18953
  if (id.slice(queryIndex + 1) !== "markdown-template") return;
18779
18954
  return { path };
18780
18955
  }
18781
- //#endregion
18782
- //#region ../internal/src/contributions.ts
18956
+ // ../internal/src/contributions.ts
18783
18957
  const unnamedPlugin = "unnamed plugin";
18784
18958
  function isNonEmptyString(value) {
18785
18959
  return String(value) === value && value.length > 0;
@@ -18884,8 +19058,7 @@ function readContribution(entry, plugin, options, fail) {
18884
19058
  ...base
18885
19059
  };
18886
19060
  }
18887
- //#endregion
18888
- //#region src/build/contributions.ts
19061
+ // src/build/contributions.ts
18889
19062
  /**
18890
19063
  * Collects `vitehub.workspaces` contributions from Vite plugins. Invalid entries fail with `WORKSPACE_B0004`. Two
18891
19064
  * contributions with one name fail with `WORKSPACE_B0003`.
@@ -18899,8 +19072,7 @@ async function collectWorkspaceContributions(plugins, context) {
18899
19072
  kind: "Workspace"
18900
19073
  });
18901
19074
  }
18902
- //#endregion
18903
- //#region src/build/workspace-config.ts
19075
+ // src/build/workspace-config.ts
18904
19076
  const workspaceSuffixPattern = /\.workspace\.(?:c|m)?[jt]s$/i;
18905
19077
  const workspaceConfigPattern = /^config\.(?:c|m)?[jt]s$/i;
18906
19078
  const workspaceAgentPattern = /^agent\.(?:c|m)?[jt]s$/i;
@@ -18912,8 +19084,7 @@ const workspaceConfigFileNames = [
18912
19084
  "config.mjs",
18913
19085
  "config.cjs"
18914
19086
  ];
18915
- //#endregion
18916
- //#region src/build/registry-source.injected.ts
19087
+ // src/build/registry-source.injected.ts
18917
19088
  /**
18918
19089
  * The registry line that rejects a contributed Workspace module without its definition export. It is source text of the
18919
19090
  * generated registry module, which runs in the app and does not import the Workspace catalog.
@@ -18921,8 +19092,7 @@ const workspaceConfigFileNames = [
18921
19092
  function missingDefinitionExportCheck(message) {
18922
19093
  return ` if (!definition) throw new TypeError(${JSON.stringify(message)})`;
18923
19094
  }
18924
- //#endregion
18925
- //#region src/build/discovery.ts
19095
+ // src/build/discovery.ts
18926
19096
  /** Discovery source label of definitions that a Vite plugin contributes. */
18927
19097
  const contributedWorkspaceSource = "vite-plugin-contribution";
18928
19098
  const configFileNameSet = new Set(workspaceConfigFileNames);
@@ -19122,8 +19292,7 @@ function createWorkspaceVirtualRegistryContents(definitions) {
19122
19292
  async function createWorkspaceManifest(definitions) {
19123
19293
  return { workspaces: definitions.map((definition) => ({ name: definition.name })) };
19124
19294
  }
19125
- //#endregion
19126
- //#region src/build/assets.ts
19295
+ // src/build/assets.ts
19127
19296
  function shouldBundleWorkspaceAssets(assets, name) {
19128
19297
  return assets === void 0 || assets === true || Array.isArray(assets) && assets.includes(name);
19129
19298
  }
@@ -19383,8 +19552,7 @@ function createWorkspaceAssetsRegistryContents(registryFile, bundles, modulePath
19383
19552
  ""
19384
19553
  ].join("\n");
19385
19554
  }
19386
- //#endregion
19387
- //#region src/build/integration.ts
19555
+ // src/build/integration.ts
19388
19556
  async function refreshWorkspaceBuildState(root, definitions) {
19389
19557
  const state = {
19390
19558
  manifest: await createWorkspaceManifest(definitions),
@@ -19416,8 +19584,7 @@ function createWorkspaceTypeAugmentation(definitions) {
19416
19584
  ""
19417
19585
  ].join("\n");
19418
19586
  }
19419
- //#endregion
19420
- //#region src/checkout-cli.ts
19587
+ // src/checkout-cli.ts
19421
19588
  const valueFlags = /* @__PURE__ */ new Set([
19422
19589
  "dir",
19423
19590
  "message",
@@ -19645,8 +19812,7 @@ function workspaceCheckoutFeatures() {
19645
19812
  }
19646
19813
  ];
19647
19814
  }
19648
- //#endregion
19649
- //#region src/hooks-cli.ts
19815
+ // src/hooks-cli.ts
19650
19816
  const exec = promisify(execFile);
19651
19817
  const marker = "# Installed by `vitehub hooks install`.";
19652
19818
  const hookNames = ["pre-commit", "pre-push"];
@@ -19967,8 +20133,7 @@ function workspaceHooksNamespace(options = {}) {
19967
20133
  name: "hooks"
19968
20134
  };
19969
20135
  }
19970
- //#endregion
19971
- //#region src/cli.ts
20136
+ // src/cli.ts
19972
20137
  const workspaceDevEndpoint = {
19973
20138
  header: workspaceDevHeader,
19974
20139
  headerValue: "1",
@@ -20250,8 +20415,7 @@ function createWorkspaceCliContributor() {
20250
20415
  workspaceHooksNamespace()
20251
20416
  ] };
20252
20417
  }
20253
- //#endregion
20254
- //#region src/inspect.ts
20418
+ // src/inspect.ts
20255
20419
  function workspaceDefinitionKind(definition) {
20256
20420
  if (definition.source === "server-agent-workspaces") return "Agent workspace";
20257
20421
  if (definition.source === "vite-plugin-contribution") return "Contributed Workspace Definition";
@@ -20309,15 +20473,13 @@ const workspaceConsoleSection = {
20309
20473
  notice: "Workspace files, Sources, collections, sync state, and processes are not opened or initialized by this build-time catalog."
20310
20474
  }
20311
20475
  };
20312
- //#endregion
20313
- //#region ../internal/src/arrays.ts
20476
+ // ../internal/src/arrays.ts
20314
20477
  function pushUnique(arr, item, key = (value) => value) {
20315
20478
  const id = key(item);
20316
20479
  if (arr.some((entry) => key(entry) === id)) return;
20317
20480
  arr.push(item);
20318
20481
  }
20319
- //#endregion
20320
- //#region src/integrations/cloudflare.ts
20482
+ // src/integrations/cloudflare.ts
20321
20483
  function configureCloudflareArtifacts(target, config) {
20322
20484
  if (!config) return;
20323
20485
  const store = config.store;
@@ -20333,8 +20495,7 @@ function configureCloudflareArtifacts(target, config) {
20333
20495
  if (existing && existing.namespace !== artifact.namespace) throw workspaceErrorDiagnostics.WORKSPACE_R0029({ message: `[vitehub] Cloudflare Artifacts binding "${artifact.binding}" cannot use both namespace "${existing.namespace}" and "${artifact.namespace}". Configure a unique binding for each namespace.` });
20334
20496
  pushUnique(target.cloudflare.wrangler.artifacts, artifact, (entry) => entry.binding);
20335
20497
  }
20336
- //#endregion
20337
- //#region src/hosts/vite/plugin.ts
20498
+ // src/hosts/vite/plugin.ts
20338
20499
  const WORKSPACE_PACKAGE_NAME = "@vite-hub/workspace";
20339
20500
  const WORKSPACES_ID = "#vitehub/workspaces";
20340
20501
  const WORKSPACE_PREFIX = "#vitehub/workspaces/";
@@ -21274,5 +21435,4 @@ function hubWorkspace(options) {
21274
21435
  }
21275
21436
  };
21276
21437
  }
21277
- //#endregion
21278
21438
  export { collectWorkspaceContributions, createWorkspaceNitroConfig, discoverViteWorkspaceDefinitions, hubWorkspace, inspectWorkspaceDefinitions, workspaceConsoleSection };