@cydm/pie 1.0.6 → 1.0.8

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 (59) hide show
  1. package/README.md +156 -9
  2. package/dist/builtin/extensions/ask-user/index.js +2 -3
  3. package/dist/builtin/extensions/init/index.js +70 -68
  4. package/dist/builtin/extensions/kimi-attachments/index.js +3 -3
  5. package/dist/builtin/extensions/plan-mode/index.js +85 -87
  6. package/dist/builtin/extensions/subagent/index.js +17 -7
  7. package/dist/builtin/extensions/todo/index.js +51 -22
  8. package/dist/builtin/skills/browser-tools/CHANGELOG.md +2 -44
  9. package/dist/builtin/skills/browser-tools/README.md +10 -99
  10. package/dist/builtin/skills/browser-tools/SKILL.md +21 -174
  11. package/dist/builtin/skills/browser-tools/package.json +6 -13
  12. package/dist/builtin/skills/browser-tools/playwright-cli.js +24 -0
  13. package/dist/builtin/skills/skill-creator/SKILL.md +17 -17
  14. package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.mjs +285 -0
  15. package/dist/builtin/skills/skill-creator/eval-viewer/viewer.html +1 -1
  16. package/dist/builtin/skills/skill-creator/scripts/aggregate_benchmark.mjs +271 -0
  17. package/dist/builtin/skills/skill-creator/scripts/claude_cli.mjs +115 -0
  18. package/dist/builtin/skills/skill-creator/scripts/generate_report.mjs +224 -0
  19. package/dist/builtin/skills/skill-creator/scripts/improve_description.mjs +198 -0
  20. package/dist/builtin/skills/skill-creator/scripts/package_skill.mjs +132 -0
  21. package/dist/builtin/skills/skill-creator/scripts/pie_runner.mjs +115 -0
  22. package/dist/builtin/skills/skill-creator/scripts/quick_validate.mjs +44 -0
  23. package/dist/builtin/skills/skill-creator/scripts/run_eval.mjs +169 -0
  24. package/dist/builtin/skills/skill-creator/scripts/run_loop.mjs +297 -0
  25. package/dist/builtin/skills/skill-creator/scripts/skill_metadata.mjs +134 -0
  26. package/dist/chunks/chunk-6WD2NFIC.js +8383 -0
  27. package/dist/chunks/{chunk-MWFBYJOI.js → chunk-A5JSJAPK.js} +3973 -1313
  28. package/dist/chunks/chunk-NTYHFBUA.js +36 -0
  29. package/dist/chunks/chunk-ZRONUKTW.js +989 -0
  30. package/dist/chunks/{src-EGWRDMLB.js → src-3X3HBT2G.js} +1 -2
  31. package/dist/chunks/typescript-GSKWJIO4.js +210747 -0
  32. package/dist/cli.js +15261 -12502
  33. package/models.schema.json +238 -0
  34. package/package.json +34 -8
  35. package/dist/builtin/skills/browser-tools/browser-content.js +0 -103
  36. package/dist/builtin/skills/browser-tools/browser-cookies.js +0 -35
  37. package/dist/builtin/skills/browser-tools/browser-eval.js +0 -49
  38. package/dist/builtin/skills/browser-tools/browser-hn-scraper.js +0 -108
  39. package/dist/builtin/skills/browser-tools/browser-nav.js +0 -44
  40. package/dist/builtin/skills/browser-tools/browser-pick.js +0 -162
  41. package/dist/builtin/skills/browser-tools/browser-screenshot.js +0 -34
  42. package/dist/builtin/skills/browser-tools/browser-start.js +0 -86
  43. package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  44. package/dist/builtin/skills/skill-creator/scripts/__init__.py +0 -0
  45. package/dist/builtin/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  46. package/dist/builtin/skills/skill-creator/scripts/generate_report.py +0 -326
  47. package/dist/builtin/skills/skill-creator/scripts/improve_description.py +0 -247
  48. package/dist/builtin/skills/skill-creator/scripts/package_skill.py +0 -136
  49. package/dist/builtin/skills/skill-creator/scripts/quick_validate.py +0 -103
  50. package/dist/builtin/skills/skill-creator/scripts/run_eval.py +0 -310
  51. package/dist/builtin/skills/skill-creator/scripts/run_loop.py +0 -328
  52. package/dist/builtin/skills/skill-creator/scripts/utils.py +0 -47
  53. package/dist/chunks/capabilities-FENCOHVA.js +0 -9
  54. package/dist/chunks/chunk-JYBXCEJJ.js +0 -315
  55. package/dist/chunks/chunk-RID3574D.js +0 -2718
  56. package/dist/chunks/chunk-TBJ25UWB.js +0 -3657
  57. package/dist/chunks/chunk-XZXLO7YB.js +0 -322
  58. package/dist/chunks/file-logger-AL5VVZHH.js +0 -22
  59. package/dist/chunks/src-WRUACRN2.js +0 -132
