vde-open 0.1.17 → 0.1.18

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.
@@ -1,5 +1,5 @@
1
- import { A as parseMarkdown, T as parse, a as scanCssReferences, b as dirnameOfLogicalPath, h as markdownUrlTransform, i as transformStaticHtml, m as inlineText$1, n as resolveAssetUrl, o as transformCss, p as assertWithinLimits, r as scanHtmlReferences, t as DiagnosticLog, u as MARKDOWN_PARSE_OPTIONS, v as classifyLink } from "./html-static-Ct_9qmNR.js";
2
- //#region ../../packages/document/src/title.ts
1
+ import { A as parseMarkdown, T as parse, a as scanCssReferences, b as dirnameOfLogicalPath, h as markdownUrlTransform, i as transformStaticHtml, m as inlineText$1, n as resolveAssetUrl, o as transformCss, p as assertWithinLimits, r as scanHtmlReferences, t as DiagnosticLog, u as MARKDOWN_PARSE_OPTIONS, v as classifyLink } from "./html-static-FxIbpM5b.js";
2
+ // ../../packages/document/src/title.ts
3
3
  const TITLE_SCAN_CHARS = 65536;
4
4
  const MAX_TITLE_LENGTH = 160;
5
5
  function inlineText(nodes) {
@@ -56,8 +56,7 @@ function extractTitle(source, format) {
56
56
  const head = source.slice(0, TITLE_SCAN_CHARS);
57
57
  return format === "markdown" ? markdownTitle(head) : htmlTitle(head);
58
58
  }
59
- //#endregion
60
- //#region ../../packages/document/src/markdown-render.ts
59
+ // ../../packages/document/src/markdown-render.ts
61
60
  const MAX_LINKS = 2e3;
62
61
  const MAX_LINK_TEXT = 120;
63
62
  function parseWithImages(source) {
@@ -130,8 +129,7 @@ function analyzeMarkdownRender(input, log = new DiagnosticLog()) {
130
129
  diagnostics: log.list()
131
130
  };
132
131
  }
133
- //#endregion
134
- //#region ../../packages/document/src/render-document.ts
132
+ // ../../packages/document/src/render-document.ts
135
133
  function renderDocument(input) {
136
134
  const assets = new Map(input.assets.map((asset) => [asset.logicalPath, asset.role]));
137
135
  const log = new DiagnosticLog();
@@ -178,5 +176,4 @@ function scanReferences(kind, source) {
178
176
  if (kind === "html") return scanHtmlReferences(source);
179
177
  return scanCssReferences(source, "stylesheet");
180
178
  }
181
- //#endregion
182
179
  export { scanReferences as n, extractTitle as r, renderDocument as t };
@@ -0,0 +1,32 @@
1
+ // \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
9
+ var __exportAll = (all, flags) => {
10
+ let target = Object.setPrototypeOf({}, null);
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return flags & 2 ? target : Object.preventExtensions(target);
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ export { __exportAll as n, __toESM as r, __commonJSMin as t };
@@ -1,4 +1,4 @@
1
- //#region ../../packages/shared/src/canonical-json.ts
1
+ // ../../packages/shared/src/canonical-json.ts
2
2
  function canonicalJson(value) {
3
3
  return serialize(value);
4
4
  }
@@ -25,8 +25,7 @@ function serializeObject(value) {
25
25
  }
26
26
  return `{${parts.join(",")}}`;
27
27
  }
28
- //#endregion
29
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
28
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
30
29
  function getEnumValues(entries) {
31
30
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
32
31
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -215,8 +214,8 @@ function optionalKeys(shape) {
215
214
  }
216
215
  const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
217
216
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
218
- int32: [-2147483648, 2147483647],
219
- uint32: [0, 4294967295],
217
+ int32: [-0x80000000, 0x7fffffff],
218
+ uint32: [0, 0xffffffff],
220
219
  float32: [-34028234663852886e22, 34028234663852886e22],
221
220
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
222
221
  }))();
