@alfe.ai/openclaw 0.0.16 → 0.0.17

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