@@ -1,2718 +0,0 @@
1
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
- import {
3
- __export
4
- } from "./chunk-TG2EQLX2.js";
5
-
6
- // ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
7
- function IsAsyncIterator(value) {
8
- return IsObject(value) && globalThis.Symbol.asyncIterator in value;
9
- }
10
- function IsIterator(value) {
11
- return IsObject(value) && globalThis.Symbol.iterator in value;
12
- }
13
- function IsStandardObject(value) {
14
- return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null);
15
- }
16
- function IsPromise(value) {
17
- return value instanceof globalThis.Promise;
18
- }
19
- function IsDate(value) {
20
- return value instanceof Date && globalThis.Number.isFinite(value.getTime());
21
- }
22
- function IsMap(value) {
23
- return value instanceof globalThis.Map;
24
- }
25
- function IsSet(value) {
26
- return value instanceof globalThis.Set;
27
- }
28
- function IsTypedArray(value) {
29
- return globalThis.ArrayBuffer.isView(value);
30
- }
31
- function IsUint8Array(value) {
32
- return value instanceof globalThis.Uint8Array;
33
- }
34
- function HasPropertyKey(value, key) {
35
- return key in value;
36
- }
37
- function IsObject(value) {
38
- return value !== null && typeof value === "object";
39
- }
40
- function IsArray(value) {
41
- return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
42
- }
43
- function IsUndefined(value) {
44
- return value === void 0;
45
- }
46
- function IsNull(value) {
47
- return value === null;
48
- }
49
- function IsBoolean(value) {
50
- return typeof value === "boolean";
51
- }
52
- function IsNumber(value) {
53
- return typeof value === "number";
54
- }
55
- function IsInteger(value) {
56
- return globalThis.Number.isInteger(value);
57
- }
58
- function IsBigInt(value) {
59
- return typeof value === "bigint";
60
- }
61
- function IsString(value) {
62
- return typeof value === "string";
63
- }
64
- function IsFunction(value) {
65
- return typeof value === "function";
66
- }
67
- function IsSymbol(value) {
68
- return typeof value === "symbol";
69
- }
70
- function IsValueType(value) {
71
- return IsBigInt(value) || IsBoolean(value) || IsNull(value) || IsNumber(value) || IsString(value) || IsSymbol(value) || IsUndefined(value);
72
- }
73
-
74
- // ../../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
75
- var TypeSystemPolicy;
76
- (function(TypeSystemPolicy2) {
77
- TypeSystemPolicy2.InstanceMode = "default";
78
- TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
79
- TypeSystemPolicy2.AllowArrayObject = false;
80
- TypeSystemPolicy2.AllowNaN = false;
81
- TypeSystemPolicy2.AllowNullVoid = false;
82
- function IsExactOptionalProperty(value, key) {
83
- return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
84
- }
85
- TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
86
- function IsObjectLike(value) {
87
- const isObject = IsObject(value);
88
- return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray(value);
89
- }
90
- TypeSystemPolicy2.IsObjectLike = IsObjectLike;
91
- function IsRecordLike(value) {
92
- return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
93
- }
94
- TypeSystemPolicy2.IsRecordLike = IsRecordLike;
95
- function IsNumberLike(value) {
96
- return TypeSystemPolicy2.AllowNaN ? IsNumber(value) : Number.isFinite(value);
97
- }
98
- TypeSystemPolicy2.IsNumberLike = IsNumberLike;
99
- function IsVoidLike(value) {
100
- const isUndefined = IsUndefined(value);
101
- return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
102
- }
103
- TypeSystemPolicy2.IsVoidLike = IsVoidLike;
104
- })(TypeSystemPolicy || (TypeSystemPolicy = {}));
105
-
106
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
107
- var value_exports = {};
108
- __export(value_exports, {
109
- HasPropertyKey: () => HasPropertyKey2,
110
- IsArray: () => IsArray2,
111
- IsAsyncIterator: () => IsAsyncIterator2,
112
- IsBigInt: () => IsBigInt2,
113
- IsBoolean: () => IsBoolean2,
114
- IsDate: () => IsDate2,
115
- IsFunction: () => IsFunction2,
116
- IsIterator: () => IsIterator2,
117
- IsNull: () => IsNull2,
118
- IsNumber: () => IsNumber2,
119
- IsObject: () => IsObject2,
120
- IsRegExp: () => IsRegExp,
121
- IsString: () => IsString2,
122
- IsSymbol: () => IsSymbol2,
123
- IsUint8Array: () => IsUint8Array2,
124
- IsUndefined: () => IsUndefined2
125
- });
126
- function HasPropertyKey2(value, key) {
127
- return key in value;
128
- }
129
- function IsAsyncIterator2(value) {
130
- return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.asyncIterator in value;
131
- }
132
- function IsArray2(value) {
133
- return Array.isArray(value);
134
- }
135
- function IsBigInt2(value) {
136
- return typeof value === "bigint";
137
- }
138
- function IsBoolean2(value) {
139
- return typeof value === "boolean";
140
- }
141
- function IsDate2(value) {
142
- return value instanceof globalThis.Date;
143
- }
144
- function IsFunction2(value) {
145
- return typeof value === "function";
146
- }
147
- function IsIterator2(value) {
148
- return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.iterator in value;
149
- }
150
- function IsNull2(value) {
151
- return value === null;
152
- }
153
- function IsNumber2(value) {
154
- return typeof value === "number";
155
- }
156
- function IsObject2(value) {
157
- return typeof value === "object" && value !== null;
158
- }
159
- function IsRegExp(value) {
160
- return value instanceof globalThis.RegExp;
161
- }
162
- function IsString2(value) {
163
- return typeof value === "string";
164
- }
165
- function IsSymbol2(value) {
166
- return typeof value === "symbol";
167
- }
168
- function IsUint8Array2(value) {
169
- return value instanceof globalThis.Uint8Array;
170
- }
171
- function IsUndefined2(value) {
172
- return value === void 0;
173
- }
174
-
175
- // ../../node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
176
- function ImmutableArray(value) {
177
- return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
178
- }
179
- function ImmutableDate(value) {
180
- return value;
181
- }
182
- function ImmutableUint8Array(value) {
183
- return value;
184
- }
185
- function ImmutableRegExp(value) {
186
- return value;
187
- }
188
- function ImmutableObject(value) {
189
- const result = {};
190
- for (const key of Object.getOwnPropertyNames(value)) {
191
- result[key] = Immutable(value[key]);
192
- }
193
- for (const key of Object.getOwnPropertySymbols(value)) {
194
- result[key] = Immutable(value[key]);
195
- }
196
- return globalThis.Object.freeze(result);
197
- }
198
- function Immutable(value) {
199
- return IsArray2(value) ? ImmutableArray(value) : IsDate2(value) ? ImmutableDate(value) : IsUint8Array2(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject2(value) ? ImmutableObject(value) : value;
200
- }
201
-
202
- // ../../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
203
- function ArrayType(value) {
204
- return value.map((value2) => Visit(value2));
205
- }
206
- function DateType(value) {
207
- return new Date(value.getTime());
208
- }
209
- function Uint8ArrayType(value) {
210
- return new Uint8Array(value);
211
- }
212
- function RegExpType(value) {
213
- return new RegExp(value.source, value.flags);
214
- }
215
- function ObjectType(value) {
216
- const result = {};
217
- for (const key of Object.getOwnPropertyNames(value)) {
218
- result[key] = Visit(value[key]);
219
- }
220
- for (const key of Object.getOwnPropertySymbols(value)) {
221
- result[key] = Visit(value[key]);
222
- }
223
- return result;
224
- }
225
- function Visit(value) {
226
- return IsArray2(value) ? ArrayType(value) : IsDate2(value) ? DateType(value) : IsUint8Array2(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject2(value) ? ObjectType(value) : value;
227
- }
228
- function Clone(value) {
229
- return Visit(value);
230
- }
231
-
232
- // ../../node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
233
- function CreateType(schema, options) {
234
- const result = options !== void 0 ? { ...options, ...schema } : schema;
235
- switch (TypeSystemPolicy.InstanceMode) {
236
- case "freeze":
237
- return Immutable(result);
238
- case "clone":
239
- return Clone(result);
240
- default:
241
- return result;
242
- }
243
- }
244
-
245
- // ../../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
246
- var TransformKind = Symbol.for("TypeBox.Transform");
247
- var ReadonlyKind = Symbol.for("TypeBox.Readonly");
248
- var OptionalKind = Symbol.for("TypeBox.Optional");
249
- var Hint = Symbol.for("TypeBox.Hint");
250
- var Kind = Symbol.for("TypeBox.Kind");
251
-
252
- // ../../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
253
- function Any(options) {
254
- return CreateType({ [Kind]: "Any" }, options);
255
- }
256
-
257
- // ../../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
258
- function Array2(items, options) {
259
- return CreateType({ [Kind]: "Array", type: "array", items }, options);
260
- }
261
-
262
- // ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
263
- function Boolean(options) {
264
- return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
265
- }
266
-
267
- // ../../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
268
- function DiscardKey(value, key) {
269
- const { [key]: _, ...rest } = value;
270
- return rest;
271
- }
272
- function Discard(value, keys) {
273
- return keys.reduce((acc, key) => DiscardKey(acc, key), value);
274
- }
275
-
276
- // ../../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
277
- function Never(options) {
278
- return CreateType({ [Kind]: "Never", not: {} }, options);
279
- }
280
-
281
- // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
282
- function MappedResult(properties) {
283
- return CreateType({
284
- [Kind]: "MappedResult",
285
- properties
286
- });
287
- }
288
-
289
- // ../../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
290
- function AsyncIterator(items, options) {
291
- return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
292
- }
293
-
294
- // ../../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
295
- function Constructor(parameters, returns, options) {
296
- return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
297
- }
298
-
299
- // ../../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
300
- function Function(parameters, returns, options) {
301
- return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
302
- }
303
-
304
- // ../../node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
305
- var TypeBoxError = class extends Error {
306
- constructor(message) {
307
- super(message);
308
- }
309
- };
310
-
311
- // ../../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
312
- function Computed(target, parameters, options) {
313
- return CreateType({ [Kind]: "Computed", target, parameters }, options);
314
- }
315
-
316
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
317
- function UnionCreate(T, options) {
318
- return CreateType({ [Kind]: "Union", anyOf: T }, options);
319
- }
320
-
321
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
322
- function IsReadonly(value) {
323
- return IsObject2(value) && value[ReadonlyKind] === "Readonly";
324
- }
325
- function IsOptional(value) {
326
- return IsObject2(value) && value[OptionalKind] === "Optional";
327
- }
328
- function IsAny(value) {
329
- return IsKindOf(value, "Any");
330
- }
331
- function IsArgument(value) {
332
- return IsKindOf(value, "Argument");
333
- }
334
- function IsArray3(value) {
335
- return IsKindOf(value, "Array");
336
- }
337
- function IsAsyncIterator3(value) {
338
- return IsKindOf(value, "AsyncIterator");
339
- }
340
- function IsBigInt3(value) {
341
- return IsKindOf(value, "BigInt");
342
- }
343
- function IsBoolean3(value) {
344
- return IsKindOf(value, "Boolean");
345
- }
346
- function IsComputed(value) {
347
- return IsKindOf(value, "Computed");
348
- }
349
- function IsConstructor(value) {
350
- return IsKindOf(value, "Constructor");
351
- }
352
- function IsDate3(value) {
353
- return IsKindOf(value, "Date");
354
- }
355
- function IsFunction3(value) {
356
- return IsKindOf(value, "Function");
357
- }
358
- function IsInteger2(value) {
359
- return IsKindOf(value, "Integer");
360
- }
361
- function IsIntersect(value) {
362
- return IsKindOf(value, "Intersect");
363
- }
364
- function IsIterator3(value) {
365
- return IsKindOf(value, "Iterator");
366
- }
367
- function IsKindOf(value, kind) {
368
- return IsObject2(value) && Kind in value && value[Kind] === kind;
369
- }
370
- function IsLiteralValue(value) {
371
- return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
372
- }
373
- function IsLiteral(value) {
374
- return IsKindOf(value, "Literal");
375
- }
376
- function IsMappedKey(value) {
377
- return IsKindOf(value, "MappedKey");
378
- }
379
- function IsMappedResult(value) {
380
- return IsKindOf(value, "MappedResult");
381
- }
382
- function IsNever(value) {
383
- return IsKindOf(value, "Never");
384
- }
385
- function IsNot(value) {
386
- return IsKindOf(value, "Not");
387
- }
388
- function IsNull3(value) {
389
- return IsKindOf(value, "Null");
390
- }
391
- function IsNumber3(value) {
392
- return IsKindOf(value, "Number");
393
- }
394
- function IsObject3(value) {
395
- return IsKindOf(value, "Object");
396
- }
397
- function IsPromise2(value) {
398
- return IsKindOf(value, "Promise");
399
- }
400
- function IsRecord(value) {
401
- return IsKindOf(value, "Record");
402
- }
403
- function IsRef(value) {
404
- return IsKindOf(value, "Ref");
405
- }
406
- function IsRegExp2(value) {
407
- return IsKindOf(value, "RegExp");
408
- }
409
- function IsString3(value) {
410
- return IsKindOf(value, "String");
411
- }
412
- function IsSymbol3(value) {
413
- return IsKindOf(value, "Symbol");
414
- }
415
- function IsTemplateLiteral(value) {
416
- return IsKindOf(value, "TemplateLiteral");
417
- }
418
- function IsThis(value) {
419
- return IsKindOf(value, "This");
420
- }
421
- function IsTransform(value) {
422
- return IsObject2(value) && TransformKind in value;
423
- }
424
- function IsTuple(value) {
425
- return IsKindOf(value, "Tuple");
426
- }
427
- function IsUndefined3(value) {
428
- return IsKindOf(value, "Undefined");
429
- }
430
- function IsUnion(value) {
431
- return IsKindOf(value, "Union");
432
- }
433
- function IsUint8Array3(value) {
434
- return IsKindOf(value, "Uint8Array");
435
- }
436
- function IsUnknown(value) {
437
- return IsKindOf(value, "Unknown");
438
- }
439
- function IsUnsafe(value) {
440
- return IsKindOf(value, "Unsafe");
441
- }
442
- function IsVoid(value) {
443
- return IsKindOf(value, "Void");
444
- }
445
- function IsKind(value) {
446
- return IsObject2(value) && Kind in value && IsString2(value[Kind]);
447
- }
448
- function IsSchema(value) {
449
- return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed(value) || IsConstructor(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect(value) || IsIterator3(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array3(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
450
- }
451
-
452
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
453
- function IsUnionOptional(types) {
454
- return types.some((type) => IsOptional(type));
455
- }
456
- function RemoveOptionalFromRest(types) {
457
- return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
458
- }
459
- function RemoveOptionalFromType(T) {
460
- return Discard(T, [OptionalKind]);
461
- }
462
- function ResolveUnion(types, options) {
463
- const isOptional = IsUnionOptional(types);
464
- return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
465
- }
466
- function UnionEvaluated(T, options) {
467
- return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
468
- }
469
-
470
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
471
- function Union(types, options) {
472
- return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
473
- }
474
-
475
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
476
- var TemplateLiteralParserError = class extends TypeBoxError {
477
- };
478
- function Unescape(pattern) {
479
- return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
480
- }
481
- function IsNonEscaped(pattern, index, char) {
482
- return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
483
- }
484
- function IsOpenParen(pattern, index) {
485
- return IsNonEscaped(pattern, index, "(");
486
- }
487
- function IsCloseParen(pattern, index) {
488
- return IsNonEscaped(pattern, index, ")");
489
- }
490
- function IsSeparator(pattern, index) {
491
- return IsNonEscaped(pattern, index, "|");
492
- }
493
- function IsGroup(pattern) {
494
- if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
495
- return false;
496
- let count = 0;
497
- for (let index = 0; index < pattern.length; index++) {
498
- if (IsOpenParen(pattern, index))
499
- count += 1;
500
- if (IsCloseParen(pattern, index))
501
- count -= 1;
502
- if (count === 0 && index !== pattern.length - 1)
503
- return false;
504
- }
505
- return true;
506
- }
507
- function InGroup(pattern) {
508
- return pattern.slice(1, pattern.length - 1);
509
- }
510
- function IsPrecedenceOr(pattern) {
511
- let count = 0;
512
- for (let index = 0; index < pattern.length; index++) {
513
- if (IsOpenParen(pattern, index))
514
- count += 1;
515
- if (IsCloseParen(pattern, index))
516
- count -= 1;
517
- if (IsSeparator(pattern, index) && count === 0)
518
- return true;
519
- }
520
- return false;
521
- }
522
- function IsPrecedenceAnd(pattern) {
523
- for (let index = 0; index < pattern.length; index++) {
524
- if (IsOpenParen(pattern, index))
525
- return true;
526
- }
527
- return false;
528
- }
529
- function Or(pattern) {
530
- let [count, start] = [0, 0];
531
- const expressions = [];
532
- for (let index = 0; index < pattern.length; index++) {
533
- if (IsOpenParen(pattern, index))
534
- count += 1;
535
- if (IsCloseParen(pattern, index))
536
- count -= 1;
537
- if (IsSeparator(pattern, index) && count === 0) {
538
- const range2 = pattern.slice(start, index);
539
- if (range2.length > 0)
540
- expressions.push(TemplateLiteralParse(range2));
541
- start = index + 1;
542
- }
543
- }
544
- const range = pattern.slice(start);
545
- if (range.length > 0)
546
- expressions.push(TemplateLiteralParse(range));
547
- if (expressions.length === 0)
548
- return { type: "const", const: "" };
549
- if (expressions.length === 1)
550
- return expressions[0];
551
- return { type: "or", expr: expressions };
552
- }
553
- function And(pattern) {
554
- function Group(value, index) {
555
- if (!IsOpenParen(value, index))
556
- throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
557
- let count = 0;
558
- for (let scan = index; scan < value.length; scan++) {
559
- if (IsOpenParen(value, scan))
560
- count += 1;
561
- if (IsCloseParen(value, scan))
562
- count -= 1;
563
- if (count === 0)
564
- return [index, scan];
565
- }
566
- throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
567
- }
568
- function Range(pattern2, index) {
569
- for (let scan = index; scan < pattern2.length; scan++) {
570
- if (IsOpenParen(pattern2, scan))
571
- return [index, scan];
572
- }
573
- return [index, pattern2.length];
574
- }
575
- const expressions = [];
576
- for (let index = 0; index < pattern.length; index++) {
577
- if (IsOpenParen(pattern, index)) {
578
- const [start, end] = Group(pattern, index);
579
- const range = pattern.slice(start, end + 1);
580
- expressions.push(TemplateLiteralParse(range));
581
- index = end;
582
- } else {
583
- const [start, end] = Range(pattern, index);
584
- const range = pattern.slice(start, end);
585
- if (range.length > 0)
586
- expressions.push(TemplateLiteralParse(range));
587
- index = end - 1;
588
- }
589
- }
590
- return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
591
- }
592
- function TemplateLiteralParse(pattern) {
593
- return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
594
- }
595
- function TemplateLiteralParseExact(pattern) {
596
- return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
597
- }
598
-
599
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
600
- var TemplateLiteralFiniteError = class extends TypeBoxError {
601
- };
602
- function IsNumberExpression(expression) {
603
- return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
604
- }
605
- function IsBooleanExpression(expression) {
606
- return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
607
- }
608
- function IsStringExpression(expression) {
609
- return expression.type === "const" && expression.const === ".*";
610
- }
611
- function IsTemplateLiteralExpressionFinite(expression) {
612
- return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
613
- throw new TemplateLiteralFiniteError(`Unknown expression type`);
614
- })();
615
- }
616
- function IsTemplateLiteralFinite(schema) {
617
- const expression = TemplateLiteralParseExact(schema.pattern);
618
- return IsTemplateLiteralExpressionFinite(expression);
619
- }
620
-
621
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
622
- var TemplateLiteralGenerateError = class extends TypeBoxError {
623
- };
624
- function* GenerateReduce(buffer) {
625
- if (buffer.length === 1)
626
- return yield* buffer[0];
627
- for (const left of buffer[0]) {
628
- for (const right of GenerateReduce(buffer.slice(1))) {
629
- yield `${left}${right}`;
630
- }
631
- }
632
- }
633
- function* GenerateAnd(expression) {
634
- return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
635
- }
636
- function* GenerateOr(expression) {
637
- for (const expr of expression.expr)
638
- yield* TemplateLiteralExpressionGenerate(expr);
639
- }
640
- function* GenerateConst(expression) {
641
- return yield expression.const;
642
- }
643
- function* TemplateLiteralExpressionGenerate(expression) {
644
- return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
645
- throw new TemplateLiteralGenerateError("Unknown expression");
646
- })();
647
- }
648
- function TemplateLiteralGenerate(schema) {
649
- const expression = TemplateLiteralParseExact(schema.pattern);
650
- return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
651
- }
652
-
653
- // ../../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
654
- function Literal(value, options) {
655
- return CreateType({
656
- [Kind]: "Literal",
657
- const: value,
658
- type: typeof value
659
- }, options);
660
- }
661
-
662
- // ../../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
663
- function BigInt(options) {
664
- return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
665
- }
666
-
667
- // ../../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
668
- function Number2(options) {
669
- return CreateType({ [Kind]: "Number", type: "number" }, options);
670
- }
671
-
672
- // ../../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
673
- function String(options) {
674
- return CreateType({ [Kind]: "String", type: "string" }, options);
675
- }
676
-
677
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
678
- function* FromUnion(syntax) {
679
- const trim = syntax.trim().replace(/"|'/g, "");
680
- return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
681
- const literals = trim.split("|").map((literal) => Literal(literal.trim()));
682
- return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
683
- })();
684
- }
685
- function* FromTerminal(syntax) {
686
- if (syntax[1] !== "{") {
687
- const L = Literal("$");
688
- const R = FromSyntax(syntax.slice(1));
689
- return yield* [L, ...R];
690
- }
691
- for (let i = 2; i < syntax.length; i++) {
692
- if (syntax[i] === "}") {
693
- const L = FromUnion(syntax.slice(2, i));
694
- const R = FromSyntax(syntax.slice(i + 1));
695
- return yield* [...L, ...R];
696
- }
697
- }
698
- yield Literal(syntax);
699
- }
700
- function* FromSyntax(syntax) {
701
- for (let i = 0; i < syntax.length; i++) {
702
- if (syntax[i] === "$") {
703
- const L = Literal(syntax.slice(0, i));
704
- const R = FromTerminal(syntax.slice(i));
705
- return yield* [L, ...R];
706
- }
707
- }
708
- yield Literal(syntax);
709
- }
710
- function TemplateLiteralSyntax(syntax) {
711
- return [...FromSyntax(syntax)];
712
- }
713
-
714
- // ../../node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
715
- var PatternBoolean = "(true|false)";
716
- var PatternNumber = "(0|[1-9][0-9]*)";
717
- var PatternString = "(.*)";
718
- var PatternNever = "(?!.*)";
719
- var PatternBooleanExact = `^${PatternBoolean}$`;
720
- var PatternNumberExact = `^${PatternNumber}$`;
721
- var PatternStringExact = `^${PatternString}$`;
722
- var PatternNeverExact = `^${PatternNever}$`;
723
-
724
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
725
- var TemplateLiteralPatternError = class extends TypeBoxError {
726
- };
727
- function Escape(value) {
728
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
729
- }
730
- function Visit2(schema, acc) {
731
- return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` : IsInteger2(schema) ? `${acc}${PatternNumber}` : IsBigInt3(schema) ? `${acc}${PatternNumber}` : IsString3(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean3(schema) ? `${acc}${PatternBoolean}` : (() => {
732
- throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
733
- })();
734
- }
735
- function TemplateLiteralPattern(kinds) {
736
- return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
737
- }
738
-
739
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
740
- function TemplateLiteralToUnion(schema) {
741
- const R = TemplateLiteralGenerate(schema);
742
- const L = R.map((S) => Literal(S));
743
- return UnionEvaluated(L);
744
- }
745
-
746
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
747
- function TemplateLiteral(unresolved, options) {
748
- const pattern = IsString2(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
749
- return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
750
- }
751
-
752
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
753
- function FromTemplateLiteral(templateLiteral) {
754
- const keys = TemplateLiteralGenerate(templateLiteral);
755
- return keys.map((key) => key.toString());
756
- }
757
- function FromUnion2(types) {
758
- const result = [];
759
- for (const type of types)
760
- result.push(...IndexPropertyKeys(type));
761
- return result;
762
- }
763
- function FromLiteral(literalValue) {
764
- return [literalValue.toString()];
765
- }
766
- function IndexPropertyKeys(type) {
767
- return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger2(type) ? ["[number]"] : [])];
768
- }
769
-
770
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
771
- function FromProperties(type, properties, options) {
772
- const result = {};
773
- for (const K2 of Object.getOwnPropertyNames(properties)) {
774
- result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
775
- }
776
- return result;
777
- }
778
- function FromMappedResult(type, mappedResult, options) {
779
- return FromProperties(type, mappedResult.properties, options);
780
- }
781
- function IndexFromMappedResult(type, mappedResult, options) {
782
- const properties = FromMappedResult(type, mappedResult, options);
783
- return MappedResult(properties);
784
- }
785
-
786
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
787
- function FromRest(types, key) {
788
- return types.map((type) => IndexFromPropertyKey(type, key));
789
- }
790
- function FromIntersectRest(types) {
791
- return types.filter((type) => !IsNever(type));
792
- }
793
- function FromIntersect(types, key) {
794
- return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
795
- }
796
- function FromUnionRest(types) {
797
- return types.some((L) => IsNever(L)) ? [] : types;
798
- }
799
- function FromUnion3(types, key) {
800
- return UnionEvaluated(FromUnionRest(FromRest(types, key)));
801
- }
802
- function FromTuple(types, key) {
803
- return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
804
- }
805
- function FromArray(type, key) {
806
- return key === "[number]" ? type : Never();
807
- }
808
- function FromProperty(properties, propertyKey) {
809
- return propertyKey in properties ? properties[propertyKey] : Never();
810
- }
811
- function IndexFromPropertyKey(type, propertyKey) {
812
- return IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : IsUnion(type) ? FromUnion3(type.anyOf, propertyKey) : IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : IsArray3(type) ? FromArray(type.items, propertyKey) : IsObject3(type) ? FromProperty(type.properties, propertyKey) : Never();
813
- }
814
- function IndexFromPropertyKeys(type, propertyKeys) {
815
- return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
816
- }
817
- function FromSchema(type, propertyKeys) {
818
- return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
819
- }
820
- function Index(type, key, options) {
821
- if (IsRef(type) || IsRef(key)) {
822
- const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
823
- if (!IsSchema(type) || !IsSchema(key))
824
- throw new TypeBoxError(error);
825
- return Computed("Index", [type, key]);
826
- }
827
- if (IsMappedResult(key))
828
- return IndexFromMappedResult(type, key, options);
829
- if (IsMappedKey(key))
830
- return IndexFromMappedKey(type, key, options);
831
- return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
832
- }
833
-
834
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
835
- function MappedIndexPropertyKey(type, key, options) {
836
- return { [key]: Index(type, [key], Clone(options)) };
837
- }
838
- function MappedIndexPropertyKeys(type, propertyKeys, options) {
839
- return propertyKeys.reduce((result, left) => {
840
- return { ...result, ...MappedIndexPropertyKey(type, left, options) };
841
- }, {});
842
- }
843
- function MappedIndexProperties(type, mappedKey, options) {
844
- return MappedIndexPropertyKeys(type, mappedKey.keys, options);
845
- }
846
- function IndexFromMappedKey(type, mappedKey, options) {
847
- const properties = MappedIndexProperties(type, mappedKey, options);
848
- return MappedResult(properties);
849
- }
850
-
851
- // ../../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
852
- function Iterator(items, options) {
853
- return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
854
- }
855
-
856
- // ../../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
857
- function RequiredArray(properties) {
858
- return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
859
- }
860
- function _Object(properties, options) {
861
- const required = RequiredArray(properties);
862
- const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
863
- return CreateType(schema, options);
864
- }
865
- var Object2 = _Object;
866
-
867
- // ../../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
868
- function Promise2(item, options) {
869
- return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
870
- }
871
-
872
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
873
- function RemoveReadonly(schema) {
874
- return CreateType(Discard(schema, [ReadonlyKind]));
875
- }
876
- function AddReadonly(schema) {
877
- return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
878
- }
879
- function ReadonlyWithFlag(schema, F) {
880
- return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
881
- }
882
- function Readonly(schema, enable) {
883
- const F = enable ?? true;
884
- return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
885
- }
886
-
887
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
888
- function FromProperties2(K, F) {
889
- const Acc = {};
890
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
891
- Acc[K2] = Readonly(K[K2], F);
892
- return Acc;
893
- }
894
- function FromMappedResult2(R, F) {
895
- return FromProperties2(R.properties, F);
896
- }
897
- function ReadonlyFromMappedResult(R, F) {
898
- const P = FromMappedResult2(R, F);
899
- return MappedResult(P);
900
- }
901
-
902
- // ../../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
903
- function Tuple(types, options) {
904
- return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
905
- }
906
-
907
- // ../../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
908
- function SetIncludes(T, S) {
909
- return T.includes(S);
910
- }
911
- function SetDistinct(T) {
912
- return [...new Set(T)];
913
- }
914
- function SetIntersect(T, S) {
915
- return T.filter((L) => S.includes(L));
916
- }
917
- function SetIntersectManyResolve(T, Init) {
918
- return T.reduce((Acc, L) => {
919
- return SetIntersect(Acc, L);
920
- }, Init);
921
- }
922
- function SetIntersectMany(T) {
923
- return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
924
- }
925
- function SetUnionMany(T) {
926
- const Acc = [];
927
- for (const L of T)
928
- Acc.push(...L);
929
- return Acc;
930
- }
931
-
932
- // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
933
- function FromMappedResult3(K, P) {
934
- return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
935
- }
936
- function MappedKeyToKnownMappedResultProperties(K) {
937
- return { [K]: Literal(K) };
938
- }
939
- function MappedKeyToUnknownMappedResultProperties(P) {
940
- const Acc = {};
941
- for (const L of P)
942
- Acc[L] = Literal(L);
943
- return Acc;
944
- }
945
- function MappedKeyToMappedResultProperties(K, P) {
946
- return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
947
- }
948
- function FromMappedKey(K, P) {
949
- const R = MappedKeyToMappedResultProperties(K, P);
950
- return FromMappedResult3(K, R);
951
- }
952
- function FromRest2(K, T) {
953
- return T.map((L) => FromSchemaType(K, L));
954
- }
955
- function FromProperties3(K, T) {
956
- const Acc = {};
957
- for (const K2 of globalThis.Object.getOwnPropertyNames(T))
958
- Acc[K2] = FromSchemaType(K, T[K2]);
959
- return Acc;
960
- }
961
- function FromSchemaType(K, T) {
962
- const options = { ...T };
963
- return (
964
- // unevaluated modifier types
965
- IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
966
- // unevaluated mapped types
967
- IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
968
- // unevaluated types
969
- IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction3(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator3(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator3(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties3(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise2(T) ? Promise2(FromSchemaType(K, T.item), options) : T
970
- )
971
- )
972
- );
973
- }
974
- function MappedFunctionReturnType(K, T) {
975
- const Acc = {};
976
- for (const L of K)
977
- Acc[L] = FromSchemaType(L, T);
978
- return Acc;
979
- }
980
- function Mapped(key, map, options) {
981
- const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
982
- const RT = map({ [Kind]: "MappedKey", keys: K });
983
- const R = MappedFunctionReturnType(K, RT);
984
- return Object2(R, options);
985
- }
986
-
987
- // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
988
- function RemoveOptional(schema) {
989
- return CreateType(Discard(schema, [OptionalKind]));
990
- }
991
- function AddOptional(schema) {
992
- return CreateType({ ...schema, [OptionalKind]: "Optional" });
993
- }
994
- function OptionalWithFlag(schema, F) {
995
- return F === false ? RemoveOptional(schema) : AddOptional(schema);
996
- }
997
- function Optional(schema, enable) {
998
- const F = enable ?? true;
999
- return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
1000
- }
1001
-
1002
- // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1003
- function FromProperties4(P, F) {
1004
- const Acc = {};
1005
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1006
- Acc[K2] = Optional(P[K2], F);
1007
- return Acc;
1008
- }
1009
- function FromMappedResult4(R, F) {
1010
- return FromProperties4(R.properties, F);
1011
- }
1012
- function OptionalFromMappedResult(R, F) {
1013
- const P = FromMappedResult4(R, F);
1014
- return MappedResult(P);
1015
- }
1016
-
1017
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1018
- function IntersectCreate(T, options = {}) {
1019
- const allObjects = T.every((schema) => IsObject3(schema));
1020
- const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1021
- return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
1022
- }
1023
-
1024
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1025
- function IsIntersectOptional(types) {
1026
- return types.every((left) => IsOptional(left));
1027
- }
1028
- function RemoveOptionalFromType2(type) {
1029
- return Discard(type, [OptionalKind]);
1030
- }
1031
- function RemoveOptionalFromRest2(types) {
1032
- return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
1033
- }
1034
- function ResolveIntersect(types, options) {
1035
- return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
1036
- }
1037
- function IntersectEvaluated(types, options = {}) {
1038
- if (types.length === 1)
1039
- return CreateType(types[0], options);
1040
- if (types.length === 0)
1041
- return Never(options);
1042
- if (types.some((schema) => IsTransform(schema)))
1043
- throw new Error("Cannot intersect transform types");
1044
- return ResolveIntersect(types, options);
1045
- }
1046
-
1047
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1048
- function Intersect(types, options) {
1049
- if (types.length === 1)
1050
- return CreateType(types[0], options);
1051
- if (types.length === 0)
1052
- return Never(options);
1053
- if (types.some((schema) => IsTransform(schema)))
1054
- throw new Error("Cannot intersect transform types");
1055
- return IntersectCreate(types, options);
1056
- }
1057
-
1058
- // ../../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1059
- function Ref(...args) {
1060
- const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1061
- if (typeof $ref !== "string")
1062
- throw new TypeBoxError("Ref: $ref must be a string");
1063
- return CreateType({ [Kind]: "Ref", $ref }, options);
1064
- }
1065
-
1066
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1067
- function FromRest3(types) {
1068
- const result = [];
1069
- for (const L of types)
1070
- result.push(KeyOfPropertyKeys(L));
1071
- return result;
1072
- }
1073
- function FromIntersect2(types) {
1074
- const propertyKeysArray = FromRest3(types);
1075
- const propertyKeys = SetUnionMany(propertyKeysArray);
1076
- return propertyKeys;
1077
- }
1078
- function FromUnion4(types) {
1079
- const propertyKeysArray = FromRest3(types);
1080
- const propertyKeys = SetIntersectMany(propertyKeysArray);
1081
- return propertyKeys;
1082
- }
1083
- function FromTuple2(types) {
1084
- return types.map((_, indexer) => indexer.toString());
1085
- }
1086
- function FromArray2(_) {
1087
- return ["[number]"];
1088
- }
1089
- function FromProperties5(T) {
1090
- return globalThis.Object.getOwnPropertyNames(T);
1091
- }
1092
- function FromPatternProperties(patternProperties) {
1093
- if (!includePatternProperties)
1094
- return [];
1095
- const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1096
- return patternPropertyKeys.map((key) => {
1097
- return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1098
- });
1099
- }
1100
- function KeyOfPropertyKeys(type) {
1101
- return IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
1102
- }
1103
- var includePatternProperties = false;
1104
- function KeyOfPattern(schema) {
1105
- includePatternProperties = true;
1106
- const keys = KeyOfPropertyKeys(schema);
1107
- includePatternProperties = false;
1108
- const pattern = keys.map((key) => `(${key})`);
1109
- return `^(${pattern.join("|")})$`;
1110
- }
1111
-
1112
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1113
- function FromComputed(target, parameters) {
1114
- return Computed("KeyOf", [Computed(target, parameters)]);
1115
- }
1116
- function FromRef($ref) {
1117
- return Computed("KeyOf", [Ref($ref)]);
1118
- }
1119
- function KeyOfFromType(type, options) {
1120
- const propertyKeys = KeyOfPropertyKeys(type);
1121
- const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
1122
- const result = UnionEvaluated(propertyKeyTypes);
1123
- return CreateType(result, options);
1124
- }
1125
- function KeyOfPropertyKeysToRest(propertyKeys) {
1126
- return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
1127
- }
1128
- function KeyOf(type, options) {
1129
- return IsComputed(type) ? FromComputed(type.target, type.parameters) : IsRef(type) ? FromRef(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1130
- }
1131
-
1132
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1133
- function FromProperties6(properties, options) {
1134
- const result = {};
1135
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1136
- result[K2] = KeyOf(properties[K2], Clone(options));
1137
- return result;
1138
- }
1139
- function FromMappedResult5(mappedResult, options) {
1140
- return FromProperties6(mappedResult.properties, options);
1141
- }
1142
- function KeyOfFromMappedResult(mappedResult, options) {
1143
- const properties = FromMappedResult5(mappedResult, options);
1144
- return MappedResult(properties);
1145
- }
1146
-
1147
- // ../../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1148
- function CompositeKeys(T) {
1149
- const Acc = [];
1150
- for (const L of T)
1151
- Acc.push(...KeyOfPropertyKeys(L));
1152
- return SetDistinct(Acc);
1153
- }
1154
- function FilterNever(T) {
1155
- return T.filter((L) => !IsNever(L));
1156
- }
1157
- function CompositeProperty(T, K) {
1158
- const Acc = [];
1159
- for (const L of T)
1160
- Acc.push(...IndexFromPropertyKeys(L, [K]));
1161
- return FilterNever(Acc);
1162
- }
1163
- function CompositeProperties(T, K) {
1164
- const Acc = {};
1165
- for (const L of K) {
1166
- Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1167
- }
1168
- return Acc;
1169
- }
1170
- function Composite(T, options) {
1171
- const K = CompositeKeys(T);
1172
- const P = CompositeProperties(T, K);
1173
- const R = Object2(P, options);
1174
- return R;
1175
- }
1176
-
1177
- // ../../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1178
- function Date2(options) {
1179
- return CreateType({ [Kind]: "Date", type: "Date" }, options);
1180
- }
1181
-
1182
- // ../../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1183
- function Null(options) {
1184
- return CreateType({ [Kind]: "Null", type: "null" }, options);
1185
- }
1186
-
1187
- // ../../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1188
- function Symbol2(options) {
1189
- return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
1190
- }
1191
-
1192
- // ../../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1193
- function Undefined(options) {
1194
- return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
1195
- }
1196
-
1197
- // ../../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1198
- function Uint8Array2(options) {
1199
- return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
1200
- }
1201
-
1202
- // ../../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1203
- function Unknown(options) {
1204
- return CreateType({ [Kind]: "Unknown" }, options);
1205
- }
1206
-
1207
- // ../../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1208
- function FromArray3(T) {
1209
- return T.map((L) => FromValue(L, false));
1210
- }
1211
- function FromProperties7(value) {
1212
- const Acc = {};
1213
- for (const K of globalThis.Object.getOwnPropertyNames(value))
1214
- Acc[K] = Readonly(FromValue(value[K], false));
1215
- return Acc;
1216
- }
1217
- function ConditionalReadonly(T, root) {
1218
- return root === true ? T : Readonly(T);
1219
- }
1220
- function FromValue(value, root) {
1221
- return IsAsyncIterator2(value) ? ConditionalReadonly(Any(), root) : IsIterator2(value) ? ConditionalReadonly(Any(), root) : IsArray2(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array2(value) ? Uint8Array2() : IsDate2(value) ? Date2() : IsObject2(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction2(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined2(value) ? Undefined() : IsNull2(value) ? Null() : IsSymbol2(value) ? Symbol2() : IsBigInt2(value) ? BigInt() : IsNumber2(value) ? Literal(value) : IsBoolean2(value) ? Literal(value) : IsString2(value) ? Literal(value) : Object2({});
1222
- }
1223
- function Const(T, options) {
1224
- return CreateType(FromValue(T, true), options);
1225
- }
1226
-
1227
- // ../../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1228
- function Enum(item, options) {
1229
- if (IsUndefined2(item))
1230
- throw new Error("Enum undefined or empty");
1231
- const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1232
- const values2 = [...new Set(values1)];
1233
- const anyOf = values2.map((value) => Literal(value));
1234
- return Union(anyOf, { ...options, [Hint]: "Enum" });
1235
- }
1236
-
1237
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
1238
- var type_exports = {};
1239
- __export(type_exports, {
1240
- IsAny: () => IsAny2,
1241
- IsArgument: () => IsArgument2,
1242
- IsArray: () => IsArray4,
1243
- IsAsyncIterator: () => IsAsyncIterator4,
1244
- IsBigInt: () => IsBigInt4,
1245
- IsBoolean: () => IsBoolean4,
1246
- IsComputed: () => IsComputed2,
1247
- IsConstructor: () => IsConstructor2,
1248
- IsDate: () => IsDate4,
1249
- IsFunction: () => IsFunction4,
1250
- IsImport: () => IsImport,
1251
- IsInteger: () => IsInteger3,
1252
- IsIntersect: () => IsIntersect2,
1253
- IsIterator: () => IsIterator4,
1254
- IsKind: () => IsKind2,
1255
- IsKindOf: () => IsKindOf2,
1256
- IsLiteral: () => IsLiteral2,
1257
- IsLiteralBoolean: () => IsLiteralBoolean,
1258
- IsLiteralNumber: () => IsLiteralNumber,
1259
- IsLiteralString: () => IsLiteralString,
1260
- IsLiteralValue: () => IsLiteralValue2,
1261
- IsMappedKey: () => IsMappedKey2,
1262
- IsMappedResult: () => IsMappedResult2,
1263
- IsNever: () => IsNever2,
1264
- IsNot: () => IsNot2,
1265
- IsNull: () => IsNull4,
1266
- IsNumber: () => IsNumber4,
1267
- IsObject: () => IsObject4,
1268
- IsOptional: () => IsOptional2,
1269
- IsPromise: () => IsPromise3,
1270
- IsProperties: () => IsProperties,
1271
- IsReadonly: () => IsReadonly2,
1272
- IsRecord: () => IsRecord2,
1273
- IsRecursive: () => IsRecursive,
1274
- IsRef: () => IsRef2,
1275
- IsRegExp: () => IsRegExp3,
1276
- IsSchema: () => IsSchema2,
1277
- IsString: () => IsString4,
1278
- IsSymbol: () => IsSymbol4,
1279
- IsTemplateLiteral: () => IsTemplateLiteral2,
1280
- IsThis: () => IsThis2,
1281
- IsTransform: () => IsTransform2,
1282
- IsTuple: () => IsTuple2,
1283
- IsUint8Array: () => IsUint8Array4,
1284
- IsUndefined: () => IsUndefined4,
1285
- IsUnion: () => IsUnion2,
1286
- IsUnionLiteral: () => IsUnionLiteral,
1287
- IsUnknown: () => IsUnknown2,
1288
- IsUnsafe: () => IsUnsafe2,
1289
- IsVoid: () => IsVoid2,
1290
- TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
1291
- });
1292
- var TypeGuardUnknownTypeError = class extends TypeBoxError {
1293
- };
1294
- var KnownTypes = [
1295
- "Argument",
1296
- "Any",
1297
- "Array",
1298
- "AsyncIterator",
1299
- "BigInt",
1300
- "Boolean",
1301
- "Computed",
1302
- "Constructor",
1303
- "Date",
1304
- "Enum",
1305
- "Function",
1306
- "Integer",
1307
- "Intersect",
1308
- "Iterator",
1309
- "Literal",
1310
- "MappedKey",
1311
- "MappedResult",
1312
- "Not",
1313
- "Null",
1314
- "Number",
1315
- "Object",
1316
- "Promise",
1317
- "Record",
1318
- "Ref",
1319
- "RegExp",
1320
- "String",
1321
- "Symbol",
1322
- "TemplateLiteral",
1323
- "This",
1324
- "Tuple",
1325
- "Undefined",
1326
- "Union",
1327
- "Uint8Array",
1328
- "Unknown",
1329
- "Void"
1330
- ];
1331
- function IsPattern(value) {
1332
- try {
1333
- new RegExp(value);
1334
- return true;
1335
- } catch {
1336
- return false;
1337
- }
1338
- }
1339
- function IsControlCharacterFree(value) {
1340
- if (!IsString2(value))
1341
- return false;
1342
- for (let i = 0; i < value.length; i++) {
1343
- const code = value.charCodeAt(i);
1344
- if (code >= 7 && code <= 13 || code === 27 || code === 127) {
1345
- return false;
1346
- }
1347
- }
1348
- return true;
1349
- }
1350
- function IsAdditionalProperties(value) {
1351
- return IsOptionalBoolean(value) || IsSchema2(value);
1352
- }
1353
- function IsOptionalBigInt(value) {
1354
- return IsUndefined2(value) || IsBigInt2(value);
1355
- }
1356
- function IsOptionalNumber(value) {
1357
- return IsUndefined2(value) || IsNumber2(value);
1358
- }
1359
- function IsOptionalBoolean(value) {
1360
- return IsUndefined2(value) || IsBoolean2(value);
1361
- }
1362
- function IsOptionalString(value) {
1363
- return IsUndefined2(value) || IsString2(value);
1364
- }
1365
- function IsOptionalPattern(value) {
1366
- return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value) && IsPattern(value);
1367
- }
1368
- function IsOptionalFormat(value) {
1369
- return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value);
1370
- }
1371
- function IsOptionalSchema(value) {
1372
- return IsUndefined2(value) || IsSchema2(value);
1373
- }
1374
- function IsReadonly2(value) {
1375
- return IsObject2(value) && value[ReadonlyKind] === "Readonly";
1376
- }
1377
- function IsOptional2(value) {
1378
- return IsObject2(value) && value[OptionalKind] === "Optional";
1379
- }
1380
- function IsAny2(value) {
1381
- return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
1382
- }
1383
- function IsArgument2(value) {
1384
- return IsKindOf2(value, "Argument") && IsNumber2(value.index);
1385
- }
1386
- function IsArray4(value) {
1387
- return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
1388
- }
1389
- function IsAsyncIterator4(value) {
1390
- return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
1391
- }
1392
- function IsBigInt4(value) {
1393
- return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
1394
- }
1395
- function IsBoolean4(value) {
1396
- return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
1397
- }
1398
- function IsComputed2(value) {
1399
- return IsKindOf2(value, "Computed") && IsString2(value.target) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
1400
- }
1401
- function IsConstructor2(value) {
1402
- return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
1403
- }
1404
- function IsDate4(value) {
1405
- return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
1406
- }
1407
- function IsFunction4(value) {
1408
- return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
1409
- }
1410
- function IsImport(value) {
1411
- return IsKindOf2(value, "Import") && HasPropertyKey2(value, "$defs") && IsObject2(value.$defs) && IsProperties(value.$defs) && HasPropertyKey2(value, "$ref") && IsString2(value.$ref) && value.$ref in value.$defs;
1412
- }
1413
- function IsInteger3(value) {
1414
- return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
1415
- }
1416
- function IsProperties(value) {
1417
- return IsObject2(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
1418
- }
1419
- function IsIntersect2(value) {
1420
- return IsKindOf2(value, "Intersect") && (IsString2(value.type) && value.type !== "object" ? false : true) && IsArray2(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
1421
- }
1422
- function IsIterator4(value) {
1423
- return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
1424
- }
1425
- function IsKindOf2(value, kind) {
1426
- return IsObject2(value) && Kind in value && value[Kind] === kind;
1427
- }
1428
- function IsLiteralString(value) {
1429
- return IsLiteral2(value) && IsString2(value.const);
1430
- }
1431
- function IsLiteralNumber(value) {
1432
- return IsLiteral2(value) && IsNumber2(value.const);
1433
- }
1434
- function IsLiteralBoolean(value) {
1435
- return IsLiteral2(value) && IsBoolean2(value.const);
1436
- }
1437
- function IsLiteral2(value) {
1438
- return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
1439
- }
1440
- function IsLiteralValue2(value) {
1441
- return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
1442
- }
1443
- function IsMappedKey2(value) {
1444
- return IsKindOf2(value, "MappedKey") && IsArray2(value.keys) && value.keys.every((key) => IsNumber2(key) || IsString2(key));
1445
- }
1446
- function IsMappedResult2(value) {
1447
- return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
1448
- }
1449
- function IsNever2(value) {
1450
- return IsKindOf2(value, "Never") && IsObject2(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
1451
- }
1452
- function IsNot2(value) {
1453
- return IsKindOf2(value, "Not") && IsSchema2(value.not);
1454
- }
1455
- function IsNull4(value) {
1456
- return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
1457
- }
1458
- function IsNumber4(value) {
1459
- return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
1460
- }
1461
- function IsObject4(value) {
1462
- return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
1463
- }
1464
- function IsPromise3(value) {
1465
- return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
1466
- }
1467
- function IsRecord2(value) {
1468
- return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject2(value.patternProperties) && ((schema) => {
1469
- const keys = Object.getOwnPropertyNames(schema.patternProperties);
1470
- return keys.length === 1 && IsPattern(keys[0]) && IsObject2(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
1471
- })(value);
1472
- }
1473
- function IsRecursive(value) {
1474
- return IsObject2(value) && Hint in value && value[Hint] === "Recursive";
1475
- }
1476
- function IsRef2(value) {
1477
- return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString2(value.$ref);
1478
- }
1479
- function IsRegExp3(value) {
1480
- return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString2(value.source) && IsString2(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
1481
- }
1482
- function IsString4(value) {
1483
- return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
1484
- }
1485
- function IsSymbol4(value) {
1486
- return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
1487
- }
1488
- function IsTemplateLiteral2(value) {
1489
- return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString2(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
1490
- }
1491
- function IsThis2(value) {
1492
- return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString2(value.$ref);
1493
- }
1494
- function IsTransform2(value) {
1495
- return IsObject2(value) && TransformKind in value;
1496
- }
1497
- function IsTuple2(value) {
1498
- return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber2(value.minItems) && IsNumber2(value.maxItems) && value.minItems === value.maxItems && // empty
1499
- (IsUndefined2(value.items) && IsUndefined2(value.additionalItems) && value.minItems === 0 || IsArray2(value.items) && value.items.every((schema) => IsSchema2(schema)));
1500
- }
1501
- function IsUndefined4(value) {
1502
- return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
1503
- }
1504
- function IsUnionLiteral(value) {
1505
- return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
1506
- }
1507
- function IsUnion2(value) {
1508
- return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject2(value) && IsArray2(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
1509
- }
1510
- function IsUint8Array4(value) {
1511
- return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
1512
- }
1513
- function IsUnknown2(value) {
1514
- return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
1515
- }
1516
- function IsUnsafe2(value) {
1517
- return IsKindOf2(value, "Unsafe");
1518
- }
1519
- function IsVoid2(value) {
1520
- return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
1521
- }
1522
- function IsKind2(value) {
1523
- return IsObject2(value) && Kind in value && IsString2(value[Kind]) && !KnownTypes.includes(value[Kind]);
1524
- }
1525
- function IsSchema2(value) {
1526
- return IsObject2(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean4(value) || IsBigInt4(value) || IsAsyncIterator4(value) || IsComputed2(value) || IsConstructor2(value) || IsDate4(value) || IsFunction4(value) || IsInteger3(value) || IsIntersect2(value) || IsIterator4(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull4(value) || IsNumber4(value) || IsObject4(value) || IsPromise3(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString4(value) || IsSymbol4(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array4(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
1527
- }
1528
-
1529
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
1530
- var ExtendsResolverError = class extends TypeBoxError {
1531
- };
1532
- var ExtendsResult;
1533
- (function(ExtendsResult2) {
1534
- ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
1535
- ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
1536
- ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
1537
- })(ExtendsResult || (ExtendsResult = {}));
1538
- function IntoBooleanResult(result) {
1539
- return result === ExtendsResult.False ? result : ExtendsResult.True;
1540
- }
1541
- function Throw(message) {
1542
- throw new ExtendsResolverError(message);
1543
- }
1544
- function IsStructuralRight(right) {
1545
- return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
1546
- }
1547
- function StructuralRight(left, right) {
1548
- return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
1549
- }
1550
- function FromAnyRight(left, right) {
1551
- return ExtendsResult.True;
1552
- }
1553
- function FromAny(left, right) {
1554
- return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) && right.anyOf.some((schema) => type_exports.IsAny(schema) || type_exports.IsUnknown(schema)) ? ExtendsResult.True : type_exports.IsUnion(right) ? ExtendsResult.Union : type_exports.IsUnknown(right) ? ExtendsResult.True : type_exports.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
1555
- }
1556
- function FromArrayRight(left, right) {
1557
- return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
1558
- }
1559
- function FromArray4(left, right) {
1560
- return type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1561
- }
1562
- function FromAsyncIterator(left, right) {
1563
- return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1564
- }
1565
- function FromBigInt(left, right) {
1566
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
1567
- }
1568
- function FromBooleanRight(left, right) {
1569
- return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
1570
- }
1571
- function FromBoolean(left, right) {
1572
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
1573
- }
1574
- function FromConstructor(left, right) {
1575
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
1576
- }
1577
- function FromDate(left, right) {
1578
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
1579
- }
1580
- function FromFunction(left, right) {
1581
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
1582
- }
1583
- function FromIntegerRight(left, right) {
1584
- return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1585
- }
1586
- function FromInteger(left, right) {
1587
- return type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
1588
- }
1589
- function FromIntersectRight(left, right) {
1590
- return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1591
- }
1592
- function FromIntersect3(left, right) {
1593
- return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1594
- }
1595
- function FromIterator(left, right) {
1596
- return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1597
- }
1598
- function FromLiteral2(left, right) {
1599
- return type_exports.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
1600
- }
1601
- function FromNeverRight(left, right) {
1602
- return ExtendsResult.False;
1603
- }
1604
- function FromNever(left, right) {
1605
- return ExtendsResult.True;
1606
- }
1607
- function UnwrapTNot(schema) {
1608
- let [current, depth] = [schema, 0];
1609
- while (true) {
1610
- if (!type_exports.IsNot(current))
1611
- break;
1612
- current = current.not;
1613
- depth += 1;
1614
- }
1615
- return depth % 2 === 0 ? current : Unknown();
1616
- }
1617
- function FromNot(left, right) {
1618
- return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
1619
- }
1620
- function FromNull(left, right) {
1621
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
1622
- }
1623
- function FromNumberRight(left, right) {
1624
- return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1625
- }
1626
- function FromNumber(left, right) {
1627
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
1628
- }
1629
- function IsObjectPropertyCount(schema, count) {
1630
- return Object.getOwnPropertyNames(schema.properties).length === count;
1631
- }
1632
- function IsObjectStringLike(schema) {
1633
- return IsObjectArrayLike(schema);
1634
- }
1635
- function IsObjectSymbolLike(schema) {
1636
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && type_exports.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (type_exports.IsString(schema.properties.description.anyOf[0]) && type_exports.IsUndefined(schema.properties.description.anyOf[1]) || type_exports.IsString(schema.properties.description.anyOf[1]) && type_exports.IsUndefined(schema.properties.description.anyOf[0]));
1637
- }
1638
- function IsObjectNumberLike(schema) {
1639
- return IsObjectPropertyCount(schema, 0);
1640
- }
1641
- function IsObjectBooleanLike(schema) {
1642
- return IsObjectPropertyCount(schema, 0);
1643
- }
1644
- function IsObjectBigIntLike(schema) {
1645
- return IsObjectPropertyCount(schema, 0);
1646
- }
1647
- function IsObjectDateLike(schema) {
1648
- return IsObjectPropertyCount(schema, 0);
1649
- }
1650
- function IsObjectUint8ArrayLike(schema) {
1651
- return IsObjectArrayLike(schema);
1652
- }
1653
- function IsObjectFunctionLike(schema) {
1654
- const length = Number2();
1655
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1656
- }
1657
- function IsObjectConstructorLike(schema) {
1658
- return IsObjectPropertyCount(schema, 0);
1659
- }
1660
- function IsObjectArrayLike(schema) {
1661
- const length = Number2();
1662
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1663
- }
1664
- function IsObjectPromiseLike(schema) {
1665
- const then = Function([Any()], Any());
1666
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
1667
- }
1668
- function Property(left, right) {
1669
- return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
1670
- }
1671
- function FromObjectRight(left, right) {
1672
- return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) || type_exports.IsLiteralString(left) && IsObjectStringLike(right) || type_exports.IsLiteralNumber(left) && IsObjectNumberLike(right) || type_exports.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsBigInt(left) && IsObjectBigIntLike(right) || type_exports.IsString(left) && IsObjectStringLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsNumber(left) && IsObjectNumberLike(right) || type_exports.IsInteger(left) && IsObjectNumberLike(right) || type_exports.IsBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || type_exports.IsDate(left) && IsObjectDateLike(right) || type_exports.IsConstructor(left) && IsObjectConstructorLike(right) || type_exports.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : type_exports.IsRecord(left) && type_exports.IsString(RecordKey(left)) ? (() => {
1673
- return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
1674
- })() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
1675
- return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
1676
- })() : ExtendsResult.False;
1677
- }
1678
- function FromObject(left, right) {
1679
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
1680
- for (const key of Object.getOwnPropertyNames(right.properties)) {
1681
- if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
1682
- return ExtendsResult.False;
1683
- }
1684
- if (type_exports.IsOptional(right.properties[key])) {
1685
- return ExtendsResult.True;
1686
- }
1687
- if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
1688
- return ExtendsResult.False;
1689
- }
1690
- }
1691
- return ExtendsResult.True;
1692
- })();
1693
- }
1694
- function FromPromise(left, right) {
1695
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !type_exports.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.item, right.item));
1696
- }
1697
- function RecordKey(schema) {
1698
- return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
1699
- }
1700
- function RecordValue(schema) {
1701
- return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
1702
- }
1703
- function FromRecordRight(left, right) {
1704
- const [Key, Value] = [RecordKey(right), RecordValue(right)];
1705
- return type_exports.IsLiteralString(left) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsString(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsArray(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsObject(left) ? (() => {
1706
- for (const key of Object.getOwnPropertyNames(left.properties)) {
1707
- if (Property(Value, left.properties[key]) === ExtendsResult.False) {
1708
- return ExtendsResult.False;
1709
- }
1710
- }
1711
- return ExtendsResult.True;
1712
- })() : ExtendsResult.False;
1713
- }
1714
- function FromRecord(left, right) {
1715
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
1716
- }
1717
- function FromRegExp(left, right) {
1718
- const L = type_exports.IsRegExp(left) ? String() : left;
1719
- const R = type_exports.IsRegExp(right) ? String() : right;
1720
- return Visit3(L, R);
1721
- }
1722
- function FromStringRight(left, right) {
1723
- return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
1724
- }
1725
- function FromString(left, right) {
1726
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? ExtendsResult.True : ExtendsResult.False;
1727
- }
1728
- function FromSymbol(left, right) {
1729
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
1730
- }
1731
- function FromTemplateLiteral2(left, right) {
1732
- return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
1733
- }
1734
- function IsArrayOfTuple(left, right) {
1735
- return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
1736
- }
1737
- function FromTupleRight(left, right) {
1738
- return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
1739
- }
1740
- function FromTuple3(left, right) {
1741
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : type_exports.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !type_exports.IsTuple(right) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) || !value_exports.IsUndefined(left.items) && value_exports.IsUndefined(right.items) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit3(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1742
- }
1743
- function FromUint8Array(left, right) {
1744
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
1745
- }
1746
- function FromUndefined(left, right) {
1747
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsVoid(right) ? FromVoidRight(left, right) : type_exports.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
1748
- }
1749
- function FromUnionRight(left, right) {
1750
- return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1751
- }
1752
- function FromUnion5(left, right) {
1753
- return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1754
- }
1755
- function FromUnknownRight(left, right) {
1756
- return ExtendsResult.True;
1757
- }
1758
- function FromUnknown(left, right) {
1759
- return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : type_exports.IsArray(right) ? FromArrayRight(left, right) : type_exports.IsTuple(right) ? FromTupleRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
1760
- }
1761
- function FromVoidRight(left, right) {
1762
- return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
1763
- }
1764
- function FromVoid(left, right) {
1765
- return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
1766
- }
1767
- function Visit3(left, right) {
1768
- return (
1769
- // resolvable
1770
- type_exports.IsTemplateLiteral(left) || type_exports.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : type_exports.IsRegExp(left) || type_exports.IsRegExp(right) ? FromRegExp(left, right) : type_exports.IsNot(left) || type_exports.IsNot(right) ? FromNot(left, right) : (
1771
- // standard
1772
- type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect3(left, right) : type_exports.IsIterator(left) ? FromIterator(left, right) : type_exports.IsLiteral(left) ? FromLiteral2(left, right) : type_exports.IsNever(left) ? FromNever(left, right) : type_exports.IsNull(left) ? FromNull(left, right) : type_exports.IsNumber(left) ? FromNumber(left, right) : type_exports.IsObject(left) ? FromObject(left, right) : type_exports.IsRecord(left) ? FromRecord(left, right) : type_exports.IsString(left) ? FromString(left, right) : type_exports.IsSymbol(left) ? FromSymbol(left, right) : type_exports.IsTuple(left) ? FromTuple3(left, right) : type_exports.IsPromise(left) ? FromPromise(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion5(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
1773
- )
1774
- );
1775
- }
1776
- function ExtendsCheck(left, right) {
1777
- return Visit3(left, right);
1778
- }
1779
-
1780
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
1781
- function FromProperties8(P, Right, True, False, options) {
1782
- const Acc = {};
1783
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1784
- Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
1785
- return Acc;
1786
- }
1787
- function FromMappedResult6(Left, Right, True, False, options) {
1788
- return FromProperties8(Left.properties, Right, True, False, options);
1789
- }
1790
- function ExtendsFromMappedResult(Left, Right, True, False, options) {
1791
- const P = FromMappedResult6(Left, Right, True, False, options);
1792
- return MappedResult(P);
1793
- }
1794
-
1795
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
1796
- function ExtendsResolve(left, right, trueType, falseType) {
1797
- const R = ExtendsCheck(left, right);
1798
- return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
1799
- }
1800
- function Extends(L, R, T, F, options) {
1801
- return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
1802
- }
1803
-
1804
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
1805
- function FromPropertyKey(K, U, L, R, options) {
1806
- return {
1807
- [K]: Extends(Literal(K), U, L, R, Clone(options))
1808
- };
1809
- }
1810
- function FromPropertyKeys(K, U, L, R, options) {
1811
- return K.reduce((Acc, LK) => {
1812
- return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
1813
- }, {});
1814
- }
1815
- function FromMappedKey2(K, U, L, R, options) {
1816
- return FromPropertyKeys(K.keys, U, L, R, options);
1817
- }
1818
- function ExtendsFromMappedKey(T, U, L, R, options) {
1819
- const P = FromMappedKey2(T, U, L, R, options);
1820
- return MappedResult(P);
1821
- }
1822
-
1823
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
1824
- function ExcludeFromTemplateLiteral(L, R) {
1825
- return Exclude(TemplateLiteralToUnion(L), R);
1826
- }
1827
-
1828
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
1829
- function ExcludeRest(L, R) {
1830
- const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1831
- return excluded.length === 1 ? excluded[0] : Union(excluded);
1832
- }
1833
- function Exclude(L, R, options = {}) {
1834
- if (IsTemplateLiteral(L))
1835
- return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1836
- if (IsMappedResult(L))
1837
- return CreateType(ExcludeFromMappedResult(L, R), options);
1838
- return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1839
- }
1840
-
1841
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1842
- function FromProperties9(P, U) {
1843
- const Acc = {};
1844
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1845
- Acc[K2] = Exclude(P[K2], U);
1846
- return Acc;
1847
- }
1848
- function FromMappedResult7(R, T) {
1849
- return FromProperties9(R.properties, T);
1850
- }
1851
- function ExcludeFromMappedResult(R, T) {
1852
- const P = FromMappedResult7(R, T);
1853
- return MappedResult(P);
1854
- }
1855
-
1856
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1857
- function ExtractFromTemplateLiteral(L, R) {
1858
- return Extract(TemplateLiteralToUnion(L), R);
1859
- }
1860
-
1861
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1862
- function ExtractRest(L, R) {
1863
- const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1864
- return extracted.length === 1 ? extracted[0] : Union(extracted);
1865
- }
1866
- function Extract(L, R, options) {
1867
- if (IsTemplateLiteral(L))
1868
- return CreateType(ExtractFromTemplateLiteral(L, R), options);
1869
- if (IsMappedResult(L))
1870
- return CreateType(ExtractFromMappedResult(L, R), options);
1871
- return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1872
- }
1873
-
1874
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1875
- function FromProperties10(P, T) {
1876
- const Acc = {};
1877
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1878
- Acc[K2] = Extract(P[K2], T);
1879
- return Acc;
1880
- }
1881
- function FromMappedResult8(R, T) {
1882
- return FromProperties10(R.properties, T);
1883
- }
1884
- function ExtractFromMappedResult(R, T) {
1885
- const P = FromMappedResult8(R, T);
1886
- return MappedResult(P);
1887
- }
1888
-
1889
- // ../../node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
1890
- function Integer(options) {
1891
- return CreateType({ [Kind]: "Integer", type: "integer" }, options);
1892
- }
1893
-
1894
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
1895
- function MappedIntrinsicPropertyKey(K, M, options) {
1896
- return {
1897
- [K]: Intrinsic(Literal(K), M, Clone(options))
1898
- };
1899
- }
1900
- function MappedIntrinsicPropertyKeys(K, M, options) {
1901
- const result = K.reduce((Acc, L) => {
1902
- return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
1903
- }, {});
1904
- return result;
1905
- }
1906
- function MappedIntrinsicProperties(T, M, options) {
1907
- return MappedIntrinsicPropertyKeys(T["keys"], M, options);
1908
- }
1909
- function IntrinsicFromMappedKey(T, M, options) {
1910
- const P = MappedIntrinsicProperties(T, M, options);
1911
- return MappedResult(P);
1912
- }
1913
-
1914
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
1915
- function ApplyUncapitalize(value) {
1916
- const [first, rest] = [value.slice(0, 1), value.slice(1)];
1917
- return [first.toLowerCase(), rest].join("");
1918
- }
1919
- function ApplyCapitalize(value) {
1920
- const [first, rest] = [value.slice(0, 1), value.slice(1)];
1921
- return [first.toUpperCase(), rest].join("");
1922
- }
1923
- function ApplyUppercase(value) {
1924
- return value.toUpperCase();
1925
- }
1926
- function ApplyLowercase(value) {
1927
- return value.toLowerCase();
1928
- }
1929
- function FromTemplateLiteral3(schema, mode, options) {
1930
- const expression = TemplateLiteralParseExact(schema.pattern);
1931
- const finite = IsTemplateLiteralExpressionFinite(expression);
1932
- if (!finite)
1933
- return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
1934
- const strings = [...TemplateLiteralExpressionGenerate(expression)];
1935
- const literals = strings.map((value) => Literal(value));
1936
- const mapped = FromRest4(literals, mode);
1937
- const union = Union(mapped);
1938
- return TemplateLiteral([union], options);
1939
- }
1940
- function FromLiteralValue(value, mode) {
1941
- return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
1942
- }
1943
- function FromRest4(T, M) {
1944
- return T.map((L) => Intrinsic(L, M));
1945
- }
1946
- function Intrinsic(schema, mode, options = {}) {
1947
- return (
1948
- // Intrinsic-Mapped-Inference
1949
- IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
1950
- // Standard-Inference
1951
- IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest4(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
1952
- // Default Type
1953
- CreateType(schema, options)
1954
- )
1955
- )
1956
- );
1957
- }
1958
-
1959
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
1960
- function Capitalize(T, options = {}) {
1961
- return Intrinsic(T, "Capitalize", options);
1962
- }
1963
-
1964
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
1965
- function Lowercase(T, options = {}) {
1966
- return Intrinsic(T, "Lowercase", options);
1967
- }
1968
-
1969
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
1970
- function Uncapitalize(T, options = {}) {
1971
- return Intrinsic(T, "Uncapitalize", options);
1972
- }
1973
-
1974
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
1975
- function Uppercase(T, options = {}) {
1976
- return Intrinsic(T, "Uppercase", options);
1977
- }
1978
-
1979
- // ../../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
1980
- function Not(type, options) {
1981
- return CreateType({ [Kind]: "Not", not: type }, options);
1982
- }
1983
-
1984
- // ../../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
1985
- function CloneType(schema, options) {
1986
- return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
1987
- }
1988
-
1989
- // ../../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1990
- function FromComputed2(target, parameters) {
1991
- return Computed("Awaited", [Computed(target, parameters)]);
1992
- }
1993
- function FromRef2($ref) {
1994
- return Computed("Awaited", [Ref($ref)]);
1995
- }
1996
- function FromIntersect4(types) {
1997
- return Intersect(FromRest5(types));
1998
- }
1999
- function FromUnion6(types) {
2000
- return Union(FromRest5(types));
2001
- }
2002
- function FromPromise2(type) {
2003
- return Awaited(type);
2004
- }
2005
- function FromRest5(types) {
2006
- return types.map((type) => Awaited(type));
2007
- }
2008
- function Awaited(type, options) {
2009
- return CreateType(IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsIntersect(type) ? FromIntersect4(type.allOf) : IsUnion(type) ? FromUnion6(type.anyOf) : IsPromise2(type) ? FromPromise2(type.item) : IsRef(type) ? FromRef2(type.$ref) : type, options);
2010
- }
2011
-
2012
- // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
2013
- function FromProperties11(properties, propertyKeys, options) {
2014
- const result = {};
2015
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2016
- result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
2017
- return result;
2018
- }
2019
- function FromMappedResult9(mappedResult, propertyKeys, options) {
2020
- return FromProperties11(mappedResult.properties, propertyKeys, options);
2021
- }
2022
- function OmitFromMappedResult(mappedResult, propertyKeys, options) {
2023
- const properties = FromMappedResult9(mappedResult, propertyKeys, options);
2024
- return MappedResult(properties);
2025
- }
2026
-
2027
- // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
2028
- function FromIntersect5(types, propertyKeys) {
2029
- return types.map((type) => OmitResolve(type, propertyKeys));
2030
- }
2031
- function FromUnion7(types, propertyKeys) {
2032
- return types.map((type) => OmitResolve(type, propertyKeys));
2033
- }
2034
- function FromProperty2(properties, key) {
2035
- const { [key]: _, ...R } = properties;
2036
- return R;
2037
- }
2038
- function FromProperties12(properties, propertyKeys) {
2039
- return propertyKeys.reduce((T, K2) => FromProperty2(T, K2), properties);
2040
- }
2041
- function FromObject2(type, propertyKeys, properties) {
2042
- const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2043
- const mappedProperties = FromProperties12(properties, propertyKeys);
2044
- return Object2(mappedProperties, options);
2045
- }
2046
- function UnionFromPropertyKeys(propertyKeys) {
2047
- const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2048
- return Union(result);
2049
- }
2050
- function OmitResolve(type, propertyKeys) {
2051
- return IsIntersect(type) ? Intersect(FromIntersect5(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion7(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject2(type, propertyKeys, type.properties) : Object2({});
2052
- }
2053
- function Omit(type, key, options) {
2054
- const typeKey = IsArray2(key) ? UnionFromPropertyKeys(key) : key;
2055
- const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2056
- const isTypeRef = IsRef(type);
2057
- const isKeyRef = IsRef(key);
2058
- return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
2059
- }
2060
-
2061
- // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2062
- function FromPropertyKey2(type, key, options) {
2063
- return { [key]: Omit(type, [key], Clone(options)) };
2064
- }
2065
- function FromPropertyKeys2(type, propertyKeys, options) {
2066
- return propertyKeys.reduce((Acc, LK) => {
2067
- return { ...Acc, ...FromPropertyKey2(type, LK, options) };
2068
- }, {});
2069
- }
2070
- function FromMappedKey3(type, mappedKey, options) {
2071
- return FromPropertyKeys2(type, mappedKey.keys, options);
2072
- }
2073
- function OmitFromMappedKey(type, mappedKey, options) {
2074
- const properties = FromMappedKey3(type, mappedKey, options);
2075
- return MappedResult(properties);
2076
- }
2077
-
2078
- // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2079
- function FromProperties13(properties, propertyKeys, options) {
2080
- const result = {};
2081
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2082
- result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2083
- return result;
2084
- }
2085
- function FromMappedResult10(mappedResult, propertyKeys, options) {
2086
- return FromProperties13(mappedResult.properties, propertyKeys, options);
2087
- }
2088
- function PickFromMappedResult(mappedResult, propertyKeys, options) {
2089
- const properties = FromMappedResult10(mappedResult, propertyKeys, options);
2090
- return MappedResult(properties);
2091
- }
2092
-
2093
- // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2094
- function FromIntersect6(types, propertyKeys) {
2095
- return types.map((type) => PickResolve(type, propertyKeys));
2096
- }
2097
- function FromUnion8(types, propertyKeys) {
2098
- return types.map((type) => PickResolve(type, propertyKeys));
2099
- }
2100
- function FromProperties14(properties, propertyKeys) {
2101
- const result = {};
2102
- for (const K2 of propertyKeys)
2103
- if (K2 in properties)
2104
- result[K2] = properties[K2];
2105
- return result;
2106
- }
2107
- function FromObject3(Type2, keys, properties) {
2108
- const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
2109
- const mappedProperties = FromProperties14(properties, keys);
2110
- return Object2(mappedProperties, options);
2111
- }
2112
- function UnionFromPropertyKeys2(propertyKeys) {
2113
- const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2114
- return Union(result);
2115
- }
2116
- function PickResolve(type, propertyKeys) {
2117
- return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
2118
- }
2119
- function Pick(type, key, options) {
2120
- const typeKey = IsArray2(key) ? UnionFromPropertyKeys2(key) : key;
2121
- const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2122
- const isTypeRef = IsRef(type);
2123
- const isKeyRef = IsRef(key);
2124
- return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
2125
- }
2126
-
2127
- // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2128
- function FromPropertyKey3(type, key, options) {
2129
- return {
2130
- [key]: Pick(type, [key], Clone(options))
2131
- };
2132
- }
2133
- function FromPropertyKeys3(type, propertyKeys, options) {
2134
- return propertyKeys.reduce((result, leftKey) => {
2135
- return { ...result, ...FromPropertyKey3(type, leftKey, options) };
2136
- }, {});
2137
- }
2138
- function FromMappedKey4(type, mappedKey, options) {
2139
- return FromPropertyKeys3(type, mappedKey.keys, options);
2140
- }
2141
- function PickFromMappedKey(type, mappedKey, options) {
2142
- const properties = FromMappedKey4(type, mappedKey, options);
2143
- return MappedResult(properties);
2144
- }
2145
-
2146
- // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2147
- function FromComputed3(target, parameters) {
2148
- return Computed("Partial", [Computed(target, parameters)]);
2149
- }
2150
- function FromRef3($ref) {
2151
- return Computed("Partial", [Ref($ref)]);
2152
- }
2153
- function FromProperties15(properties) {
2154
- const partialProperties = {};
2155
- for (const K of globalThis.Object.getOwnPropertyNames(properties))
2156
- partialProperties[K] = Optional(properties[K]);
2157
- return partialProperties;
2158
- }
2159
- function FromObject4(type, properties) {
2160
- const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2161
- const mappedProperties = FromProperties15(properties);
2162
- return Object2(mappedProperties, options);
2163
- }
2164
- function FromRest6(types) {
2165
- return types.map((type) => PartialResolve(type));
2166
- }
2167
- function PartialResolve(type) {
2168
- return (
2169
- // Mappable
2170
- IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject4(type, type.properties) : (
2171
- // Intrinsic
2172
- IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : (
2173
- // Passthrough
2174
- Object2({})
2175
- )
2176
- )
2177
- );
2178
- }
2179
- function Partial(type, options) {
2180
- if (IsMappedResult(type)) {
2181
- return PartialFromMappedResult(type, options);
2182
- } else {
2183
- return CreateType({ ...PartialResolve(type), ...options });
2184
- }
2185
- }
2186
-
2187
- // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2188
- function FromProperties16(K, options) {
2189
- const Acc = {};
2190
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2191
- Acc[K2] = Partial(K[K2], Clone(options));
2192
- return Acc;
2193
- }
2194
- function FromMappedResult11(R, options) {
2195
- return FromProperties16(R.properties, options);
2196
- }
2197
- function PartialFromMappedResult(R, options) {
2198
- const P = FromMappedResult11(R, options);
2199
- return MappedResult(P);
2200
- }
2201
-
2202
- // ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
2203
- function RecordCreateFromPattern(pattern, T, options) {
2204
- return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
2205
- }
2206
- function RecordCreateFromKeys(K, T, options) {
2207
- const result = {};
2208
- for (const K2 of K)
2209
- result[K2] = T;
2210
- return Object2(result, { ...options, [Hint]: "Record" });
2211
- }
2212
- function FromTemplateLiteralKey(K, T, options) {
2213
- return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2214
- }
2215
- function FromUnionKey(key, type, options) {
2216
- return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
2217
- }
2218
- function FromLiteralKey(key, type, options) {
2219
- return RecordCreateFromKeys([key.toString()], type, options);
2220
- }
2221
- function FromRegExpKey(key, type, options) {
2222
- return RecordCreateFromPattern(key.source, type, options);
2223
- }
2224
- function FromStringKey(key, type, options) {
2225
- const pattern = IsUndefined2(key.pattern) ? PatternStringExact : key.pattern;
2226
- return RecordCreateFromPattern(pattern, type, options);
2227
- }
2228
- function FromAnyKey(_, type, options) {
2229
- return RecordCreateFromPattern(PatternStringExact, type, options);
2230
- }
2231
- function FromNeverKey(_key, type, options) {
2232
- return RecordCreateFromPattern(PatternNeverExact, type, options);
2233
- }
2234
- function FromBooleanKey(_key, type, options) {
2235
- return Object2({ true: type, false: type }, options);
2236
- }
2237
- function FromIntegerKey(_key, type, options) {
2238
- return RecordCreateFromPattern(PatternNumberExact, type, options);
2239
- }
2240
- function FromNumberKey(_, type, options) {
2241
- return RecordCreateFromPattern(PatternNumberExact, type, options);
2242
- }
2243
- function Record(key, type, options = {}) {
2244
- return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean3(key) ? FromBooleanKey(key, type, options) : IsInteger2(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString3(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
2245
- }
2246
- function RecordPattern(record) {
2247
- return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
2248
- }
2249
- function RecordKey2(type) {
2250
- const pattern = RecordPattern(type);
2251
- return pattern === PatternStringExact ? String() : pattern === PatternNumberExact ? Number2() : String({ pattern });
2252
- }
2253
- function RecordValue2(type) {
2254
- return type.patternProperties[RecordPattern(type)];
2255
- }
2256
-
2257
- // ../../node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2258
- function FromComputed4(target, parameters) {
2259
- return Computed("Required", [Computed(target, parameters)]);
2260
- }
2261
- function FromRef4($ref) {
2262
- return Computed("Required", [Ref($ref)]);
2263
- }
2264
- function FromProperties17(properties) {
2265
- const requiredProperties = {};
2266
- for (const K of globalThis.Object.getOwnPropertyNames(properties))
2267
- requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2268
- return requiredProperties;
2269
- }
2270
- function FromObject5(type, properties) {
2271
- const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2272
- const mappedProperties = FromProperties17(properties);
2273
- return Object2(mappedProperties, options);
2274
- }
2275
- function FromRest7(types) {
2276
- return types.map((type) => RequiredResolve(type));
2277
- }
2278
- function RequiredResolve(type) {
2279
- return (
2280
- // Mappable
2281
- IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject5(type, type.properties) : (
2282
- // Intrinsic
2283
- IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : (
2284
- // Passthrough
2285
- Object2({})
2286
- )
2287
- )
2288
- );
2289
- }
2290
- function Required(type, options) {
2291
- if (IsMappedResult(type)) {
2292
- return RequiredFromMappedResult(type, options);
2293
- } else {
2294
- return CreateType({ ...RequiredResolve(type), ...options });
2295
- }
2296
- }
2297
-
2298
- // ../../node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2299
- function FromProperties18(P, options) {
2300
- const Acc = {};
2301
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2302
- Acc[K2] = Required(P[K2], options);
2303
- return Acc;
2304
- }
2305
- function FromMappedResult12(R, options) {
2306
- return FromProperties18(R.properties, options);
2307
- }
2308
- function RequiredFromMappedResult(R, options) {
2309
- const P = FromMappedResult12(R, options);
2310
- return MappedResult(P);
2311
- }
2312
-
2313
- // ../../node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2314
- function DereferenceParameters(moduleProperties, types) {
2315
- return types.map((type) => {
2316
- return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType(moduleProperties, type);
2317
- });
2318
- }
2319
- function Dereference(moduleProperties, ref) {
2320
- return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
2321
- }
2322
- function FromAwaited(parameters) {
2323
- return Awaited(parameters[0]);
2324
- }
2325
- function FromIndex(parameters) {
2326
- return Index(parameters[0], parameters[1]);
2327
- }
2328
- function FromKeyOf(parameters) {
2329
- return KeyOf(parameters[0]);
2330
- }
2331
- function FromPartial(parameters) {
2332
- return Partial(parameters[0]);
2333
- }
2334
- function FromOmit(parameters) {
2335
- return Omit(parameters[0], parameters[1]);
2336
- }
2337
- function FromPick(parameters) {
2338
- return Pick(parameters[0], parameters[1]);
2339
- }
2340
- function FromRequired(parameters) {
2341
- return Required(parameters[0]);
2342
- }
2343
- function FromComputed5(moduleProperties, target, parameters) {
2344
- const dereferenced = DereferenceParameters(moduleProperties, parameters);
2345
- return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
2346
- }
2347
- function FromArray5(moduleProperties, type) {
2348
- return Array2(FromType(moduleProperties, type));
2349
- }
2350
- function FromAsyncIterator2(moduleProperties, type) {
2351
- return AsyncIterator(FromType(moduleProperties, type));
2352
- }
2353
- function FromConstructor2(moduleProperties, parameters, instanceType) {
2354
- return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));
2355
- }
2356
- function FromFunction2(moduleProperties, parameters, returnType) {
2357
- return Function(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));
2358
- }
2359
- function FromIntersect7(moduleProperties, types) {
2360
- return Intersect(FromTypes(moduleProperties, types));
2361
- }
2362
- function FromIterator2(moduleProperties, type) {
2363
- return Iterator(FromType(moduleProperties, type));
2364
- }
2365
- function FromObject6(moduleProperties, properties) {
2366
- return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2367
- return { ...result, [key]: FromType(moduleProperties, properties[key]) };
2368
- }, {}));
2369
- }
2370
- function FromRecord2(moduleProperties, type) {
2371
- const [value, pattern] = [FromType(moduleProperties, RecordValue2(type)), RecordPattern(type)];
2372
- const result = CloneType(type);
2373
- result.patternProperties[pattern] = value;
2374
- return result;
2375
- }
2376
- function FromTransform(moduleProperties, transform) {
2377
- return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
2378
- }
2379
- function FromTuple4(moduleProperties, types) {
2380
- return Tuple(FromTypes(moduleProperties, types));
2381
- }
2382
- function FromUnion9(moduleProperties, types) {
2383
- return Union(FromTypes(moduleProperties, types));
2384
- }
2385
- function FromTypes(moduleProperties, types) {
2386
- return types.map((type) => FromType(moduleProperties, type));
2387
- }
2388
- function FromType(moduleProperties, type) {
2389
- return (
2390
- // Modifiers
2391
- IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2392
- // Transform
2393
- IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
2394
- // Types
2395
- IsArray3(type) ? CreateType(FromArray5(moduleProperties, type.items), type) : IsAsyncIterator3(type) ? CreateType(FromAsyncIterator2(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor2(moduleProperties, type.parameters, type.returns), type) : IsFunction3(type) ? CreateType(FromFunction2(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect7(moduleProperties, type.allOf), type) : IsIterator3(type) ? CreateType(FromIterator2(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject6(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord2(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple4(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion9(moduleProperties, type.anyOf), type) : type
2396
- )
2397
- )
2398
- );
2399
- }
2400
- function ComputeType(moduleProperties, key) {
2401
- return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
2402
- }
2403
- function ComputeModuleProperties(moduleProperties) {
2404
- return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
2405
- return { ...result, [key]: ComputeType(moduleProperties, key) };
2406
- }, {});
2407
- }
2408
-
2409
- // ../../node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
2410
- var TModule = class {
2411
- constructor($defs) {
2412
- const computed = ComputeModuleProperties($defs);
2413
- const identified = this.WithIdentifiers(computed);
2414
- this.$defs = identified;
2415
- }
2416
- /** `[Json]` Imports a Type by Key. */
2417
- Import(key, options) {
2418
- const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
2419
- return CreateType({ [Kind]: "Import", $defs, $ref: key });
2420
- }
2421
- // prettier-ignore
2422
- WithIdentifiers($defs) {
2423
- return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
2424
- return { ...result, [key]: { ...$defs[key], $id: key } };
2425
- }, {});
2426
- }
2427
- };
2428
- function Module(properties) {
2429
- return new TModule(properties);
2430
- }
2431
-
2432
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
2433
- function ReadonlyOptional(schema) {
2434
- return Readonly(Optional(schema));
2435
- }
2436
-
2437
- // ../../node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2438
- var Ordinal = 0;
2439
- function Recursive(callback, options = {}) {
2440
- if (IsUndefined2(options.$id))
2441
- options.$id = `T${Ordinal++}`;
2442
- const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
2443
- thisType.$id = options.$id;
2444
- return CreateType({ [Hint]: "Recursive", ...thisType }, options);
2445
- }
2446
-
2447
- // ../../node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2448
- function RestResolve(T) {
2449
- return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
2450
- }
2451
- function Rest(T) {
2452
- return RestResolve(T);
2453
- }
2454
-
2455
- // ../../node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
2456
- var TransformDecodeBuilder = class {
2457
- constructor(schema) {
2458
- this.schema = schema;
2459
- }
2460
- Decode(decode) {
2461
- return new TransformEncodeBuilder(this.schema, decode);
2462
- }
2463
- };
2464
- var TransformEncodeBuilder = class {
2465
- constructor(schema, decode) {
2466
- this.schema = schema;
2467
- this.decode = decode;
2468
- }
2469
- EncodeTransform(encode, schema) {
2470
- const Encode = (value) => schema[TransformKind].Encode(encode(value));
2471
- const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
2472
- const Codec = { Encode, Decode };
2473
- return { ...schema, [TransformKind]: Codec };
2474
- }
2475
- EncodeSchema(encode, schema) {
2476
- const Codec = { Decode: this.decode, Encode: encode };
2477
- return { ...schema, [TransformKind]: Codec };
2478
- }
2479
- Encode(encode) {
2480
- return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
2481
- }
2482
- };
2483
- function Transform(schema) {
2484
- return new TransformDecodeBuilder(schema);
2485
- }
2486
-
2487
- // ../../node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
2488
- function Unsafe(options = {}) {
2489
- return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
2490
- }
2491
-
2492
- // ../../node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2493
- var type_exports2 = {};
2494
- __export(type_exports2, {
2495
- Any: () => Any,
2496
- Argument: () => Argument,
2497
- Array: () => Array2,
2498
- AsyncIterator: () => AsyncIterator,
2499
- Awaited: () => Awaited,
2500
- BigInt: () => BigInt,
2501
- Boolean: () => Boolean,
2502
- Capitalize: () => Capitalize,
2503
- Composite: () => Composite,
2504
- Const: () => Const,
2505
- Constructor: () => Constructor,
2506
- ConstructorParameters: () => ConstructorParameters,
2507
- Date: () => Date2,
2508
- Enum: () => Enum,
2509
- Exclude: () => Exclude,
2510
- Extends: () => Extends,
2511
- Extract: () => Extract,
2512
- Function: () => Function,
2513
- Index: () => Index,
2514
- InstanceType: () => InstanceType,
2515
- Instantiate: () => Instantiate,
2516
- Integer: () => Integer,
2517
- Intersect: () => Intersect,
2518
- Iterator: () => Iterator,
2519
- KeyOf: () => KeyOf,
2520
- Literal: () => Literal,
2521
- Lowercase: () => Lowercase,
2522
- Mapped: () => Mapped,
2523
- Module: () => Module,
2524
- Never: () => Never,
2525
- Not: () => Not,
2526
- Null: () => Null,
2527
- Number: () => Number2,
2528
- Object: () => Object2,
2529
- Omit: () => Omit,
2530
- Optional: () => Optional,
2531
- Parameters: () => Parameters,
2532
- Partial: () => Partial,
2533
- Pick: () => Pick,
2534
- Promise: () => Promise2,
2535
- Readonly: () => Readonly,
2536
- ReadonlyOptional: () => ReadonlyOptional,
2537
- Record: () => Record,
2538
- Recursive: () => Recursive,
2539
- Ref: () => Ref,
2540
- RegExp: () => RegExp2,
2541
- Required: () => Required,
2542
- Rest: () => Rest,
2543
- ReturnType: () => ReturnType,
2544
- String: () => String,
2545
- Symbol: () => Symbol2,
2546
- TemplateLiteral: () => TemplateLiteral,
2547
- Transform: () => Transform,
2548
- Tuple: () => Tuple,
2549
- Uint8Array: () => Uint8Array2,
2550
- Uncapitalize: () => Uncapitalize,
2551
- Undefined: () => Undefined,
2552
- Union: () => Union,
2553
- Unknown: () => Unknown,
2554
- Unsafe: () => Unsafe,
2555
- Uppercase: () => Uppercase,
2556
- Void: () => Void
2557
- });
2558
-
2559
- // ../../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
2560
- function Argument(index) {
2561
- return CreateType({ [Kind]: "Argument", index });
2562
- }
2563
-
2564
- // ../../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
2565
- function ConstructorParameters(schema, options) {
2566
- return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
2567
- }
2568
-
2569
- // ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
2570
- function InstanceType(schema, options) {
2571
- return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
2572
- }
2573
-
2574
- // ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
2575
- function FromConstructor3(args, type) {
2576
- type.parameters = FromTypes2(args, type.parameters);
2577
- type.returns = FromType2(args, type.returns);
2578
- return type;
2579
- }
2580
- function FromFunction3(args, type) {
2581
- type.parameters = FromTypes2(args, type.parameters);
2582
- type.returns = FromType2(args, type.returns);
2583
- return type;
2584
- }
2585
- function FromIntersect8(args, type) {
2586
- type.allOf = FromTypes2(args, type.allOf);
2587
- return type;
2588
- }
2589
- function FromUnion10(args, type) {
2590
- type.anyOf = FromTypes2(args, type.anyOf);
2591
- return type;
2592
- }
2593
- function FromTuple5(args, type) {
2594
- if (IsUndefined2(type.items))
2595
- return type;
2596
- type.items = FromTypes2(args, type.items);
2597
- return type;
2598
- }
2599
- function FromArray6(args, type) {
2600
- type.items = FromType2(args, type.items);
2601
- return type;
2602
- }
2603
- function FromAsyncIterator3(args, type) {
2604
- type.items = FromType2(args, type.items);
2605
- return type;
2606
- }
2607
- function FromIterator3(args, type) {
2608
- type.items = FromType2(args, type.items);
2609
- return type;
2610
- }
2611
- function FromPromise3(args, type) {
2612
- type.item = FromType2(args, type.item);
2613
- return type;
2614
- }
2615
- function FromObject7(args, type) {
2616
- const mappedProperties = FromProperties19(args, type.properties);
2617
- return { ...type, ...Object2(mappedProperties) };
2618
- }
2619
- function FromRecord3(args, type) {
2620
- const mappedKey = FromType2(args, RecordKey2(type));
2621
- const mappedValue = FromType2(args, RecordValue2(type));
2622
- const result = Record(mappedKey, mappedValue);
2623
- return { ...type, ...result };
2624
- }
2625
- function FromArgument(args, argument) {
2626
- return argument.index in args ? args[argument.index] : Unknown();
2627
- }
2628
- function FromProperty3(args, type) {
2629
- const isReadonly = IsReadonly(type);
2630
- const isOptional = IsOptional(type);
2631
- const mapped = FromType2(args, type);
2632
- return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
2633
- }
2634
- function FromProperties19(args, properties) {
2635
- return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
2636
- return { ...result, [key]: FromProperty3(args, properties[key]) };
2637
- }, {});
2638
- }
2639
- function FromTypes2(args, types) {
2640
- return types.map((type) => FromType2(args, type));
2641
- }
2642
- function FromType2(args, type) {
2643
- return IsConstructor(type) ? FromConstructor3(args, type) : IsFunction3(type) ? FromFunction3(args, type) : IsIntersect(type) ? FromIntersect8(args, type) : IsUnion(type) ? FromUnion10(args, type) : IsTuple(type) ? FromTuple5(args, type) : IsArray3(type) ? FromArray6(args, type) : IsAsyncIterator3(type) ? FromAsyncIterator3(args, type) : IsIterator3(type) ? FromIterator3(args, type) : IsPromise2(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject7(args, type) : IsRecord(type) ? FromRecord3(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
2644
- }
2645
- function Instantiate(type, args) {
2646
- return FromType2(args, CloneType(type));
2647
- }
2648
-
2649
- // ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2650
- function Parameters(schema, options) {
2651
- return IsFunction3(schema) ? Tuple(schema.parameters, options) : Never();
2652
- }
2653
-
2654
- // ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2655
- function RegExp2(unresolved, options) {
2656
- const expr = IsString2(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2657
- return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
2658
- }
2659
-
2660
- // ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2661
- function ReturnType(schema, options) {
2662
- return IsFunction3(schema) ? CreateType(schema.returns, options) : Never(options);
2663
- }
2664
-
2665
- // ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2666
- function Void(options) {
2667
- return CreateType({ [Kind]: "Void", type: "void" }, options);
2668
- }
2669
-
2670
- // ../../node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2671
- var Type = type_exports2;
2672
-
2673
- export {
2674
- IsAsyncIterator,
2675
- IsIterator,
2676
- IsStandardObject,
2677
- IsPromise,
2678
- IsDate,
2679
- IsMap,
2680
- IsSet,
2681
- IsTypedArray,
2682
- IsUint8Array,
2683
- HasPropertyKey,
2684
- IsObject,
2685
- IsArray,
2686
- IsUndefined,
2687
- IsNull,
2688
- IsBoolean,
2689
- IsNumber,
2690
- IsInteger,
2691
- IsBigInt,
2692
- IsString,
2693
- IsFunction,
2694
- IsSymbol,
2695
- IsValueType,
2696
- TypeSystemPolicy,
2697
- TypeBoxError,
2698
- TransformKind,
2699
- Kind,
2700
- IsTransform,
2701
- IsUndefined3 as IsUndefined2,
2702
- IsKind,
2703
- IsSchema,
2704
- IsSchema2,
2705
- Never,
2706
- Union,
2707
- IsTemplateLiteralFinite,
2708
- TemplateLiteralGenerate,
2709
- Literal,
2710
- String,
2711
- IndexFromPropertyKeys,
2712
- Object2 as Object,
2713
- Ref,
2714
- KeyOfPropertyKeys,
2715
- KeyOfPattern,
2716
- Unknown,
2717
- Type
2718
- };