@@ -333,6 +332,17 @@ function prefixIssues(path, issues) {
333
332
  function unwrapMessage(message) {
334
333
  return typeof message === "string" ? message : message?.message;
335
334
  }
335
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
336
+ function sizeCaps(defChecks) {
337
+ const caps = [];
338
+ for (const ch of defChecks ?? []) {
339
+ const d = ch._zod.def;
340
+ if (!/_(length|size)$|_equals$/.test(d.check)) break;
341
+ const max = d.maximum ?? d.length ?? d.size;
342
+ if (max >= 0) caps.push([max, ch]);
343
+ }
344
+ return caps;
345
+ }
336
346
  function attachSchema(issues, start, inst) {
337
347
  var _a;
338
348
  for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
@@ -425,6 +435,7 @@ function hide(inst, key, value) {
425
435
  return own(inst, key, value, false);
426
436
  }
427
437
  /** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
438
+ /* @__NO_SIDE_EFFECTS__ */
428
439
  function derived(computes, table) {
429
440
  for (const key in computes) {
430
441
  const compute = computes[key];
@@ -548,8 +559,7 @@ function constantCatch(value) {
548
559
  fn[CONSTANT_CATCH] = true;
549
560
  return fn;
550
561
  }
551
- //#endregion
552
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
562
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js
553
563
  var _a$1;
554
564
  const _zodDesc = {
555
565
  value: void 0,
@@ -576,6 +586,7 @@ function newError(Definition) {
576
586
  }
577
587
  return new Definition();
578
588
  }
589
+ /* @__NO_SIDE_EFFECTS__ */
579
590
  function $constructor(name, initializer, proto, params) {
580
591
  const zodProto = {};
581
592
  function Internals(def) {
@@ -654,8 +665,7 @@ function config(newConfig) {
654
665
  if (newConfig) Object.assign(globalConfig, newConfig);
655
666
  return globalConfig;
656
667
  }
657
- //#endregion
658
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
668
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js
659
669
  function _getMessage() {
660
670
  const internals = this._zod;
661
671
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -706,8 +716,7 @@ const initializer$1 = (inst, def) => {
706
716
  });
707
717
  }
708
718
  };
709
- const $ZodError = $constructor("$ZodError", initializer$1);
710
- $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
719
+ const $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
711
720
  /** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
712
721
  * ("toString", "constructor") would otherwise read through to the prototype, and assigning
713
722
  * "__proto__" would hit the setter instead of creating a key. */
@@ -770,8 +779,7 @@ function formatError(error, mapper = (issue) => issue.message) {
770
779
  processError(error);
771
780
  return fieldErrors;
772
781
  }
773
- //#endregion
774
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
782
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js
775
783
  function finalizeParams(callee, params) {
776
784
  return {
777
785
  callee: params?.callee ?? callee,
@@ -973,8 +981,7 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
973
981
  const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
974
982
  return _safeParseAsync(_Err)(schema, value, _ctx);
975
983
  };
976
- //#endregion
977
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
984
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js
978
985
  /**
979
986
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
980
987
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -1045,8 +1052,7 @@ const number$1 = /^-?\d+(?:\.\d+)?$/;
1045
1052
  const boolean$1 = /^(?:true|false)$/i;
1046
1053
  const lowercase = /^[^A-Z]*$/;
1047
1054
  const uppercase = /^[^a-z]*$/;
1048
- //#endregion
1049
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
1055
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js
1050
1056
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1051
1057
  var _a;
1052
1058
  inst._zod ?? (inst._zod = {});
@@ -1341,8 +1347,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
1341
1347
  payload.value = def.tx(payload.value);
1342
1348
  };
1343
1349
  });
1344
- //#endregion
1345
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
1350
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js
1346
1351
  var Doc = class {
1347
1352
  constructor(args = [], closed = {}) {
1348
1353
  this.content = [];
@@ -1375,15 +1380,13 @@ var Doc = class {
1375
1380
  return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
1376
1381
  }
1377
1382
  };
1378
- //#endregion
1379
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
1383
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js
1380
1384
  const version = {
1381
1385
  major: 4,
1382
1386
  minor: 6,
1383
- patch: 5
1387
+ patch: 7
1384
1388
  };
1385
- //#endregion
1386
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
1389
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js
1387
1390
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1388
1391
  var _a;
1389
1392
  inst ?? (inst = {});
@@ -1880,6 +1883,26 @@ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1880
1883
  return payload;
1881
1884
  };
1882
1885
  });
1886
+ function capSize(inst, size) {
1887
+ const caps = sizeCaps(inst._zod.def.checks);
1888
+ if (!caps.length) return;
1889
+ const cap = Math.min(...caps.map((c) => c[0]));
1890
+ const parse = inst._zod.parse;
1891
+ inst._zod.parse = (payload, ctx) => {
1892
+ const n = size(payload.value);
1893
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
1894
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
1895
+ const start = payload.issues.length;
1896
+ ch._zod.check(payload);
1897
+ payload.issues[start].continue = false;
1898
+ attachSchema(payload.issues, start, inst);
1899
+ return payload;
1900
+ }
1901
+ }
1902
+ return parse(payload, ctx);
1903
+ };
1904
+ }
1905
+ const arraySize = (input) => Array.isArray(input) ? input.length : -1;
1883
1906
  function handleArrayResult(result, final, index) {
1884
1907
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1885
1908
  final.value[index] = result.value;
@@ -1917,6 +1940,7 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1917
1940
  if (proms.length) return Promise.all(proms).then(() => payload);
1918
1941
  return payload;
1919
1942
  };
1943
+ capSize(inst, arraySize);
1920
1944
  });
1921
1945
  function handlePropertyResult(result, final, key, input, optin, optout) {
1922
1946
  const isPresent = key in input;
@@ -2025,7 +2049,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2025
2049
  }
2026
2050
  return propValues;
2027
2051
  });
2028
- const isObject$2 = isObject;
2052
+ const isObject$1 = isObject;
2029
2053
  const catchall = def.catchall;
2030
2054
  let value;
2031
2055
  const memo = globalConfig.memoizer;
@@ -2033,7 +2057,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2033
2057
  inst._zod.parse = (payload, ctx) => {
2034
2058
  value ?? (value = _normalized.value);
2035
2059
  const input = payload.value;
2036
- if (!isObject$2(input)) {
2060
+ if (!isObject$1(input)) {
2037
2061
  payload.issues.push({
2038
2062
  expected: "object",
2039
2063
  code: "invalid_type",
@@ -2163,7 +2187,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2163
2187
  return doc.compile();
2164
2188
  };
2165
2189
  let fastpass;
2166
- const isObject$1 = isObject;
2190
+ const isObject$2 = isObject;
2167
2191
  const jit = !globalConfig.jitless;
2168
2192
  const fastEnabled = jit && allowsEval.value;
2169
2193
  const catchall = def.catchall;
@@ -2171,7 +2195,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2171
2195
  inst._zod.parse = (payload, ctx) => {
2172
2196
  value ?? (value = _normalized.value);
2173
2197
  const input = payload.value;
2174
- if (!isObject$1(input)) {
2198
+ if (!isObject$2(input)) {
2175
2199
  payload.issues.push({
2176
2200
  expected: "object",
2177
2201
  code: "invalid_type",
@@ -2364,9 +2388,7 @@ function mergeValues(a, b) {
2364
2388
  };
2365
2389
  const newArray = [];
2366
2390
  for (let index = 0; index < a.length; index++) {
2367
- const itemA = a[index];
2368
- const itemB = b[index];
2369
- const sharedValue = mergeValues(itemA, itemB);
2391
+ const sharedValue = mergeValues(a[index], b[index]);
2370
2392
  if (!sharedValue.valid) return {
2371
2393
  valid: false,
2372
2394
  mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
@@ -2816,8 +2838,7 @@ function handleRefineResult(result, payload, input, inst) {
2816
2838
  payload.issues.push(issue(_iss));
2817
2839
  }
2818
2840
  }
2819
- //#endregion
2820
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
2841
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
2821
2842
  var $ZodCyclicError = class extends Error {
2822
2843
  constructor() {
2823
2844
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -3069,8 +3090,7 @@ function isBackEdge(ctx, value) {
3069
3090
  const backEdges = ctx[STATE]?.backEdges;
3070
3091
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
3071
3092
  }
3072
- //#endregion
3073
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
3093
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js
3074
3094
  const error = () => {
3075
3095
  const Sizable = {
3076
3096
  string: {
@@ -3177,8 +3197,7 @@ const error = () => {
3177
3197
  function en_default() {
3178
3198
  return { localeError: error() };
3179
3199
  }
3180
- //#endregion
3181
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
3200
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js
3182
3201
  var _a;
3183
3202
  var $ZodRegistry = class {
3184
3203
  constructor() {
@@ -3224,8 +3243,7 @@ function registry() {
3224
3243
  }
3225
3244
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
3226
3245
  const globalRegistry = globalThis.__zod_globalRegistry;
3227
- //#endregion
3228
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
3246
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js
3229
3247
  function snapshotChecks(def) {
3230
3248
  if (def.checks) def.checks = [...def.checks];
3231
3249
  return def;
@@ -3742,8 +3760,7 @@ function _check(fn, params) {
3742
3760
  ch._zod.check = fn;
3743
3761
  return ch;
3744
3762
  }
3745
- //#endregion
3746
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
3763
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
3747
3764
  function assignProps(target, ...sources) {
3748
3765
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3749
3766
  return target;
@@ -4186,8 +4203,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
4186
4203
  extractDefs(ctx, schema);
4187
4204
  return finalize(ctx, schema);
4188
4205
  };
4189
- //#endregion
4190
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
4206
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
4191
4207
  const narrowMin = (agg, key, value) => {
4192
4208
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
4193
4209
  };
@@ -4325,8 +4341,7 @@ const neverProcessor = (_schema, _ctx, json, _params) => {
4325
4341
  json.not = {};
4326
4342
  };
4327
4343
  const enumProcessor = (schema, _ctx, json, _params) => {
4328
- const def = schema._zod.def;
4329
- const values = getEnumValues(def.entries);
4344
+ const values = getEnumValues(schema._zod.def.entries);
4330
4345
  if (values.length === 0) {
4331
4346
  json.not = {};
4332
4347
  return;
@@ -4634,8 +4649,7 @@ const optionalProcessor = (schema, ctx, _json, params) => {
4634
4649
  const seen = ctx.seen.get(schema);
4635
4650
  seen.ref = def.innerType;
4636
4651
  };
4637
- //#endregion
4638
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
4652
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js
4639
4653
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4640
4654
  function _lazyMethod(proto, key, make) {
4641
4655
  Object.defineProperty(proto, key, {
@@ -4685,8 +4699,7 @@ const initializer = (inst, issues) => {
4685
4699
  };
4686
4700
  const ZodError = /*@__PURE__*/ $constructor("ZodError", initializer);
4687
4701
  const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
4688
- //#endregion
4689
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
4702
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js
4690
4703
  const parse = /* @__PURE__ */ _parse(ZodRealError);
4691
4704
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
4692
4705
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -4699,8 +4712,7 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
4699
4712
  const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
4700
4713
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
4701
4714
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
4702
- //#endregion
4703
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
4715
+ // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
4704
4716
  function _ensureDefaultLocale() {
4705
4717
  if (!globalConfig.localeError) config(en_default());
4706
4718
  }
@@ -5584,8 +5596,7 @@ function refine(fn, _params = {}) {
5584
5596
  function superRefine(fn, params) {
5585
5597
  return /* @__PURE__ */ _superRefine(fn, params);
5586
5598
  }
5587
- //#endregion
5588
- //#region ../../packages/shared/src/limits.ts
5599
+ // ../../packages/shared/src/limits.ts
5589
5600
  const KiB = 1024;
5590
5601
  const MiB = 1024 * KiB;
5591
5602
  const LIMITS = {
@@ -5636,8 +5647,7 @@ const LIMITS = {
5636
5647
  bridgeMessagesPerSecond: 20,
5637
5648
  renderMissingPerGrant: 32
5638
5649
  };
5639
- //#endregion
5640
- //#region ../../packages/shared/src/documents.ts
5650
+ // ../../packages/shared/src/documents.ts
5641
5651
  const documentIdSchema = string().regex(/^doc_[0-9a-f-]{36}$/);
5642
5652
  const revisionSchema = string().regex(/^rev_[0-9a-f]{64}$/);
5643
5653
  const sha256Schema = string().regex(/^[0-9a-f]{64}$/);
@@ -5841,7 +5851,8 @@ const mobileStatusSchema = discriminatedUnion("state", [
5841
5851
  strictObject({ state: literal("disabled") }),
5842
5852
  strictObject({
5843
5853
  state: literal("ready"),
5844
- uiUrl: string()
5854
+ uiUrl: string(),
5855
+ previewPort: number().int()
5845
5856
  }),
5846
5857
  strictObject({
5847
5858
  state: literal("error"),
@@ -5904,7 +5915,8 @@ strictObject({
5904
5915
  catalogVersion: number().int().nonnegative(),
5905
5916
  activeDocumentId: documentIdSchema.nullable(),
5906
5917
  openDocuments: number().int().nonnegative(),
5907
- previewOrigin: string()
5918
+ previewOrigin: string(),
5919
+ phoneUrl: string().nullable()
5908
5920
  });
5909
5921
  const renderGrantParamsSchema = strictObject({
5910
5922
  documentId: documentIdSchema,
@@ -6020,8 +6032,7 @@ strictObject({
6020
6032
  truncated: boolean(),
6021
6033
  nextCursor: string().nullable()
6022
6034
  });
6023
- //#endregion
6024
- //#region ../../packages/shared/src/envelope.ts
6035
+ // ../../packages/shared/src/envelope.ts
6025
6036
  const detailsSchema = record(string(), unknown());
6026
6037
  const warningSchema = strictObject({
6027
6038
  code: string().min(1),
@@ -6067,8 +6078,7 @@ function errorEnvelope(error, warnings = []) {
6067
6078
  warnings
6068
6079
  };
6069
6080
  }
6070
- //#endregion
6071
- //#region ../../packages/shared/src/exit-codes.ts
6081
+ // ../../packages/shared/src/exit-codes.ts
6072
6082
  const ExitCode = {
6073
6083
  success: 0,
6074
6084
  usage: 2,
@@ -6081,8 +6091,7 @@ const ExitCode = {
6081
6091
  internal: 9,
6082
6092
  interrupted: 130
6083
6093
  };
6084
- //#endregion
6085
- //#region ../../packages/shared/src/errors.ts
6094
+ // ../../packages/shared/src/errors.ts
6086
6095
  const ERROR_SPECS = {
6087
6096
  E_INVALID_ARGUMENT: {
6088
6097
  exit: ExitCode.usage,
@@ -6326,8 +6335,7 @@ var VdeError = class extends Error {
6326
6335
  function isVdeError(value) {
6327
6336
  return value instanceof VdeError;
6328
6337
  }
6329
- //#endregion
6330
- //#region ../../packages/shared/src/feedback.ts
6338
+ // ../../packages/shared/src/feedback.ts
6331
6339
  const requestIdSchema = string().regex(/^req_[0-9a-f-]{36}$/);
6332
6340
  const submissionIdSchema = string().regex(/^sub_[0-9a-f-]{36}$/);
6333
6341
  const FIELD_NAME = /^[A-Za-z][A-Za-z0-9_]{0,63}$/;
@@ -6341,6 +6349,7 @@ const fieldNameSchema = string().regex(FIELD_NAME).refine((name) => !RESERVED_NA
6341
6349
  const fieldTitle = string().min(1).max(160);
6342
6350
  const fieldDescription = string().max(2e3);
6343
6351
  const enumValues = array(string().max(160)).min(1).max(32).refine((values) => new Set(values).size === values.length, { message: "The choices contain duplicates." });
6352
+ const enumDescriptions = array(fieldDescription).max(32);
6344
6353
  const lengthLimit = number().int().min(0).max(LIMITS.answerStringLength);
6345
6354
  const finite = number().refine(Number.isFinite, { message: "The number must be finite." });
6346
6355
  const questionFieldSchema = discriminatedUnion("type", [
@@ -6350,7 +6359,9 @@ const questionFieldSchema = discriminatedUnion("type", [
6350
6359
  description: fieldDescription.optional(),
6351
6360
  minLength: lengthLimit.optional(),
6352
6361
  maxLength: lengthLimit.optional(),
6353
- enum: enumValues.optional()
6362
+ enum: enumValues.optional(),
6363
+ enumDescriptions: enumDescriptions.optional(),
6364
+ recommended: string().optional()
6354
6365
  }),
6355
6366
  strictObject({
6356
6367
  type: literal("boolean"),
@@ -6373,8 +6384,10 @@ const questionFieldSchema = discriminatedUnion("type", [
6373
6384
  uniqueItems: literal(true),
6374
6385
  items: strictObject({
6375
6386
  type: literal("string"),
6376
- enum: enumValues
6377
- })
6387
+ enum: enumValues,
6388
+ enumDescriptions: enumDescriptions.optional()
6389
+ }),
6390
+ recommended: array(string()).optional()
6378
6391
  })
6379
6392
  ]);
6380
6393
  const questionnaireSchema = strictObject({
@@ -6431,6 +6444,38 @@ const questionnaireSchema = strictObject({
6431
6444
  path,
6432
6445
  message: "minItems is greater than the number of choices."
6433
6446
  });
6447
+ if (field.type !== "string" && field.type !== "array") continue;
6448
+ const [choices, descriptions, descriptionsPath] = field.type === "string" ? [
6449
+ field.enum,
6450
+ field.enumDescriptions,
6451
+ [...path, "enumDescriptions"]
6452
+ ] : [
6453
+ field.items.enum,
6454
+ field.items.enumDescriptions,
6455
+ [
6456
+ ...path,
6457
+ "items",
6458
+ "enumDescriptions"
6459
+ ]
6460
+ ];
6461
+ if (choices === void 0) {
6462
+ if (descriptions !== void 0 || field.recommended !== void 0) context.addIssue({
6463
+ code: "custom",
6464
+ path,
6465
+ message: "enumDescriptions and recommended need enum."
6466
+ });
6467
+ continue;
6468
+ }
6469
+ if (descriptions !== void 0 && descriptions.length !== choices.length) context.addIssue({
6470
+ code: "custom",
6471
+ path: descriptionsPath,
6472
+ message: "enumDescriptions must have one entry per choice."
6473
+ });
6474
+ if (field.recommended !== void 0 && validateAnswers(questionnaire, { [name]: field.recommended }, { complete: true }).some((issue) => issue.field === name)) context.addIssue({
6475
+ code: "custom",
6476
+ path: [...path, "recommended"],
6477
+ message: "recommended is not a valid answer to this field."
6478
+ });
6434
6479
  }
6435
6480
  });
6436
6481
  const answersSchema = record(fieldNameSchema, union([
@@ -6597,7 +6642,10 @@ strictObject({
6597
6642
  request: feedbackForAgentSchema,
6598
6643
  replayed: boolean()
6599
6644
  });
6600
- const feedbackListParamsSchema = strictObject({ status: feedbackStatusSchema.optional() });
6645
+ const feedbackListParamsSchema = strictObject({
6646
+ status: feedbackStatusSchema.optional(),
6647
+ acknowledged: boolean().optional()
6648
+ });
6601
6649
  strictObject({ requests: array(feedbackForAgentSchema) });
6602
6650
  const feedbackIdParamsSchema = strictObject({ requestId: requestIdSchema });
6603
6651
  const feedbackWaitParamsSchema = strictObject({
@@ -6624,14 +6672,50 @@ const feedbackSubmitParamsSchema = strictObject({
6624
6672
  confirmOlderRevision: boolean().default(false)
6625
6673
  });
6626
6674
  const feedbackCancelParamsSchema = strictObject({ confirmed: literal(true) });
6627
- //#endregion
6628
- //#region ../../packages/shared/src/mobile.ts
6675
+ // ../../packages/shared/src/mobile.ts
6629
6676
  const viewEpochSchema = string().regex(/^\d+\.\d+$/);
6677
+ const mobileLocationSchema = discriminatedUnion("kind", [
6678
+ strictObject({ kind: literal("stdin") }),
6679
+ strictObject({ kind: literal("generated") }),
6680
+ strictObject({
6681
+ kind: literal("outside"),
6682
+ fileName: string()
6683
+ }),
6684
+ strictObject({
6685
+ kind: literal("pending"),
6686
+ fileName: string()
6687
+ }),
6688
+ strictObject({
6689
+ kind: literal("repository"),
6690
+ key: string(),
6691
+ name: string(),
6692
+ checkout: discriminatedUnion("kind", [
6693
+ strictObject({ kind: literal("main") }),
6694
+ strictObject({
6695
+ kind: literal("linked"),
6696
+ key: string(),
6697
+ label: string(),
6698
+ full: string()
6699
+ }),
6700
+ strictObject({ kind: literal("unknown") })
6701
+ ]),
6702
+ path: array(string())
6703
+ }),
6704
+ strictObject({
6705
+ kind: literal("unresolved"),
6706
+ key: string(),
6707
+ name: string(),
6708
+ reason: repositoryReasonSchema,
6709
+ path: array(string())
6710
+ })
6711
+ ]);
6630
6712
  const mobileDocumentSchema = strictObject({
6631
6713
  documentId: documentIdSchema,
6632
6714
  title: string(),
6633
6715
  format: documentFormatSchema,
6716
+ location: mobileLocationSchema,
6634
6717
  openedAt: string(),
6718
+ updatedAt: string(),
6635
6719
  revision: revisionSchema.nullable(),
6636
6720
  sourceState: sourceStateSchema,
6637
6721
  effectiveMode: htmlModeSchema.nullable(),
@@ -6673,6 +6757,7 @@ strictObject({
6673
6757
  anchor: string()
6674
6758
  }))
6675
6759
  });
6760
+ const mobileCloseParamsSchema = strictObject({});
6676
6761
  string().regex(/^[A-Za-z0-9_-]{43}$/);
6677
6762
  const mobileReleaseParamsSchema = strictObject({ grants: array(string().min(1).max(128)).max(256) });
6678
6763
  const mobileCheckParamsSchema = strictObject({ grant: string().min(1).max(128) });
@@ -6694,8 +6779,7 @@ strictObject({
6694
6779
  daemonId: string(),
6695
6780
  documentId: documentIdSchema.optional()
6696
6781
  });
6697
- //#endregion
6698
- //#region ../../node_modules/.pnpm/minisearch@7.2.0/node_modules/minisearch/dist/es/index.js
6782
+ // ../../node_modules/.pnpm/minisearch@7.2.0/node_modules/minisearch/dist/es/index.js
6699
6783
  /** @ignore */
6700
6784
  const ENTRIES = "ENTRIES";
6701
6785
  /** @ignore */
@@ -8467,8 +8551,7 @@ const objectToNumericMapAsync = async (object) => {
8467
8551
  };
8468
8552
  const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
8469
8553
  const SPACE_OR_PUNCTUATION = /[\n\r\p{Z}\p{P}]+/u;
8470
- //#endregion
8471
- //#region src/search/tokenize.ts
8554
+ // src/search/tokenize.ts
8472
8555
  function normalizeForSearch(text) {
8473
8556
  return text.normalize("NFKC").toLowerCase();
8474
8557
  }
@@ -8501,8 +8584,7 @@ function codePointLength(text) {
8501
8584
  function sliceCodePoints(text, start, end) {
8502
8585
  return Array.from(text).slice(start, end).join("");
8503
8586
  }
8504
- //#endregion
8505
- //#region src/search/search-index.ts
8587
+ // src/search/search-index.ts
8506
8588
  const PART_LENGTH = 16384;
8507
8589
  const PART_OVERLAP = 4096;
8508
8590
  const CONTEXT_FACTOR = .25;
@@ -8981,5 +9063,4 @@ var SearchIndex = class {
8981
9063
  return hits;
8982
9064
  }
8983
9065
  };
8984
- //#endregion
8985
- export { sourceStateSchema as $, isErrorCode as A, htmlModeChangeParamsSchema as B, questionnaireSchema as C, validateAnswers as D, utf8Length as E, successEnvelope as F, openParamsSchema as G, lastOpenedDocument as H, assetRecordSchema as I, reorderParamsSchema as J, readParamsSchema as K, closeParamsSchema as L, ExitCode as M, envelopeSchema as N, VdeError as O, errorEnvelope as P, sourceKindSchema as Q, documentFormatSchema as R, feedbackWaitParamsSchema as S, submissionSchema as T, linkOpenParamsSchema as U, htmlModeSchema as V, listParamsSchema as W, searchParamsSchema as X, revisionSchema as Y, sha256Schema as Z, feedbackForgetParamsSchema as _, uniqueTokens as a, boolean as at, feedbackStatusSchema as b, mobileLinkParamsSchema as c, record as ct, answersSchema as d, unknown as dt, watchRuleSchema as et, cancellationSchema as f, ZodError as ft, feedbackDraftParamsSchema as g, feedbackCreateParamsSchema as h, codePointLength as i, array as it, isVdeError as j, exitCodeForError as k, mobileReleaseParamsSchema as l, strictObject as lt, feedbackCancelParamsSchema as m, canonicalJson as mt, batchesOf as n, ZodNumber as nt, mobileCheckParamsSchema as o, literal as ot, feedbackAckParamsSchema as p, _coercedNumber as pt, renderGrantParamsSchema as q, partsOf as r, _enum as rt, mobileGrantParamsSchema as s, number as st, SearchIndex as t, LIMITS as tt, viewEpochSchema as u, string as ut, feedbackIdParamsSchema as v, requestIdSchema as w, feedbackSubmitParamsSchema as x, feedbackListParamsSchema as y, documentIdSchema as z };
9066
+ export { sourceKindSchema as $, exitCodeForError as A, documentIdSchema as B, feedbackWaitParamsSchema as C, utf8Length as D, submissionSchema as E, errorEnvelope as F, listParamsSchema as G, htmlModeSchema as H, successEnvelope as I, renderGrantParamsSchema as J, openParamsSchema as K, assetRecordSchema as L, isVdeError as M, ExitCode as N, validateAnswers as O, envelopeSchema as P, sha256Schema as Q, closeParamsSchema as R, feedbackSubmitParamsSchema as S, requestIdSchema as T, lastOpenedDocument as U, htmlModeChangeParamsSchema as V, linkOpenParamsSchema as W, revisionSchema as X, reorderParamsSchema as Y, searchParamsSchema as Z, feedbackDraftParamsSchema as _, uniqueTokens as a, array as at, feedbackListParamsSchema as b, mobileGrantParamsSchema as c, number as ct, viewEpochSchema as d, string as dt, sourceStateSchema as et, answersSchema as f, unknown as ft, feedbackCreateParamsSchema as g, feedbackCancelParamsSchema as h, canonicalJson as ht, codePointLength as i, _enum as it, isErrorCode as j, VdeError as k, mobileLinkParamsSchema as l, record as lt, feedbackAckParamsSchema as m, _coercedNumber as mt, batchesOf as n, LIMITS as nt, mobileCheckParamsSchema as o, boolean as ot, cancellationSchema as p, ZodError as pt, readParamsSchema as q, partsOf as r, ZodNumber as rt, mobileCloseParamsSchema as s, literal as st, SearchIndex as t, watchRuleSchema as tt, mobileReleaseParamsSchema as u, strictObject as ut, feedbackForgetParamsSchema as v, questionnaireSchema as w, feedbackStatusSchema as x, feedbackIdParamsSchema as y, documentFormatSchema as z };