pi2dsh 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +44 -19
  2. package/README.zh.md +44 -19
  3. package/dist/build-DsGYAgiT.mjs +4416 -0
  4. package/dist/build-DsGYAgiT.mjs.map +1 -0
  5. package/dist/cli.mjs +2 -2
  6. package/dist/compat/pi-ai.d.mts +195 -2435
  7. package/dist/compat/pi-ai.d.mts.map +1 -1
  8. package/dist/compat/pi-ai.mjs +3 -4668
  9. package/dist/compat/pi-coding-agent.d.mts +333 -14
  10. package/dist/compat/pi-coding-agent.d.mts.map +1 -1
  11. package/dist/compat/pi-coding-agent.mjs +2 -2
  12. package/dist/compat/pi-tui.mjs +1 -3620
  13. package/dist/credentials-oauth.d.mts +27 -0
  14. package/dist/credentials-oauth.d.mts.map +1 -0
  15. package/dist/credentials-oauth.mjs +91 -0
  16. package/dist/credentials-oauth.mjs.map +1 -0
  17. package/dist/host.mjs +4 -2
  18. package/dist/host.mjs.map +1 -1
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +2 -2
  21. package/dist/{mcp-config-jL9w70It.mjs → mcp-config-gqg7GJEE.mjs} +115 -51
  22. package/dist/mcp-config-gqg7GJEE.mjs.map +1 -0
  23. package/dist/oauth-bridge-BpPrppjR.mjs +359 -0
  24. package/dist/oauth-bridge-BpPrppjR.mjs.map +1 -0
  25. package/dist/pi-ai-CWFlgigJ.mjs +2947 -0
  26. package/dist/pi-ai-CWFlgigJ.mjs.map +1 -0
  27. package/dist/pi-coding-agent-Z1hTs61i.mjs +5203 -0
  28. package/dist/pi-coding-agent-Z1hTs61i.mjs.map +1 -0
  29. package/dist/pi-tui-5CYLcj-_.mjs +4512 -0
  30. package/dist/pi-tui-5CYLcj-_.mjs.map +1 -0
  31. package/dist/pi-types-BLt46jaf.d.mts +2494 -0
  32. package/dist/pi-types-BLt46jaf.d.mts.map +1 -0
  33. package/dist/{rolldown-runtime-C2Q2p085.mjs → rolldown-runtime-D-uZhY3_.mjs} +3 -2
  34. package/dist/{runtime-D84Hv_3m.mjs → runtime-6DefpI6h.mjs} +344 -23
  35. package/dist/runtime-6DefpI6h.mjs.map +1 -0
  36. package/dist/runtime.d.mts.map +1 -1
  37. package/dist/runtime.mjs +1 -1
  38. package/dist/{source-D7Ir-rPT.mjs → source-0sA5z08z.mjs} +6 -2
  39. package/dist/source-0sA5z08z.mjs.map +1 -0
  40. package/package.json +14 -1
  41. package/dist/compat/pi-ai.mjs.map +0 -1
  42. package/dist/compat/pi-tui.mjs.map +0 -1
  43. package/dist/mcp-config-jL9w70It.mjs.map +0 -1
  44. package/dist/pi-coding-agent-Dsg6_0ua.mjs +0 -2060
  45. package/dist/pi-coding-agent-Dsg6_0ua.mjs.map +0 -1
  46. package/dist/pi-tui-utils-CcaVtm-3.mjs +0 -895
  47. package/dist/pi-tui-utils-CcaVtm-3.mjs.map +0 -1
  48. package/dist/pi-types-KazmR2O5.d.mts +0 -62
  49. package/dist/pi-types-KazmR2O5.d.mts.map +0 -1
  50. package/dist/pi-uuid-Db8ShZsK.mjs +0 -47
  51. package/dist/pi-uuid-Db8ShZsK.mjs.map +0 -1
  52. package/dist/runtime-D84Hv_3m.mjs.map +0 -1
  53. package/dist/source-D7Ir-rPT.mjs.map +0 -1
