@vtstech/pi-soul 1.2.1 → 1.2.3

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