@@ -0,0 +1,4416 @@
1
+
2
+ import { t as __exportAll } from "./rolldown-runtime-D-uZhY3_.mjs";
3
+ //#region src/compat/vendor/pi-uuid.ts
4
+ let lastTimestamp = -Infinity;
5
+ let sequence = 0;
6
+ function fillRandomBytes(bytes) {
7
+ if (globalThis.crypto?.getRandomValues) {
8
+ globalThis.crypto.getRandomValues(bytes);
9
+ return;
10
+ }
11
+ for (let i = 0; i < bytes.length; i++) bytes[i] = Math.floor(Math.random() * 256);
12
+ }
13
+ /** Generate a time-ordered UUIDv7. */
14
+ function uuidv7() {
15
+ const random = /* @__PURE__ */ new Uint8Array(16);
16
+ fillRandomBytes(random);
17
+ const timestamp = Date.now();
18
+ if (timestamp > lastTimestamp) {
19
+ sequence = random[6] * 16777216 + random[7] * 65536 + random[8] * 256 + random[9];
20
+ lastTimestamp = timestamp;
21
+ } else {
22
+ sequence = sequence + 1 >>> 0;
23
+ if (sequence === 0) lastTimestamp++;
24
+ }
25
+ const bytes = /* @__PURE__ */ new Uint8Array(16);
26
+ bytes[0] = lastTimestamp / 1099511627776 & 255;
27
+ bytes[1] = lastTimestamp / 4294967296 & 255;
28
+ bytes[2] = lastTimestamp / 16777216 & 255;
29
+ bytes[3] = lastTimestamp / 65536 & 255;
30
+ bytes[4] = lastTimestamp / 256 & 255;
31
+ bytes[5] = lastTimestamp & 255;
32
+ bytes[6] = 112 | sequence >>> 28 & 15;
33
+ bytes[7] = sequence >>> 20 & 255;
34
+ bytes[8] = 128 | sequence >>> 14 & 63;
35
+ bytes[9] = sequence >>> 6 & 255;
36
+ bytes[10] = (sequence & 63) << 2 | random[10] & 3;
37
+ bytes[11] = random[11];
38
+ bytes[12] = random[12];
39
+ bytes[13] = random[13];
40
+ bytes[14] = random[14];
41
+ bytes[15] = random[15];
42
+ const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
43
+ return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10, 16).join("")}`;
44
+ }
45
+ //#endregion
46
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/metrics.mjs
47
+ /** TypeBox instantiation metrics */
48
+ const Metrics = {
49
+ assign: 0,
50
+ create: 0,
51
+ clone: 0,
52
+ discard: 0,
53
+ update: 0
54
+ };
55
+ //#endregion
56
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/assign.mjs
57
+ /**
58
+ * Performs an Object assign using the Left and Right object types. We track this operation as it
59
+ * creates a new GC handle per assignment.
60
+ */
61
+ function Assign(left, right) {
62
+ Metrics.assign += 1;
63
+ return {
64
+ ...left,
65
+ ...right
66
+ };
67
+ }
68
+ //#endregion
69
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/guard/guard.mjs
70
+ /** Returns true if this value is an array */
71
+ function IsArray$1(value) {
72
+ return Array.isArray(value);
73
+ }
74
+ /** Returns true if this value is bigint */
75
+ function IsBigInt$1(value) {
76
+ return IsEqual(typeof value, "bigint");
77
+ }
78
+ /** Returns true if this value is a boolean */
79
+ function IsBoolean$1(value) {
80
+ return IsEqual(typeof value, "boolean");
81
+ }
82
+ /** Returns true if this value is a function */
83
+ function IsFunction$1(value) {
84
+ return IsEqual(typeof value, "function");
85
+ }
86
+ /** Returns true if this value is null */
87
+ function IsNull$1(value) {
88
+ return IsEqual(value, null);
89
+ }
90
+ /** Returns true if this value is number */
91
+ function IsNumber$1(value) {
92
+ return Number.isFinite(value);
93
+ }
94
+ /** Returns true if this value is an object but not an array */
95
+ function IsObjectNotArray(value) {
96
+ return IsObject$1(value) && !IsArray$1(value);
97
+ }
98
+ /** Returns true if this value is an object */
99
+ function IsObject$1(value) {
100
+ return IsEqual(typeof value, "object") && !IsNull$1(value);
101
+ }
102
+ /** Returns true if this value is string */
103
+ function IsString$1(value) {
104
+ return IsEqual(typeof value, "string");
105
+ }
106
+ function IsEqual(left, right) {
107
+ return left === right;
108
+ }
109
+ function IsGreaterThan(left, right) {
110
+ return left > right;
111
+ }
112
+ function IsLessThan(left, right) {
113
+ return left < right;
114
+ }
115
+ /** Returns true if the value appears to be an instance of a class. */
116
+ function IsClassInstance(value) {
117
+ if (!IsObject$1(value)) return false;
118
+ const proto = globalThis.Object.getPrototypeOf(value);
119
+ if (IsNull$1(proto)) return false;
120
+ return IsEqual(typeof proto.constructor, "function") && !(IsEqual(proto.constructor, globalThis.Object) || IsEqual(proto.constructor.name, "Object"));
121
+ }
122
+ /** Returns true if every element from offset satisfies the callback, short-circuiting on the first failure */
123
+ function Every(value, offset, callback) {
124
+ for (let index = offset; index < value.length; index++) if (!callback(value[index], index)) return false;
125
+ return true;
126
+ }
127
+ /** Shifts the left-most element from an array and dispatches to the true arm, or the false arm if empty */
128
+ function ShiftLeft(array, true_, false_) {
129
+ return IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1));
130
+ }
131
+ /** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */
132
+ function IsUnsafePropertyKey(key) {
133
+ return IsEqual(key, "__proto__") || IsEqual(key, "constructor") || IsEqual(key, "prototype");
134
+ }
135
+ /** Returns true if this value has this property key */
136
+ function HasPropertyKey(value, key) {
137
+ return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
138
+ }
139
+ /** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */
140
+ function Keys(value) {
141
+ return Object.getOwnPropertyNames(value);
142
+ }
143
+ /** Returns the property keys for this object via `Object.getOwnPropertySymbols({ ... })` */
144
+ function Symbols(value) {
145
+ return Object.getOwnPropertySymbols(value);
146
+ }
147
+ /** Returns the property values for the given object via `Object.values()` */
148
+ function Values(value) {
149
+ return Object.values(value);
150
+ }
151
+ //#endregion
152
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/guard/globals.mjs
153
+ function IsTypeArray(value) {
154
+ return globalThis.ArrayBuffer.isView(value);
155
+ }
156
+ /** Returns true if the value is a RegExp */
157
+ function IsRegExp(value) {
158
+ return value instanceof globalThis.RegExp;
159
+ }
160
+ /** Returns true if the value is a Set */
161
+ function IsSet(value) {
162
+ return value instanceof globalThis.Set;
163
+ }
164
+ /** Returns true if the value is a Map */
165
+ function IsMap(value) {
166
+ return value instanceof globalThis.Map;
167
+ }
168
+ //#endregion
169
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/clone.mjs
170
+ function FromClassInstance(value) {
171
+ return value;
172
+ }
173
+ function IsSchemaObject(value) {
174
+ return HasPropertyKey(value, "~kind") || HasPropertyKey(value, "~unsafe");
175
+ }
176
+ function FromSchemaObject(value) {
177
+ const result = {};
178
+ for (const key of Keys(value)) {
179
+ if (IsUnsafePropertyKey(key)) continue;
180
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
181
+ descriptor.value = FromValue(descriptor.value);
182
+ if (IsEqual(descriptor.enumerable, true)) result[key] = descriptor.value;
183
+ else Object.defineProperty(result, key, descriptor);
184
+ }
185
+ return result;
186
+ }
187
+ function FromPlainObject(value) {
188
+ const result = {};
189
+ for (const key of Keys(value)) {
190
+ if (IsUnsafePropertyKey(key)) continue;
191
+ result[key] = FromValue(value[key]);
192
+ }
193
+ for (const key of Symbols(value)) result[key] = FromValue(value[key]);
194
+ return result;
195
+ }
196
+ function FromObject$7(value) {
197
+ return IsClassInstance(value) ? FromClassInstance(value) : IsSchemaObject(value) ? FromSchemaObject(value) : FromPlainObject(value);
198
+ }
199
+ function FromArray$3(value) {
200
+ return value.map((element) => FromValue(element));
201
+ }
202
+ function FromTypedArray(value) {
203
+ return value.slice();
204
+ }
205
+ function FromRegExp(value) {
206
+ return new RegExp(value.source, value.flags);
207
+ }
208
+ function FromMap(value) {
209
+ return new Map(FromValue([...value.entries()]));
210
+ }
211
+ function FromSet(value) {
212
+ return new Set(FromValue([...value.values()]));
213
+ }
214
+ function FromValue(value) {
215
+ return IsTypeArray(value) ? FromTypedArray(value) : IsRegExp(value) ? FromRegExp(value) : IsMap(value) ? FromMap(value) : IsSet(value) ? FromSet(value) : IsArray$1(value) ? FromArray$3(value) : IsObject$1(value) ? FromObject$7(value) : value;
216
+ }
217
+ /**
218
+ * Returns a Clone of the given value. This function is similar to structuredClone()
219
+ * but also supports deep cloning instances of Map, Set and TypeArray.
220
+ */
221
+ function Clone(value) {
222
+ Metrics.clone += 1;
223
+ return FromValue(value);
224
+ }
225
+ //#endregion
226
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/settings/settings.mjs
227
+ const settings = {
228
+ immutableTypes: false,
229
+ maxErrors: 8,
230
+ maxInstantiationCount: 128,
231
+ useAcceleration: true,
232
+ exactOptionalPropertyTypes: false,
233
+ enumerableKind: false,
234
+ correctiveParse: false,
235
+ unionPrioritySort: true
236
+ };
237
+ /** Gets current system settings */
238
+ function Get() {
239
+ return settings;
240
+ }
241
+ //#endregion
242
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/create.mjs
243
+ function MergeHidden(left, right) {
244
+ for (const key of Object.keys(right)) Object.defineProperty(left, key, {
245
+ configurable: true,
246
+ writable: true,
247
+ enumerable: false,
248
+ value: right[key]
249
+ });
250
+ return left;
251
+ }
252
+ function Merge(left, right) {
253
+ return {
254
+ ...left,
255
+ ...right
256
+ };
257
+ }
258
+ /**
259
+ * Creates an object with hidden, enumerable, and optional property sets. This function
260
+ * ensures types are instantiated according to configuration rules for enumerable and
261
+ * non-enumerable properties.
262
+ */
263
+ function Create(hidden, enumerable, options = {}) {
264
+ Metrics.create += 1;
265
+ const settings = Get();
266
+ const withOptions = Merge(enumerable, options);
267
+ const withHidden = settings.enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
268
+ return settings.immutableTypes ? Object.freeze(withHidden) : withHidden;
269
+ }
270
+ //#endregion
271
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/discard.mjs
272
+ /** Discards multiple property keys from the given object value */
273
+ function Discard(value, propertyKeys) {
274
+ Metrics.discard += 1;
275
+ const result = {};
276
+ for (const key of Keys(value)) {
277
+ if (propertyKeys.includes(key)) continue;
278
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
279
+ descriptor.value = Clone(descriptor.value);
280
+ Object.defineProperty(result, key, descriptor);
281
+ }
282
+ return result;
283
+ }
284
+ //#endregion
285
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/update.mjs
286
+ /**
287
+ * Updates a value with new properties while preserving property enumerability. Use this function to modify
288
+ * existing types without altering their configuration.
289
+ */
290
+ function Update(current, hidden, enumerable) {
291
+ Metrics.update += 1;
292
+ const settings = Get();
293
+ const result = Clone(current);
294
+ for (const key of Object.keys(hidden)) Object.defineProperty(result, key, {
295
+ configurable: true,
296
+ writable: true,
297
+ enumerable: settings.enumerableKind,
298
+ value: hidden[key]
299
+ });
300
+ for (const key of Object.keys(enumerable)) Object.defineProperty(result, key, {
301
+ configurable: true,
302
+ enumerable: true,
303
+ writable: true,
304
+ value: enumerable[key]
305
+ });
306
+ return result;
307
+ }
308
+ //#endregion
309
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/schema.mjs
310
+ function IsKind(value, kind) {
311
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], kind);
312
+ }
313
+ function IsSchema(value) {
314
+ return IsObject$1(value);
315
+ }
316
+ //#endregion
317
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/deferred.mjs
318
+ /** Creates a Deferred action. */
319
+ function Deferred(action, parameters, options) {
320
+ return Create({ "~kind": "Deferred" }, {
321
+ type: "deferred",
322
+ action,
323
+ parameters,
324
+ options
325
+ }, {});
326
+ }
327
+ /** Returns true if the given value is a TDeferred. */
328
+ function IsDeferred(value) {
329
+ return IsKind(value, "Deferred");
330
+ }
331
+ //#endregion
332
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs
333
+ function AddReadonlyOperation(type) {
334
+ return Update(type, { "~readonly": true }, {});
335
+ }
336
+ function AddReadonlyAction(type, options) {
337
+ return Update(AddReadonlyOperation(type), {}, options);
338
+ }
339
+ function AddReadonlyInstantiate(context, state, type, options) {
340
+ return AddReadonlyAction(InstantiateType(context, state, type), options);
341
+ }
342
+ //#endregion
343
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs
344
+ function AddOptionalOperation(type) {
345
+ return Update(type, { "~optional": true }, {});
346
+ }
347
+ function AddOptionalAction(type, options) {
348
+ return Update(AddOptionalOperation(type), {}, options);
349
+ }
350
+ function AddOptionalInstantiate(context, state, type, options) {
351
+ return AddOptionalAction(InstantiateType(context, state, type), options);
352
+ }
353
+ //#endregion
354
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/array.mjs
355
+ /** Creates an Array type. */
356
+ function _Array_(items, options) {
357
+ return Create({ "~kind": "Array" }, {
358
+ type: "array",
359
+ items
360
+ }, options);
361
+ }
362
+ /** Returns true if the given value is a TArray. */
363
+ function IsArray(value) {
364
+ return IsKind(value, "Array");
365
+ }
366
+ /** Extracts options from a TArray. */
367
+ function ArrayOptions(type) {
368
+ return Discard(type, [
369
+ "~kind",
370
+ "type",
371
+ "items"
372
+ ]);
373
+ }
374
+ //#endregion
375
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/constructor.mjs
376
+ /** Creates a Constructor type. */
377
+ function Constructor(parameters, instanceType, options = {}) {
378
+ return Create({ "~kind": "Constructor" }, {
379
+ type: "constructor",
380
+ parameters,
381
+ instanceType
382
+ }, options);
383
+ }
384
+ /** Returns true if the given value is a TConstructor. */
385
+ function IsConstructor(value) {
386
+ return IsKind(value, "Constructor");
387
+ }
388
+ /** Extracts options from a TConstructor. */
389
+ function ConstructorOptions(type) {
390
+ return Discard(type, [
391
+ "~kind",
392
+ "type",
393
+ "parameters",
394
+ "instanceType"
395
+ ]);
396
+ }
397
+ //#endregion
398
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/function.mjs
399
+ /** Creates a Function type. */
400
+ function _Function_$1(parameters, returnType, options = {}) {
401
+ return Create({ ["~kind"]: "Function" }, {
402
+ type: "function",
403
+ parameters,
404
+ returnType
405
+ }, options);
406
+ }
407
+ /** Returns true if the given value is TFunction. */
408
+ function IsFunction(value) {
409
+ return IsKind(value, "Function");
410
+ }
411
+ /** Extracts options from a TFunction. */
412
+ function FunctionOptions(type) {
413
+ return Discard(type, [
414
+ "~kind",
415
+ "type",
416
+ "parameters",
417
+ "returnType"
418
+ ]);
419
+ }
420
+ //#endregion
421
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/ref.mjs
422
+ /** Creates a Ref type. */
423
+ function Ref(ref, options) {
424
+ return Create({ ["~kind"]: "Ref" }, { $ref: ref }, options);
425
+ }
426
+ /** Returns true if the given value is TRef. */
427
+ function IsRef(value) {
428
+ return IsKind(value, "Ref");
429
+ }
430
+ //#endregion
431
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/generic.mjs
432
+ /** Creates a Generic type. */
433
+ function Generic(parameters, expression) {
434
+ return Create({ "~kind": "Generic" }, {
435
+ type: "generic",
436
+ parameters,
437
+ expression
438
+ });
439
+ }
440
+ /** Returns true if the given value is a TGeneric. */
441
+ function IsGeneric(value) {
442
+ return IsKind(value, "Generic");
443
+ }
444
+ //#endregion
445
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/any.mjs
446
+ /** Creates a Any type. */
447
+ function Any(options) {
448
+ return Create({ ["~kind"]: "Any" }, {}, options);
449
+ }
450
+ /** Returns true if the given value is a TAny. */
451
+ function IsAny(value) {
452
+ return IsKind(value, "Any");
453
+ }
454
+ //#endregion
455
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/never.mjs
456
+ const NeverPattern = "(?!)";
457
+ /** Creates a Never type. */
458
+ function Never(options) {
459
+ return Create({ "~kind": "Never" }, { not: {} }, options);
460
+ }
461
+ /** Returns true if the given value is TNever. */
462
+ function IsNever(value) {
463
+ return IsKind(value, "Never");
464
+ }
465
+ //#endregion
466
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_add_optional.mjs
467
+ /** Creates a deferred AddOptional action. */
468
+ function AddOptionalDeferred(type, options = {}) {
469
+ return Deferred("AddOptional", [type], options);
470
+ }
471
+ /** Applies an AddOptional action to a type. */
472
+ function AddOptional(type, options = {}) {
473
+ return AddOptionalAction(type, options);
474
+ }
475
+ //#endregion
476
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_optional.mjs
477
+ /** Applies an Optional modifier to the given type. */
478
+ function Optional$2(type) {
479
+ return AddOptional(type);
480
+ }
481
+ /** Returns true if the given value is TOptional */
482
+ function IsOptional(value) {
483
+ return IsSchema(value) && HasPropertyKey(value, "~optional");
484
+ }
485
+ //#endregion
486
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/properties.mjs
487
+ /** Creates a RequiredArray derived from the given TProperties value. */
488
+ function RequiredArray(properties) {
489
+ return Keys(properties).filter((key) => !IsOptional(properties[key]));
490
+ }
491
+ /** Extracts a tuple of keys from a TProperties value. */
492
+ function PropertyKeys(properties) {
493
+ return Keys(properties);
494
+ }
495
+ /** Extracts a tuple of property values from a TProperties value. */
496
+ function PropertyValues(properties) {
497
+ return Values(properties);
498
+ }
499
+ //#endregion
500
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/object.mjs
501
+ /** Creates an Object type. */
502
+ function _Object_$1(properties, options = {}) {
503
+ const requiredKeys = RequiredArray(properties);
504
+ return Create({ "~kind": "Object" }, {
505
+ type: "object",
506
+ ...requiredKeys.length > 0 ? { required: requiredKeys } : {},
507
+ properties
508
+ }, options);
509
+ }
510
+ /** Returns true if the given value is TObject. */
511
+ function IsObject(value) {
512
+ return IsKind(value, "Object");
513
+ }
514
+ /** Extracts options from a TObject. */
515
+ function ObjectOptions(type) {
516
+ return Discard(type, [
517
+ "~kind",
518
+ "type",
519
+ "properties",
520
+ "required"
521
+ ]);
522
+ }
523
+ //#endregion
524
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/unknown.mjs
525
+ /** Creates an Unknown type. */
526
+ function Unknown(options) {
527
+ return Create({ ["~kind"]: "Unknown" }, {}, options);
528
+ }
529
+ /** Returns true if the given value is TUnknown. */
530
+ function IsUnknown(value) {
531
+ return IsKind(value, "Unknown");
532
+ }
533
+ //#endregion
534
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/cyclic.mjs
535
+ /** Creates a Cyclic type. */
536
+ function Cyclic($defs, $ref, options) {
537
+ const defs = Keys($defs).reduce((result, key) => {
538
+ return {
539
+ ...result,
540
+ [key]: Update($defs[key], {}, { $id: key })
541
+ };
542
+ }, {});
543
+ return Create({ ["~kind"]: "Cyclic" }, {
544
+ $defs: defs,
545
+ $ref
546
+ }, options);
547
+ }
548
+ /** Returns true if the given value is a TCyclic. */
549
+ function IsCyclic(value) {
550
+ return IsKind(value, "Cyclic");
551
+ }
552
+ //#endregion
553
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/unsafe.mjs
554
+ /** Creates a Unsafe type. */
555
+ function Unsafe(schema) {
556
+ return Update(schema, { ["~unsafe"]: null }, {});
557
+ }
558
+ /** Returns true if the given value is TUnsafe. */
559
+ function IsUnsafe(value) {
560
+ return IsObjectNotArray(value) && HasPropertyKey(value, "~unsafe") && IsNull$1(value["~unsafe"]);
561
+ }
562
+ //#endregion
563
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/arguments/arguments.mjs
564
+ /**
565
+ * Match arguments for overloaded functions that use the `...args: unknown[]` pattern. Arguments
566
+ * are parsed using argument length only.
567
+ */
568
+ function Match$2(args, match) {
569
+ return match[args.length]?.(...args) ?? (() => {
570
+ throw Error("Invalid Arguments");
571
+ })();
572
+ }
573
+ //#endregion
574
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/infer.mjs
575
+ /** Creates an Infer instruction. */
576
+ function Infer(...args) {
577
+ const [name, extends_] = Match$2(args, {
578
+ 2: (name, extends_) => [
579
+ name,
580
+ extends_,
581
+ extends_
582
+ ],
583
+ 1: (name) => [
584
+ name,
585
+ Unknown(),
586
+ Unknown()
587
+ ]
588
+ });
589
+ return Create({ ["~kind"]: "Infer" }, {
590
+ type: "infer",
591
+ name,
592
+ extends: extends_
593
+ }, {});
594
+ }
595
+ /** Returns true if the given value is TInfer. */
596
+ function IsInfer(value) {
597
+ return IsKind(value, "Infer");
598
+ }
599
+ //#endregion
600
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/dependent.mjs
601
+ /** Creates a Dependent type */
602
+ function Dependent$1(if_, then_, else_, options = {}) {
603
+ return Create({ "~kind": "Dependent" }, {
604
+ if: if_,
605
+ then: then_,
606
+ else: else_
607
+ }, options);
608
+ }
609
+ /** Returns true if the given value is TDependent. */
610
+ function IsDependent(value) {
611
+ return IsKind(value, "Dependent");
612
+ }
613
+ /** Extracts options from a IsDependent. */
614
+ function DependentOptions(type) {
615
+ return Discard(type, [
616
+ "~kind",
617
+ "if",
618
+ "then",
619
+ "else"
620
+ ]);
621
+ }
622
+ //#endregion
623
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs
624
+ function IsTypeScriptEnumLike(value) {
625
+ return IsObjectNotArray(value);
626
+ }
627
+ function TypeScriptEnumToEnumValues(type) {
628
+ return Keys(type).filter((key) => isNaN(key)).reduce((result, key) => [...result, type[key]], []);
629
+ }
630
+ //#endregion
631
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/enum.mjs
632
+ /** Returns true if the given value is a EnumValue */
633
+ function IsEnumValue(value) {
634
+ return IsString$1(value) || IsNumber$1(value);
635
+ }
636
+ /** Creates an Enum type. */
637
+ function Enum(value, options) {
638
+ return Create({ "~kind": "Enum" }, { enum: IsTypeScriptEnumLike(value) ? TypeScriptEnumToEnumValues(value) : value }, options);
639
+ }
640
+ /** Returns true if the given value is a TEnum. */
641
+ function IsEnum(value) {
642
+ return IsKind(value, "Enum");
643
+ }
644
+ //#endregion
645
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/intersect.mjs
646
+ /** Creates a Intersect type. */
647
+ function Intersect(types, options = {}) {
648
+ return Create({ "~kind": "Intersect" }, { allOf: types }, options);
649
+ }
650
+ /** Returns true if the given value is TIntersect. */
651
+ function IsIntersect(value) {
652
+ return IsKind(value, "Intersect");
653
+ }
654
+ /** Extracts options from a TIntersect. */
655
+ function IntersectOptions(type) {
656
+ return Discard(type, ["~kind", "allOf"]);
657
+ }
658
+ //#endregion
659
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/unreachable/unreachable.mjs
660
+ /** Used for unreachable logic */
661
+ function Unreachable$1() {
662
+ throw new Error("Unreachable");
663
+ }
664
+ //#endregion
665
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/hashing/hash.mjs
666
+ var ByteMarker;
667
+ (function(ByteMarker) {
668
+ ByteMarker[ByteMarker["Array"] = 0] = "Array";
669
+ ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
670
+ ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
671
+ ByteMarker[ByteMarker["Date"] = 3] = "Date";
672
+ ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
673
+ ByteMarker[ByteMarker["Function"] = 5] = "Function";
674
+ ByteMarker[ByteMarker["Null"] = 6] = "Null";
675
+ ByteMarker[ByteMarker["Number"] = 7] = "Number";
676
+ ByteMarker[ByteMarker["Object"] = 8] = "Object";
677
+ ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
678
+ ByteMarker[ByteMarker["String"] = 10] = "String";
679
+ ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
680
+ ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
681
+ ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
682
+ })(ByteMarker || (ByteMarker = {}));
683
+ Array.from({ length: 256 }).map((_, i) => BigInt(i));
684
+ const F64 = /* @__PURE__ */ new Float64Array(1);
685
+ new DataView(F64.buffer);
686
+ new Uint8Array(F64.buffer);
687
+ new TextEncoder();
688
+ //#endregion
689
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_codec.mjs
690
+ var EncodeBuilder = class {
691
+ constructor(type, decode) {
692
+ this.type = type;
693
+ this.decode = decode;
694
+ }
695
+ Encode(callback) {
696
+ const type = this.type;
697
+ const codec = {
698
+ decode: IsCodec(type) ? (value) => this.decode(type["~codec"].decode(value)) : this.decode,
699
+ encode: IsCodec(type) ? (value) => type["~codec"].encode(callback(value)) : callback
700
+ };
701
+ return Update(this.type, { "~codec": codec }, {});
702
+ }
703
+ };
704
+ var DecodeBuilder = class {
705
+ constructor(type) {
706
+ this.type = type;
707
+ }
708
+ Decode(callback) {
709
+ return new EncodeBuilder(this.type, callback);
710
+ }
711
+ };
712
+ /** Creates a bi-directional Codec. Codec functions are called on Value.Decode and Value.Encode. */
713
+ function Codec(type) {
714
+ return new DecodeBuilder(type);
715
+ }
716
+ /** Createsa uni-directional Codec with Decode only. The Decode function is called on Value.Decode */
717
+ function Decode(type, callback) {
718
+ return Codec(type).Decode(callback).Encode(() => {
719
+ throw Error("Encode not implemented");
720
+ });
721
+ }
722
+ /** Creates a uni-directional Codec with Encode only. The Encode function is called on Value.Encode */
723
+ function Encode(type, callback) {
724
+ return Codec(type).Decode(() => {
725
+ throw Error("Decode not implemented");
726
+ }).Encode(callback);
727
+ }
728
+ function IsCodec(value) {
729
+ return IsSchema(value) && HasPropertyKey(value, "~codec") && IsObject$1(value["~codec"]) && HasPropertyKey(value["~codec"], "encode") && HasPropertyKey(value["~codec"], "decode");
730
+ }
731
+ //#endregion
732
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_immutable.mjs
733
+ /** Applies an Immutable modifier to the given type. */
734
+ function Immutable(type) {
735
+ return AddImmutable(type);
736
+ }
737
+ /** Returns true if the given value is a TImmutable */
738
+ function IsImmutable(value) {
739
+ return IsSchema(value) && HasPropertyKey(value, "~immutable");
740
+ }
741
+ //#endregion
742
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_add_readonly.mjs
743
+ /** Creates a deferred AddReadonly action. */
744
+ function AddReadonlyDeferred(type, options = {}) {
745
+ return Deferred("AddReadonly", [type], options);
746
+ }
747
+ /** Applies an AddReadonly action to a type. */
748
+ function AddReadonly(type, options = {}) {
749
+ return AddReadonlyAction(type, options);
750
+ }
751
+ //#endregion
752
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_readonly.mjs
753
+ /** Applies an Readonly property modifier to the given type. */
754
+ function Readonly$1(type) {
755
+ return AddReadonly(type);
756
+ }
757
+ /** Returns true if the given value is a TReadonly */
758
+ function IsReadonly(value) {
759
+ return IsSchema(value) && HasPropertyKey(value, "~readonly");
760
+ }
761
+ //#endregion
762
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_refine.mjs
763
+ /** Applies a Refine check to the given type. */
764
+ function RefineAdd(type, refinement) {
765
+ return Update(type, { "~refine": IsRefine(type) ? [...type["~refine"], refinement] : [refinement] }, {});
766
+ }
767
+ /** Refines a type with an explicit check */
768
+ function Refine(...args) {
769
+ const [type, check, error] = Match$2(args, {
770
+ 3: (type, check, error) => [
771
+ type,
772
+ check,
773
+ error
774
+ ],
775
+ 2: (type, check) => [
776
+ type,
777
+ check,
778
+ () => "Refine Error"
779
+ ]
780
+ });
781
+ return RefineAdd(type, {
782
+ check,
783
+ error
784
+ });
785
+ }
786
+ /** Returns true if the given value is a TRefinement. */
787
+ function IsRefinement(value) {
788
+ return IsObjectNotArray(value) && HasPropertyKey(value, "check") && HasPropertyKey(value, "error") && IsFunction$1(value.check) && IsFunction$1(value.error);
789
+ }
790
+ /** Returns true if the given value is a TRefine. */
791
+ function IsRefine(value) {
792
+ return IsSchema(value) && HasPropertyKey(value, "~refine") && IsArray$1(value["~refine"]) && Every(value["~refine"], 0, (value) => IsRefinement(value));
793
+ }
794
+ //#endregion
795
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/bigint.mjs
796
+ const BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
797
+ /** Creates a BigInt type. */
798
+ function BigInt$2(options) {
799
+ return Create({ "~kind": "BigInt" }, { type: "bigint" }, options);
800
+ }
801
+ /** Returns true if the given value is a TBigInt. */
802
+ function IsBigInt(value) {
803
+ return IsKind(value, "BigInt");
804
+ }
805
+ //#endregion
806
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/boolean.mjs
807
+ /** Creates a Boolean type. */
808
+ function Boolean$1(options) {
809
+ return Create({ "~kind": "Boolean" }, { type: "boolean" }, options);
810
+ }
811
+ /** Returns true if the given value is a TBoolean. */
812
+ function IsBoolean(value) {
813
+ return IsKind(value, "Boolean");
814
+ }
815
+ //#endregion
816
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/identifier.mjs
817
+ /** Creates an Identifier. */
818
+ function Identifier(name) {
819
+ return Create({ "~kind": "Identifier" }, { name });
820
+ }
821
+ /** Returns true if the given value is a TIdentifier. */
822
+ function IsIdentifier(value) {
823
+ return IsKind(value, "Identifier");
824
+ }
825
+ //#endregion
826
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/integer.mjs
827
+ const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
828
+ /** Creates a Integer type. */
829
+ function Integer$1(options) {
830
+ return Create({ "~kind": "Integer" }, { type: "integer" }, options);
831
+ }
832
+ /** Returns true if the given value is TInteger. */
833
+ function IsInteger(value) {
834
+ return IsKind(value, "Integer");
835
+ }
836
+ //#endregion
837
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/literal.mjs
838
+ var InvalidLiteralValue = class extends Error {
839
+ constructor(value) {
840
+ super(`Invalid Literal value`);
841
+ Object.defineProperty(this, "cause", {
842
+ value: { value },
843
+ writable: false,
844
+ configurable: false,
845
+ enumerable: false
846
+ });
847
+ }
848
+ };
849
+ function LiteralTypeName(value) {
850
+ return IsBigInt$1(value) ? "bigint" : IsBoolean$1(value) ? "boolean" : IsNumber$1(value) ? "number" : IsString$1(value) ? "string" : (() => {
851
+ throw new InvalidLiteralValue(value);
852
+ })();
853
+ }
854
+ /** Creates a Literal type. */
855
+ function Literal(value, options) {
856
+ return Create({ "~kind": "Literal" }, {
857
+ type: LiteralTypeName(value),
858
+ const: value
859
+ }, options);
860
+ }
861
+ /** Returns true if the given value is a TLiteralValue. */
862
+ function IsLiteralValue(value) {
863
+ return IsBigInt$1(value) || IsBoolean$1(value) || IsNumber$1(value) || IsString$1(value);
864
+ }
865
+ /** Returns true if the given value is TLiteral<number>. */
866
+ function IsLiteralNumber(value) {
867
+ return IsLiteral(value) && IsNumber$1(value.const);
868
+ }
869
+ /** Returns true if the given value is TLiteral<string>. */
870
+ function IsLiteralString(value) {
871
+ return IsLiteral(value) && IsString$1(value.const);
872
+ }
873
+ /** Returns true if the given value is TLiteral. */
874
+ function IsLiteral(value) {
875
+ return IsKind(value, "Literal");
876
+ }
877
+ //#endregion
878
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/null.mjs
879
+ /** Creates a Null type. */
880
+ function Null(options) {
881
+ return Create({ "~kind": "Null" }, { type: "null" }, options);
882
+ }
883
+ /** Returns true if the given value is TNull. */
884
+ function IsNull(value) {
885
+ return IsKind(value, "Null");
886
+ }
887
+ //#endregion
888
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/number.mjs
889
+ const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
890
+ /** Creates a Number type. */
891
+ function Number$2(options) {
892
+ return Create({ "~kind": "Number" }, { type: "number" }, options);
893
+ }
894
+ /** Returns true if the given value is a TNumber. */
895
+ function IsNumber(value) {
896
+ return IsKind(value, "Number");
897
+ }
898
+ //#endregion
899
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/symbol.mjs
900
+ /** Creates a Symbol type. */
901
+ function Symbol(options) {
902
+ return Create({ "~kind": "Symbol" }, { type: "symbol" }, options);
903
+ }
904
+ /** Returns true if the given value is TSymbol. */
905
+ function IsSymbol(value) {
906
+ return IsKind(value, "Symbol");
907
+ }
908
+ //#endregion
909
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/parameter.mjs
910
+ /** Creates a Parameter type. */
911
+ function Parameter$1(...args) {
912
+ const [name, extends_, equals] = Match$2(args, {
913
+ 3: (name, extends_, equals) => [
914
+ name,
915
+ extends_,
916
+ equals
917
+ ],
918
+ 2: (name, extends_) => [
919
+ name,
920
+ extends_,
921
+ extends_
922
+ ],
923
+ 1: (name) => [
924
+ name,
925
+ Unknown(),
926
+ Unknown()
927
+ ]
928
+ });
929
+ return Create({ "~kind": "Parameter" }, {
930
+ name,
931
+ extends: extends_,
932
+ equals
933
+ }, {});
934
+ }
935
+ /** Returns true if the given value is TParameter. */
936
+ function IsParameter(value) {
937
+ return IsKind(value, "Parameter");
938
+ }
939
+ //#endregion
940
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/string.mjs
941
+ /** Creates a String type. */
942
+ function String$2(options) {
943
+ return Create({ "~kind": "String" }, { type: "string" }, options);
944
+ }
945
+ /** Returns true if the given value is TString. */
946
+ function IsString(value) {
947
+ return IsKind(value, "String");
948
+ }
949
+ //#endregion
950
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/union.mjs
951
+ /** Creates a Union type. */
952
+ function Union(anyOf, options = {}) {
953
+ return Create({ "~kind": "Union" }, { anyOf }, options);
954
+ }
955
+ /** Returns true if the given value is TUnion. */
956
+ function IsUnion(value) {
957
+ return IsKind(value, "Union");
958
+ }
959
+ /** Extracts options from a TUnion. */
960
+ function UnionOptions(type) {
961
+ return Discard(type, ["~kind", "anyOf"]);
962
+ }
963
+ //#endregion
964
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/patterns/pattern.mjs
965
+ /** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
966
+ function ParsePatternIntoTypes(pattern) {
967
+ const parsed = Pattern(pattern);
968
+ return IsEqual(parsed.length, 2) ? parsed[0] : [];
969
+ }
970
+ //#endregion
971
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
972
+ function FromLiteral$4(_value) {
973
+ return true;
974
+ }
975
+ function FromTypesReduce(types) {
976
+ return ShiftLeft(types, (left, right) => FromType$17(left) ? FromTypesReduce(right) : false, () => true);
977
+ }
978
+ function FromTypes$4(types) {
979
+ return IsEqual(types.length, 0) ? false : FromTypesReduce(types);
980
+ }
981
+ function FromType$17(type) {
982
+ return IsUnion(type) ? FromTypes$4(type.anyOf) : IsLiteral(type) ? FromLiteral$4(type.const) : false;
983
+ }
984
+ /** Returns true if the given TemplateLiteral types yields a finite variant set */
985
+ function IsTemplateLiteralFinite(types) {
986
+ return FromTypes$4(types);
987
+ }
988
+ //#endregion
989
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/create.mjs
990
+ function TemplateLiteralCreate(pattern) {
991
+ return Create({ ["~kind"]: "TemplateLiteral" }, {
992
+ type: "string",
993
+ pattern
994
+ }, {});
995
+ }
996
+ //#endregion
997
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/decode.mjs
998
+ function FromLiteralPush(variants, value, result = []) {
999
+ return ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
1000
+ }
1001
+ function FromLiteral$3(variants, value) {
1002
+ return IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value);
1003
+ }
1004
+ function FromUnion$7(variants, types, result = []) {
1005
+ return ShiftLeft(types, (left, right) => FromUnion$7(variants, right, [...result, ...FromType$16(variants, left)]), () => result);
1006
+ }
1007
+ function FromType$16(variants, type) {
1008
+ return IsUnion(type) ? FromUnion$7(variants, type.anyOf) : IsLiteral(type) ? FromLiteral$3(variants, type.const) : Unreachable$1();
1009
+ }
1010
+ function DecodeFromSpan(variants, types) {
1011
+ return ShiftLeft(types, (left, right) => DecodeFromSpan(FromType$16(variants, left), right), () => variants);
1012
+ }
1013
+ function VariantsToLiterals(variants) {
1014
+ return variants.map((variant) => Literal(variant));
1015
+ }
1016
+ function DecodeTypesAsUnion(types) {
1017
+ return Union(VariantsToLiterals(DecodeFromSpan([], types)));
1018
+ }
1019
+ function DecodeTypes(types) {
1020
+ return IsEqual(types.length, 0) ? Unreachable$1() : IsEqual(types.length, 1) && IsLiteral(types[0]) ? types[0] : DecodeTypesAsUnion(types);
1021
+ }
1022
+ /**
1023
+ * (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
1024
+ * TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
1025
+ * TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
1026
+ * decoding algorithm is needed. (for review)
1027
+ */
1028
+ function TemplateLiteralDecodeUnsafe(pattern) {
1029
+ const types = ParsePatternIntoTypes(pattern);
1030
+ return IsEqual(types.length, 0) ? String$2() : IsTemplateLiteralFinite(types) ? DecodeTypes(types) : TemplateLiteralCreate(pattern);
1031
+ }
1032
+ /** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
1033
+ function TemplateLiteralDecode(pattern) {
1034
+ const decoded = TemplateLiteralDecodeUnsafe(pattern);
1035
+ return IsTemplateLiteral(decoded) ? String$2() : decoded;
1036
+ }
1037
+ //#endregion
1038
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/record_create.mjs
1039
+ function CreateRecord(key, value) {
1040
+ const type = "object";
1041
+ const patternProperties = { [key]: value };
1042
+ return Create({ ["~kind"]: "Record" }, {
1043
+ type,
1044
+ patternProperties
1045
+ });
1046
+ }
1047
+ //#endregion
1048
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_any.mjs
1049
+ function FromAnyKey(value) {
1050
+ return CreateRecord(StringKey, value);
1051
+ }
1052
+ //#endregion
1053
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
1054
+ function FromBooleanKey(value) {
1055
+ return _Object_$1({
1056
+ true: value,
1057
+ false: value
1058
+ });
1059
+ }
1060
+ //#endregion
1061
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/tuple.mjs
1062
+ /** Creates a Tuple type. */
1063
+ function Tuple(types, options = {}) {
1064
+ const [items, minItems, additionalItems] = [
1065
+ types,
1066
+ types.length,
1067
+ false
1068
+ ];
1069
+ return Create({ ["~kind"]: "Tuple" }, {
1070
+ type: "array",
1071
+ additionalItems,
1072
+ items,
1073
+ minItems
1074
+ }, options);
1075
+ }
1076
+ /** Returns true if the given value is TTuple. */
1077
+ function IsTuple(value) {
1078
+ return IsKind(value, "Tuple");
1079
+ }
1080
+ /** Extracts options from a TTuple. */
1081
+ function TupleOptions(type) {
1082
+ return Discard(type, [
1083
+ "~kind",
1084
+ "type",
1085
+ "items",
1086
+ "minItems",
1087
+ "additionalItems"
1088
+ ]);
1089
+ }
1090
+ //#endregion
1091
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs
1092
+ function RemoveReadonlyOperation(type) {
1093
+ return Discard(type, ["~readonly"]);
1094
+ }
1095
+ function RemoveReadonlyAction(type, options) {
1096
+ return Update(RemoveReadonlyOperation(type), {}, options);
1097
+ }
1098
+ function RemoveReadonlyInstantiate(context, state, type, options) {
1099
+ return RemoveReadonlyAction(InstantiateType(context, state, type), options);
1100
+ }
1101
+ //#endregion
1102
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_remove_readonly.mjs
1103
+ /** Creates a deferred RemoveReadonly action. */
1104
+ function RemoveReadonlyDeferred(type, options = {}) {
1105
+ return Deferred("RemoveReadonly", [type], options);
1106
+ }
1107
+ /** Applies an RemoveReadonly action to a type. */
1108
+ function RemoveReadonly(type, options = {}) {
1109
+ return RemoveReadonlyAction(type, options);
1110
+ }
1111
+ //#endregion
1112
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs
1113
+ function RemoveOptionalOperation(type) {
1114
+ return Discard(type, ["~optional"]);
1115
+ }
1116
+ function RemoveOptionalAction(type, options) {
1117
+ return Update(RemoveOptionalOperation(type), {}, options);
1118
+ }
1119
+ function RemoveOptionalInstantiate(context, state, type, options) {
1120
+ return RemoveOptionalAction(InstantiateType(context, state, type), options);
1121
+ }
1122
+ //#endregion
1123
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_remove_optional.mjs
1124
+ /** Creates a deferred RemoveOptional action. */
1125
+ function RemoveOptionalDeferred(type, options = {}) {
1126
+ return Deferred("RemoveOptional", [type], options);
1127
+ }
1128
+ /** Applies an RemoveOptional action to a type. */
1129
+ function RemoveOptional(type, options = {}) {
1130
+ return RemoveOptionalAction(type, options);
1131
+ }
1132
+ //#endregion
1133
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/tuple/to_object.mjs
1134
+ function TupleElementsToProperties(types) {
1135
+ return types.reduceRight((result, right, index) => {
1136
+ return {
1137
+ [index]: right,
1138
+ ...result
1139
+ };
1140
+ }, {});
1141
+ }
1142
+ function TupleToObject(type) {
1143
+ return _Object_$1(TupleElementsToProperties(type.items));
1144
+ }
1145
+ //#endregion
1146
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/composite.mjs
1147
+ /** Returns true if the type is a valid operand to Composite. */
1148
+ function CanComposite(type) {
1149
+ return IsObject(type) || IsTuple(type);
1150
+ }
1151
+ function IsReadonlyProperty(left, right) {
1152
+ return IsReadonly(left) ? IsReadonly(right) ? true : false : false;
1153
+ }
1154
+ function IsOptionalProperty(left, right) {
1155
+ return IsOptional(left) ? IsOptional(right) ? true : false : false;
1156
+ }
1157
+ function CompositeProperty(left, right) {
1158
+ const isReadonly = IsReadonlyProperty(left, right);
1159
+ const isOptional = IsOptionalProperty(left, right);
1160
+ const property = RemoveReadonly(RemoveOptional(EvaluateIntersect([left, right])));
1161
+ return isReadonly && isOptional ? AddReadonly(AddOptional(property)) : isReadonly && !isOptional ? AddReadonly(property) : !isReadonly && isOptional ? AddOptional(property) : property;
1162
+ }
1163
+ function CompositePropertyKey(left, right, key) {
1164
+ return key in left ? key in right ? CompositeProperty(left[key], right[key]) : left[key] : key in right ? right[key] : Never();
1165
+ }
1166
+ function CompositeProperties(left, right) {
1167
+ return [.../* @__PURE__ */ new Set([...Keys(left), ...Keys(right)])].reduce((result, key) => {
1168
+ return {
1169
+ ...result,
1170
+ [key]: CompositePropertyKey(left, right, key)
1171
+ };
1172
+ }, {});
1173
+ }
1174
+ function GetProperties(type) {
1175
+ return IsObject(type) ? type.properties : IsTuple(type) ? TupleElementsToProperties(type.items) : {};
1176
+ }
1177
+ function Composite(left, right) {
1178
+ return _Object_$1(CompositeProperties(GetProperties(left), GetProperties(right)));
1179
+ }
1180
+ //#endregion
1181
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
1182
+ function NarrowCompareRule(left, right) {
1183
+ const result = Compare(left, right);
1184
+ return IsEqual(result, 2) ? left : IsEqual(result, 3) ? right : IsEqual(result, 0) ? right : Never();
1185
+ }
1186
+ function NarrowCompositeRule(left, right) {
1187
+ const canCompositeLeft = CanComposite(left);
1188
+ const canCompositeRight = CanComposite(right);
1189
+ return canCompositeLeft && canCompositeRight ? Composite(left, right) : canCompositeLeft && !canCompositeRight ? left : !canCompositeLeft && canCompositeRight ? right : NarrowCompareRule(left, right);
1190
+ }
1191
+ function Narrow(left, right) {
1192
+ return IsNever(left) ? left : IsAny(left) ? left : IsUnknown(left) ? right : IsNever(right) ? right : IsAny(right) ? right : IsUnknown(right) ? left : NarrowCompositeRule(left, right);
1193
+ }
1194
+ //#endregion
1195
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
1196
+ function ShouldEvaluate(left, right) {
1197
+ return IsUnion(left) || IsUnion(right);
1198
+ }
1199
+ function DistributeOperation(left, right) {
1200
+ const evaluatedLeft = EvaluateType(left);
1201
+ const evaluatedRight = EvaluateType(right);
1202
+ return ShouldEvaluate(evaluatedLeft, evaluatedRight) ? EvaluateIntersect([evaluatedLeft, evaluatedRight]) : Narrow(evaluatedLeft, evaluatedRight);
1203
+ }
1204
+ function DistributeType(type, types, result = []) {
1205
+ return ShiftLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(left, type)]), () => IsEqual(result.length, 0) ? [type] : result);
1206
+ }
1207
+ function DistributeUnion(types, distribution, result = []) {
1208
+ return ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute$1([left], distribution)]), () => result);
1209
+ }
1210
+ function Distribute$1(types, result = []) {
1211
+ return ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute$1(right, DistributeUnion(left.anyOf, result)) : Distribute$1(right, DistributeType(left, result)), () => result);
1212
+ }
1213
+ //#endregion
1214
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/exclude/operation.mjs
1215
+ function ExcludeType(left, right) {
1216
+ return IsExtendsTrueLike(Extends({}, left, right)) ? [] : [left];
1217
+ }
1218
+ function ExcludeUnion(left, right, result = []) {
1219
+ return ShiftLeft(left, (head, tail) => ExcludeUnion(tail, right, [...result, ...ExcludeType(head, right)]), () => result);
1220
+ }
1221
+ function ExcludeOperation(left, right) {
1222
+ const evaluated = EvaluateType(left);
1223
+ return EvaluateUnion(ExcludeUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
1224
+ }
1225
+ //#endregion
1226
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
1227
+ function EvaluateDependent(if_, then_, else_) {
1228
+ return EvaluateUnion([EvaluateIntersect([if_, then_]), ExcludeOperation(else_, if_)]);
1229
+ }
1230
+ function EvaluateEnum(values, result = []) {
1231
+ return ShiftLeft(values, (left, right) => EvaluateEnum(right, [...result, Literal(left)]), () => EvaluateUnion(result));
1232
+ }
1233
+ function EvaluateIntersect(types) {
1234
+ return EvaluateUnion(Broaden(Distribute$1(types)));
1235
+ }
1236
+ function EvaluateTemplateLiteral(pattern) {
1237
+ return EvaluateType(TemplateLiteralDecode(pattern));
1238
+ }
1239
+ function EvaluateUnion(types) {
1240
+ return EvaluateUnionFast(Broaden(types));
1241
+ }
1242
+ function EvaluateType(type) {
1243
+ return IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) : IsEnum(type) ? EvaluateEnum(type.enum) : IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
1244
+ }
1245
+ function EvaluateUnionFast(types) {
1246
+ return IsEqual(types.length, 1) ? types[0] : IsEqual(types.length, 0) ? Never() : Union(types);
1247
+ }
1248
+ //#endregion
1249
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
1250
+ function FromEnumKey(values, value) {
1251
+ return FromKey(EvaluateEnum(values), value);
1252
+ }
1253
+ //#endregion
1254
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
1255
+ function FromIntegerKey(_key, value) {
1256
+ return CreateRecord(IntegerKey, value);
1257
+ }
1258
+ //#endregion
1259
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
1260
+ function FromIntersectKey(types, value) {
1261
+ return FromKey(EvaluateIntersect(types), value);
1262
+ }
1263
+ //#endregion
1264
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
1265
+ function FromLiteralKey(key, value) {
1266
+ return IsString$1(key) || IsNumber$1(key) ? _Object_$1({ [key]: value }) : IsEqual(key, false) ? _Object_$1({ false: value }) : IsEqual(key, true) ? _Object_$1({ true: value }) : _Object_$1({});
1267
+ }
1268
+ //#endregion
1269
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_number.mjs
1270
+ function FromNumberKey(_key, value) {
1271
+ return CreateRecord(NumberKey, value);
1272
+ }
1273
+ //#endregion
1274
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_string.mjs
1275
+ function FromStringKey(key, value) {
1276
+ return HasPropertyKey(key, "pattern") && (IsString$1(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
1277
+ }
1278
+ //#endregion
1279
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
1280
+ function FromTemplateKey(pattern, value) {
1281
+ return IsTemplateLiteralFinite(ParsePatternIntoTypes(pattern)) ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
1282
+ }
1283
+ //#endregion
1284
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
1285
+ function FlattenType(type) {
1286
+ return IsUnion(type) ? Flatten(type.anyOf) : [type];
1287
+ }
1288
+ function Flatten(types, result = []) {
1289
+ return ShiftLeft(types, (left, right) => Flatten(right, [...result, ...FlattenType(left)]), () => result);
1290
+ }
1291
+ //#endregion
1292
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_union.mjs
1293
+ function StringOrNumberCheck(types) {
1294
+ return types.some((type) => IsString(type) || IsNumber(type) || IsInteger(type));
1295
+ }
1296
+ function TryBuildRecord(types, value) {
1297
+ return IsEqual(StringOrNumberCheck(types), true) ? CreateRecord(StringKey, value) : void 0;
1298
+ }
1299
+ function CreateProperties(types, value) {
1300
+ return types.reduce((result, left) => {
1301
+ return IsLiteral(left) && (IsString$1(left.const) || IsNumber$1(left.const)) ? {
1302
+ ...result,
1303
+ [left.const]: value
1304
+ } : result;
1305
+ }, {});
1306
+ }
1307
+ function CreateObject(types, value) {
1308
+ return _Object_$1(CreateProperties(types, value));
1309
+ }
1310
+ function FromUnionKey(types, value) {
1311
+ const flattened = Flatten(types);
1312
+ const record = TryBuildRecord(flattened, value);
1313
+ return IsSchema(record) ? record : CreateObject(flattened, value);
1314
+ }
1315
+ //#endregion
1316
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key.mjs
1317
+ function FromKey(key, value) {
1318
+ return IsAny(key) ? FromAnyKey(value) : IsBoolean(key) ? FromBooleanKey(value) : IsEnum(key) ? FromEnumKey(key.enum, value) : IsInteger(key) ? FromIntegerKey(key, value) : IsIntersect(key) ? FromIntersectKey(key.allOf, value) : IsLiteral(key) ? FromLiteralKey(key.const, value) : IsNumber(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_$1({});
1319
+ }
1320
+ //#endregion
1321
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/instantiate.mjs
1322
+ function RecordAction(key, value, options) {
1323
+ return CanInstantiate([key]) ? Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
1324
+ }
1325
+ function RecordInstantiate(context, state, key, value, options) {
1326
+ return RecordAction(InstantiateType(context, state, key), InstantiateType(context, state, value), options);
1327
+ }
1328
+ //#endregion
1329
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/record.mjs
1330
+ const IntegerKey = `^${IntegerPattern}$`;
1331
+ const NumberKey = `^${NumberPattern}$`;
1332
+ const StringKey = `^.*$`;
1333
+ /** Represents a deferred Record action. */
1334
+ function RecordDeferred(key, value, options = {}) {
1335
+ return Deferred("Record", [key, value], options);
1336
+ }
1337
+ /** Creates a Record type. */
1338
+ function Record(key, value, options = {}) {
1339
+ return RecordAction(key, value, options);
1340
+ }
1341
+ /** Creates a Record type from regular expression pattern. */
1342
+ function RecordFromPattern(pattern, value) {
1343
+ return CreateRecord(pattern, value);
1344
+ }
1345
+ /** Transforms a Record Pattern to a Type */
1346
+ function RecordPatternToType(pattern) {
1347
+ return IsEqual(pattern, StringKey) ? String$2() : IsEqual(pattern, IntegerKey) ? Integer$1() : IsEqual(pattern, NumberKey) ? Number$2() : TemplateLiteralDecodeUnsafe(pattern);
1348
+ }
1349
+ /** Extracts the Pattern from a Record type */
1350
+ function RecordPattern(type) {
1351
+ return Keys(type.patternProperties)[0];
1352
+ }
1353
+ /** Extracts the Key from a Record type */
1354
+ function RecordKey(type) {
1355
+ return RecordPatternToType(RecordPattern(type));
1356
+ }
1357
+ /** Extracts the Value from a Record type */
1358
+ function RecordValue(type) {
1359
+ return type.patternProperties[RecordPattern(type)];
1360
+ }
1361
+ function IsRecord(value) {
1362
+ return IsKind(value, "Record");
1363
+ }
1364
+ //#endregion
1365
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/rest.mjs
1366
+ /** Creates a Rest instruction type. */
1367
+ function Rest(type) {
1368
+ return Create({ "~kind": "Rest" }, {
1369
+ type: "rest",
1370
+ items: type
1371
+ }, {});
1372
+ }
1373
+ /** Returns true if the given value is TRest. */
1374
+ function IsRest(value) {
1375
+ return IsKind(value, "Rest");
1376
+ }
1377
+ //#endregion
1378
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/this.mjs
1379
+ /** Creates a This type. */
1380
+ function This(options) {
1381
+ return Create({ ["~kind"]: "This" }, { $ref: "#" }, options);
1382
+ }
1383
+ /** Returns true if the given value is TThis. */
1384
+ function IsThis(value) {
1385
+ return IsKind(value, "This");
1386
+ }
1387
+ //#endregion
1388
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/undefined.mjs
1389
+ /** Creates a Undefined type. */
1390
+ function Undefined(options) {
1391
+ return Create({ "~kind": "Undefined" }, { type: "undefined" }, options);
1392
+ }
1393
+ /** Returns true if the given value is TUndefined. */
1394
+ function IsUndefined(value) {
1395
+ return IsKind(value, "Undefined");
1396
+ }
1397
+ //#endregion
1398
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/void.mjs
1399
+ /** Creates a Void type. */
1400
+ function Void(options) {
1401
+ return Create({ "~kind": "Void" }, { type: "void" }, options);
1402
+ }
1403
+ /** Returns true if the given value is TVoid. */
1404
+ function IsVoid(value) {
1405
+ return IsKind(value, "Void");
1406
+ }
1407
+ //#endregion
1408
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/mapping.mjs
1409
+ function IntrinsicOrCall(ref, parameters) {
1410
+ return IsEqual(ref, "Array") ? _Array_(parameters[0]) : IsEqual(ref, "Capitalize") ? CapitalizeDeferred(parameters[0]) : IsEqual(ref, "ConstructorParameters") ? ConstructorParametersDeferred(parameters[0]) : IsEqual(ref, "Evaluate") ? EvaluateDeferred(parameters[0]) : IsEqual(ref, "Exclude") ? ExcludeDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Extract") ? ExtractDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Index") ? IndexDeferred(parameters[0], parameters[1]) : IsEqual(ref, "InstanceType") ? InstanceTypeDeferred(parameters[0]) : IsEqual(ref, "Lowercase") ? LowercaseDeferred(parameters[0]) : IsEqual(ref, "NonNullable") ? NonNullableDeferred(parameters[0]) : IsEqual(ref, "Omit") ? OmitDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Parameters") ? ParametersDeferred(parameters[0]) : IsEqual(ref, "Partial") ? PartialDeferred(parameters[0]) : IsEqual(ref, "Pick") ? PickDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Readonly") ? ReadonlyObjectDeferred(parameters[0]) : IsEqual(ref, "KeyOf") ? KeyOfDeferred(parameters[0]) : IsEqual(ref, "Record") ? RecordDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Required") ? RequiredDeferred(parameters[0]) : IsEqual(ref, "ReturnType") ? ReturnTypeDeferred(parameters[0]) : IsEqual(ref, "Uncapitalize") ? UncapitalizeDeferred(parameters[0]) : IsEqual(ref, "Uppercase") ? UppercaseDeferred(parameters[0]) : CallConstruct(Ref(ref), parameters);
1411
+ }
1412
+ function Unreachable() {
1413
+ throw Error("Unreachable");
1414
+ }
1415
+ function DelimitedDecode(input, result = []) {
1416
+ return ShiftLeft(input, (left, right) => DelimitedDecode(right, [...result, left[1]]), () => result);
1417
+ }
1418
+ function Delimited(input) {
1419
+ return IsEqual(input.length, 3) ? [input[0], ...DelimitedDecode(input[1])] : [];
1420
+ }
1421
+ function GenericParameterExtendsEqualsMapping(input) {
1422
+ return Parameter$1(input[0], input[2], input[4]);
1423
+ }
1424
+ function GenericParameterExtendsMapping(input) {
1425
+ return Parameter$1(input[0], input[2], input[2]);
1426
+ }
1427
+ function GenericParameterEqualsMapping(input) {
1428
+ return Parameter$1(input[0], Unknown(), input[2]);
1429
+ }
1430
+ function GenericParameterIdentifierMapping(input) {
1431
+ return Parameter$1(input, Unknown(), Unknown());
1432
+ }
1433
+ function GenericParameterMapping(input) {
1434
+ return input;
1435
+ }
1436
+ function GenericParameterListMapping(input) {
1437
+ return Delimited(input);
1438
+ }
1439
+ function GenericParametersMapping(input) {
1440
+ return input[1];
1441
+ }
1442
+ function GenericCallArgumentListMapping(input) {
1443
+ return Delimited(input);
1444
+ }
1445
+ function GenericCallArgumentsMapping(input) {
1446
+ return input[1];
1447
+ }
1448
+ function GenericCallMapping(input) {
1449
+ return IntrinsicOrCall(input[0], input[1]);
1450
+ }
1451
+ function OptionalSemiColonMapping(input) {
1452
+ return null;
1453
+ }
1454
+ function KeywordStringMapping(input) {
1455
+ return String$2();
1456
+ }
1457
+ function KeywordNumberMapping(input) {
1458
+ return Number$2();
1459
+ }
1460
+ function KeywordBooleanMapping(input) {
1461
+ return Boolean$1();
1462
+ }
1463
+ function KeywordUndefinedMapping(input) {
1464
+ return Undefined();
1465
+ }
1466
+ function KeywordNullMapping(input) {
1467
+ return Null();
1468
+ }
1469
+ function KeywordIntegerMapping(input) {
1470
+ return Integer$1();
1471
+ }
1472
+ function KeywordBigIntMapping(input) {
1473
+ return BigInt$2();
1474
+ }
1475
+ function KeywordUnknownMapping(input) {
1476
+ return Unknown();
1477
+ }
1478
+ function KeywordAnyMapping(input) {
1479
+ return Any();
1480
+ }
1481
+ function KeywordObjectMapping(input) {
1482
+ return _Object_$1({});
1483
+ }
1484
+ function KeywordNeverMapping(input) {
1485
+ return Never();
1486
+ }
1487
+ function KeywordSymbolMapping(input) {
1488
+ return Symbol();
1489
+ }
1490
+ function KeywordVoidMapping(input) {
1491
+ return Void();
1492
+ }
1493
+ function KeywordThisMapping(input) {
1494
+ return This();
1495
+ }
1496
+ function LiteralBigIntMapping(input) {
1497
+ return Literal(BigInt(input));
1498
+ }
1499
+ function LiteralBooleanMapping(input) {
1500
+ return Literal(IsEqual(input, "true"));
1501
+ }
1502
+ function LiteralNumberMapping(input) {
1503
+ return Literal(parseFloat(input));
1504
+ }
1505
+ function LiteralStringMapping(input) {
1506
+ return Literal(input);
1507
+ }
1508
+ function TemplateInterpolateMapping(input) {
1509
+ return input[1];
1510
+ }
1511
+ function TemplateSpanMapping(input) {
1512
+ return Literal(input);
1513
+ }
1514
+ function TemplateBodyMapping(input) {
1515
+ return IsEqual(input.length, 3) ? [
1516
+ input[0],
1517
+ input[1],
1518
+ ...input[2]
1519
+ ] : [input[0]];
1520
+ }
1521
+ function TemplateLiteralTypesMapping(input) {
1522
+ return input[1];
1523
+ }
1524
+ function TemplateLiteralMapping(input) {
1525
+ return TemplateLiteralDeferred(input);
1526
+ }
1527
+ function DependentMapping(input) {
1528
+ return IsEqual(input.length, 6) ? Dependent$1(input[1], input[3], input[5]) : Dependent$1(input[1], input[3], Unknown());
1529
+ }
1530
+ function KeyOfMapping(input) {
1531
+ return input.length > 0;
1532
+ }
1533
+ function IndexArrayMapping(input) {
1534
+ return input.reduce((result, current) => {
1535
+ return IsEqual(current.length, 3) ? [...result, [current[1]]] : [...result, []];
1536
+ }, []);
1537
+ }
1538
+ function ExtendsMapping(input) {
1539
+ return IsEqual(input.length, 6) ? [
1540
+ input[1],
1541
+ input[3],
1542
+ input[5]
1543
+ ] : [];
1544
+ }
1545
+ function BaseMapping(input) {
1546
+ return IsArray$1(input) && IsEqual(input.length, 3) ? input[1] : input;
1547
+ }
1548
+ function WithMapping(input) {
1549
+ return IsEqual(input.length, 2) ? input[1] : [];
1550
+ }
1551
+ function FactorIndexArray(Type, indexArray) {
1552
+ return indexArray.reduce((result, left) => {
1553
+ const _left = left;
1554
+ return IsEqual(_left.length, 1) ? IndexDeferred(result, _left[0]) : IsEqual(_left.length, 0) ? _Array_(result) : Unreachable();
1555
+ }, Type);
1556
+ }
1557
+ function FactorExtends(type, extend) {
1558
+ return IsEqual(extend.length, 3) ? ConditionalDeferred(type, extend[0], extend[1], extend[2]) : type;
1559
+ }
1560
+ function FactorWith(type, withClause) {
1561
+ return IsArray$1(withClause) && IsEqual(withClause.length, 0) ? type : WithDeferred(type, withClause);
1562
+ }
1563
+ function FactorMapping(input) {
1564
+ const [keyOf, type, indexArray, extend, withClause] = input;
1565
+ return FactorWith(keyOf ? FactorExtends(KeyOfDeferred(FactorIndexArray(type, indexArray)), extend) : FactorExtends(FactorIndexArray(type, indexArray), extend), withClause);
1566
+ }
1567
+ function ExprBinaryMapping(left, rest) {
1568
+ return IsEqual(rest.length, 3) ? (() => {
1569
+ const [operator, right, next] = rest;
1570
+ const Schema = ExprBinaryMapping(right, next);
1571
+ if (IsEqual(operator, "&")) return IsIntersect(Schema) ? Intersect([left, ...Schema.allOf]) : Intersect([left, Schema]);
1572
+ if (IsEqual(operator, "|")) return IsUnion(Schema) ? Union([left, ...Schema.anyOf]) : Union([left, Schema]);
1573
+ Unreachable();
1574
+ })() : left;
1575
+ }
1576
+ function ExprTermTailMapping(input) {
1577
+ return input;
1578
+ }
1579
+ function ExprTermMapping(input) {
1580
+ const [left, rest] = input;
1581
+ return ExprBinaryMapping(left, rest);
1582
+ }
1583
+ function ExprTailMapping(input) {
1584
+ return input;
1585
+ }
1586
+ function ExprMapping(input) {
1587
+ const [left, rest] = input;
1588
+ return ExprBinaryMapping(left, rest);
1589
+ }
1590
+ function ExprReadonlyMapping(input) {
1591
+ return AddImmutableDeferred(input[1]);
1592
+ }
1593
+ function ExprPipeMapping(input) {
1594
+ return input[1];
1595
+ }
1596
+ function GenericTypeMapping(input) {
1597
+ return Generic(input[0], input[2]);
1598
+ }
1599
+ function InferTypeMapping(input) {
1600
+ return IsEqual(input.length, 4) ? Infer(input[1], input[3]) : IsEqual(input.length, 2) ? Infer(input[1], Unknown()) : Unreachable();
1601
+ }
1602
+ function TypeMapping(input) {
1603
+ return input;
1604
+ }
1605
+ function PropertyKeyNumberMapping(input) {
1606
+ return `${input}`;
1607
+ }
1608
+ function PropertyKeyIdentMapping(input) {
1609
+ return input;
1610
+ }
1611
+ function PropertyKeyQuotedMapping(input) {
1612
+ return input;
1613
+ }
1614
+ function PropertyKeyIndexMapping(input) {
1615
+ return IsInteger(input[3]) ? IntegerKey : IsNumber(input[3]) ? NumberKey : IsSymbol(input[3]) ? StringKey : IsString(input[3]) ? StringKey : Unreachable();
1616
+ }
1617
+ function PropertyKeyMapping(input) {
1618
+ return input;
1619
+ }
1620
+ function ReadonlyMapping(input) {
1621
+ return input.length > 0;
1622
+ }
1623
+ function OptionalMapping(input) {
1624
+ return input.length > 0;
1625
+ }
1626
+ function PropertyMapping(input) {
1627
+ const [isReadonly, key, isOptional, _colon, type] = input;
1628
+ return { [key]: isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type };
1629
+ }
1630
+ function PropertyDelimiterMapping(input) {
1631
+ return input;
1632
+ }
1633
+ function PropertyListMapping(input) {
1634
+ return Delimited(input);
1635
+ }
1636
+ function PropertiesReduce(propertyList) {
1637
+ return propertyList.reduce((result, left) => {
1638
+ return HasPropertyKey(left, IntegerKey) || HasPropertyKey(left, NumberKey) || HasPropertyKey(left, StringKey) ? [result[0], Assign(result[1], left)] : [Assign(result[0], left), result[1]];
1639
+ }, [{}, {}]);
1640
+ }
1641
+ function PropertiesMapping(input) {
1642
+ return PropertiesReduce(input[1]);
1643
+ }
1644
+ function _Object_Mapping(input) {
1645
+ const [properties, patternProperties] = input;
1646
+ return _Object_$1(properties, IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties });
1647
+ }
1648
+ function ElementNamedMapping(input) {
1649
+ return IsEqual(input.length, 5) ? AddReadonlyDeferred(AddOptionalDeferred(input[4])) : IsEqual(input.length, 3) ? input[2] : IsEqual(input.length, 4) ? IsEqual(input[2], "readonly") ? AddReadonlyDeferred(input[3]) : AddOptionalDeferred(input[3]) : Unreachable();
1650
+ }
1651
+ function ElementBaseMapping(input) {
1652
+ if (!IsArray$1(input) || !IsEqual(input.length, 3)) return input;
1653
+ const [isReadonly, type, isOptional] = input;
1654
+ return isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type;
1655
+ }
1656
+ function ElementMapping(input) {
1657
+ return IsEqual(input.length, 2) ? Rest(input[1]) : IsEqual(input.length, 1) ? input[0] : Unreachable();
1658
+ }
1659
+ function ElementListMapping(input) {
1660
+ return Delimited(input);
1661
+ }
1662
+ function _Tuple_Mapping(input) {
1663
+ return Tuple(input[1]);
1664
+ }
1665
+ function ParameterReadonlyOptionalMapping(input) {
1666
+ return AddReadonlyDeferred(AddOptionalDeferred(input[4]));
1667
+ }
1668
+ function ParameterReadonlyMapping(input) {
1669
+ return AddReadonlyDeferred(input[3]);
1670
+ }
1671
+ function ParameterOptionalMapping(input) {
1672
+ return AddOptionalDeferred(input[3]);
1673
+ }
1674
+ function ParameterTypeMapping(input) {
1675
+ return input[2];
1676
+ }
1677
+ function ParameterBaseMapping(input) {
1678
+ return input;
1679
+ }
1680
+ function ParameterMapping(input) {
1681
+ return IsEqual(input.length, 2) ? Rest(input[1]) : IsEqual(input.length, 1) ? input[0] : Unreachable();
1682
+ }
1683
+ function ParameterListMapping(input) {
1684
+ return Delimited(input);
1685
+ }
1686
+ function _Function_Mapping(input) {
1687
+ return _Function_$1(input[1], input[4]);
1688
+ }
1689
+ function _Constructor_Mapping(input) {
1690
+ return Constructor(input[2], input[5]);
1691
+ }
1692
+ function ApplyReadonly(state, type) {
1693
+ return IsEqual(state, "remove") ? RemoveReadonlyDeferred(type) : IsEqual(state, "add") ? AddReadonlyDeferred(type) : type;
1694
+ }
1695
+ function MappedReadonlyMapping(input) {
1696
+ return IsEqual(input.length, 2) && IsEqual(input[0], "-") ? "remove" : IsEqual(input.length, 2) && IsEqual(input[0], "+") ? "add" : IsEqual(input.length, 1) ? "add" : "none";
1697
+ }
1698
+ function ApplyOptional(state, type) {
1699
+ return IsEqual(state, "remove") ? RemoveOptionalDeferred(type) : IsEqual(state, "add") ? AddOptionalDeferred(type) : type;
1700
+ }
1701
+ function MappedOptionalMapping(input) {
1702
+ return IsEqual(input.length, 2) && IsEqual(input[0], "-") ? "remove" : IsEqual(input.length, 2) && IsEqual(input[0], "+") ? "add" : IsEqual(input.length, 1) ? "add" : "none";
1703
+ }
1704
+ function MappedAsMapping(input) {
1705
+ return IsEqual(input.length, 2) ? [input[1]] : [];
1706
+ }
1707
+ function _Mapped_Mapping(input) {
1708
+ return IsArray$1(input[6]) && IsEqual(input[6].length, 1) ? MappedDeferred(Identifier(input[3]), input[5], input[6][0], ApplyReadonly(input[1], ApplyOptional(input[8], input[10]))) : MappedDeferred(Identifier(input[3]), input[5], Ref(input[3]), ApplyReadonly(input[1], ApplyOptional(input[8], input[10])));
1709
+ }
1710
+ function ReferenceMapping(input) {
1711
+ return Ref(input);
1712
+ }
1713
+ function WithBigIntMapping(input) {
1714
+ return BigInt(input);
1715
+ }
1716
+ function WithNumberMapping(input) {
1717
+ return parseFloat(input);
1718
+ }
1719
+ function WithBooleanMapping(input) {
1720
+ return IsEqual(input, "true");
1721
+ }
1722
+ function WithStringMapping(input) {
1723
+ return input;
1724
+ }
1725
+ function WithNullMapping(input) {
1726
+ return null;
1727
+ }
1728
+ function WithPropertyMapping(input) {
1729
+ return { [input[0]]: input[2] };
1730
+ }
1731
+ function WithPropertyListMapping(input) {
1732
+ return Delimited(input);
1733
+ }
1734
+ function WithObjectMappingReduce(propertyList) {
1735
+ return propertyList.reduce((result, left) => {
1736
+ return Assign(result, left);
1737
+ }, {});
1738
+ }
1739
+ function WithObjectMapping(input) {
1740
+ return WithObjectMappingReduce(input[1]);
1741
+ }
1742
+ function WithElementListMapping(input) {
1743
+ return Delimited(input);
1744
+ }
1745
+ function WithArrayMapping(input) {
1746
+ return input[1];
1747
+ }
1748
+ function WithValueMapping(input) {
1749
+ return input;
1750
+ }
1751
+ function PatternBigIntMapping(input) {
1752
+ return BigInt$2();
1753
+ }
1754
+ function PatternStringMapping(input) {
1755
+ return String$2();
1756
+ }
1757
+ function PatternNumberMapping(input) {
1758
+ return Number$2();
1759
+ }
1760
+ function PatternIntegerMapping(input) {
1761
+ return Integer$1();
1762
+ }
1763
+ function PatternNeverMapping(input) {
1764
+ return Never();
1765
+ }
1766
+ function PatternTextMapping(input) {
1767
+ return Literal(input);
1768
+ }
1769
+ function PatternBaseMapping(input) {
1770
+ return input;
1771
+ }
1772
+ function PatternGroupMapping(input) {
1773
+ return Union(input[1]);
1774
+ }
1775
+ function PatternUnionMapping(input) {
1776
+ return input.length === 3 ? [...input[0], ...input[2]] : input.length === 1 ? [...input[0]] : [];
1777
+ }
1778
+ function PatternTermMapping(input) {
1779
+ return [input[0], ...input[1]];
1780
+ }
1781
+ function PatternBodyMapping(input) {
1782
+ return input;
1783
+ }
1784
+ function PatternMapping(input) {
1785
+ return input[1];
1786
+ }
1787
+ function InterfaceDeclarationHeritageListMapping(input) {
1788
+ return Delimited(input);
1789
+ }
1790
+ function InterfaceDeclarationHeritageMapping(input) {
1791
+ return IsEqual(input.length, 2) ? input[1] : [];
1792
+ }
1793
+ function InterfaceDeclarationGenericMapping(input) {
1794
+ const parameters = input[2];
1795
+ const heritage = input[3];
1796
+ const [properties, patternProperties] = input[4];
1797
+ const options = IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties };
1798
+ return { [input[1]]: Generic(parameters, InterfaceDeferred(heritage, properties, options)) };
1799
+ }
1800
+ function InterfaceDeclarationMapping(input) {
1801
+ const heritage = input[2];
1802
+ const [properties, patternProperties] = input[3];
1803
+ const options = IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties };
1804
+ return { [input[1]]: InterfaceDeferred(heritage, properties, options) };
1805
+ }
1806
+ function TypeAliasDeclarationGenericMapping(input) {
1807
+ return { [input[1]]: Generic(input[2], input[4]) };
1808
+ }
1809
+ function TypeAliasDeclarationMapping(input) {
1810
+ return { [input[1]]: input[3] };
1811
+ }
1812
+ function ExportKeywordMapping(input) {
1813
+ return null;
1814
+ }
1815
+ function ModuleDeclarationDelimiterMapping(input) {
1816
+ return input;
1817
+ }
1818
+ function ModuleDeclarationListMapping(input) {
1819
+ return Delimited(input);
1820
+ }
1821
+ function ModuleDeclarationMapping(input) {
1822
+ return input[1];
1823
+ }
1824
+ function ModuleMapping(input) {
1825
+ const [moduleDeclaration, moduleDeclarationList] = [input[0], input[1]];
1826
+ return ModuleDeferred(Assign(moduleDeclaration, PropertiesReduce(moduleDeclarationList)[0]));
1827
+ }
1828
+ function ScriptMapping(input) {
1829
+ return input;
1830
+ }
1831
+ //#endregion
1832
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/match.mjs
1833
+ /** Checks the value is a Tuple-2 [string, string] result */
1834
+ function IsMatch(value) {
1835
+ return IsEqual(value.length, 2);
1836
+ }
1837
+ /** Matches on a result and dispatches either left or right arm */
1838
+ function Match$1(input, ok, fail) {
1839
+ return IsMatch(input) ? ok(input[0], input[1]) : fail();
1840
+ }
1841
+ //#endregion
1842
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/take.mjs
1843
+ function TakeVariant(variant, input) {
1844
+ return IsEqual(input.indexOf(variant), 0) ? [variant, input.slice(variant.length)] : [];
1845
+ }
1846
+ /** Takes one of the given variants or fail */
1847
+ function Take(variants, input) {
1848
+ for (let i = 0; i < variants.length; i++) {
1849
+ const result = TakeVariant(variants[i], input);
1850
+ if (IsMatch(result)) return result;
1851
+ }
1852
+ return [];
1853
+ }
1854
+ //#endregion
1855
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/char.mjs
1856
+ function Range(start, end) {
1857
+ return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
1858
+ }
1859
+ const Alpha = [...Range(97, 122), ...Range(65, 90)];
1860
+ const NonZero = Range(49, 57);
1861
+ const Digit = ["0", ...NonZero];
1862
+ //#endregion
1863
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/trim.mjs
1864
+ const LineComment = "//";
1865
+ const OpenComment = "/*";
1866
+ const CloseComment = "*/";
1867
+ function DiscardMultilineComment(input) {
1868
+ const index = input.indexOf(CloseComment);
1869
+ return IsEqual(index, -1) ? "" : input.slice(index + 2);
1870
+ }
1871
+ function DiscardLineComment(input) {
1872
+ const index = input.indexOf("\n");
1873
+ return IsEqual(index, -1) ? "" : input.slice(index);
1874
+ }
1875
+ function TrimStartUntilNewline(input) {
1876
+ return input.replace(/^[ \t\r\f\v]+/, "");
1877
+ }
1878
+ function TrimWhitespace(input) {
1879
+ const trimmed = TrimStartUntilNewline(input);
1880
+ return trimmed.startsWith(OpenComment) ? TrimWhitespace(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? TrimWhitespace(DiscardLineComment(trimmed.slice(2))) : trimmed;
1881
+ }
1882
+ function Trim(input) {
1883
+ const trimmed = input.trimStart();
1884
+ return trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) : trimmed;
1885
+ }
1886
+ //#endregion
1887
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/optional.mjs
1888
+ /** Matches the given Value or empty string if no match. This function never fails */
1889
+ function Optional$1(value, input) {
1890
+ return Match$1(Take([value], input), (Optional, Rest) => [Optional, Rest], () => ["", input]);
1891
+ }
1892
+ //#endregion
1893
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/many.mjs
1894
+ function IsDiscard(discard, input) {
1895
+ return discard.includes(input);
1896
+ }
1897
+ /** Takes characters from the Input until no-match. The Discard set is used to omit characters from the match */
1898
+ function Many(allowed, discard, input, result = "") {
1899
+ return Match$1(Take(allowed, input), (Char, Rest) => IsDiscard(discard, Char) ? Many(allowed, discard, Rest, result) : Many(allowed, discard, Rest, `${result}${Char}`), () => [result, input]);
1900
+ }
1901
+ //#endregion
1902
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/unsigned_integer.mjs
1903
+ function TakeNonZero(input) {
1904
+ return Take(NonZero, input);
1905
+ }
1906
+ const AllowedDigits$1 = [...Digit, "_"];
1907
+ function TakeDigits(input) {
1908
+ return Many(AllowedDigits$1, ["_"], input);
1909
+ }
1910
+ function TakeUnsignedInteger(input) {
1911
+ return Match$1(Take(["0"], input), (Zero, ZeroRest) => [Zero, ZeroRest], () => Match$1(TakeNonZero(input), (NonZero, NonZeroRest) => Match$1(TakeDigits(NonZeroRest), (Digits, DigitsRest) => [`${NonZero}${Digits}`, DigitsRest], () => []), () => []));
1912
+ }
1913
+ /** Matches if next is a UnsignedInteger */
1914
+ function UnsignedInteger(input) {
1915
+ return TakeUnsignedInteger(Trim(input));
1916
+ }
1917
+ //#endregion
1918
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/integer.mjs
1919
+ function TakeSign$1(input) {
1920
+ return Optional$1("-", input);
1921
+ }
1922
+ function TakeSignedInteger(input) {
1923
+ return Match$1(TakeSign$1(input), (Sign, SignRest) => Match$1(UnsignedInteger(SignRest), (UnsignedInteger, UnsignedIntegerRest) => [`${Sign}${UnsignedInteger}`, UnsignedIntegerRest], () => []), () => []);
1924
+ }
1925
+ /** Matches if next is a signed or unsigned Integer */
1926
+ function Integer(input) {
1927
+ return TakeSignedInteger(Trim(input));
1928
+ }
1929
+ //#endregion
1930
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/bigint.mjs
1931
+ function TakeBigInt(input) {
1932
+ return Match$1(Integer(input), (Integer, IntegerRest) => Match$1(Take(["n"], IntegerRest), (_N, NRest) => [`${Integer}`, NRest], () => []), () => []);
1933
+ }
1934
+ /** Matches if next is a Integer literal with trailing 'n'. Trailing 'n' is omitted in result. */
1935
+ function BigInt$1(input) {
1936
+ return TakeBigInt(input);
1937
+ }
1938
+ //#endregion
1939
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/const.mjs
1940
+ function TakeConst(const_, input) {
1941
+ return Take([const_], input);
1942
+ }
1943
+ /** Matches if next is the given Const value */
1944
+ function Const(const_, input) {
1945
+ return IsEqual(const_, "") ? ["", input] : const_.startsWith("\n") ? TakeConst(const_, TrimWhitespace(input)) : const_.startsWith(" ") ? TakeConst(const_, input) : TakeConst(const_, Trim(input));
1946
+ }
1947
+ //#endregion
1948
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/ident.mjs
1949
+ const Initial = [
1950
+ ...Alpha,
1951
+ "_",
1952
+ "$"
1953
+ ];
1954
+ function TakeInitial$1(input) {
1955
+ return Take(Initial, input);
1956
+ }
1957
+ const Remaining = [...Initial, ...Digit];
1958
+ function TakeRemaining(input, result = "") {
1959
+ return Match$1(Take(Remaining, input), (Remaining, RemainingRest) => TakeRemaining(RemainingRest, `${result}${Remaining}`), () => [result, input]);
1960
+ }
1961
+ function TakeIdent(input) {
1962
+ return Match$1(TakeInitial$1(input), (Initial, InitialRest) => Match$1(TakeRemaining(InitialRest), (Remaining, RemainingRest) => [`${Initial}${Remaining}`, RemainingRest], () => []), () => []);
1963
+ }
1964
+ /** Matches if next is an Ident */
1965
+ function Ident(input) {
1966
+ return TakeIdent(Trim(input));
1967
+ }
1968
+ //#endregion
1969
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/unsigned_number.mjs
1970
+ const AllowedDigits = [...Digit, "_"];
1971
+ function IsLeadingDot(input) {
1972
+ return IsMatch(Take(["."], input));
1973
+ }
1974
+ function TakeFractional(input) {
1975
+ return Match$1(Many(AllowedDigits, ["_"], input), (Digits, DigitsRest) => IsEqual(Digits, "") ? [] : [Digits, DigitsRest], () => []);
1976
+ }
1977
+ function LeadingDot(input) {
1978
+ return Match$1(Take(["."], input), (Dot, DotRest) => Match$1(TakeFractional(DotRest), (Fractional, FractionalRest) => [`0${Dot}${Fractional}`, FractionalRest], () => []), () => []);
1979
+ }
1980
+ function LeadingInteger(input) {
1981
+ return Match$1(UnsignedInteger(input), (Integer, IntegerRest) => Match$1(Take(["."], IntegerRest), (Dot, DotRest) => Match$1(TakeFractional(DotRest), (Fractional, FractionalRest) => [`${Integer}${Dot}${Fractional}`, FractionalRest], () => [`${Integer}`, DotRest]), () => [`${Integer}`, IntegerRest]), () => []);
1982
+ }
1983
+ function TakeUnsignedNumber(input) {
1984
+ return IsLeadingDot(input) ? LeadingDot(input) : LeadingInteger(input);
1985
+ }
1986
+ /** Matches if next is a UnsignedNumber */
1987
+ function UnsignedNumber(input) {
1988
+ return TakeUnsignedNumber(Trim(input));
1989
+ }
1990
+ //#endregion
1991
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/number.mjs
1992
+ function TakeSign(input) {
1993
+ return Optional$1("-", input);
1994
+ }
1995
+ function TakeSignedNumber(input) {
1996
+ return Match$1(TakeSign(input), (Sign, SignRest) => Match$1(UnsignedNumber(SignRest), (UnsignedInteger, UnsignedIntegerRest) => [`${Sign}${UnsignedInteger}`, UnsignedIntegerRest], () => []), () => []);
1997
+ }
1998
+ /** Matches if next is a signed or unsigned Number */
1999
+ function Number$1(input) {
2000
+ return TakeSignedNumber(Trim(input));
2001
+ }
2002
+ //#endregion
2003
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/until.mjs
2004
+ function TakeOne(input) {
2005
+ return IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
2006
+ }
2007
+ function IsInputMatchSentinal(end, input) {
2008
+ return ShiftLeft(end, (left, right) => input.startsWith(left) ? true : IsInputMatchSentinal(right, input), () => false);
2009
+ }
2010
+ /** Match Input until but not including End. No match if End not found. */
2011
+ function Until(end, input, result = "") {
2012
+ return Match$1(TakeOne(input), (One, Rest) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest, `${result}${One}`), () => []);
2013
+ }
2014
+ //#endregion
2015
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/span.mjs
2016
+ function MultiLine(start, end, input) {
2017
+ return Match$1(Take([start], input), (_, Rest) => Match$1(Until([end], Rest), (Until, UntilRest) => Match$1(Take([end], UntilRest), (_, Rest) => [`${Until}`, Rest], () => []), () => []), () => []);
2018
+ }
2019
+ function SingleLine(start, end, input) {
2020
+ return Match$1(Take([start], input), (_, Rest) => Match$1(Until(["\n", end], Rest), (Until, UntilRest) => Match$1(Take([end], UntilRest), (_, EndRest) => [`${Until}`, EndRest], () => []), () => []), () => []);
2021
+ }
2022
+ /** Matches from Start and End capturing everything in-between. Start and End are consumed. */
2023
+ function Span(start, end, multiLine, input) {
2024
+ return multiLine ? MultiLine(start, end, Trim(input)) : SingleLine(start, end, Trim(input));
2025
+ }
2026
+ //#endregion
2027
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/string.mjs
2028
+ function TakeInitial(quotes, input) {
2029
+ return Take(quotes, input);
2030
+ }
2031
+ function TakeSpan(quote, input) {
2032
+ return Span(quote, quote, false, input);
2033
+ }
2034
+ function TakeString(quotes, input) {
2035
+ return Match$1(TakeInitial(quotes, input), (Initial, InitialRest) => TakeSpan(Initial, `${Initial}${InitialRest}`), () => []);
2036
+ }
2037
+ /** Matches a literal String with the given quotes */
2038
+ function String$1(quotes, input) {
2039
+ return TakeString(quotes, Trim(input));
2040
+ }
2041
+ //#endregion
2042
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/until_1.mjs
2043
+ /** Match Input until but not including End. No match if End not found or match is zero-length. */
2044
+ function Until_1(end, input) {
2045
+ return Match$1(Until(end, input), (Until, UntilRest) => IsEqual(Until, "") ? [] : [Until, UntilRest], () => []);
2046
+ }
2047
+ //#endregion
2048
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/parser.mjs
2049
+ const If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
2050
+ const GenericParameterExtendsEquals = (input) => If(If(Ident(input), ([_0, input]) => If(Const("extends", input), ([_1, input]) => If(Type(input), ([_2, input]) => If(Const("=", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
2051
+ _0,
2052
+ _1,
2053
+ _2,
2054
+ _3,
2055
+ _4
2056
+ ], input]))))), ([_0, input]) => [GenericParameterExtendsEqualsMapping(_0), input]);
2057
+ const GenericParameterExtends = (input) => If(If(Ident(input), ([_0, input]) => If(Const("extends", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
2058
+ _0,
2059
+ _1,
2060
+ _2
2061
+ ], input]))), ([_0, input]) => [GenericParameterExtendsMapping(_0), input]);
2062
+ const GenericParameterEquals = (input) => If(If(Ident(input), ([_0, input]) => If(Const("=", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
2063
+ _0,
2064
+ _1,
2065
+ _2
2066
+ ], input]))), ([_0, input]) => [GenericParameterEqualsMapping(_0), input]);
2067
+ const GenericParameterIdentifier = (input) => If(Ident(input), ([_0, input]) => [GenericParameterIdentifierMapping(_0), input]);
2068
+ const GenericParameter = (input) => If(If(GenericParameterExtendsEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterExtends(input), ([_0, input]) => [_0, input], () => If(GenericParameterEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterIdentifier(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [GenericParameterMapping(_0), input]);
2069
+ const GenericParameterList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(GenericParameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericParameterList_0(input, [...result, _0]), () => [result, input]);
2070
+ const GenericParameterList = (input) => If(If(If(GenericParameter(input), ([_0, input]) => If(GenericParameterList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2071
+ _0,
2072
+ _1,
2073
+ _2
2074
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [GenericParameterListMapping(_0), input]);
2075
+ const GenericParameters = (input) => If(If(Const("<", input), ([_0, input]) => If(GenericParameterList(input), ([_1, input]) => If(Const(">", input), ([_2, input]) => [[
2076
+ _0,
2077
+ _1,
2078
+ _2
2079
+ ], input]))), ([_0, input]) => [GenericParametersMapping(_0), input]);
2080
+ const GenericCallArgumentList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericCallArgumentList_0(input, [...result, _0]), () => [result, input]);
2081
+ const GenericCallArgumentList = (input) => If(If(If(Type(input), ([_0, input]) => If(GenericCallArgumentList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2082
+ _0,
2083
+ _1,
2084
+ _2
2085
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [GenericCallArgumentListMapping(_0), input]);
2086
+ const GenericCallArguments = (input) => If(If(Const("<", input), ([_0, input]) => If(GenericCallArgumentList(input), ([_1, input]) => If(Const(">", input), ([_2, input]) => [[
2087
+ _0,
2088
+ _1,
2089
+ _2
2090
+ ], input]))), ([_0, input]) => [GenericCallArgumentsMapping(_0), input]);
2091
+ const GenericCall = (input) => If(If(Ident(input), ([_0, input]) => If(GenericCallArguments(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [GenericCallMapping(_0), input]);
2092
+ const OptionalSemiColon = (input) => If(If(If(Const(";", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [OptionalSemiColonMapping(_0), input]);
2093
+ const KeywordString = (input) => If(Const("string", input), ([_0, input]) => [KeywordStringMapping(_0), input]);
2094
+ const KeywordNumber = (input) => If(Const("number", input), ([_0, input]) => [KeywordNumberMapping(_0), input]);
2095
+ const KeywordBoolean = (input) => If(Const("boolean", input), ([_0, input]) => [KeywordBooleanMapping(_0), input]);
2096
+ const KeywordUndefined = (input) => If(Const("undefined", input), ([_0, input]) => [KeywordUndefinedMapping(_0), input]);
2097
+ const KeywordNull = (input) => If(Const("null", input), ([_0, input]) => [KeywordNullMapping(_0), input]);
2098
+ const KeywordInteger = (input) => If(Const("integer", input), ([_0, input]) => [KeywordIntegerMapping(_0), input]);
2099
+ const KeywordBigInt = (input) => If(Const("bigint", input), ([_0, input]) => [KeywordBigIntMapping(_0), input]);
2100
+ const KeywordUnknown = (input) => If(Const("unknown", input), ([_0, input]) => [KeywordUnknownMapping(_0), input]);
2101
+ const KeywordAny = (input) => If(Const("any", input), ([_0, input]) => [KeywordAnyMapping(_0), input]);
2102
+ const KeywordObject = (input) => If(Const("object", input), ([_0, input]) => [KeywordObjectMapping(_0), input]);
2103
+ const KeywordNever = (input) => If(Const("never", input), ([_0, input]) => [KeywordNeverMapping(_0), input]);
2104
+ const KeywordSymbol = (input) => If(Const("symbol", input), ([_0, input]) => [KeywordSymbolMapping(_0), input]);
2105
+ const KeywordVoid = (input) => If(Const("void", input), ([_0, input]) => [KeywordVoidMapping(_0), input]);
2106
+ const KeywordThis = (input) => If(Const("this", input), ([_0, input]) => [KeywordThisMapping(_0), input]);
2107
+ const TemplateInterpolate = (input) => If(If(Const("${", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
2108
+ _0,
2109
+ _1,
2110
+ _2
2111
+ ], input]))), ([_0, input]) => [TemplateInterpolateMapping(_0), input]);
2112
+ const TemplateSpan = (input) => If(Until(["${", "`"], input), ([_0, input]) => [TemplateSpanMapping(_0), input]);
2113
+ const TemplateBody = (input) => If(If(If(TemplateSpan(input), ([_0, input]) => If(TemplateInterpolate(input), ([_1, input]) => If(TemplateBody(input), ([_2, input]) => [[
2114
+ _0,
2115
+ _1,
2116
+ _2
2117
+ ], input]))), ([_0, input]) => [_0, input], () => If(If(TemplateSpan(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(TemplateSpan(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [TemplateBodyMapping(_0), input]);
2118
+ const TemplateLiteralTypes = (input) => If(If(Const("`", input), ([_0, input]) => If(TemplateBody(input), ([_1, input]) => If(Const("`", input), ([_2, input]) => [[
2119
+ _0,
2120
+ _1,
2121
+ _2
2122
+ ], input]))), ([_0, input]) => [TemplateLiteralTypesMapping(_0), input]);
2123
+ const TemplateLiteral$1 = (input) => If(TemplateLiteralTypes(input), ([_0, input]) => [TemplateLiteralMapping(_0), input]);
2124
+ const Dependent = (input) => If(If(If(Const("if", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("then", input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Const("else", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
2125
+ _0,
2126
+ _1,
2127
+ _2,
2128
+ _3,
2129
+ _4,
2130
+ _5
2131
+ ], input])))))), ([_0, input]) => [_0, input], () => If(If(Const("if", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("then", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
2132
+ _0,
2133
+ _1,
2134
+ _2,
2135
+ _3
2136
+ ], input])))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [DependentMapping(_0), input]);
2137
+ const LiteralBigInt = (input) => If(BigInt$1(input), ([_0, input]) => [LiteralBigIntMapping(_0), input]);
2138
+ const LiteralBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [LiteralBooleanMapping(_0), input]);
2139
+ const LiteralNumber = (input) => If(Number$1(input), ([_0, input]) => [LiteralNumberMapping(_0), input]);
2140
+ const LiteralString = (input) => If(String$1(["'", "\""], input), ([_0, input]) => [LiteralStringMapping(_0), input]);
2141
+ const KeyOf$1 = (input) => If(If(If(Const("keyof", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [KeyOfMapping(_0), input]);
2142
+ const IndexArray_0 = (input, result = []) => If(If(If(Const("[", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
2143
+ _0,
2144
+ _1,
2145
+ _2
2146
+ ], input]))), ([_0, input]) => [_0, input], () => If(If(Const("[", input), ([_0, input]) => If(Const("]", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => IndexArray_0(input, [...result, _0]), () => [result, input]);
2147
+ const IndexArray = (input) => If(IndexArray_0(input), ([_0, input]) => [IndexArrayMapping(_0), input]);
2148
+ const Extends$1 = (input) => If(If(If(Const("extends", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("?", input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Const(":", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
2149
+ _0,
2150
+ _1,
2151
+ _2,
2152
+ _3,
2153
+ _4,
2154
+ _5
2155
+ ], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExtendsMapping(_0), input]);
2156
+ const Base = (input) => If(If(If(Const("(", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => [[
2157
+ _0,
2158
+ _1,
2159
+ _2
2160
+ ], input]))), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input), ([_0, input]) => [_0, input], () => If(KeywordNull(input), ([_0, input]) => [_0, input], () => If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input), ([_0, input]) => [_0, input], () => If(KeywordAny(input), ([_0, input]) => [_0, input], () => If(KeywordObject(input), ([_0, input]) => [_0, input], () => If(KeywordNever(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => If(KeywordVoid(input), ([_0, input]) => [_0, input], () => If(KeywordThis(input), ([_0, input]) => [_0, input], () => If(LiteralBigInt(input), ([_0, input]) => [_0, input], () => If(LiteralBoolean(input), ([_0, input]) => [_0, input], () => If(LiteralNumber(input), ([_0, input]) => [_0, input], () => If(LiteralString(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral$1(input), ([_0, input]) => [_0, input], () => If(Dependent(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(_Tuple_(input), ([_0, input]) => [_0, input], () => If(_Constructor_(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(_Mapped_(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))))))))))))))))))), ([_0, input]) => [BaseMapping(_0), input]);
2161
+ const With$1 = (input) => If(If(If(Const("with", input), ([_0, input]) => If(WithObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithMapping(_0), input]);
2162
+ const Factor = (input) => If(If(KeyOf$1(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends$1(input), ([_3, input]) => If(With$1(input), ([_4, input]) => [[
2163
+ _0,
2164
+ _1,
2165
+ _2,
2166
+ _3,
2167
+ _4
2168
+ ], input]))))), ([_0, input]) => [FactorMapping(_0), input]);
2169
+ const ExprTermTail = (input) => If(If(If(Const("&", input), ([_0, input]) => If(Factor(input), ([_1, input]) => If(ExprTermTail(input), ([_2, input]) => [[
2170
+ _0,
2171
+ _1,
2172
+ _2
2173
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExprTermTailMapping(_0), input]);
2174
+ const ExprTerm = (input) => If(If(Factor(input), ([_0, input]) => If(ExprTermTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprTermMapping(_0), input]);
2175
+ const ExprTail = (input) => If(If(If(Const("|", input), ([_0, input]) => If(ExprTerm(input), ([_1, input]) => If(ExprTail(input), ([_2, input]) => [[
2176
+ _0,
2177
+ _1,
2178
+ _2
2179
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExprTailMapping(_0), input]);
2180
+ const Expr = (input) => If(If(ExprTerm(input), ([_0, input]) => If(ExprTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprMapping(_0), input]);
2181
+ const ExprReadonly = (input) => If(If(Const("readonly", input), ([_0, input]) => If(Expr(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprReadonlyMapping(_0), input]);
2182
+ const ExprPipe = (input) => If(If(Const("|", input), ([_0, input]) => If(Expr(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprPipeMapping(_0), input]);
2183
+ const GenericType = (input) => If(If(GenericParameters(input), ([_0, input]) => If(Const("=", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
2184
+ _0,
2185
+ _1,
2186
+ _2
2187
+ ], input]))), ([_0, input]) => [GenericTypeMapping(_0), input]);
2188
+ const InferType = (input) => If(If(If(Const("infer", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(Const("extends", input), ([_2, input]) => If(Expr(input), ([_3, input]) => [[
2189
+ _0,
2190
+ _1,
2191
+ _2,
2192
+ _3
2193
+ ], input])))), ([_0, input]) => [_0, input], () => If(If(Const("infer", input), ([_0, input]) => If(Ident(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [InferTypeMapping(_0), input]);
2194
+ const Type = (input) => If(If(InferType(input), ([_0, input]) => [_0, input], () => If(ExprPipe(input), ([_0, input]) => [_0, input], () => If(ExprReadonly(input), ([_0, input]) => [_0, input], () => If(Expr(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [TypeMapping(_0), input]);
2195
+ const PropertyKeyNumber = (input) => If(Number$1(input), ([_0, input]) => [PropertyKeyNumberMapping(_0), input]);
2196
+ const PropertyKeyIdent = (input) => If(Ident(input), ([_0, input]) => [PropertyKeyIdentMapping(_0), input]);
2197
+ const PropertyKeyQuoted = (input) => If(String$1(["'", "\""], input), ([_0, input]) => [PropertyKeyQuotedMapping(_0), input]);
2198
+ const PropertyKeyIndex = (input) => If(If(Const("[", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => [])))), ([_3, input]) => If(Const("]", input), ([_4, input]) => [[
2199
+ _0,
2200
+ _1,
2201
+ _2,
2202
+ _3,
2203
+ _4
2204
+ ], input]))))), ([_0, input]) => [PropertyKeyIndexMapping(_0), input]);
2205
+ const PropertyKey = (input) => If(If(PropertyKeyNumber(input), ([_0, input]) => [_0, input], () => If(PropertyKeyIdent(input), ([_0, input]) => [_0, input], () => If(PropertyKeyQuoted(input), ([_0, input]) => [_0, input], () => If(PropertyKeyIndex(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [PropertyKeyMapping(_0), input]);
2206
+ const Readonly = (input) => If(If(If(Const("readonly", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ReadonlyMapping(_0), input]);
2207
+ const Optional = (input) => If(If(If(Const("?", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [OptionalMapping(_0), input]);
2208
+ const Property = (input) => If(If(Readonly(input), ([_0, input]) => If(PropertyKey(input), ([_1, input]) => If(Optional(input), ([_2, input]) => If(Const(":", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
2209
+ _0,
2210
+ _1,
2211
+ _2,
2212
+ _3,
2213
+ _4
2214
+ ], input]))))), ([_0, input]) => [PropertyMapping(_0), input]);
2215
+ const PropertyDelimiter = (input) => If(If(If(Const(",", input), ([_0, input]) => If(Const("\n", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const(";", input), ([_0, input]) => If(Const("\n", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const(",", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Const(";", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Const("\n", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [PropertyDelimiterMapping(_0), input]);
2216
+ const PropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(Property(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => PropertyList_0(input, [...result, _0]), () => [result, input]);
2217
+ const PropertyList = (input) => If(If(If(Property(input), ([_0, input]) => If(PropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2218
+ _0,
2219
+ _1,
2220
+ _2
2221
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [PropertyListMapping(_0), input]);
2222
+ const Properties = (input) => If(If(Const("{", input), ([_0, input]) => If(PropertyList(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
2223
+ _0,
2224
+ _1,
2225
+ _2
2226
+ ], input]))), ([_0, input]) => [PropertiesMapping(_0), input]);
2227
+ const _Object_ = (input) => If(Properties(input), ([_0, input]) => [_Object_Mapping(_0), input]);
2228
+ const ElementNamed = (input) => If(If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Const("readonly", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
2229
+ _0,
2230
+ _1,
2231
+ _2,
2232
+ _3,
2233
+ _4
2234
+ ], input]))))), ([_0, input]) => [_0, input], () => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Const("readonly", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
2235
+ _0,
2236
+ _1,
2237
+ _2,
2238
+ _3
2239
+ ], input])))), ([_0, input]) => [_0, input], () => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
2240
+ _0,
2241
+ _1,
2242
+ _2,
2243
+ _3
2244
+ ], input])))), ([_0, input]) => [_0, input], () => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
2245
+ _0,
2246
+ _1,
2247
+ _2
2248
+ ], input]))), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [ElementNamedMapping(_0), input]);
2249
+ const ElementBase = (input) => If(If(ElementNamed(input), ([_0, input]) => [_0, input], () => If(If(Readonly(input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Optional(input), ([_2, input]) => [[
2250
+ _0,
2251
+ _1,
2252
+ _2
2253
+ ], input]))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementBaseMapping(_0), input]);
2254
+ const Element = (input) => If(If(If(Const("...", input), ([_0, input]) => If(ElementBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ElementBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementMapping(_0), input]);
2255
+ const ElementList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Element(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, [...result, _0]), () => [result, input]);
2256
+ const ElementList = (input) => If(If(If(Element(input), ([_0, input]) => If(ElementList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2257
+ _0,
2258
+ _1,
2259
+ _2
2260
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementListMapping(_0), input]);
2261
+ const _Tuple_ = (input) => If(If(Const("[", input), ([_0, input]) => If(ElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
2262
+ _0,
2263
+ _1,
2264
+ _2
2265
+ ], input]))), ([_0, input]) => [_Tuple_Mapping(_0), input]);
2266
+ const ParameterReadonlyOptional = (input) => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Const("readonly", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
2267
+ _0,
2268
+ _1,
2269
+ _2,
2270
+ _3,
2271
+ _4
2272
+ ], input]))))), ([_0, input]) => [ParameterReadonlyOptionalMapping(_0), input]);
2273
+ const ParameterReadonly = (input) => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Const("readonly", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
2274
+ _0,
2275
+ _1,
2276
+ _2,
2277
+ _3
2278
+ ], input])))), ([_0, input]) => [ParameterReadonlyMapping(_0), input]);
2279
+ const ParameterOptional = (input) => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
2280
+ _0,
2281
+ _1,
2282
+ _2,
2283
+ _3
2284
+ ], input])))), ([_0, input]) => [ParameterOptionalMapping(_0), input]);
2285
+ const ParameterType = (input) => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
2286
+ _0,
2287
+ _1,
2288
+ _2
2289
+ ], input]))), ([_0, input]) => [ParameterTypeMapping(_0), input]);
2290
+ const ParameterBase = (input) => If(If(ParameterReadonlyOptional(input), ([_0, input]) => [_0, input], () => If(ParameterReadonly(input), ([_0, input]) => [_0, input], () => If(ParameterOptional(input), ([_0, input]) => [_0, input], () => If(ParameterType(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [ParameterBaseMapping(_0), input]);
2291
+ const Parameter = (input) => If(If(If(Const("...", input), ([_0, input]) => If(ParameterBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ParameterBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ParameterMapping(_0), input]);
2292
+ const ParameterList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Parameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ParameterList_0(input, [...result, _0]), () => [result, input]);
2293
+ const ParameterList = (input) => If(If(If(Parameter(input), ([_0, input]) => If(ParameterList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2294
+ _0,
2295
+ _1,
2296
+ _2
2297
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ParameterListMapping(_0), input]);
2298
+ const _Function_ = (input) => If(If(Const("(", input), ([_0, input]) => If(ParameterList(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => If(Const("=>", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
2299
+ _0,
2300
+ _1,
2301
+ _2,
2302
+ _3,
2303
+ _4
2304
+ ], input]))))), ([_0, input]) => [_Function_Mapping(_0), input]);
2305
+ const _Constructor_ = (input) => If(If(Const("new", input), ([_0, input]) => If(Const("(", input), ([_1, input]) => If(ParameterList(input), ([_2, input]) => If(Const(")", input), ([_3, input]) => If(Const("=>", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
2306
+ _0,
2307
+ _1,
2308
+ _2,
2309
+ _3,
2310
+ _4,
2311
+ _5
2312
+ ], input])))))), ([_0, input]) => [_Constructor_Mapping(_0), input]);
2313
+ const MappedReadonly = (input) => If(If(If(Const("+", input), ([_0, input]) => If(Const("readonly", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("-", input), ([_0, input]) => If(Const("readonly", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("readonly", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [MappedReadonlyMapping(_0), input]);
2314
+ const MappedOptional = (input) => If(If(If(Const("+", input), ([_0, input]) => If(Const("?", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("-", input), ([_0, input]) => If(Const("?", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("?", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [MappedOptionalMapping(_0), input]);
2315
+ const MappedAs = (input) => If(If(If(Const("as", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [MappedAsMapping(_0), input]);
2316
+ const _Mapped_ = (input) => If(If(Const("{", input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Const("[", input), ([_2, input]) => If(Ident(input), ([_3, input]) => If(Const("in", input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Const("]", input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Const(":", input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Const("}", input), ([_12, input]) => [[
2317
+ _0,
2318
+ _1,
2319
+ _2,
2320
+ _3,
2321
+ _4,
2322
+ _5,
2323
+ _6,
2324
+ _7,
2325
+ _8,
2326
+ _9,
2327
+ _10,
2328
+ _11,
2329
+ _12
2330
+ ], input]))))))))))))), ([_0, input]) => [_Mapped_Mapping(_0), input]);
2331
+ const Reference = (input) => If(Ident(input), ([_0, input]) => [ReferenceMapping(_0), input]);
2332
+ const WithBigInt = (input) => If(BigInt$1(input), ([_0, input]) => [WithBigIntMapping(_0), input]);
2333
+ const WithNumber = (input) => If(Number$1(input), ([_0, input]) => [WithNumberMapping(_0), input]);
2334
+ const WithBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithBooleanMapping(_0), input]);
2335
+ const WithString = (input) => If(String$1(["\"", "'"], input), ([_0, input]) => [WithStringMapping(_0), input]);
2336
+ const WithNull = (input) => If(Const("null", input), ([_0, input]) => [WithNullMapping(_0), input]);
2337
+ const WithUndefined = (input) => If(Const("undefined", input), ([_0, input]) => [void 0, input]);
2338
+ const WithProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(WithValue(input), ([_2, input]) => [[
2339
+ _0,
2340
+ _1,
2341
+ _2
2342
+ ], input]))), ([_0, input]) => [WithPropertyMapping(_0), input]);
2343
+ const WithPropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(WithProperty(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithPropertyList_0(input, [...result, _0]), () => [result, input]);
2344
+ const WithPropertyList = (input) => If(If(If(WithProperty(input), ([_0, input]) => If(WithPropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2345
+ _0,
2346
+ _1,
2347
+ _2
2348
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithPropertyListMapping(_0), input]);
2349
+ const WithObject = (input) => If(If(Const("{", input), ([_0, input]) => If(WithPropertyList(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
2350
+ _0,
2351
+ _1,
2352
+ _2
2353
+ ], input]))), ([_0, input]) => [WithObjectMapping(_0), input]);
2354
+ const WithElementList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(WithValue(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithElementList_0(input, [...result, _0]), () => [result, input]);
2355
+ const WithElementList = (input) => If(If(If(WithValue(input), ([_0, input]) => If(WithElementList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2356
+ _0,
2357
+ _1,
2358
+ _2
2359
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithElementListMapping(_0), input]);
2360
+ const WithArray = (input) => If(If(Const("[", input), ([_0, input]) => If(WithElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
2361
+ _0,
2362
+ _1,
2363
+ _2
2364
+ ], input]))), ([_0, input]) => [WithArrayMapping(_0), input]);
2365
+ const WithValue = (input) => If(If(WithBigInt(input), ([_0, input]) => [_0, input], () => If(WithNumber(input), ([_0, input]) => [_0, input], () => If(WithBoolean(input), ([_0, input]) => [_0, input], () => If(WithString(input), ([_0, input]) => [_0, input], () => If(WithNull(input), ([_0, input]) => [_0, input], () => If(WithUndefined(input), ([_0, input]) => [_0, input], () => If(WithObject(input), ([_0, input]) => [_0, input], () => If(WithArray(input), ([_0, input]) => [_0, input], () => [])))))))), ([_0, input]) => [WithValueMapping(_0), input]);
2366
+ const PatternBigInt = (input) => If(Const("-?(?:0|[1-9][0-9]*)n", input), ([_0, input]) => [PatternBigIntMapping(_0), input]);
2367
+ const PatternString = (input) => If(Const(".*", input), ([_0, input]) => [PatternStringMapping(_0), input]);
2368
+ const PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?", input), ([_0, input]) => [PatternNumberMapping(_0), input]);
2369
+ const PatternInteger = (input) => If(Const("-?(?:0|[1-9][0-9]*)", input), ([_0, input]) => [PatternIntegerMapping(_0), input]);
2370
+ const PatternNever = (input) => If(Const("(?!)", input), ([_0, input]) => [PatternNeverMapping(_0), input]);
2371
+ const PatternText = (input) => If(Until_1([
2372
+ "-?(?:0|[1-9][0-9]*)n",
2373
+ ".*",
2374
+ "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",
2375
+ "-?(?:0|[1-9][0-9]*)",
2376
+ "(?!)",
2377
+ "(",
2378
+ ")",
2379
+ "$",
2380
+ "|"
2381
+ ], input), ([_0, input]) => [PatternTextMapping(_0), input]);
2382
+ const PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input]) => [_0, input], () => If(PatternString(input), ([_0, input]) => [_0, input], () => If(PatternNumber(input), ([_0, input]) => [_0, input], () => If(PatternInteger(input), ([_0, input]) => [_0, input], () => If(PatternNever(input), ([_0, input]) => [_0, input], () => If(PatternGroup(input), ([_0, input]) => [_0, input], () => If(PatternText(input), ([_0, input]) => [_0, input], () => []))))))), ([_0, input]) => [PatternBaseMapping(_0), input]);
2383
+ const PatternGroup = (input) => If(If(Const("(", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => [[
2384
+ _0,
2385
+ _1,
2386
+ _2
2387
+ ], input]))), ([_0, input]) => [PatternGroupMapping(_0), input]);
2388
+ const PatternUnion = (input) => If(If(If(PatternTerm(input), ([_0, input]) => If(Const("|", input), ([_1, input]) => If(PatternUnion(input), ([_2, input]) => [[
2389
+ _0,
2390
+ _1,
2391
+ _2
2392
+ ], input]))), ([_0, input]) => [_0, input], () => If(If(PatternTerm(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [PatternUnionMapping(_0), input]);
2393
+ const PatternTerm = (input) => If(If(PatternBase(input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [PatternTermMapping(_0), input]);
2394
+ const PatternBody = (input) => If(If(PatternUnion(input), ([_0, input]) => [_0, input], () => If(PatternTerm(input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [PatternBodyMapping(_0), input]);
2395
+ const Pattern = (input) => If(If(Const("^", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const("$", input), ([_2, input]) => [[
2396
+ _0,
2397
+ _1,
2398
+ _2
2399
+ ], input]))), ([_0, input]) => [PatternMapping(_0), input]);
2400
+ const InterfaceDeclarationHeritageList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => InterfaceDeclarationHeritageList_0(input, [...result, _0]), () => [result, input]);
2401
+ const InterfaceDeclarationHeritageList = (input) => If(If(If(Type(input), ([_0, input]) => If(InterfaceDeclarationHeritageList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2402
+ _0,
2403
+ _1,
2404
+ _2
2405
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [InterfaceDeclarationHeritageListMapping(_0), input]);
2406
+ const InterfaceDeclarationHeritage = (input) => If(If(If(Const("extends", input), ([_0, input]) => If(InterfaceDeclarationHeritageList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [InterfaceDeclarationHeritageMapping(_0), input]);
2407
+ const InterfaceDeclarationGeneric = (input) => If(If(Const("interface", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(InterfaceDeclarationHeritage(input), ([_3, input]) => If(Properties(input), ([_4, input]) => [[
2408
+ _0,
2409
+ _1,
2410
+ _2,
2411
+ _3,
2412
+ _4
2413
+ ], input]))))), ([_0, input]) => [InterfaceDeclarationGenericMapping(_0), input]);
2414
+ const InterfaceDeclaration = (input) => If(If(Const("interface", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(InterfaceDeclarationHeritage(input), ([_2, input]) => If(Properties(input), ([_3, input]) => [[
2415
+ _0,
2416
+ _1,
2417
+ _2,
2418
+ _3
2419
+ ], input])))), ([_0, input]) => [InterfaceDeclarationMapping(_0), input]);
2420
+ const TypeAliasDeclarationGeneric = (input) => If(If(Const("type", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(Const("=", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
2421
+ _0,
2422
+ _1,
2423
+ _2,
2424
+ _3,
2425
+ _4
2426
+ ], input]))))), ([_0, input]) => [TypeAliasDeclarationGenericMapping(_0), input]);
2427
+ const TypeAliasDeclaration = (input) => If(If(Const("type", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(Const("=", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
2428
+ _0,
2429
+ _1,
2430
+ _2,
2431
+ _3
2432
+ ], input])))), ([_0, input]) => [TypeAliasDeclarationMapping(_0), input]);
2433
+ const ExportKeyword = (input) => If(If(If(Const("export", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExportKeywordMapping(_0), input]);
2434
+ const ModuleDeclarationDelimiter = (input) => If(If(If(Const(";", input), ([_0, input]) => If(Const("\n", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const(";", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Const("\n", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [ModuleDeclarationDelimiterMapping(_0), input]);
2435
+ const ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => If(ModuleDeclaration(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ModuleDeclarationList_0(input, [...result, _0]), () => [result, input]);
2436
+ const ModuleDeclarationList = (input) => If(If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList_0(input), ([_1, input]) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
2437
+ _0,
2438
+ _1,
2439
+ _2
2440
+ ], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ModuleDeclarationListMapping(_0), input]);
2441
+ const ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input]) => If(If(InterfaceDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(InterfaceDeclaration(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclaration(input), ([_0, input]) => [_0, input], () => [])))), ([_1, input]) => If(OptionalSemiColon(input), ([_2, input]) => [[
2442
+ _0,
2443
+ _1,
2444
+ _2
2445
+ ], input]))), ([_0, input]) => [ModuleDeclarationMapping(_0), input]);
2446
+ const Module$1 = (input) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ModuleMapping(_0), input]);
2447
+ const Script$1 = (input) => If(If(Module$1(input), ([_0, input]) => [_0, input], () => If(GenericType(input), ([_0, input]) => [_0, input], () => If(Type(input), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [ScriptMapping(_0), input]);
2448
+ //#endregion
2449
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/patterns/template.mjs
2450
+ /** Parses a Template into a TemplateLiteral types */
2451
+ function ParseTemplateIntoTypes(template) {
2452
+ const parsed = TemplateLiteralTypes(`\`${template}\``);
2453
+ return IsEqual(parsed.length, 2) ? parsed[0] : Unreachable$1();
2454
+ }
2455
+ //#endregion
2456
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/encode.mjs
2457
+ function JoinString(input) {
2458
+ return input.join("|");
2459
+ }
2460
+ function UnwrapTemplateLiteralPattern(pattern) {
2461
+ return pattern.slice(1, pattern.length - 1);
2462
+ }
2463
+ function EncodeLiteral(value, right, pattern) {
2464
+ return EncodeTypes(right, `${pattern}${value}`);
2465
+ }
2466
+ function EncodeBigInt(right, pattern) {
2467
+ return EncodeTypes(right, `${pattern}${BigIntPattern}`);
2468
+ }
2469
+ function EncodeInteger(right, pattern) {
2470
+ return EncodeTypes(right, `${pattern}${IntegerPattern}`);
2471
+ }
2472
+ function EncodeNumber(right, pattern) {
2473
+ return EncodeTypes(right, `${pattern}${NumberPattern}`);
2474
+ }
2475
+ function EncodeBoolean(right, pattern) {
2476
+ return EncodeType(Union([Literal("false"), Literal("true")]), right, pattern);
2477
+ }
2478
+ function EncodeString(right, pattern) {
2479
+ return EncodeTypes(right, `${pattern}.*`);
2480
+ }
2481
+ function EncodeTemplateLiteral(templatePattern, right, pattern) {
2482
+ return EncodeTypes(right, `${pattern}${UnwrapTemplateLiteralPattern(templatePattern)}`);
2483
+ }
2484
+ function EncodeTemplateLiteralDeferred(types, right, pattern) {
2485
+ return EncodeType(TemplateLiteralAction(types, {}), right, pattern);
2486
+ }
2487
+ function EncodeEnum(values, right, pattern) {
2488
+ return EncodeType(EvaluateEnum(values), right, pattern);
2489
+ }
2490
+ function EncodeUnion(types, right, pattern, result = []) {
2491
+ return ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
2492
+ }
2493
+ function EncodeType(type, right, pattern) {
2494
+ return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt(type) ? EncodeBigInt(right, pattern) : IsBoolean(type) ? EncodeBoolean(right, pattern) : IsNumber(type) ? EncodeNumber(right, pattern) : IsString(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
2495
+ }
2496
+ function EncodeTypes(types, pattern) {
2497
+ return ShiftLeft(types, (left, right) => EncodeType(left, right, pattern), () => pattern);
2498
+ }
2499
+ function EncodePattern(types) {
2500
+ return `^${EncodeTypes(types, "")}$`;
2501
+ }
2502
+ /** Encodes a TemplateLiteral type sequence into a TemplateLiteral */
2503
+ function TemplateLiteralEncode(types) {
2504
+ return TemplateLiteralCreate(EncodePattern(types));
2505
+ }
2506
+ //#endregion
2507
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
2508
+ function TemplateLiteralAction(types, options) {
2509
+ return CanInstantiate(types) ? Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
2510
+ }
2511
+ function TemplateLiteralInstantiate(context, state, types, options) {
2512
+ return TemplateLiteralAction(InstantiateTypes(context, state, types), options);
2513
+ }
2514
+ //#endregion
2515
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/template_literal.mjs
2516
+ /** Creates a deferred TemplateLiteral action. */
2517
+ function TemplateLiteralDeferred(types, options = {}) {
2518
+ return Deferred("TemplateLiteral", [types], options);
2519
+ }
2520
+ /** Returns true if this value is a deferred Interface action. */
2521
+ function IsTemplateLiteralDeferred(value) {
2522
+ return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "TemplateLiteral");
2523
+ }
2524
+ function TemplateLiteralFromTypes(types) {
2525
+ return TemplateLiteralAction(types, {});
2526
+ }
2527
+ function TemplateLiteralFromString(template) {
2528
+ return TemplateLiteralFromTypes(ParseTemplateIntoTypes(template));
2529
+ }
2530
+ /** Creates a TemplateLiteral type. */
2531
+ function TemplateLiteral(input, options = {}) {
2532
+ return Update(IsString$1(input) ? TemplateLiteralFromString(input) : TemplateLiteralFromTypes(input), {}, options);
2533
+ }
2534
+ /** Returns true if the given value is TTemplateLiteral. */
2535
+ function IsTemplateLiteral(value) {
2536
+ return IsKind(value, "TemplateLiteral");
2537
+ }
2538
+ //#endregion
2539
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/result.mjs
2540
+ var result_exports = /* @__PURE__ */ __exportAll({
2541
+ ExtendsFalse: () => ExtendsFalse,
2542
+ ExtendsTrue: () => ExtendsTrue,
2543
+ ExtendsUnion: () => ExtendsUnion$1,
2544
+ IsExtendsFalse: () => IsExtendsFalse,
2545
+ IsExtendsTrue: () => IsExtendsTrue,
2546
+ IsExtendsTrueLike: () => IsExtendsTrueLike,
2547
+ IsExtendsUnion: () => IsExtendsUnion,
2548
+ Match: () => Match
2549
+ });
2550
+ function ExtendsUnion$1(inferred) {
2551
+ return Create({ ["~kind"]: "ExtendsUnion" }, { inferred });
2552
+ }
2553
+ function IsExtendsUnion(value) {
2554
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsUnion") && IsObject$1(value.inferred);
2555
+ }
2556
+ function ExtendsTrue(inferred) {
2557
+ return Create({ ["~kind"]: "ExtendsTrue" }, { inferred });
2558
+ }
2559
+ function IsExtendsTrue(value) {
2560
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsTrue") && IsObject$1(value.inferred);
2561
+ }
2562
+ function ExtendsFalse() {
2563
+ return Create({ ["~kind"]: "ExtendsFalse" }, {});
2564
+ }
2565
+ function IsExtendsFalse(value) {
2566
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], "ExtendsFalse");
2567
+ }
2568
+ function IsExtendsTrueLike(value) {
2569
+ return IsExtendsUnion(value) || IsExtendsTrue(value);
2570
+ }
2571
+ function Match(result, true_, false_) {
2572
+ return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
2573
+ }
2574
+ //#endregion
2575
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/extends_right.mjs
2576
+ function ExtendsRightInfer(inferred, name, left, right) {
2577
+ return Match(ExtendsLeft(inferred, left, right), (checkInferred) => ExtendsTrue(Assign(Assign(inferred, checkInferred), { [name]: left })), () => ExtendsFalse());
2578
+ }
2579
+ function ExtendsRightAny(inferred, _left) {
2580
+ return ExtendsTrue(inferred);
2581
+ }
2582
+ function ExtendsRightDependent(inferred, left, if_, then_, else_) {
2583
+ return Match(ExtendsLeft(inferred, left, if_), (inferred) => Match(ExtendsLeft(inferred, left, then_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()), () => Match(ExtendsLeft(inferred, left, else_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()));
2584
+ }
2585
+ function ExtendsRightEnum(inferred, left, right) {
2586
+ return ExtendsLeft(inferred, left, EvaluateEnum(right));
2587
+ }
2588
+ function ExtendsRightIntersect(inferred, left, right) {
2589
+ return ShiftLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsRightIntersect(inferred, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
2590
+ }
2591
+ function ExtendsRightTemplateLiteral(inferred, left, right) {
2592
+ return ExtendsLeft(inferred, left, EvaluateTemplateLiteral(right));
2593
+ }
2594
+ function ExtendsRightUnion(inferred, left, right) {
2595
+ return ShiftLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
2596
+ }
2597
+ function ExtendsRight(inferred, left, right) {
2598
+ return IsAny(right) ? ExtendsRightAny(inferred, left) : IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) : IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) : IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) : IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) : IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) : IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
2599
+ }
2600
+ //#endregion
2601
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/any.mjs
2602
+ function ExtendsAny(inferred, left, right) {
2603
+ return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion$1(inferred);
2604
+ }
2605
+ //#endregion
2606
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/array.mjs
2607
+ function ExtendsImmutable(left, right) {
2608
+ const isImmutableLeft = IsImmutable(left);
2609
+ const isImmutableRight = IsImmutable(right);
2610
+ return isImmutableLeft && isImmutableRight ? true : !isImmutableLeft && isImmutableRight ? true : isImmutableLeft && !isImmutableRight ? false : true;
2611
+ }
2612
+ function ExtendsArray(inferred, arrayLeft, left, right) {
2613
+ return IsArray(right) ? ExtendsImmutable(arrayLeft, right) ? ExtendsLeft(inferred, left, right.items) : ExtendsFalse() : ExtendsRight(inferred, arrayLeft, right);
2614
+ }
2615
+ //#endregion
2616
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/bigint.mjs
2617
+ function ExtendsBigInt(inferred, left, right) {
2618
+ return IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2619
+ }
2620
+ //#endregion
2621
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/boolean.mjs
2622
+ function ExtendsBoolean(inferred, left, right) {
2623
+ return IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2624
+ }
2625
+ //#endregion
2626
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/parameters.mjs
2627
+ function ParameterCompare(inferred, left, leftRest, right, rightRest) {
2628
+ const checkLeft = IsInfer(right) ? left : right;
2629
+ const checkRight = IsInfer(right) ? right : left;
2630
+ const isLeftOptional = IsOptional(left);
2631
+ const isRightOptional = IsOptional(right);
2632
+ return !isLeftOptional && isRightOptional ? ExtendsFalse() : Match(ExtendsLeft(inferred, checkLeft, checkRight), (inferred) => ExtendsParameters(inferred, leftRest, rightRest), () => ExtendsFalse());
2633
+ }
2634
+ function ParameterRight(inferred, left, leftRest, rightRest) {
2635
+ return ShiftLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) ? ExtendsTrue(inferred) : ExtendsFalse());
2636
+ }
2637
+ function ParametersLeft(inferred, left, rightRest) {
2638
+ return ShiftLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => ExtendsTrue(inferred));
2639
+ }
2640
+ function ExtendsParameters(inferred, left, right) {
2641
+ return ParametersLeft(inferred, left, right);
2642
+ }
2643
+ //#endregion
2644
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/return_type.mjs
2645
+ function ExtendsReturnType(inferred, left, right) {
2646
+ return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsLeft(inferred, left, right);
2647
+ }
2648
+ //#endregion
2649
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/constructor.mjs
2650
+ function ExtendsConstructor(inferred, parameters, returnType, right) {
2651
+ return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsConstructor(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["instanceType"]), () => ExtendsFalse()) : ExtendsFalse();
2652
+ }
2653
+ //#endregion
2654
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/dependent.mjs
2655
+ function ExtendsDependent(inferred, if_, then_, else_, right) {
2656
+ return Match(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));
2657
+ }
2658
+ //#endregion
2659
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/enum.mjs
2660
+ function ExtendsEnum(inferred, left, right) {
2661
+ return ExtendsLeft(inferred, EvaluateEnum(left), right);
2662
+ }
2663
+ //#endregion
2664
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/function.mjs
2665
+ function ExtendsFunction(inferred, parameters, returnType, right) {
2666
+ return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsFunction(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["returnType"]), () => ExtendsFalse()) : ExtendsFalse();
2667
+ }
2668
+ //#endregion
2669
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/integer.mjs
2670
+ function ExtendsInteger(inferred, left, right) {
2671
+ return IsInteger(right) ? ExtendsTrue(inferred) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2672
+ }
2673
+ //#endregion
2674
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/intersect.mjs
2675
+ function ExtendsIntersect(inferred, left, right) {
2676
+ return ExtendsLeft(inferred, EvaluateIntersect(left), right);
2677
+ }
2678
+ //#endregion
2679
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/literal.mjs
2680
+ function ExtendsLiteralValue(inferred, left, right) {
2681
+ return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
2682
+ }
2683
+ function ExtendsLiteralBigInt(inferred, left, right) {
2684
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
2685
+ }
2686
+ function ExtendsLiteralBoolean(inferred, left, right) {
2687
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
2688
+ }
2689
+ function ExtendsLiteralNumber(inferred, left, right) {
2690
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
2691
+ }
2692
+ function ExtendsLiteralString(inferred, left, right) {
2693
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
2694
+ }
2695
+ function ExtendsLiteral(inferred, left, right) {
2696
+ return IsBigInt$1(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) : IsBoolean$1(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) : IsNumber$1(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) : IsString$1(left.const) ? ExtendsLiteralString(inferred, left.const, right) : Unreachable$1();
2697
+ }
2698
+ //#endregion
2699
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/never.mjs
2700
+ function ExtendsNever(inferred, left, right) {
2701
+ return IsInfer(right) ? ExtendsRight(inferred, left, right) : ExtendsTrue(inferred);
2702
+ }
2703
+ //#endregion
2704
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/null.mjs
2705
+ function ExtendsNull(inferred, left, right) {
2706
+ return IsNull(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2707
+ }
2708
+ //#endregion
2709
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/number.mjs
2710
+ function ExtendsNumber(inferred, left, right) {
2711
+ return IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2712
+ }
2713
+ //#endregion
2714
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/object.mjs
2715
+ function ExtendsPropertyOptional(inferred, left, right) {
2716
+ return IsOptional(left) ? IsOptional(right) ? ExtendsTrue(inferred) : ExtendsFalse() : ExtendsTrue(inferred);
2717
+ }
2718
+ function ExtendsProperty(inferred, left, right) {
2719
+ return IsInfer(right) && IsNever(right.extends) ? ExtendsFalse() : Match(ExtendsLeft(inferred, left, right), (inferred) => ExtendsPropertyOptional(inferred, left, right), () => ExtendsFalse());
2720
+ }
2721
+ function ExtractInferredProperties(keys, properties) {
2722
+ return keys.reduce((result, key) => {
2723
+ return key in properties ? IsExtendsTrueLike(properties[key]) ? {
2724
+ ...result,
2725
+ ...properties[key].inferred
2726
+ } : Unreachable$1() : Unreachable$1();
2727
+ }, {});
2728
+ }
2729
+ function ExtendsPropertiesComparer(inferred, left, right) {
2730
+ const properties = {};
2731
+ for (const rightKey of Keys(right)) properties[rightKey] = rightKey in left ? ExtendsProperty({}, left[rightKey], right[rightKey]) : IsOptional(right[rightKey]) ? IsInfer(right[rightKey]) ? ExtendsTrue(Assign(inferred, { [right[rightKey].name]: right[rightKey].extends })) : ExtendsTrue(inferred) : ExtendsFalse();
2732
+ const checked = Values(properties).every((result) => IsExtendsTrueLike(result));
2733
+ const extracted = checked ? ExtractInferredProperties(Keys(properties), properties) : {};
2734
+ return checked ? ExtendsTrue(extracted) : ExtendsFalse();
2735
+ }
2736
+ function ExtendsProperties(inferred, left, right) {
2737
+ const compared = ExtendsPropertiesComparer(inferred, left, right);
2738
+ return IsExtendsTrueLike(compared) ? ExtendsTrue(Assign(inferred, compared.inferred)) : ExtendsFalse();
2739
+ }
2740
+ function ExtendsObjectToObject(inferred, left, right) {
2741
+ return ExtendsProperties(inferred, left, right);
2742
+ }
2743
+ function RecordMergeInferred(left, right) {
2744
+ return Keys(right).reduce((result, key) => {
2745
+ return {
2746
+ ...result,
2747
+ [key]: HasPropertyKey(left, key) ? IsUnion(result[key]) ? Union([...result[key].anyOf, right[key]]) : Union([left[key], right[key]]) : right[key]
2748
+ };
2749
+ }, left);
2750
+ }
2751
+ function ExtendsRecordComparer(properties, keys, type, result) {
2752
+ return ShiftLeft(keys, (left, right) => Match(ExtendsLeft({}, properties[left], type), (inferred) => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result, inferred)), () => ExtendsFalse()), () => ExtendsTrue(result));
2753
+ }
2754
+ function ExtendsObjectToRecord(inferred, properties, _pattern, value) {
2755
+ return ExtendsRecordComparer(properties, Keys(properties), value, inferred);
2756
+ }
2757
+ function ExtendsObject(inferred, left, right) {
2758
+ return IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) : IsObject(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_$1(left), right);
2759
+ }
2760
+ //#endregion
2761
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/record.mjs
2762
+ function FromObject$6(inferred, properties) {
2763
+ return IsEqual(Keys(properties).length, 0) ? ExtendsTrue(inferred) : ExtendsFalse();
2764
+ }
2765
+ function FromRecord$1(inferred, _leftKey, leftValue, _rightKey, rightValue) {
2766
+ return ExtendsLeft(inferred, leftValue, rightValue);
2767
+ }
2768
+ function ExtendsRecord(inferred, leftPattern, leftValue, right) {
2769
+ return IsRecord(right) ? FromRecord$1(inferred, RecordPatternToType(leftPattern), leftValue, RecordPatternToType(RecordPattern(right)), RecordValue(right)) : IsObject(right) ? FromObject$6(inferred, right.properties) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
2770
+ }
2771
+ //#endregion
2772
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/string.mjs
2773
+ function ExtendsString(inferred, left, right) {
2774
+ return IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2775
+ }
2776
+ //#endregion
2777
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/symbol.mjs
2778
+ function ExtendsSymbol(inferred, left, right) {
2779
+ return IsSymbol(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2780
+ }
2781
+ //#endregion
2782
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/template_literal.mjs
2783
+ function ExtendsTemplateLiteral(inferred, left, right) {
2784
+ return ExtendsLeft(inferred, EvaluateTemplateLiteral(left), right);
2785
+ }
2786
+ //#endregion
2787
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/inference.mjs
2788
+ function Inferrable(name, type) {
2789
+ return Create({ "~kind": "Inferrable" }, {
2790
+ name,
2791
+ type
2792
+ }, {});
2793
+ }
2794
+ function IsInferable(value) {
2795
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "name") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "Inferrable") && IsString$1(value.name) && IsObject$1(value.type);
2796
+ }
2797
+ function TryRestInferable(type) {
2798
+ return IsRest(type) ? IsInfer(type.items) ? IsArray(type.items.extends) ? Inferrable(type.items.name, type.items.extends.items) : IsUnknown(type.items.extends) ? Inferrable(type.items.name, type.items.extends) : void 0 : Unreachable$1() : void 0;
2799
+ }
2800
+ function TryInferable(type) {
2801
+ return IsInfer(type) ? Inferrable(type.name, type.extends) : void 0;
2802
+ }
2803
+ function TryInferResults(rest, right, result = []) {
2804
+ return ShiftLeft(rest, (head, tail) => Match(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => void 0), () => result);
2805
+ }
2806
+ function InferTupleResult(inferred, name, left, right) {
2807
+ const results = TryInferResults(left, right);
2808
+ return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Tuple(results) })) : ExtendsFalse();
2809
+ }
2810
+ function InferUnionResult(inferred, name, left, right) {
2811
+ const results = TryInferResults(left, right);
2812
+ return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Union(results) })) : ExtendsFalse();
2813
+ }
2814
+ //#endregion
2815
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/tuple.mjs
2816
+ function Reverse(types) {
2817
+ return [...types].reverse();
2818
+ }
2819
+ function ApplyReverse(types, reversed) {
2820
+ return reversed ? Reverse(types) : types;
2821
+ }
2822
+ function Reversed(types) {
2823
+ const first = types.length > 0 ? types[0] : void 0;
2824
+ return IsSchema(IsSchema(first) ? TryRestInferable(first) : void 0);
2825
+ }
2826
+ function ElementsCompare(inferred, reversed, left, leftRest, right, rightRest) {
2827
+ return Match(ExtendsLeft(inferred, left, right), (checkInferred) => Elements(checkInferred, reversed, leftRest, rightRest), () => ExtendsFalse());
2828
+ }
2829
+ function ElementsLeft(inferred, reversed, leftRest, right, rightRest) {
2830
+ const inferable = TryRestInferable(right);
2831
+ return IsInferable(inferable) ? InferTupleResult(inferred, inferable["name"], ApplyReverse(leftRest, reversed), inferable["type"]) : ShiftLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => ExtendsFalse());
2832
+ }
2833
+ function ElementsRight(inferred, reversed, leftRest, rightRest) {
2834
+ return ShiftLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => IsEqual(leftRest.length, 0) ? ExtendsTrue(inferred) : ExtendsFalse());
2835
+ }
2836
+ function Elements(inferred, reversed, leftRest, rightRest) {
2837
+ return ElementsRight(inferred, reversed, leftRest, rightRest);
2838
+ }
2839
+ function ExtendsTupleToTuple(inferred, left, right) {
2840
+ const instantiatedRight = InstantiateElements(inferred, State([], []), right);
2841
+ const reversed = Reversed(instantiatedRight);
2842
+ return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
2843
+ }
2844
+ function ExtendsTupleToArray(inferred, left, right) {
2845
+ const inferrable = TryInferable(right);
2846
+ return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : ShiftLeft(left, (head, tail) => Match(ExtendsLeft(inferred, head, right), (inferred) => ExtendsTupleToArray(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
2847
+ }
2848
+ function ExtendsTuple(inferred, left, right) {
2849
+ const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
2850
+ return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
2851
+ }
2852
+ //#endregion
2853
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/undefined.mjs
2854
+ function ExtendsUndefined(inferred, left, right) {
2855
+ return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2856
+ }
2857
+ //#endregion
2858
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/union.mjs
2859
+ function ExtendsUnionSome(inferred, type, unionTypes) {
2860
+ return ShiftLeft(unionTypes, (head, tail) => Match(ExtendsLeft(inferred, type, head), (inferred) => ExtendsTrue(inferred), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
2861
+ }
2862
+ function ExtendsUnionLeft(inferred, left, right) {
2863
+ return ShiftLeft(left, (head, tail) => Match(ExtendsUnionSome(inferred, head, right), (inferred) => ExtendsUnionLeft(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
2864
+ }
2865
+ function ExtendsUnion(inferred, left, right) {
2866
+ const inferrable = TryInferable(right);
2867
+ return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable.name, left, inferrable.type) : IsUnion(right) ? ExtendsUnionLeft(inferred, left, right.anyOf) : ExtendsUnionLeft(inferred, left, [right]);
2868
+ }
2869
+ //#endregion
2870
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/unknown.mjs
2871
+ function ExtendsUnknown(inferred, left, right) {
2872
+ return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
2873
+ }
2874
+ //#endregion
2875
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/void.mjs
2876
+ function ExtendsVoid(inferred, left, right) {
2877
+ return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2878
+ }
2879
+ //#endregion
2880
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/extends_left.mjs
2881
+ function ExtendsLeft(inferred, left, right) {
2882
+ return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray(left) ? ExtendsArray(inferred, left, left.items, right) : IsBigInt(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) : IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) : IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull(left) ? ExtendsNull(inferred, left, right) : IsNumber(left) ? ExtendsNumber(inferred, left, right) : IsObject(left) ? ExtendsObject(inferred, left.properties, right) : IsRecord(left) ? ExtendsRecord(inferred, RecordPattern(left), RecordValue(left), right) : IsString(left) ? ExtendsString(inferred, left, right) : IsSymbol(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
2883
+ }
2884
+ //#endregion
2885
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/interface/instantiate.mjs
2886
+ function InterfaceOperation(heritage, properties) {
2887
+ return EvaluateIntersect([...heritage, _Object_$1(properties)]);
2888
+ }
2889
+ function InterfaceAction(heritage, properties, options) {
2890
+ return CanInstantiate(heritage) ? Update(InterfaceOperation(heritage, properties), {}, options) : InterfaceDeferred(heritage, properties, options);
2891
+ }
2892
+ function InterfaceInstantiate(context, state, heritage, properties, options) {
2893
+ return InterfaceAction(InstantiateTypes(context, state, heritage), InstantiateProperties(context, state, properties), options);
2894
+ }
2895
+ //#endregion
2896
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/interface.mjs
2897
+ /** Creates a deferred Interface action. */
2898
+ function InterfaceDeferred(heritage, properties, options = {}) {
2899
+ return Deferred("Interface", [heritage, properties], options);
2900
+ }
2901
+ /** Returns true if this value is a deferred Interface action. */
2902
+ function IsInterfaceDeferred(value) {
2903
+ return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "Interface");
2904
+ }
2905
+ /** Creates an Interface using the given heritage and properties. */
2906
+ function Interface(heritage, properties, options = {}) {
2907
+ return InterfaceAction(heritage, properties, options);
2908
+ }
2909
+ //#endregion
2910
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/check.mjs
2911
+ function FromRef$3(stack, context, ref) {
2912
+ return stack.includes(ref) ? true : FromType$15([...stack, ref], context, context[ref]);
2913
+ }
2914
+ function FromProperties$2(stack, context, properties) {
2915
+ return FromTypes$3(stack, context, PropertyValues(properties));
2916
+ }
2917
+ function FromTypes$3(stack, context, types) {
2918
+ return ShiftLeft(types, (left, right) => FromType$15(stack, context, left) ? true : FromTypes$3(stack, context, right), () => false);
2919
+ }
2920
+ function FromType$15(stack, context, type) {
2921
+ return IsRef(type) ? FromRef$3(stack, context, type.$ref) : IsArray(type) ? FromType$15(stack, context, type.items) : IsConstructor(type) ? FromTypes$3(stack, context, [...type.parameters, type.instanceType]) : IsFunction(type) ? FromTypes$3(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties$2(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes$3(stack, context, type.allOf) : IsObject(type) ? FromProperties$2(stack, context, type.properties) : IsUnion(type) ? FromTypes$3(stack, context, type.anyOf) : IsTuple(type) ? FromTypes$3(stack, context, type.items) : IsRecord(type) ? FromType$15(stack, context, RecordValue(type)) : false;
2922
+ }
2923
+ /** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */
2924
+ function CyclicCheck(stack, context, type) {
2925
+ return FromType$15(stack, context, type);
2926
+ }
2927
+ //#endregion
2928
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
2929
+ function ResolveCandidateKeys(context, keys) {
2930
+ return keys.reduce((result, left) => {
2931
+ return CyclicCheck([left], context, context[left]) ? [...result, left] : result;
2932
+ }, []);
2933
+ }
2934
+ /** Returns keys for context types that need to be transformed to TCyclic. */
2935
+ function CyclicCandidates(context) {
2936
+ return ResolveCandidateKeys(context, PropertyKeys(context));
2937
+ }
2938
+ //#endregion
2939
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
2940
+ function FromRef$2(context, ref, result) {
2941
+ return result.includes(ref) ? result : ref in context ? FromType$14(context, context[ref], [...result, ref]) : Unreachable$1();
2942
+ }
2943
+ function FromProperties$1(context, properties, result) {
2944
+ return FromTypes$2(context, PropertyValues(properties), result);
2945
+ }
2946
+ function FromTypes$2(context, types, result) {
2947
+ return types.reduce((result, left) => {
2948
+ return FromType$14(context, left, result);
2949
+ }, result);
2950
+ }
2951
+ function FromType$14(context, type, result) {
2952
+ return IsRef(type) ? FromRef$2(context, type.$ref, result) : IsArray(type) ? FromType$14(context, type.items, result) : IsConstructor(type) ? FromTypes$2(context, [...type.parameters, type.instanceType], result) : IsFunction(type) ? FromTypes$2(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties$1(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes$2(context, type.allOf, result) : IsObject(type) ? FromProperties$1(context, type.properties, result) : IsUnion(type) ? FromTypes$2(context, type.anyOf, result) : IsTuple(type) ? FromTypes$2(context, type.items, result) : IsRecord(type) ? FromType$14(context, RecordValue(type), result) : result;
2953
+ }
2954
+ /** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */
2955
+ function CyclicDependencies(context, key, type) {
2956
+ return FromType$14(context, type, [key]);
2957
+ }
2958
+ //#endregion
2959
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/extends.mjs
2960
+ function FromRef$1(_ref) {
2961
+ return Any();
2962
+ }
2963
+ function FromProperties(properties) {
2964
+ return Keys(properties).reduce((result, key) => {
2965
+ return {
2966
+ ...result,
2967
+ [key]: FromType$13(properties[key])
2968
+ };
2969
+ }, {});
2970
+ }
2971
+ function FromTypes$1(types) {
2972
+ return types.reduce((result, left) => {
2973
+ return [...result, FromType$13(left)];
2974
+ }, []);
2975
+ }
2976
+ function FromType$13(type) {
2977
+ return IsRef(type) ? FromRef$1(type.$ref) : IsArray(type) ? _Array_(FromType$13(type.items), ArrayOptions(type)) : IsConstructor(type) ? Constructor(FromTypes$1(type.parameters), FromType$13(type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes$1(type.parameters), FromType$13(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes$1(type.allOf)) : IsObject(type) ? _Object_$1(FromProperties(type.properties)) : IsRecord(type) ? Record(RecordKey(type), FromType$13(RecordValue(type))) : IsUnion(type) ? Union(FromTypes$1(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes$1(type.items)) : type;
2978
+ }
2979
+ function CyclicAnyFromParameters(defs, ref) {
2980
+ return ref in defs ? FromType$13(defs[ref]) : Unknown();
2981
+ }
2982
+ /** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/
2983
+ function CyclicExtends(type) {
2984
+ return CyclicAnyFromParameters(type.$defs, type.$ref);
2985
+ }
2986
+ //#endregion
2987
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
2988
+ function CyclicInterface(context, heritage, properties) {
2989
+ const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
2990
+ const instantiatedProperties = InstantiateProperties({}, State([], []), properties);
2991
+ return EvaluateIntersect([...instantiatedHeritage, _Object_$1(instantiatedProperties)]);
2992
+ }
2993
+ function CyclicDefinitions(context, dependencies) {
2994
+ return Keys(context).filter((key) => dependencies.includes(key)).reduce((result, key) => {
2995
+ const type = context[key];
2996
+ const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;
2997
+ return {
2998
+ ...result,
2999
+ [key]: instantiatedType
3000
+ };
3001
+ }, {});
3002
+ }
3003
+ function InstantiateCyclic(context, ref, type) {
3004
+ return Cyclic(CyclicDefinitions(context, CyclicDependencies(context, ref, type)), ref);
3005
+ }
3006
+ //#endregion
3007
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/target.mjs
3008
+ function Resolve(defs, ref) {
3009
+ return ref in defs ? IsRef(defs[ref]) ? Resolve(defs, defs[ref].$ref) : defs[ref] : Never();
3010
+ }
3011
+ /** Returns the target Type from the Defs or Never if target is non-resolvable */
3012
+ function CyclicTarget(defs, ref) {
3013
+ return Resolve(defs, ref);
3014
+ }
3015
+ //#endregion
3016
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/extends.mjs
3017
+ function Canonical(type) {
3018
+ return IsCyclic(type) ? CyclicExtends(type) : IsUnsafe(type) ? Unknown() : type;
3019
+ }
3020
+ /** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
3021
+ function Extends(inferred, left, right) {
3022
+ return ExtendsLeft(inferred, Canonical(left), Canonical(right));
3023
+ }
3024
+ /** Compares left and right types and determines their set relationship. */
3025
+ function Compare(left, right) {
3026
+ const extendsCheck = [Extends({}, left, right), Extends({}, right, left)];
3027
+ return IsExtendsTrueLike(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? 0 : IsExtendsTrueLike(extendsCheck[0]) && IsExtendsFalse(extendsCheck[1]) ? 2 : IsExtendsFalse(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? 3 : 1;
3028
+ }
3029
+ //#endregion
3030
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
3031
+ function BroadenFilter(type, types, result = [], all = types) {
3032
+ return ShiftLeft(types, (left, right) => {
3033
+ const compare = Compare(type, left);
3034
+ return IsEqual(compare, 2) || IsEqual(compare, 0) ? all : IsEqual(compare, 1) ? BroadenFilter(type, right, [...result, left], all) : BroadenFilter(type, right, result, all);
3035
+ }, () => [...result, type]);
3036
+ }
3037
+ function BroadenType(type, types, result) {
3038
+ const evaluated = EvaluateType(type);
3039
+ return IsAny(evaluated) ? [evaluated] : IsUnknown(evaluated) ? [evaluated] : IsNever(evaluated) ? BroadenTypes(types, result) : IsObject(evaluated) ? BroadenTypes(types, [...result, evaluated]) : BroadenTypes(types, BroadenFilter(evaluated, result));
3040
+ }
3041
+ function BroadenTypes(types, result = []) {
3042
+ return ShiftLeft(types, (left, right) => BroadenType(left, right, result), () => result);
3043
+ }
3044
+ /** Broadens a set of types and returns either the most broad type, or union or disjoint types. */
3045
+ function Broaden(types) {
3046
+ return Flatten(BroadenTypes(types));
3047
+ }
3048
+ //#endregion
3049
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
3050
+ function EvaluateAction(type, options) {
3051
+ return Update(EvaluateType(type), {}, options);
3052
+ }
3053
+ function EvaluateInstantiate(context, state, type, options) {
3054
+ return EvaluateAction(InstantiateType(context, state, type), options);
3055
+ }
3056
+ //#endregion
3057
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
3058
+ function CollectDistributionNames(expression, result = []) {
3059
+ return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result)) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? IsDeferred(expression.parameters[1]) && IsEqual(expression.parameters[1].action, "KeyOf") && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]["$ref"]] : result : result;
3060
+ }
3061
+ function BuildDistributionArray(parameters, names) {
3062
+ return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
3063
+ }
3064
+ function ZipDistributionArray(arguments_, distributionArray, result = []) {
3065
+ return ShiftLeft(arguments_, (argumentLeft, argumentRight) => ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);
3066
+ }
3067
+ function CanonicalArgument(type) {
3068
+ return IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsEnum(type) ? EvaluateEnum(type.enum) : type;
3069
+ }
3070
+ function Expand(type) {
3071
+ const canonicalArgument = CanonicalArgument(type);
3072
+ return IsUnion(canonicalArgument) ? [...canonicalArgument.anyOf] : [canonicalArgument];
3073
+ }
3074
+ function Append(current, type) {
3075
+ return current.reduce((result, left) => [...result, [...left, type]], []);
3076
+ }
3077
+ function Cross(current, variants) {
3078
+ return variants.reduce((result, left) => {
3079
+ return [...result, ...Append(current, left)];
3080
+ }, []);
3081
+ }
3082
+ function Distribute(zipped) {
3083
+ return zipped.reduce((result, left) => {
3084
+ return IsEqual(left[0], true) ? Cross(result, Expand(left[1])) : Cross(result, [left[1]]);
3085
+ }, [[]]);
3086
+ }
3087
+ function DistributeArguments(parameters, arguments_, expression) {
3088
+ const zippedArguments = ZipDistributionArray(arguments_, BuildDistributionArray(parameters, CollectDistributionNames(expression)));
3089
+ return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? Distribute(zippedArguments) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? Distribute(zippedArguments) : [arguments_];
3090
+ }
3091
+ //#endregion
3092
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/resolve_target.mjs
3093
+ function FromNotResolvable() {
3094
+ return ["(not-resolvable)", Never()];
3095
+ }
3096
+ function FromNotGeneric() {
3097
+ return ["(not-generic)", Never()];
3098
+ }
3099
+ function FromGeneric(name, parameters, expression) {
3100
+ return [name, Generic(parameters, expression)];
3101
+ }
3102
+ function FromRef(context, ref, arguments_) {
3103
+ return ref in context ? FromType$12(context, ref, context[ref], arguments_) : FromNotResolvable();
3104
+ }
3105
+ function FromType$12(context, name, target, arguments_) {
3106
+ return IsGeneric(target) ? FromGeneric(name, target.parameters, target.expression) : IsRef(target) ? FromRef(context, target.$ref, arguments_) : FromNotGeneric();
3107
+ }
3108
+ /** Resolves a named generic target from the context, or returns TNever if it cannot be resolved or is not generic. */
3109
+ function ResolveTarget(context, target, arguments_) {
3110
+ return FromType$12(context, "(anonymous)", target, arguments_);
3111
+ }
3112
+ //#endregion
3113
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
3114
+ function AssertArgumentExtends(name, type, extends_) {
3115
+ if (IsInfer(type) || IsCall(type) || IsExtendsTrueLike(Extends({}, type, extends_))) return;
3116
+ const cause = {
3117
+ parameter: name,
3118
+ expect: extends_,
3119
+ actual: type
3120
+ };
3121
+ throw new Error(`Argument for parameter ${name} does not satisfy constraint`, { cause });
3122
+ }
3123
+ function BindArgument(context, state, name, extends_, type) {
3124
+ const instantiatedArgument = InstantiateType(context, state, type);
3125
+ AssertArgumentExtends(name, instantiatedArgument, extends_);
3126
+ return Assign(context, { [name]: instantiatedArgument });
3127
+ }
3128
+ function BindArguments(context, state, parameterLeft, parameterRight, arguments_) {
3129
+ const instantiatedExtends = InstantiateType(context, state, parameterLeft.extends);
3130
+ const instantiatedEquals = InstantiateType(context, state, parameterLeft.equals);
3131
+ return ShiftLeft(arguments_, (left, right) => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, left), state, parameterRight, right), () => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, instantiatedEquals), state, parameterRight, []));
3132
+ }
3133
+ function BindParameters(context, state, parameters, arguments_) {
3134
+ return ShiftLeft(parameters, (left, right) => BindArguments(context, state, left, right, arguments_), () => context);
3135
+ }
3136
+ function ResolveArgumentsContext(context, state, parameters, arguments_) {
3137
+ return BindParameters(context, state, parameters, arguments_);
3138
+ }
3139
+ //#endregion
3140
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/instantiate.mjs
3141
+ let instantiationDepth = 0;
3142
+ let instantiationCount = 0;
3143
+ function InstantiationAssert() {
3144
+ if (IsLessThan(instantiationCount, Get().maxInstantiationCount)) return;
3145
+ throw Error("Type instantiation is excessively deep and possibly infinite");
3146
+ }
3147
+ function InstantiationIncrement() {
3148
+ InstantiationAssert();
3149
+ instantiationCount++;
3150
+ instantiationDepth++;
3151
+ }
3152
+ function InstantiationDecrement() {
3153
+ instantiationDepth--;
3154
+ if (IsEqual(instantiationDepth, 0)) instantiationCount = 0;
3155
+ }
3156
+ function Peek(state) {
3157
+ return IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
3158
+ }
3159
+ function IsTailCall(state, name) {
3160
+ return IsEqual(Peek(state), name);
3161
+ }
3162
+ function CallDispatch(context, state, target, parameters, expression, arguments_) {
3163
+ InstantiationIncrement();
3164
+ try {
3165
+ const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
3166
+ const returnType = InstantiateType(argumentsContext, State([...state["callstack"], target["$ref"]], state["visited"]), expression);
3167
+ return InstantiateType(argumentsContext, State([], []), returnType);
3168
+ } finally {
3169
+ InstantiationDecrement();
3170
+ }
3171
+ }
3172
+ function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
3173
+ return distributedArguments.reduce((result, arguments_) => {
3174
+ const returnType = CallDispatch(context, state, target, parameters, expression, arguments_);
3175
+ return [...result, returnType];
3176
+ }, []);
3177
+ }
3178
+ function CallImmediate(context, state, target, parameters, expression, arguments_) {
3179
+ const returnTypes = CallDistributed(context, state, target, parameters, expression, DistributeArguments(parameters, arguments_, expression));
3180
+ return IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);
3181
+ }
3182
+ function CallInstantiate(context, state, target, arguments_) {
3183
+ const instantiatedArguments = InstantiateTypes(context, state, arguments_);
3184
+ const resolved = ResolveTarget(context, target, arguments_);
3185
+ const name = resolved[0];
3186
+ const type = resolved[1];
3187
+ return IsGeneric(type) ? IsTailCall(state, name) ? CallConstruct(Ref(name), instantiatedArguments) : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments) : CallConstruct(target, instantiatedArguments);
3188
+ }
3189
+ //#endregion
3190
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/call.mjs
3191
+ function CallConstruct(target, arguments_) {
3192
+ return Create({ ["~kind"]: "Call" }, {
3193
+ type: "call",
3194
+ target,
3195
+ arguments: arguments_
3196
+ }, {});
3197
+ }
3198
+ /** Creates a Call type. */
3199
+ function Call(target, arguments_) {
3200
+ return CallInstantiate({}, State([], []), target, arguments_);
3201
+ }
3202
+ /** Returns true if the given type is a TCall. */
3203
+ function IsCall(value) {
3204
+ return IsKind(value, "Call");
3205
+ }
3206
+ //#endregion
3207
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
3208
+ function RemoveImmutableOperation(type) {
3209
+ return Discard(type, ["~immutable"]);
3210
+ }
3211
+ function RemoveImmutableAction(type, options) {
3212
+ return Update(RemoveImmutableOperation(type), {}, options);
3213
+ }
3214
+ function RemoveImmutableInstantiate(context, state, type, options) {
3215
+ return RemoveImmutableAction(InstantiateType(context, state, type), options);
3216
+ }
3217
+ //#endregion
3218
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
3219
+ function ApplyMapping(mapping, value) {
3220
+ return mapping(value);
3221
+ }
3222
+ //#endregion
3223
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
3224
+ function FromLiteral$2(mapping, value) {
3225
+ return IsString$1(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
3226
+ }
3227
+ //#endregion
3228
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
3229
+ function FromTemplateLiteral$2(mapping, pattern) {
3230
+ return FromType$11(mapping, EvaluateTemplateLiteral(pattern));
3231
+ }
3232
+ //#endregion
3233
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
3234
+ function FromUnion$6(mapping, types) {
3235
+ return Union(types.map((type) => FromType$11(mapping, type)));
3236
+ }
3237
+ //#endregion
3238
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
3239
+ function FromType$11(mapping, type) {
3240
+ return IsLiteral(type) ? FromLiteral$2(mapping, type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$2(mapping, type.pattern) : IsUnion(type) ? FromUnion$6(mapping, type.anyOf) : type;
3241
+ }
3242
+ //#endregion
3243
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/capitalize.mjs
3244
+ /** Creates a deferred Capitalize action. */
3245
+ function CapitalizeDeferred(type, options = {}) {
3246
+ return Deferred("Capitalize", [type], options);
3247
+ }
3248
+ /** Applies a Capitalize action to the given type. */
3249
+ function Capitalize(type, options = {}) {
3250
+ return CapitalizeAction(type, options);
3251
+ }
3252
+ //#endregion
3253
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/lowercase.mjs
3254
+ /** Creates a deferred Lowercase action. */
3255
+ function LowercaseDeferred(type, options = {}) {
3256
+ return Deferred("Lowercase", [type], options);
3257
+ }
3258
+ /** Applies a Lowercase action to the given type. */
3259
+ function Lowercase(type, options = {}) {
3260
+ return LowercaseAction(type, options);
3261
+ }
3262
+ //#endregion
3263
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/uncapitalize.mjs
3264
+ /** Creates a deferred Uncapitalize action. */
3265
+ function UncapitalizeDeferred(type, options = {}) {
3266
+ return Deferred("Uncapitalize", [type], options);
3267
+ }
3268
+ /** Applies a Uncapitalize action to the given type. */
3269
+ function Uncapitalize(type, options = {}) {
3270
+ return UncapitalizeAction(type, options);
3271
+ }
3272
+ //#endregion
3273
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/uppercase.mjs
3274
+ /** Creates a deferred Uppercase action. */
3275
+ function UppercaseDeferred(type, options = {}) {
3276
+ return Deferred("Uppercase", [type], options);
3277
+ }
3278
+ /** Applies a Uppercase action to the given type. */
3279
+ function Uppercase(type, options = {}) {
3280
+ return UppercaseAction(type, options);
3281
+ }
3282
+ //#endregion
3283
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
3284
+ const CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);
3285
+ const LowercaseMapping = (input) => input.toLowerCase();
3286
+ const UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);
3287
+ const UppercaseMapping = (input) => input.toUpperCase();
3288
+ function CapitalizeAction(type, options) {
3289
+ return CanInstantiate([type]) ? Update(FromType$11(CapitalizeMapping, type), {}, options) : CapitalizeDeferred(type, options);
3290
+ }
3291
+ function LowercaseAction(type, options) {
3292
+ return CanInstantiate([type]) ? Update(FromType$11(LowercaseMapping, type), {}, options) : LowercaseDeferred(type, options);
3293
+ }
3294
+ function UncapitalizeAction(type, options) {
3295
+ return CanInstantiate([type]) ? Update(FromType$11(UncapitalizeMapping, type), {}, options) : UncapitalizeDeferred(type, options);
3296
+ }
3297
+ function UppercaseAction(type, options) {
3298
+ return CanInstantiate([type]) ? Update(FromType$11(UppercaseMapping, type), {}, options) : UppercaseDeferred(type, options);
3299
+ }
3300
+ function CapitalizeInstantiate(context, state, type, options) {
3301
+ return CapitalizeAction(InstantiateType(context, state, type), options);
3302
+ }
3303
+ function LowercaseInstantiate(context, state, type, options) {
3304
+ return LowercaseAction(InstantiateType(context, state, type), options);
3305
+ }
3306
+ function UncapitalizeInstantiate(context, state, type, options) {
3307
+ return UncapitalizeAction(InstantiateType(context, state, type), options);
3308
+ }
3309
+ function UppercaseInstantiate(context, state, type, options) {
3310
+ return UppercaseAction(InstantiateType(context, state, type), options);
3311
+ }
3312
+ //#endregion
3313
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/conditional.mjs
3314
+ /** Creates a deferred Conditional action. */
3315
+ function ConditionalDeferred(left, right, true_, false_, options = {}) {
3316
+ return Deferred("Conditional", [
3317
+ left,
3318
+ right,
3319
+ true_,
3320
+ false_
3321
+ ], options);
3322
+ }
3323
+ /** Applies a Conditional action to the given types. */
3324
+ function Conditional(left, right, true_, false_, options = {}) {
3325
+ return ConditionalAction({}, State([], []), left, right, true_, false_, options);
3326
+ }
3327
+ //#endregion
3328
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
3329
+ function ConditionalOperation(context, state, left, right, true_, false_) {
3330
+ const extendsResult = Extends(context, left, right);
3331
+ return IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) : IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) : InstantiateType(context, state, false_);
3332
+ }
3333
+ function ConditionalAction(context, state, left, right, true_, false_, options) {
3334
+ return CanInstantiate([left, right]) ? Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options) : ConditionalDeferred(left, right, true_, false_, options);
3335
+ }
3336
+ function ConditionalInstantiate(context, state, left, right, true_, false_, options) {
3337
+ return ConditionalAction(context, state, InstantiateType(context, state, left), InstantiateType(context, state, right), true_, false_, options);
3338
+ }
3339
+ //#endregion
3340
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/constructor_parameters.mjs
3341
+ /** Creates a deferred ConstructorParameters action. */
3342
+ function ConstructorParametersDeferred(type, options = {}) {
3343
+ return Deferred("ConstructorParameters", [type], options);
3344
+ }
3345
+ /** Applies a ConstructorParameters action to a type. */
3346
+ function ConstructorParameters(type, options = {}) {
3347
+ return ConstructorParametersAction(type, options);
3348
+ }
3349
+ //#endregion
3350
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
3351
+ function ConstructorParametersOperation(type) {
3352
+ const parameters = IsConstructor(type) ? type["parameters"] : [];
3353
+ return Tuple(InstantiateElements({}, State([], []), parameters));
3354
+ }
3355
+ function ConstructorParametersAction(type, options) {
3356
+ return CanInstantiate([type]) ? Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
3357
+ }
3358
+ function ConstructorParametersInstantiate(context, state, type, options) {
3359
+ return ConstructorParametersAction(InstantiateType(context, state, type), options);
3360
+ }
3361
+ //#endregion
3362
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/exclude.mjs
3363
+ /** Creates a deferred Exclude action. */
3364
+ function ExcludeDeferred(left, right, options = {}) {
3365
+ return Deferred("Exclude", [left, right], options);
3366
+ }
3367
+ /** Applies a Exclude action using the given types */
3368
+ function Exclude(left, right, options = {}) {
3369
+ return ExcludeAction(left, right, options);
3370
+ }
3371
+ //#endregion
3372
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
3373
+ function ExcludeAction(left, right, options) {
3374
+ return CanInstantiate([left, right]) ? Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
3375
+ }
3376
+ function ExcludeInstantiate(context, state, left, right, options) {
3377
+ return ExcludeAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
3378
+ }
3379
+ //#endregion
3380
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/extract.mjs
3381
+ /** Creates a deferred Extract action. */
3382
+ function ExtractDeferred(left, right, options = {}) {
3383
+ return Deferred("Extract", [left, right], options);
3384
+ }
3385
+ /** Applies an Extract action using the given types. */
3386
+ function Extract(left, right, options = {}) {
3387
+ return ExtractAction(left, right, options);
3388
+ }
3389
+ //#endregion
3390
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/extract/operation.mjs
3391
+ function ExtractType(left, right) {
3392
+ return IsExtendsTrueLike(Extends({}, left, right)) ? [left] : [];
3393
+ }
3394
+ function ExtractUnion(left, right, result = []) {
3395
+ return ShiftLeft(left, (head, tail) => ExtractUnion(tail, right, [...result, ...ExtractType(head, right)]), () => result);
3396
+ }
3397
+ function ExtractOperation(left, right) {
3398
+ const evaluated = EvaluateType(left);
3399
+ return EvaluateUnion(ExtractUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
3400
+ }
3401
+ //#endregion
3402
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/extract/instantiate.mjs
3403
+ function ExtractAction(left, right, options) {
3404
+ return CanInstantiate([left, right]) ? Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
3405
+ }
3406
+ function ExtractInstantiate(context, state, left, right, options) {
3407
+ return ExtractAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
3408
+ }
3409
+ //#endregion
3410
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
3411
+ function KeysToLiterals(keys) {
3412
+ return keys.reduce((result, left) => {
3413
+ return IsLiteralValue(left) ? [...result, Literal(left)] : result;
3414
+ }, []);
3415
+ }
3416
+ function KeysToIndexer(keys) {
3417
+ return Union(KeysToLiterals(keys));
3418
+ }
3419
+ //#endregion
3420
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/indexed.mjs
3421
+ /** Creates a deferred Index action. */
3422
+ function IndexDeferred(type, indexer, options = {}) {
3423
+ return Deferred("Index", [type, indexer], options);
3424
+ }
3425
+ /** Applies a Index action using the given types. */
3426
+ function Index(type, indexer_or_keys, options = {}) {
3427
+ return IndexAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
3428
+ }
3429
+ //#endregion
3430
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
3431
+ function FromCyclic$4(defs, ref) {
3432
+ return FromType$10(CyclicTarget(defs, ref));
3433
+ }
3434
+ //#endregion
3435
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_dependent.mjs
3436
+ function FromDependent$4(if_, then_, else_) {
3437
+ return FromType$10(EvaluateDependent(if_, then_, else_));
3438
+ }
3439
+ //#endregion
3440
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_intersect.mjs
3441
+ function CollapseIntersectProperties(left, right) {
3442
+ const leftKeys = Keys(left).filter((key) => !HasPropertyKey(right, key));
3443
+ const rightKeys = Keys(right).filter((key) => !HasPropertyKey(left, key));
3444
+ const sharedKeys = Keys(left).filter((key) => HasPropertyKey(right, key));
3445
+ const leftProperties = leftKeys.reduce((result, key) => ({
3446
+ ...result,
3447
+ [key]: left[key]
3448
+ }), {});
3449
+ const rightProperties = rightKeys.reduce((result, key) => ({
3450
+ ...result,
3451
+ [key]: right[key]
3452
+ }), {});
3453
+ const sharedProperties = sharedKeys.reduce((result, key) => ({
3454
+ ...result,
3455
+ [key]: EvaluateIntersect([left[key], right[key]])
3456
+ }), {});
3457
+ return Assign(Assign(leftProperties, rightProperties), sharedProperties);
3458
+ }
3459
+ function FromIntersect$4(types) {
3460
+ return types.reduce((result, left) => {
3461
+ return CollapseIntersectProperties(result, FromType$10(left));
3462
+ }, {});
3463
+ }
3464
+ //#endregion
3465
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_object.mjs
3466
+ function FromObject$5(properties) {
3467
+ return properties;
3468
+ }
3469
+ //#endregion
3470
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_tuple.mjs
3471
+ function FromTuple$3(types) {
3472
+ return FromType$10(TupleToObject(Tuple(types)));
3473
+ }
3474
+ //#endregion
3475
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_union.mjs
3476
+ function CollapseUnionProperties(left, right) {
3477
+ return Keys(left).filter((key) => key in right).reduce((result, key) => {
3478
+ return {
3479
+ ...result,
3480
+ [key]: EvaluateUnion([left[key], right[key]])
3481
+ };
3482
+ }, {});
3483
+ }
3484
+ function ReduceVariants(types, result) {
3485
+ return ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType$10(left))), () => result);
3486
+ }
3487
+ function FromUnion$5(types) {
3488
+ return ShiftLeft(types, (left, right) => ReduceVariants(right, FromType$10(left)), () => Unreachable$1());
3489
+ }
3490
+ //#endregion
3491
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_type.mjs
3492
+ function FromType$10(type) {
3493
+ return IsCyclic(type) ? FromCyclic$4(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$4(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$4(type.allOf) : IsUnion(type) ? FromUnion$5(type.anyOf) : IsTuple(type) ? FromTuple$3(type.items) : IsObject(type) ? FromObject$5(type.properties) : {};
3494
+ }
3495
+ //#endregion
3496
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/collapse.mjs
3497
+ /**
3498
+ * Collapses a type into a TObject schema. This is a lossy fast path used to
3499
+ * normalize arbitrary TSchema types into a TObject structure. This function is
3500
+ * primarily used in indexing operations where a normalized object structure
3501
+ * is required. If the type cannot be collapsed, an empty object schema is returned.
3502
+ */
3503
+ function CollapseToObject(type) {
3504
+ return _Object_$1(FromType$10(type));
3505
+ }
3506
+ //#endregion
3507
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/helpers/keys.mjs
3508
+ const integerKeyPattern = /* @__PURE__ */ new RegExp("^(?:0|[1-9][0-9]*)$");
3509
+ function ConvertToIntegerKey(value) {
3510
+ const normal = `${value}`;
3511
+ return integerKeyPattern.test(normal) ? parseInt(normal) : value;
3512
+ }
3513
+ //#endregion
3514
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_array.mjs
3515
+ function NormalizeLiteral(value) {
3516
+ return Literal(ConvertToIntegerKey(value));
3517
+ }
3518
+ function NormalizeIndexerTypes(types) {
3519
+ return types.map((type) => NormalizeIndexer(type));
3520
+ }
3521
+ function NormalizeIndexer(type) {
3522
+ return IsIntersect(type) ? Intersect(NormalizeIndexerTypes(type.allOf)) : IsUnion(type) ? Union(NormalizeIndexerTypes(type.anyOf)) : IsLiteral(type) ? NormalizeLiteral(type.const) : type;
3523
+ }
3524
+ function FromArray$2(type, indexer) {
3525
+ return IsExtendsTrueLike(Extends({}, NormalizeIndexer(indexer), Number$2())) ? type : IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Number$2() : Never();
3526
+ }
3527
+ //#endregion
3528
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
3529
+ function FromCyclic$3(defs, ref) {
3530
+ return FromType$9(CyclicTarget(defs, ref));
3531
+ }
3532
+ //#endregion
3533
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
3534
+ function FromDependent$3(if_, then_, else_) {
3535
+ return FromType$9(EvaluateDependent(if_, then_, else_));
3536
+ }
3537
+ //#endregion
3538
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
3539
+ function FromEnum$1(values) {
3540
+ return FromType$9(EvaluateEnum(values));
3541
+ }
3542
+ //#endregion
3543
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
3544
+ function FromIntersect$3(types) {
3545
+ return FromType$9(EvaluateIntersect(types));
3546
+ }
3547
+ //#endregion
3548
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
3549
+ function FromLiteral$1(value) {
3550
+ return [`${value}`];
3551
+ }
3552
+ //#endregion
3553
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
3554
+ function FromTemplateLiteral$1(pattern) {
3555
+ return FromType$9(EvaluateTemplateLiteral(pattern));
3556
+ }
3557
+ //#endregion
3558
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_union.mjs
3559
+ function FromUnion$4(types) {
3560
+ return types.reduce((result, left) => {
3561
+ return [...result, ...FromType$9(left)];
3562
+ }, []);
3563
+ }
3564
+ //#endregion
3565
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_type.mjs
3566
+ function FromType$9(type) {
3567
+ return IsCyclic(type) ? FromCyclic$3(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$3(type.if, type.then, type.else) : IsEnum(type) ? FromEnum$1(type.enum) : IsIntersect(type) ? FromIntersect$3(type.allOf) : IsLiteral(type) ? FromLiteral$1(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$1(type.pattern) : IsUnion(type) ? FromUnion$4(type.anyOf) : [];
3568
+ }
3569
+ //#endregion
3570
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
3571
+ /**
3572
+ * Transforms a type meant as an Indexer into string[] array which is used by Indexable types
3573
+ * like Index, Pick and Omit to select from property keys. This function should only be used
3574
+ * for Object key selection, and not for Array / Tuple key selection as Array-Like structures
3575
+ * require TNumber indexing support.
3576
+ */
3577
+ function ToIndexableKeys(type) {
3578
+ return FromType$9(type);
3579
+ }
3580
+ //#endregion
3581
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/this/expand_this.mjs
3582
+ function FromTypes(properties, types) {
3583
+ return types.map((type) => FromType$8(properties, type));
3584
+ }
3585
+ function FromType$8(properties, type) {
3586
+ return IsArray(type) ? _Array_(FromType$8(properties, type.items)) : IsConstructor(type) ? Constructor(FromTypes(properties, type.parameters), FromType$8(properties, type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes(properties, type.parameters), FromType$8(properties, type.returnType)) : IsTuple(type) ? Tuple(FromTypes(properties, type.items)) : IsUnion(type) ? Union(FromTypes(properties, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes(properties, type.allOf)) : IsThis(type) ? _Object_$1(properties) : type;
3587
+ }
3588
+ function ExpandThis(properties, type) {
3589
+ return FromType$8(properties, type);
3590
+ }
3591
+ //#endregion
3592
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_object.mjs
3593
+ function IndexProperty(properties, key) {
3594
+ return ExpandThis(properties, key in properties ? properties[key] : Never());
3595
+ }
3596
+ function IndexProperties(properties, keys) {
3597
+ return keys.reduce((result, left) => {
3598
+ return [...result, IndexProperty(properties, left)];
3599
+ }, []);
3600
+ }
3601
+ function FromIndexer(properties, indexer) {
3602
+ return EvaluateUnion(IndexProperties(properties, ToIndexableKeys(indexer)));
3603
+ }
3604
+ const NumericKeyPattern = new RegExp(IntegerKey);
3605
+ function NumericKeys(keys) {
3606
+ return keys.filter((key) => NumericKeyPattern.test(key));
3607
+ }
3608
+ function FromIndexerNumber(properties) {
3609
+ return EvaluateUnion(IndexProperties(properties, NumericKeys(PropertyKeys(properties))));
3610
+ }
3611
+ function FromObject$4(properties, indexer) {
3612
+ return IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
3613
+ }
3614
+ //#endregion
3615
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
3616
+ function ConvertLiteral(value) {
3617
+ return Literal(ConvertToIntegerKey(value));
3618
+ }
3619
+ function ArrayIndexerTypes(types) {
3620
+ return types.map((type) => FormatArrayIndexer(type));
3621
+ }
3622
+ /** Formats embedded integer-like strings on an Indexer to be number values inline with TS indexing | coercion behaviors. */
3623
+ function FormatArrayIndexer(type) {
3624
+ return IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) : IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) : IsLiteral(type) ? ConvertLiteral(type.const) : type;
3625
+ }
3626
+ //#endregion
3627
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
3628
+ function IndexElementsWithIndexer(types, indexer) {
3629
+ return types.reduceRight((result, right, index) => {
3630
+ return IsExtendsTrueLike(Extends({}, Literal(index), indexer)) ? [right, ...result] : result;
3631
+ }, []);
3632
+ }
3633
+ function FromTupleWithIndexer(types, indexer) {
3634
+ return EvaluateUnionFast(IndexElementsWithIndexer(types, FormatArrayIndexer(indexer)));
3635
+ }
3636
+ function FromTupleWithoutIndexer(types) {
3637
+ return EvaluateUnionFast(types);
3638
+ }
3639
+ function FromTuple$2(types, indexer) {
3640
+ return IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber(indexer) || IsInteger(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
3641
+ }
3642
+ //#endregion
3643
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_type.mjs
3644
+ function FromType$7(type, indexer) {
3645
+ return IsArray(type) ? FromArray$2(type.items, indexer) : IsObject(type) ? FromObject$4(type.properties, indexer) : IsTuple(type) ? FromTuple$2(type.items, indexer) : Never();
3646
+ }
3647
+ //#endregion
3648
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
3649
+ function NormalizeType$1(type) {
3650
+ return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
3651
+ }
3652
+ function IndexAction(type, indexer, options) {
3653
+ return CanInstantiate([type, indexer]) ? Update(FromType$7(NormalizeType$1(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
3654
+ }
3655
+ function IndexInstantiate(context, state, type, indexer, options) {
3656
+ return IndexAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
3657
+ }
3658
+ //#endregion
3659
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/instance_type.mjs
3660
+ /** Creates a deferred InstanceType action. */
3661
+ function InstanceTypeDeferred(type, options = {}) {
3662
+ return Deferred("InstanceType", [type], options);
3663
+ }
3664
+ /** Applies a InstanceType action to the given type. */
3665
+ function InstanceType(type, options = {}) {
3666
+ return InstanceTypeAction(type, options);
3667
+ }
3668
+ //#endregion
3669
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
3670
+ function InstanceTypeOperation(type) {
3671
+ return IsConstructor(type) ? type["instanceType"] : Never();
3672
+ }
3673
+ function InstanceTypeAction(type, options) {
3674
+ return CanInstantiate([type]) ? Update(InstanceTypeOperation(type), {}, options) : InstanceTypeDeferred(type, options);
3675
+ }
3676
+ function InstanceTypeInstantiate(context, state, type, options = {}) {
3677
+ return InstanceTypeAction(InstantiateType(context, state, type), options);
3678
+ }
3679
+ //#endregion
3680
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/keyof.mjs
3681
+ /** Creates a deferred KeyOf action. */
3682
+ function KeyOfDeferred(type, options = {}) {
3683
+ return Deferred("KeyOf", [type], options);
3684
+ }
3685
+ /** Applies a KeyOf action to the given type. */
3686
+ function KeyOf(type, options = {}) {
3687
+ return KeyOfAction(type, options);
3688
+ }
3689
+ //#endregion
3690
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_any.mjs
3691
+ function FromAny() {
3692
+ return Union([
3693
+ Number$2(),
3694
+ String$2(),
3695
+ Symbol()
3696
+ ]);
3697
+ }
3698
+ //#endregion
3699
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_array.mjs
3700
+ function FromArray$1(_type) {
3701
+ return Number$2();
3702
+ }
3703
+ //#endregion
3704
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_object.mjs
3705
+ function FromPropertyKeys(keys) {
3706
+ return keys.reduce((result, left) => {
3707
+ return IsLiteralValue(left) ? [...result, Literal(ConvertToIntegerKey(left))] : Unreachable$1();
3708
+ }, []);
3709
+ }
3710
+ function FromObject$3(properties) {
3711
+ return EvaluateUnionFast(FromPropertyKeys(Keys(properties)));
3712
+ }
3713
+ //#endregion
3714
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_record.mjs
3715
+ function FromRecord(type) {
3716
+ return RecordKey(type);
3717
+ }
3718
+ //#endregion
3719
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
3720
+ function FromTuple$1(types) {
3721
+ return EvaluateUnionFast(types.map((_, index) => Literal(index)));
3722
+ }
3723
+ //#endregion
3724
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_type.mjs
3725
+ function FromType$6(type) {
3726
+ return IsAny(type) ? FromAny() : IsArray(type) ? FromArray$1(type.items) : IsObject(type) ? FromObject$3(type.properties) : IsRecord(type) ? FromRecord(type) : IsTuple(type) ? FromTuple$1(type.items) : Never();
3727
+ }
3728
+ //#endregion
3729
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
3730
+ function NormalizeType(type) {
3731
+ return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
3732
+ }
3733
+ function KeyOfAction(type, options) {
3734
+ return CanInstantiate([type]) ? Update(FromType$6(NormalizeType(type)), {}, options) : KeyOfDeferred(type, options);
3735
+ }
3736
+ function KeyOfInstantiate(context, state, type, options) {
3737
+ return KeyOfAction(InstantiateType(context, state, type), options);
3738
+ }
3739
+ //#endregion
3740
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/mapped.mjs
3741
+ /** Creates a deferred Mapped action. */
3742
+ function MappedDeferred(identifier, type, as, property, options = {}) {
3743
+ return Deferred("Mapped", [
3744
+ identifier,
3745
+ type,
3746
+ as,
3747
+ property
3748
+ ], options);
3749
+ }
3750
+ /** Applies a Mapped action using the given types. */
3751
+ function Mapped(identifier, type, as, property, options = {}) {
3752
+ return MappedAction({}, State([], []), identifier, type, as, property, options);
3753
+ }
3754
+ //#endregion
3755
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
3756
+ function FromTemplateLiteral(pattern) {
3757
+ return FromType$5(EvaluateTemplateLiteral(pattern));
3758
+ }
3759
+ function FromUnion$3(types) {
3760
+ return types.reduce((result, left) => {
3761
+ return [...result, ...FromType$5(left)];
3762
+ }, []);
3763
+ }
3764
+ function FromEnum(values) {
3765
+ return FromType$5(EvaluateEnum(values));
3766
+ }
3767
+ function FromLiteral(value) {
3768
+ return IsNumber$1(value) ? [Literal(`${value}`)] : [Literal(value)];
3769
+ }
3770
+ function FromType$5(type) {
3771
+ return IsEnum(type) ? FromEnum(type.enum) : IsLiteral(type) ? FromLiteral(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) : IsUnion(type) ? FromUnion$3(type.anyOf) : [type];
3772
+ }
3773
+ function MappedVariants(type) {
3774
+ return FromType$5(type);
3775
+ }
3776
+ //#endregion
3777
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
3778
+ function CanonicalAs(instantiatedAs) {
3779
+ return IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
3780
+ }
3781
+ function MappedVariant(context, state, identifier, variant, as, property) {
3782
+ const variantContext = Assign(context, { [identifier["name"]]: variant });
3783
+ const canonicalAs = CanonicalAs(InstantiateType(variantContext, state, as));
3784
+ const instantiatedProperty = InstantiateType(variantContext, state, property);
3785
+ return IsLiteralNumber(canonicalAs) || IsLiteralString(canonicalAs) ? { [canonicalAs.const]: instantiatedProperty } : {};
3786
+ }
3787
+ function MappedProperties(context, state, identifier, variants, as, property) {
3788
+ return variants.reduce((result, left) => {
3789
+ return [...result, MappedVariant(context, state, identifier, left, as, property)];
3790
+ }, []);
3791
+ }
3792
+ function MappedObjects(properties) {
3793
+ return properties.reduce((result, left) => {
3794
+ return [...result, _Object_$1(left)];
3795
+ }, []);
3796
+ }
3797
+ function MappedOperation(context, state, identifier, type, as, property) {
3798
+ return EvaluateIntersect(MappedObjects(MappedProperties(context, state, identifier, MappedVariants(type), as, property)));
3799
+ }
3800
+ //#endregion
3801
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
3802
+ function MappedAction(context, state, identifier, type, as, property, options) {
3803
+ return CanInstantiate([type]) ? Update(MappedOperation(context, state, identifier, type, as, property), {}, options) : MappedDeferred(identifier, type, as, property, options);
3804
+ }
3805
+ function MappedInstantiate(context, state, identifier, type, as, property, options) {
3806
+ return MappedAction(context, state, identifier, InstantiateType(context, state, type), as, property, options);
3807
+ }
3808
+ //#endregion
3809
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/module/instantiate.mjs
3810
+ function InstantiateCyclics(context, declarations, cyclicKeys) {
3811
+ const declarationContext = Assign(context, declarations);
3812
+ return Keys(declarations).filter((key) => cyclicKeys.includes(key)).reduce((result, key) => {
3813
+ return {
3814
+ ...result,
3815
+ [key]: InstantiateCyclic(declarationContext, key, declarations[key])
3816
+ };
3817
+ }, {});
3818
+ }
3819
+ function InstantiateNonCyclics(context, declarations, cyclicKeys) {
3820
+ const declarationContext = Assign(context, declarations);
3821
+ return Keys(declarations).filter((key) => !cyclicKeys.includes(key)).reduce((result, key) => {
3822
+ return {
3823
+ ...result,
3824
+ [key]: InstantiateType(declarationContext, State([], []), declarations[key])
3825
+ };
3826
+ }, {});
3827
+ }
3828
+ function InstantiateModule(context, declarations, options) {
3829
+ const cyclicCandidates = CyclicCandidates(declarations);
3830
+ const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);
3831
+ const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);
3832
+ return Update({
3833
+ ...instantiatedCyclics,
3834
+ ...instantiatedNonCyclics
3835
+ }, {}, options);
3836
+ }
3837
+ function ModuleInstantiate(context, _state, declarations, options) {
3838
+ return InstantiateModule(context, declarations, options);
3839
+ }
3840
+ //#endregion
3841
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/non_nullable.mjs
3842
+ /** Creates a deferred NonNullable action. */
3843
+ function NonNullableDeferred(type, options = {}) {
3844
+ return Deferred("NonNullable", [type], options);
3845
+ }
3846
+ /** Applies a NonNullable action to the given type. */
3847
+ function NonNullable(type, options = {}) {
3848
+ return NonNullableAction(type, options);
3849
+ }
3850
+ //#endregion
3851
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
3852
+ function NonNullableOperation(type) {
3853
+ return ExcludeAction(type, Union([Null(), Undefined()]), {});
3854
+ }
3855
+ function NonNullableAction(type, options) {
3856
+ return CanInstantiate([type]) ? Update(NonNullableOperation(type), {}, options) : NonNullableDeferred(type, options);
3857
+ }
3858
+ function NonNullableInstantiate(context, state, type, options) {
3859
+ return NonNullableAction(InstantiateType(context, state, type), options);
3860
+ }
3861
+ //#endregion
3862
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/omit.mjs
3863
+ /** Creates a deferred Omit action. */
3864
+ function OmitDeferred(type, indexer, options = {}) {
3865
+ return Deferred("Omit", [type, indexer], options);
3866
+ }
3867
+ /** Applies a Omit action using the given types. */
3868
+ function Omit(type, indexer_or_keys, options = {}) {
3869
+ return OmitAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
3870
+ }
3871
+ //#endregion
3872
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
3873
+ /** Transforms a type into a TProperties used for indexing operations */
3874
+ function ToIndexable(type) {
3875
+ const collapsed = CollapseToObject(type);
3876
+ return IsObject(collapsed) ? collapsed.properties : Unreachable$1();
3877
+ }
3878
+ //#endregion
3879
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/omit/from_type.mjs
3880
+ function FromKeys$1(properties, keys) {
3881
+ return Keys(properties).reduce((result, key) => {
3882
+ return keys.includes(key) ? result : {
3883
+ ...result,
3884
+ [key]: properties[key]
3885
+ };
3886
+ }, {});
3887
+ }
3888
+ function FromType$4(type, indexer) {
3889
+ return _Object_$1(FromKeys$1(ToIndexable(type), ToIndexableKeys(indexer)));
3890
+ }
3891
+ //#endregion
3892
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/omit/instantiate.mjs
3893
+ function OmitAction(type, indexer, options) {
3894
+ return CanInstantiate([type, indexer]) ? Update(FromType$4(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
3895
+ }
3896
+ function OmitInstantiate(context, state, type, indexer, options) {
3897
+ return OmitAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
3898
+ }
3899
+ //#endregion
3900
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/parameters.mjs
3901
+ /** Creates a deferred Parameters action. */
3902
+ function ParametersDeferred(type, options = {}) {
3903
+ return Deferred("Parameters", [type], options);
3904
+ }
3905
+ /** Applies a Parameters action to the given type. */
3906
+ function Parameters(type, options = {}) {
3907
+ return ParametersAction(type, options);
3908
+ }
3909
+ //#endregion
3910
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
3911
+ function ParametersOperation(type) {
3912
+ const parameters = IsFunction(type) ? type["parameters"] : [];
3913
+ return Tuple(InstantiateElements({}, State([], []), parameters));
3914
+ }
3915
+ function ParametersAction(type, options) {
3916
+ return CanInstantiate([type]) ? Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
3917
+ }
3918
+ function ParametersInstantiate(context, state, type, options) {
3919
+ return ParametersAction(InstantiateType(context, state, type), options);
3920
+ }
3921
+ //#endregion
3922
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/partial.mjs
3923
+ /** Creates a deferred Partial action. */
3924
+ function PartialDeferred(type, options = {}) {
3925
+ return Deferred("Partial", [type], options);
3926
+ }
3927
+ /** Applies a Partial action to the given type. */
3928
+ function Partial(type, options = {}) {
3929
+ return PartialAction(type, options);
3930
+ }
3931
+ //#endregion
3932
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
3933
+ function FromCyclic$2(defs, ref) {
3934
+ const partial = FromType$3(CyclicTarget(defs, ref));
3935
+ return Cyclic(Assign(defs, { [ref]: partial }), ref);
3936
+ }
3937
+ //#endregion
3938
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
3939
+ function FromDependent$2(if_, then_, else_) {
3940
+ return FromType$3(EvaluateDependent(if_, then_, else_));
3941
+ }
3942
+ //#endregion
3943
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
3944
+ function FromIntersect$2(types) {
3945
+ return FromType$3(EvaluateIntersect(types));
3946
+ }
3947
+ //#endregion
3948
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_union.mjs
3949
+ function FromUnion$2(types) {
3950
+ return Union(types.map((type) => FromType$3(type)));
3951
+ }
3952
+ //#endregion
3953
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_object.mjs
3954
+ function FromObject$2(properties) {
3955
+ return _Object_$1(Keys(properties).reduce((result, left) => {
3956
+ return {
3957
+ ...result,
3958
+ [left]: AddOptional(properties[left])
3959
+ };
3960
+ }, {}));
3961
+ }
3962
+ //#endregion
3963
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_type.mjs
3964
+ function FromType$3(type) {
3965
+ return IsCyclic(type) ? FromCyclic$2(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$2(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$2(type.allOf) : IsUnion(type) ? FromUnion$2(type.anyOf) : IsObject(type) ? FromObject$2(type.properties) : _Object_$1({});
3966
+ }
3967
+ //#endregion
3968
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/instantiate.mjs
3969
+ function PartialAction(type, options) {
3970
+ return CanInstantiate([type]) ? Update(FromType$3(type), {}, options) : PartialDeferred(type, options);
3971
+ }
3972
+ function PartialInstantiate(context, state, type, options) {
3973
+ return PartialAction(InstantiateType(context, state, type), options);
3974
+ }
3975
+ //#endregion
3976
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/pick.mjs
3977
+ /** Creates a deferred Pick action. */
3978
+ function PickDeferred(type, indexer, options = {}) {
3979
+ return Deferred("Pick", [type, indexer], options);
3980
+ }
3981
+ /** Applies a Pick action using the given types. */
3982
+ function Pick(type, indexer_or_keys, options = {}) {
3983
+ return PickAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
3984
+ }
3985
+ //#endregion
3986
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/pick/from_type.mjs
3987
+ function FromKeys(properties, keys) {
3988
+ return Keys(properties).reduce((result, key) => {
3989
+ return keys.includes(key) ? Assign(result, { [key]: properties[key] }) : result;
3990
+ }, {});
3991
+ }
3992
+ function FromType$2(type, indexer) {
3993
+ return _Object_$1(FromKeys(ToIndexable(type), ToIndexableKeys(indexer)));
3994
+ }
3995
+ //#endregion
3996
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/pick/instantiate.mjs
3997
+ function PickAction(type, indexer, options) {
3998
+ return CanInstantiate([type, indexer]) ? Update(FromType$2(type, indexer), {}, options) : PickDeferred(type, indexer, options);
3999
+ }
4000
+ function PickInstantiate(context, state, type, indexer, options) {
4001
+ return PickAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
4002
+ }
4003
+ //#endregion
4004
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/readonly_object.mjs
4005
+ /** Creates a deferred ReadonlyType action. */
4006
+ function ReadonlyObjectDeferred(type, options = {}) {
4007
+ return Deferred("ReadonlyObject", [type], options);
4008
+ }
4009
+ /** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
4010
+ function ReadonlyObject(type, options = {}) {
4011
+ return ReadonlyObjectAction(type, options);
4012
+ }
4013
+ /**
4014
+ * This type has been renamed to ReadonlyObject.
4015
+ * @deprecated
4016
+ */
4017
+ const ReadonlyType = ReadonlyObject;
4018
+ //#endregion
4019
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
4020
+ function FromArray(type) {
4021
+ return AddImmutable(_Array_(type));
4022
+ }
4023
+ //#endregion
4024
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
4025
+ function FromCyclic$1(defs, ref) {
4026
+ const partial = FromType$1(CyclicTarget(defs, ref));
4027
+ return Cyclic(Assign(defs, { [ref]: partial }), ref);
4028
+ }
4029
+ //#endregion
4030
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
4031
+ function FromDependent$1(if_, then_, else_) {
4032
+ return FromType$1(EvaluateDependent(if_, then_, else_));
4033
+ }
4034
+ //#endregion
4035
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
4036
+ function FromIntersect$1(types) {
4037
+ return FromType$1(EvaluateIntersect(types));
4038
+ }
4039
+ //#endregion
4040
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
4041
+ function FromObject$1(properties) {
4042
+ return _Object_$1(Keys(properties).reduce((result, left) => {
4043
+ return {
4044
+ ...result,
4045
+ [left]: AddReadonly(properties[left])
4046
+ };
4047
+ }, {}));
4048
+ }
4049
+ //#endregion
4050
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
4051
+ function FromTuple(types) {
4052
+ return AddImmutable(Tuple(types));
4053
+ }
4054
+ //#endregion
4055
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
4056
+ function FromUnion$1(types) {
4057
+ return Union(types.map((type) => FromType$1(type)));
4058
+ }
4059
+ //#endregion
4060
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
4061
+ function FromType$1(type) {
4062
+ return IsArray(type) ? FromArray(type.items) : IsCyclic(type) ? FromCyclic$1(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$1(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$1(type.allOf) : IsObject(type) ? FromObject$1(type.properties) : IsTuple(type) ? FromTuple(type.items) : IsUnion(type) ? FromUnion$1(type.anyOf) : type;
4063
+ }
4064
+ //#endregion
4065
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
4066
+ function ReadonlyObjectAction(type, options) {
4067
+ return CanInstantiate([type]) ? Update(FromType$1(type), {}, options) : ReadonlyObjectDeferred(type);
4068
+ }
4069
+ function ReadonlyObjectInstantiate(context, state, type, options) {
4070
+ return ReadonlyObjectAction(InstantiateType(context, state, type), options);
4071
+ }
4072
+ //#endregion
4073
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/ref/instantiate.mjs
4074
+ function RefInstantiate(context, state, type, ref) {
4075
+ return state.visited.includes(ref) ? type : ref in context ? InstantiateType(context, State(state["callstack"], [...state["visited"], ref]), context[ref]) : type;
4076
+ }
4077
+ //#endregion
4078
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
4079
+ function FromCyclic(defs, ref) {
4080
+ const partial = FromType(CyclicTarget(defs, ref));
4081
+ return Cyclic(Assign(defs, { [ref]: partial }), ref);
4082
+ }
4083
+ //#endregion
4084
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_dependent.mjs
4085
+ function FromDependent(if_, then_, else_) {
4086
+ return FromType(EvaluateDependent(if_, then_, else_));
4087
+ }
4088
+ //#endregion
4089
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_intersect.mjs
4090
+ function FromIntersect(types) {
4091
+ return FromType(EvaluateIntersect(types));
4092
+ }
4093
+ //#endregion
4094
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_union.mjs
4095
+ function FromUnion(types) {
4096
+ return Union(types.map((type) => FromType(type)));
4097
+ }
4098
+ //#endregion
4099
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_object.mjs
4100
+ function FromObject(properties) {
4101
+ return _Object_$1(Keys(properties).reduce((result, left) => {
4102
+ return {
4103
+ ...result,
4104
+ [left]: RemoveOptional(properties[left])
4105
+ };
4106
+ }, {}));
4107
+ }
4108
+ //#endregion
4109
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_type.mjs
4110
+ function FromType(type) {
4111
+ return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsDependent(type) ? FromDependent(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsObject(type) ? FromObject(type.properties) : _Object_$1({});
4112
+ }
4113
+ //#endregion
4114
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/required.mjs
4115
+ /** Creates a deferred Required action. */
4116
+ function RequiredDeferred(type, options = {}) {
4117
+ return Deferred("Required", [type], options);
4118
+ }
4119
+ /** Applies a Required action to the given type. */
4120
+ function Required(type, options = {}) {
4121
+ return RequiredAction(type, options);
4122
+ }
4123
+ //#endregion
4124
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/instantiate.mjs
4125
+ function RequiredAction(type, options) {
4126
+ return CanInstantiate([type]) ? Update(FromType(type), {}, options) : RequiredDeferred(type, options);
4127
+ }
4128
+ function RequiredInstantiate(context, state, type, options) {
4129
+ return RequiredAction(InstantiateType(context, state, type), options);
4130
+ }
4131
+ //#endregion
4132
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/return_type.mjs
4133
+ /** Creates a deferred ReturnType action. */
4134
+ function ReturnTypeDeferred(type, options = {}) {
4135
+ return Deferred("ReturnType", [type], options);
4136
+ }
4137
+ /** Applies a ReturnType action to the given type. */
4138
+ function ReturnType(type, options = {}) {
4139
+ return ReturnTypeAction(type, options);
4140
+ }
4141
+ //#endregion
4142
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
4143
+ function ReturnTypeOperation(type) {
4144
+ return IsFunction(type) ? type["returnType"] : Never();
4145
+ }
4146
+ function ReturnTypeAction(type, options) {
4147
+ return CanInstantiate([type]) ? Update(ReturnTypeOperation(type), {}, options) : ReturnTypeDeferred(type, options);
4148
+ }
4149
+ function ReturnTypeInstantiate(context, state, type, options = {}) {
4150
+ return ReturnTypeAction(InstantiateType(context, state, type), options);
4151
+ }
4152
+ //#endregion
4153
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/with.mjs
4154
+ /** Creates a deferred With action. */
4155
+ function WithDeferred(type, options) {
4156
+ return Deferred("With", [type, options], {});
4157
+ }
4158
+ /** Applies annotation options to the given type. */
4159
+ function With(type, options) {
4160
+ return WithAction(type, options);
4161
+ }
4162
+ //#endregion
4163
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/with/instantiate.mjs
4164
+ function WithAction(type, options) {
4165
+ return CanInstantiate([type]) ? Update(type, {}, options) : WithDeferred(type, options);
4166
+ }
4167
+ function WithInstantiate(context, state, type, options) {
4168
+ return WithAction(InstantiateType(context, state, type), options);
4169
+ }
4170
+ //#endregion
4171
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/rest/spread.mjs
4172
+ function SpreadElement(type) {
4173
+ return IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
4174
+ }
4175
+ function RestSpread(types) {
4176
+ return types.reduce((result, left) => {
4177
+ return [...result, ...SpreadElement(left)];
4178
+ }, []);
4179
+ }
4180
+ //#endregion
4181
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/instantiate.mjs
4182
+ function State(callstack, visited) {
4183
+ return {
4184
+ callstack,
4185
+ visited
4186
+ };
4187
+ }
4188
+ function CanInstantiate(types) {
4189
+ return ShiftLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
4190
+ }
4191
+ function InstantiateProperties(context, state, properties) {
4192
+ return Keys(properties).reduce((result, key) => {
4193
+ return {
4194
+ ...result,
4195
+ [key]: InstantiateType(context, state, properties[key])
4196
+ };
4197
+ }, {});
4198
+ }
4199
+ function InstantiateElements(context, state, types) {
4200
+ return RestSpread(InstantiateTypes(context, state, types));
4201
+ }
4202
+ function InstantiateTypes(context, state, types) {
4203
+ return types.map((type) => InstantiateType(context, state, type));
4204
+ }
4205
+ function WithModifiers(type, instantiatedType) {
4206
+ const withOptional = IsOptional(type) ? AddOptionalAction(instantiatedType, {}) : instantiatedType;
4207
+ const withReadonly = IsReadonly(type) ? AddReadonlyAction(withOptional, {}) : withOptional;
4208
+ return IsImmutable(type) ? AddImmutableAction(withReadonly, {}) : withReadonly;
4209
+ }
4210
+ function InstantiateDeferred(context, state, action, parameters, options) {
4211
+ return IsEqual(action, "AddImmutable") ? AddImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveImmutable") ? RemoveImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddReadonly") ? AddReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveReadonly") ? RemoveReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddOptional") ? AddOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveOptional") ? RemoveOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "With") ? WithInstantiate(context, state, parameters[0], parameters[1]) : Deferred(action, parameters, options);
4212
+ }
4213
+ function InstantiateImmediate(context, state, type) {
4214
+ return WithModifiers(type, IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsFunction(type) ? _Function_$1(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsDependent(type) ? Dependent$1(InstantiateType(context, state, type.if), InstantiateType(context, state, type.then), InstantiateType(context, state, type.else), DependentOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsObject(type) ? _Object_$1(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type);
4215
+ }
4216
+ function InstantiateType(context, state, type) {
4217
+ return IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : InstantiateImmediate(context, state, type);
4218
+ }
4219
+ /** Instantiates computed schematics using the given context and type. */
4220
+ function Instantiate(context, type) {
4221
+ return InstantiateType(context, State([], []), type);
4222
+ }
4223
+ //#endregion
4224
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
4225
+ function AddImmutableOperation(type) {
4226
+ return Update(type, { "~immutable": true }, {});
4227
+ }
4228
+ function AddImmutableAction(type, options) {
4229
+ return Update(AddImmutableOperation(type), {}, options);
4230
+ }
4231
+ function AddImmutableInstantiate(context, state, type, options) {
4232
+ return AddImmutableAction(InstantiateType(context, state, type), options);
4233
+ }
4234
+ //#endregion
4235
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_add_immutable.mjs
4236
+ /** Creates a deferred AddImmutable action. */
4237
+ function AddImmutableDeferred(type, options = {}) {
4238
+ return Deferred("AddImmutable", [type], options);
4239
+ }
4240
+ /** Applies an AddImmutable action to a type. */
4241
+ function AddImmutable(type, options = {}) {
4242
+ return AddImmutableAction(type, options);
4243
+ }
4244
+ //#endregion
4245
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/evaluate.mjs
4246
+ /** Creates a deferred Evaluate action. */
4247
+ function EvaluateDeferred(type, options = {}) {
4248
+ return Deferred("Evaluate", [type], options);
4249
+ }
4250
+ /** Applies an Evaluate action to a type. */
4251
+ function Evaluate(type, options = {}) {
4252
+ return EvaluateAction(type, options);
4253
+ }
4254
+ //#endregion
4255
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/module.mjs
4256
+ /** Creates a deferred Module action. */
4257
+ function ModuleDeferred(declarations, options = {}) {
4258
+ return Deferred("Module", [declarations], options);
4259
+ }
4260
+ /** Creates a Module with the given declarations */
4261
+ function Module(declarations, options = {}) {
4262
+ return ModuleInstantiate({}, State([], []), declarations, options);
4263
+ }
4264
+ //#endregion
4265
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/script.mjs
4266
+ /** Parses a type from a TypeScript type expression */
4267
+ function Script(...args) {
4268
+ const [context, input, options] = Match$2(args, {
4269
+ 2: (script, options) => IsString$1(script) ? [
4270
+ {},
4271
+ script,
4272
+ options
4273
+ ] : [
4274
+ script,
4275
+ options,
4276
+ {}
4277
+ ],
4278
+ 3: (context, script, options) => [
4279
+ context,
4280
+ script,
4281
+ options
4282
+ ],
4283
+ 1: (script) => [
4284
+ {},
4285
+ script,
4286
+ {}
4287
+ ]
4288
+ });
4289
+ const result = Script$1(input);
4290
+ return Update(IsArray$1(result) && IsEqual(result.length, 2) ? InstantiateType(context, State([], []), result[0]) : Never(), {}, options);
4291
+ }
4292
+ //#endregion
4293
+ //#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/typebox.mjs
4294
+ var typebox_exports = /* @__PURE__ */ __exportAll({
4295
+ Any: () => Any,
4296
+ Array: () => _Array_,
4297
+ BigInt: () => BigInt$2,
4298
+ Boolean: () => Boolean$1,
4299
+ Call: () => Call,
4300
+ Capitalize: () => Capitalize,
4301
+ Codec: () => Codec,
4302
+ Conditional: () => Conditional,
4303
+ Constructor: () => Constructor,
4304
+ ConstructorParameters: () => ConstructorParameters,
4305
+ Cyclic: () => Cyclic,
4306
+ Decode: () => Decode,
4307
+ DecodeBuilder: () => DecodeBuilder,
4308
+ Dependent: () => Dependent$1,
4309
+ Encode: () => Encode,
4310
+ EncodeBuilder: () => EncodeBuilder,
4311
+ Enum: () => Enum,
4312
+ Evaluate: () => Evaluate,
4313
+ Exclude: () => Exclude,
4314
+ Extends: () => Extends,
4315
+ ExtendsResult: () => result_exports,
4316
+ Extract: () => Extract,
4317
+ Function: () => _Function_$1,
4318
+ Generic: () => Generic,
4319
+ Identifier: () => Identifier,
4320
+ Immutable: () => Immutable,
4321
+ Index: () => Index,
4322
+ Infer: () => Infer,
4323
+ InstanceType: () => InstanceType,
4324
+ Instantiate: () => Instantiate,
4325
+ Integer: () => Integer$1,
4326
+ Interface: () => Interface,
4327
+ Intersect: () => Intersect,
4328
+ IsAny: () => IsAny,
4329
+ IsArray: () => IsArray,
4330
+ IsBigInt: () => IsBigInt,
4331
+ IsBoolean: () => IsBoolean,
4332
+ IsCall: () => IsCall,
4333
+ IsCodec: () => IsCodec,
4334
+ IsConstructor: () => IsConstructor,
4335
+ IsCyclic: () => IsCyclic,
4336
+ IsDependent: () => IsDependent,
4337
+ IsEnum: () => IsEnum,
4338
+ IsEnumValue: () => IsEnumValue,
4339
+ IsFunction: () => IsFunction,
4340
+ IsGeneric: () => IsGeneric,
4341
+ IsIdentifier: () => IsIdentifier,
4342
+ IsImmutable: () => IsImmutable,
4343
+ IsInfer: () => IsInfer,
4344
+ IsInteger: () => IsInteger,
4345
+ IsIntersect: () => IsIntersect,
4346
+ IsKind: () => IsKind,
4347
+ IsLiteral: () => IsLiteral,
4348
+ IsNever: () => IsNever,
4349
+ IsNull: () => IsNull,
4350
+ IsNumber: () => IsNumber,
4351
+ IsObject: () => IsObject,
4352
+ IsOptional: () => IsOptional,
4353
+ IsParameter: () => IsParameter,
4354
+ IsReadonly: () => IsReadonly,
4355
+ IsRecord: () => IsRecord,
4356
+ IsRef: () => IsRef,
4357
+ IsRefine: () => IsRefine,
4358
+ IsRest: () => IsRest,
4359
+ IsSchema: () => IsSchema,
4360
+ IsString: () => IsString,
4361
+ IsSymbol: () => IsSymbol,
4362
+ IsTemplateLiteral: () => IsTemplateLiteral,
4363
+ IsThis: () => IsThis,
4364
+ IsTuple: () => IsTuple,
4365
+ IsUndefined: () => IsUndefined,
4366
+ IsUnion: () => IsUnion,
4367
+ IsUnknown: () => IsUnknown,
4368
+ IsUnsafe: () => IsUnsafe,
4369
+ IsVoid: () => IsVoid,
4370
+ KeyOf: () => KeyOf,
4371
+ Literal: () => Literal,
4372
+ Lowercase: () => Lowercase,
4373
+ Mapped: () => Mapped,
4374
+ Module: () => Module,
4375
+ Never: () => Never,
4376
+ NonNullable: () => NonNullable,
4377
+ Null: () => Null,
4378
+ Number: () => Number$2,
4379
+ Object: () => _Object_$1,
4380
+ Omit: () => Omit,
4381
+ Optional: () => Optional$2,
4382
+ Parameter: () => Parameter$1,
4383
+ Parameters: () => Parameters,
4384
+ Partial: () => Partial,
4385
+ Pick: () => Pick,
4386
+ Readonly: () => Readonly$1,
4387
+ ReadonlyObject: () => ReadonlyObject,
4388
+ ReadonlyType: () => ReadonlyType,
4389
+ Record: () => Record,
4390
+ RecordKey: () => RecordKey,
4391
+ RecordPattern: () => RecordPattern,
4392
+ RecordValue: () => RecordValue,
4393
+ Ref: () => Ref,
4394
+ Refine: () => Refine,
4395
+ Required: () => Required,
4396
+ Rest: () => Rest,
4397
+ ReturnType: () => ReturnType,
4398
+ Script: () => Script,
4399
+ String: () => String$2,
4400
+ Symbol: () => Symbol,
4401
+ TemplateLiteral: () => TemplateLiteral,
4402
+ This: () => This,
4403
+ Tuple: () => Tuple,
4404
+ Uncapitalize: () => Uncapitalize,
4405
+ Undefined: () => Undefined,
4406
+ Union: () => Union,
4407
+ Unknown: () => Unknown,
4408
+ Unsafe: () => Unsafe,
4409
+ Uppercase: () => Uppercase,
4410
+ Void: () => Void,
4411
+ With: () => With
4412
+ });
4413
+ //#endregion
4414
+ export { _Object_$1 as a, uuidv7 as c, Boolean$1 as i, String$2 as n, Optional$2 as o, Number$2 as r, _Array_ as s, typebox_exports as t };
4415
+
4416
+ //# sourceMappingURL=build-DsGYAgiT.mjs.map