@vibe-lark/larkpal 0.1.85 → 0.1.86

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 (106) hide show
  1. package/dist/account-id-BM1T6029-DYjVxojW.mjs +46 -0
  2. package/dist/activation-context--5yu1dPF-Bwsn3moT.mjs +172 -0
  3. package/dist/anthropic-TH8ERTXK.mjs +5962 -0
  4. package/dist/assistant-visible-text-DuFWokAt-CsbII5KS.mjs +596 -0
  5. package/dist/azure-openai-responses-Bt_Ag9Er.mjs +166 -0
  6. package/dist/boundary-file-read-BSd9MXPy--KThL5e6.mjs +594 -0
  7. package/dist/browser-lifecycle-cleanup-BdNsMhMD-O3tnAM4i.mjs +60 -0
  8. package/dist/build-DgTrEpge.mjs +3333 -0
  9. package/dist/bundled-compat-BpaDaAAu-D7oazKjD.mjs +5216 -0
  10. package/dist/bundled-dir-U738ay4K-DXK0q_TV.mjs +258 -0
  11. package/dist/call-DimWbpgJ-ColD4W-y.mjs +9993 -0
  12. package/dist/channel-bootstrap.runtime-BVclcGv1-DJv_Z-Kr.mjs +2 -0
  13. package/dist/channel-bootstrap.runtime-Cwcr38m2-VRfVCR-i.mjs +33 -0
  14. package/dist/chunk-D6SyT4dJ.mjs +36 -0
  15. package/dist/cli.mjs +6 -6
  16. package/dist/command-format-LSnUCVVF-BQ2SMKka.mjs +685 -0
  17. package/dist/config-Bim2pi8a-BQUdfiEi.mjs +9 -0
  18. package/dist/delivery-context.shared-j5hC5qb1-CI83RXXZ.mjs +72 -0
  19. package/dist/diagnostic-ClMwNnUA-D6nUtLnb.mjs +140 -0
  20. package/dist/dist-CEGw8-2W.mjs +429 -0
  21. package/dist/dist-DD2aJ2UL.mjs +125135 -0
  22. package/dist/env-api-keys-BVvSg7T2.mjs +68 -0
  23. package/dist/event-stream-xaQWmyas.mjs +15226 -0
  24. package/dist/facade-loader-DFzIYYt_-CIr4HKtE.mjs +194 -0
  25. package/dist/from-DF7cl2wz.mjs +3842 -0
  26. package/dist/gateway-method-policy-C7rf0SeV-CJQMEYIE.mjs +28 -0
  27. package/dist/github-copilot-headers-DjqWtUoP.mjs +22 -0
  28. package/dist/google-C2pVrgBZ.mjs +336 -0
  29. package/dist/google-gemini-cli-BBxgS5Ho.mjs +623 -0
  30. package/dist/google-shared-BsWgwEk1.mjs +22791 -0
  31. package/dist/google-vertex-BsVLJrrC.mjs +358 -0
  32. package/dist/hash-DAFtW_W7.mjs +16 -0
  33. package/dist/headers-R3HdCbAE.mjs +8 -0
  34. package/dist/home-dir-C44RaPME-CBRS4HLP.mjs +93 -0
  35. package/dist/ids-BPsM98Uu-CwuxvUai.mjs +77 -0
  36. package/dist/image-2w3cApg7-CxpHvoB5.mjs +207 -0
  37. package/dist/io-CH2g3vsv-BOGlLlB8.mjs +26218 -0
  38. package/dist/jiti-loader-cache-Bat69wam-D6hCxboy.mjs +5049 -0
  39. package/dist/json-file-BQRNuxmK-DhJM5NsG.mjs +108 -0
  40. package/dist/json-parse-v_HIJjjI.mjs +381 -0
  41. package/dist/jws-GFcTvvVT.mjs +2291 -0
  42. package/dist/{lark-cli-provider-7LvtOIF_.mjs → lark-cli-provider-BARgbbmo.mjs} +1 -1
  43. package/dist/{live-smoke-nvTUPtrv.mjs → live-smoke-BhkBOcH9.mjs} +3 -3
  44. package/dist/load-context-mb7uvLSn-B10MAi3I.mjs +29 -0
  45. package/dist/loader-708jrx4Y-BOswuvpe.mjs +5053 -0
  46. package/dist/main.mjs +56550 -205
  47. package/dist/manifest-registry-_hxKCS2K-CZdeyN0f.mjs +3512 -0
  48. package/dist/mcp-server.mjs +1 -1
  49. package/dist/message-channel-Bk_YHfQg-AeNrPPpp.mjs +50 -0
  50. package/dist/message-channel-core-DTA--Gjh-CY4Tkb7N.mjs +29 -0
  51. package/dist/message.config.runtime-K-k4XOyq-DZTmXomP.mjs +2 -0
  52. package/dist/message.gateway.runtime-DqHOHRTQ-DH4ml0YF.mjs +2 -0
  53. package/dist/mistral-CaR4DiLu.mjs +28657 -0
  54. package/dist/model-auth-env-oyg2Hexc-DU_rOUU5.mjs +1306 -0
  55. package/dist/models-config-BmpSQJQF-Gfvh1n3A.mjs +1282 -0
  56. package/dist/models-config.runtime-BsU_22xk.mjs +2 -0
  57. package/dist/multipart-parser-DedmaB5g.mjs +294 -0
  58. package/dist/oauth-DOJeGfcE.mjs +6392 -0
  59. package/dist/openai-BDtIh3Ja.mjs +6693 -0
  60. package/dist/openai-codex-responses-C5EORu31.mjs +664 -0
  61. package/dist/openai-completions-CR_cS6gX.mjs +669 -0
  62. package/dist/openai-responses-oGxwZyuC.mjs +184 -0
  63. package/dist/openai-responses-shared-BixMSDZE.mjs +398 -0
  64. package/dist/paths-D6msg0S1-C2lYuisN.mjs +189 -0
  65. package/dist/paths-D92DjaZ--CTOESW2b.mjs +192 -0
  66. package/dist/pi-model-discovery-Bd0TWzo8-BFsJmeMb.mjs +227 -0
  67. package/dist/pi-model-discovery-runtime-CCCZxkd8.mjs +2 -0
  68. package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-C5ewk8kK.mjs +399 -0
  69. package/dist/plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs +1456 -0
  70. package/dist/process-scoped-map-B2cWkYET-CXwUZ8CZ.mjs +61 -0
  71. package/dist/provider-discovery.runtime-BPzz1PFj.mjs +58 -0
  72. package/dist/provider-model-compat-CFqcq0it-BDDuBI3A.mjs +118 -0
  73. package/dist/provider-runtime-C8rljsNs-CIT93zoy.mjs +2 -0
  74. package/dist/provider-runtime-CT50mNIX-BwEV6GyO.mjs +573 -0
  75. package/dist/provider-stream-COLujAAo-CbJPDngm.mjs +35449 -0
  76. package/dist/providers.runtime-Ba7tOlq7-CXkhkzU9.mjs +219 -0
  77. package/dist/public-surface-loader-BVl0NQAE-C0piXtsT.mjs +117 -0
  78. package/dist/resolve-C33B7eeu-BNvYTl6k.mjs +1041 -0
  79. package/dist/runtime-Cym-fqI8-DaSDMH-a.mjs +120 -0
  80. package/dist/runtime-channel-state-CohMybAh-hXR6y5Gx.mjs +19 -0
  81. package/dist/runtime-snapshot-C54O1-gI-40cbyi7P.mjs +677 -0
  82. package/dist/runtime-state-IBOIXKOx-Bf9tcLvc.mjs +10 -0
  83. package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BCVImm7a.mjs +39 -0
  84. package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-Cb4nJkRT.mjs +2 -0
  85. package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-BrQdXzOQ.mjs +2 -0
  86. package/dist/session-archive.runtime-B52_5vs4-BG-_IwNJ.mjs +2 -0
  87. package/dist/session-key-Cn2QoOyX-CuHbJMgR.mjs +82 -0
  88. package/dist/session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs +147 -0
  89. package/dist/src-BgCX0MLG.mjs +813 -0
  90. package/dist/src-DYbqlAqf.mjs +1177 -0
  91. package/dist/subagent-announce-L5WsQatW-CQWI9GMd.mjs +344 -0
  92. package/dist/subagent-announce.registry.runtime-DiqZyeTs-BKuniyi3.mjs +28 -0
  93. package/dist/subagent-registry-steer-runtime-DFgZFC0j-BhBz0roy.mjs +211 -0
  94. package/dist/subagent-system-prompt-C1qnN--K-DpnTFP47.mjs +3061 -0
  95. package/dist/target-parsing-loaded-DKkb6jJY-BMD4CkpS.mjs +1002 -0
  96. package/dist/task-registry-delivery-runtime-Dd1CUkZF-C8U40a3O.mjs +2950 -0
  97. package/dist/task-registry-delivery-runtime-ragbeVx5-CNbFAkjD.mjs +2 -0
  98. package/dist/thinking-Bh-7MqXz-D3woGbO7.mjs +2 -0
  99. package/dist/transcript-E_-ISOkD-DWCfZP2p.mjs +2019 -0
  100. package/dist/transcript.runtime-BqhvZZdl-BPy42vBP.mjs +2 -0
  101. package/dist/transform-messages-DbhIzTxq.mjs +207 -0
  102. package/dist/web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs +295 -0
  103. package/dist/web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs +200 -0
  104. package/package.json +3 -3
  105. package/dist/rolldown-runtime-wcPFST8Q.mjs +0 -13
  106. /package/dist/{interactive-init-B6j8j_Ap.mjs → interactive-init-BXQBalNr.mjs} +0 -0
@@ -0,0 +1,3333 @@
1
+ import { r as __exportAll } from "./chunk-D6SyT4dJ.mjs";
2
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/memory/metrics.mjs
3
+ /** TypeBox instantiation metrics */
4
+ const Metrics = {
5
+ assign: 0,
6
+ create: 0,
7
+ clone: 0,
8
+ discard: 0,
9
+ update: 0
10
+ };
11
+ //#endregion
12
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/memory/assign.mjs
13
+ /**
14
+ * Performs an Object assign using the Left and Right object types. We track this operation as it
15
+ * creates a new GC handle per assignment.
16
+ */
17
+ function Assign(left, right) {
18
+ Metrics.assign += 1;
19
+ return {
20
+ ...left,
21
+ ...right
22
+ };
23
+ }
24
+ //#endregion
25
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/guard/string.mjs
26
+ function IsBetween(value, min, max) {
27
+ return value >= min && value <= max;
28
+ }
29
+ function IsRegionalIndicator(value) {
30
+ return IsBetween(value, 127462, 127487);
31
+ }
32
+ function IsVariationSelector(value) {
33
+ return IsBetween(value, 65024, 65039);
34
+ }
35
+ function IsCombiningMark(value) {
36
+ return IsBetween(value, 768, 879) || IsBetween(value, 6832, 6911) || IsBetween(value, 7616, 7679) || IsBetween(value, 65056, 65071);
37
+ }
38
+ function CodePointLength(value) {
39
+ return value > 65535 ? 2 : 1;
40
+ }
41
+ function ConsumeModifiers(value, index) {
42
+ while (index < value.length) {
43
+ const point = value.codePointAt(index);
44
+ if (IsCombiningMark(point) || IsVariationSelector(point)) index += CodePointLength(point);
45
+ else break;
46
+ }
47
+ return index;
48
+ }
49
+ function NextGraphemeClusterIndex(value, clusterStart) {
50
+ const startCP = value.codePointAt(clusterStart);
51
+ let clusterEnd = clusterStart + CodePointLength(startCP);
52
+ clusterEnd = ConsumeModifiers(value, clusterEnd);
53
+ while (clusterEnd < value.length - 1 && value[clusterEnd] === "‍") {
54
+ const nextCP = value.codePointAt(clusterEnd + 1);
55
+ clusterEnd += 1 + CodePointLength(nextCP);
56
+ clusterEnd = ConsumeModifiers(value, clusterEnd);
57
+ }
58
+ if (IsRegionalIndicator(startCP) && clusterEnd < value.length && IsRegionalIndicator(value.codePointAt(clusterEnd))) clusterEnd += CodePointLength(value.codePointAt(clusterEnd));
59
+ return clusterEnd;
60
+ }
61
+ function IsGraphemeCodePoint(value) {
62
+ return IsBetween(value, 55296, 56319) || IsBetween(value, 768, 879) || value === 8205;
63
+ }
64
+ /** Returns the number of grapheme clusters in a string */
65
+ function GraphemeCount$1(value) {
66
+ let count = 0;
67
+ let index = 0;
68
+ while (index < value.length) {
69
+ index = NextGraphemeClusterIndex(value, index);
70
+ count++;
71
+ }
72
+ return count;
73
+ }
74
+ /** Checks if a string has at least a minimum number of grapheme clusters */
75
+ function IsMinLength$1(value, minLength) {
76
+ if (minLength === 0) return true;
77
+ let count = 0;
78
+ let index = 0;
79
+ while (index < value.length) {
80
+ index = NextGraphemeClusterIndex(value, index);
81
+ count++;
82
+ if (count >= minLength) return true;
83
+ }
84
+ return false;
85
+ }
86
+ /** Checks if a string has at most a maximum number of grapheme clusters */
87
+ function IsMaxLength$1(value, maxLength) {
88
+ let count = 0;
89
+ let index = 0;
90
+ while (index < value.length) {
91
+ index = NextGraphemeClusterIndex(value, index);
92
+ count++;
93
+ if (count > maxLength) return false;
94
+ }
95
+ return true;
96
+ }
97
+ /** Fast check for minimum grapheme length, falls back to full check if needed */
98
+ function IsMinLengthFast(value, minLength) {
99
+ if (minLength === 0) return true;
100
+ let index = 0;
101
+ while (index < value.length) {
102
+ if (IsGraphemeCodePoint(value.charCodeAt(index))) return IsMinLength$1(value, minLength);
103
+ index++;
104
+ if (index >= minLength) return true;
105
+ }
106
+ return false;
107
+ }
108
+ /** Fast check for maximum grapheme length, falls back to full check if needed */
109
+ function IsMaxLengthFast(value, maxLength) {
110
+ let index = 0;
111
+ while (index < value.length) {
112
+ if (IsGraphemeCodePoint(value.charCodeAt(index))) return IsMaxLength$1(value, maxLength);
113
+ index++;
114
+ if (index > maxLength) return false;
115
+ }
116
+ return true;
117
+ }
118
+ //#endregion
119
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/guard/guard.mjs
120
+ var guard_exports = /* @__PURE__ */ __exportAll({
121
+ Entries: () => Entries,
122
+ EntriesRegExp: () => EntriesRegExp,
123
+ Every: () => Every,
124
+ EveryAll: () => EveryAll,
125
+ GraphemeCount: () => GraphemeCount,
126
+ HasPropertyKey: () => HasPropertyKey,
127
+ IsArray: () => IsArray$1,
128
+ IsAsyncIterator: () => IsAsyncIterator$1,
129
+ IsBigInt: () => IsBigInt$1,
130
+ IsBoolean: () => IsBoolean$2,
131
+ IsClassInstance: () => IsClassInstance,
132
+ IsConstructor: () => IsConstructor$1,
133
+ IsDeepEqual: () => IsDeepEqual,
134
+ IsEqual: () => IsEqual,
135
+ IsFunction: () => IsFunction$1,
136
+ IsGreaterEqualThan: () => IsGreaterEqualThan,
137
+ IsGreaterThan: () => IsGreaterThan,
138
+ IsInteger: () => IsInteger$1,
139
+ IsIterator: () => IsIterator$1,
140
+ IsLessEqualThan: () => IsLessEqualThan,
141
+ IsLessThan: () => IsLessThan,
142
+ IsMaxLength: () => IsMaxLength,
143
+ IsMinLength: () => IsMinLength,
144
+ IsMultipleOf: () => IsMultipleOf,
145
+ IsNull: () => IsNull$1,
146
+ IsNumber: () => IsNumber$2,
147
+ IsObject: () => IsObject$1,
148
+ IsObjectNotArray: () => IsObjectNotArray,
149
+ IsString: () => IsString$2,
150
+ IsSymbol: () => IsSymbol$1,
151
+ IsUndefined: () => IsUndefined$1,
152
+ IsValueLike: () => IsValueLike,
153
+ Keys: () => Keys,
154
+ Symbols: () => Symbols,
155
+ Values: () => Values
156
+ });
157
+ /** Returns true if this value is an array */
158
+ function IsArray$1(value) {
159
+ return Array.isArray(value);
160
+ }
161
+ /** Returns true if this value is an async iterator */
162
+ function IsAsyncIterator$1(value) {
163
+ return IsObject$1(value) && Symbol.asyncIterator in value;
164
+ }
165
+ /** Returns true if this value is bigint */
166
+ function IsBigInt$1(value) {
167
+ return IsEqual(typeof value, "bigint");
168
+ }
169
+ /** Returns true if this value is a boolean */
170
+ function IsBoolean$2(value) {
171
+ return IsEqual(typeof value, "boolean");
172
+ }
173
+ /** Returns true if this value is a constructor */
174
+ function IsConstructor$1(value) {
175
+ if (IsUndefined$1(value) || !IsFunction$1(value)) return false;
176
+ const result = Function.prototype.toString.call(value);
177
+ if (/^class\s/.test(result)) return true;
178
+ if (/\[native code\]/.test(result)) return true;
179
+ return false;
180
+ }
181
+ /** Returns true if this value is a function */
182
+ function IsFunction$1(value) {
183
+ return IsEqual(typeof value, "function");
184
+ }
185
+ /** Returns true if this value is integer */
186
+ function IsInteger$1(value) {
187
+ return Number.isInteger(value);
188
+ }
189
+ /** Returns true if this value is an iterator */
190
+ function IsIterator$1(value) {
191
+ return IsObject$1(value) && Symbol.iterator in value;
192
+ }
193
+ /** Returns true if this value is null */
194
+ function IsNull$1(value) {
195
+ return IsEqual(value, null);
196
+ }
197
+ /** Returns true if this value is number */
198
+ function IsNumber$2(value) {
199
+ return Number.isFinite(value);
200
+ }
201
+ /** Returns true if this value is an object but not an array */
202
+ function IsObjectNotArray(value) {
203
+ return IsObject$1(value) && !IsArray$1(value);
204
+ }
205
+ /** Returns true if this value is an object */
206
+ function IsObject$1(value) {
207
+ return IsEqual(typeof value, "object") && !IsNull$1(value);
208
+ }
209
+ /** Returns true if this value is string */
210
+ function IsString$2(value) {
211
+ return IsEqual(typeof value, "string");
212
+ }
213
+ /** Returns true if this value is symbol */
214
+ function IsSymbol$1(value) {
215
+ return IsEqual(typeof value, "symbol");
216
+ }
217
+ /** Returns true if this value is undefined */
218
+ function IsUndefined$1(value) {
219
+ return IsEqual(value, void 0);
220
+ }
221
+ function IsEqual(left, right) {
222
+ return left === right;
223
+ }
224
+ function IsGreaterThan(left, right) {
225
+ return left > right;
226
+ }
227
+ function IsLessThan(left, right) {
228
+ return left < right;
229
+ }
230
+ function IsLessEqualThan(left, right) {
231
+ return left <= right;
232
+ }
233
+ function IsGreaterEqualThan(left, right) {
234
+ return left >= right;
235
+ }
236
+ function IsMultipleOf(dividend, divisor) {
237
+ if (IsBigInt$1(dividend) || IsBigInt$1(divisor)) return BigInt(dividend) % BigInt(divisor) === 0n;
238
+ const tolerance = 1e-10;
239
+ if (!IsNumber$2(dividend)) return true;
240
+ if (IsInteger$1(dividend) && 1 / divisor % 1 === 0) return true;
241
+ const mod = dividend % divisor;
242
+ return Math.min(Math.abs(mod), Math.abs(mod - divisor)) < tolerance;
243
+ }
244
+ /** Returns true if the value appears to be an instance of a class. */
245
+ function IsClassInstance(value) {
246
+ if (!IsObject$1(value)) return false;
247
+ const proto = globalThis.Object.getPrototypeOf(value);
248
+ if (IsNull$1(proto)) return false;
249
+ return IsEqual(typeof proto.constructor, "function") && !(IsEqual(proto.constructor, globalThis.Object) || IsEqual(proto.constructor.name, "Object"));
250
+ }
251
+ function IsValueLike(value) {
252
+ return IsBigInt$1(value) || IsBoolean$2(value) || IsNull$1(value) || IsNumber$2(value) || IsString$2(value) || IsUndefined$1(value);
253
+ }
254
+ /** Returns the number of grapheme clusters in the string */
255
+ function GraphemeCount(value) {
256
+ return GraphemeCount$1(value);
257
+ }
258
+ /** Returns true if the string has at most the given number of graphemes */
259
+ function IsMaxLength(value, length) {
260
+ return IsMaxLengthFast(value, length);
261
+ }
262
+ /** Returns true if the string has at least the given number of graphemes */
263
+ function IsMinLength(value, length) {
264
+ return IsMinLengthFast(value, length);
265
+ }
266
+ function Every(value, offset, callback) {
267
+ for (let index = offset; index < value.length; index++) if (!callback(value[index], index)) return false;
268
+ return true;
269
+ }
270
+ function EveryAll(value, offset, callback) {
271
+ let result = true;
272
+ for (let index = offset; index < value.length; index++) if (!callback(value[index], index)) result = false;
273
+ return result;
274
+ }
275
+ /** Returns true if this value has this property key */
276
+ function HasPropertyKey(value, key) {
277
+ return IsEqual(key, "__proto__") || IsEqual(key, "constructor") ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
278
+ }
279
+ /** Returns object entries as `[RegExp, Value][]` */
280
+ function EntriesRegExp(value) {
281
+ return Keys(value).map((key) => [new RegExp(`^${key}$`), value[key]]);
282
+ }
283
+ /** Returns object entries as `[string, Value][]` */
284
+ function Entries(value) {
285
+ return Object.entries(value);
286
+ }
287
+ /** Returns the property keys for this object via `Object.getOwnPropertyKeys({ ... })` */
288
+ function Keys(value) {
289
+ return Object.getOwnPropertyNames(value);
290
+ }
291
+ /** Returns the property keys for this object via `Object.getOwnPropertyKeys({ ... })` */
292
+ function Symbols(value) {
293
+ return Object.getOwnPropertySymbols(value);
294
+ }
295
+ /** Returns the property values for the given object via `Object.values()` */
296
+ function Values(value) {
297
+ return Object.values(value);
298
+ }
299
+ function DeepEqualObject(left, right) {
300
+ if (!IsObject$1(right)) return false;
301
+ const keys = Keys(left);
302
+ return IsEqual(keys.length, Keys(right).length) && keys.every((key) => IsDeepEqual(left[key], right[key]));
303
+ }
304
+ function DeepEqualArray(left, right) {
305
+ return IsArray$1(right) && IsEqual(left.length, right.length) && left.every((_, index) => IsDeepEqual(left[index], right[index]));
306
+ }
307
+ /** Tests values for deep equality */
308
+ function IsDeepEqual(left, right) {
309
+ return IsArray$1(left) ? DeepEqualArray(left, right) : IsObject$1(left) ? DeepEqualObject(left, right) : IsEqual(left, right);
310
+ }
311
+ //#endregion
312
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/guard/globals.mjs
313
+ function IsBoolean$1(value) {
314
+ return value instanceof Boolean;
315
+ }
316
+ function IsNumber$1(value) {
317
+ return value instanceof Number;
318
+ }
319
+ function IsString$1(value) {
320
+ return value instanceof String;
321
+ }
322
+ function IsTypeArray(value) {
323
+ return globalThis.ArrayBuffer.isView(value);
324
+ }
325
+ /** Returns true if the value is a RegExp */
326
+ function IsRegExp(value) {
327
+ return value instanceof globalThis.RegExp;
328
+ }
329
+ /** Returns true if the value is a Date */
330
+ function IsDate(value) {
331
+ return value instanceof globalThis.Date;
332
+ }
333
+ /** Returns true if the value is a Set */
334
+ function IsSet(value) {
335
+ return value instanceof globalThis.Set;
336
+ }
337
+ /** Returns true if the value is a Map */
338
+ function IsMap(value) {
339
+ return value instanceof globalThis.Map;
340
+ }
341
+ //#endregion
342
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/memory/clone.mjs
343
+ function IsGuard(value) {
344
+ return IsObject$1(value) && HasPropertyKey(value, "~guard");
345
+ }
346
+ function FromGuard(value) {
347
+ return value;
348
+ }
349
+ function FromArray$4(value) {
350
+ return value.map((value) => FromValue$1(value));
351
+ }
352
+ function FromObject$7(value) {
353
+ const result = {};
354
+ const descriptors = Object.getOwnPropertyDescriptors(value);
355
+ for (const key of Object.keys(descriptors)) {
356
+ const descriptor = descriptors[key];
357
+ if (HasPropertyKey(descriptor, "value")) Object.defineProperty(result, key, {
358
+ ...descriptor,
359
+ value: FromValue$1(descriptor.value)
360
+ });
361
+ }
362
+ return result;
363
+ }
364
+ function FromRegExp$1(value) {
365
+ return new RegExp(value.source, value.flags);
366
+ }
367
+ function FromUnknown(value) {
368
+ return value;
369
+ }
370
+ function FromValue$1(value) {
371
+ return value instanceof RegExp ? FromRegExp$1(value) : IsGuard(value) ? FromGuard(value) : IsArray$1(value) ? FromArray$4(value) : IsObject$1(value) ? FromObject$7(value) : FromUnknown(value);
372
+ }
373
+ /**
374
+ * Clones a value using the TypeBox type cloning strategy. This function preserves non-enumerable
375
+ * properties from the source value. This is to ensure cloned types retain discriminable
376
+ * hidden properties.
377
+ */
378
+ function Clone(value) {
379
+ Metrics.clone += 1;
380
+ return FromValue$1(value);
381
+ }
382
+ //#endregion
383
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/settings/settings.mjs
384
+ const settings = {
385
+ immutableTypes: false,
386
+ maxErrors: 8,
387
+ useAcceleration: true,
388
+ exactOptionalPropertyTypes: false,
389
+ enumerableKind: false,
390
+ correctiveParse: false
391
+ };
392
+ /** Gets current system settings */
393
+ function Get() {
394
+ return settings;
395
+ }
396
+ //#endregion
397
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/memory/create.mjs
398
+ function MergeHidden(left, right) {
399
+ for (const key of Object.keys(right)) Object.defineProperty(left, key, {
400
+ configurable: true,
401
+ writable: true,
402
+ enumerable: false,
403
+ value: right[key]
404
+ });
405
+ return left;
406
+ }
407
+ function Merge(left, right) {
408
+ return {
409
+ ...left,
410
+ ...right
411
+ };
412
+ }
413
+ /**
414
+ * Creates an object with hidden, enumerable, and optional property sets. This function
415
+ * ensures types are instantiated according to configuration rules for enumerable and
416
+ * non-enumerable properties.
417
+ */
418
+ function Create(hidden, enumerable, options = {}) {
419
+ Metrics.create += 1;
420
+ const settings = Get();
421
+ const withOptions = Merge(enumerable, options);
422
+ const withHidden = settings.enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
423
+ return settings.immutableTypes ? Object.freeze(withHidden) : withHidden;
424
+ }
425
+ //#endregion
426
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/memory/discard.mjs
427
+ /** Discards multiple property keys from the given object value */
428
+ function Discard(value, propertyKeys) {
429
+ Metrics.discard += 1;
430
+ const result = {};
431
+ const descriptors = Object.getOwnPropertyDescriptors(Clone(value));
432
+ const keysToDiscard = new Set(propertyKeys);
433
+ for (const key of Object.keys(descriptors)) {
434
+ if (keysToDiscard.has(key)) continue;
435
+ Object.defineProperty(result, key, descriptors[key]);
436
+ }
437
+ return result;
438
+ }
439
+ //#endregion
440
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/memory/update.mjs
441
+ /**
442
+ * Updates a value with new properties while preserving property enumerability. Use this function to modify
443
+ * existing types without altering their configuration.
444
+ */
445
+ function Update(current, hidden, enumerable) {
446
+ Metrics.update += 1;
447
+ const settings = Get();
448
+ const result = Clone(current);
449
+ for (const key of Object.keys(hidden)) Object.defineProperty(result, key, {
450
+ configurable: true,
451
+ writable: true,
452
+ enumerable: settings.enumerableKind,
453
+ value: hidden[key]
454
+ });
455
+ for (const key of Object.keys(enumerable)) Object.defineProperty(result, key, {
456
+ configurable: true,
457
+ enumerable: true,
458
+ writable: true,
459
+ value: enumerable[key]
460
+ });
461
+ return result;
462
+ }
463
+ //#endregion
464
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/schema.mjs
465
+ function IsKind(value, kind) {
466
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], kind);
467
+ }
468
+ function IsSchema(value) {
469
+ return IsObject$1(value);
470
+ }
471
+ //#endregion
472
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/_optional.mjs
473
+ /** Returns true if this value is a OptionalAddAction. */
474
+ function IsOptionalAddAction(value) {
475
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "OptionalAddAction") && IsSchema(value.type);
476
+ }
477
+ /** Returns true if this value is a OptionalRemoveAction. */
478
+ function IsOptionalRemoveAction(value) {
479
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "OptionalRemoveAction") && IsSchema(value.type);
480
+ }
481
+ //#endregion
482
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/_readonly.mjs
483
+ /** Returns true if this value is a ReadonlyAddAction. */
484
+ function IsReadonlyAddAction(value) {
485
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "ReadonlyAddAction") && IsSchema(value.type);
486
+ }
487
+ /** Returns true if this value is a ReadonlyRemoveAction. */
488
+ function IsReadonlyRemoveAction(value) {
489
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "ReadonlyRemoveAction") && IsSchema(value.type);
490
+ }
491
+ //#endregion
492
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/deferred.mjs
493
+ /** Creates a Deferred action. */
494
+ function Deferred(action, parameters, options) {
495
+ return Create({ "~kind": "Deferred" }, {
496
+ action,
497
+ parameters,
498
+ options
499
+ }, {});
500
+ }
501
+ /** Returns true if the given value is a TDeferred. */
502
+ function IsDeferred(value) {
503
+ return IsKind(value, "Deferred");
504
+ }
505
+ //#endregion
506
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/promise.mjs
507
+ /** Creates a Promise type. */
508
+ function _Promise_(item, options) {
509
+ return Create({ ["~kind"]: "Promise" }, {
510
+ type: "promise",
511
+ item
512
+ }, options);
513
+ }
514
+ /** Returns true if the given type is TPromise. */
515
+ function IsPromise(value) {
516
+ return IsKind(value, "Promise");
517
+ }
518
+ /** Extracts options from a TPromise. */
519
+ function PromiseOptions(type) {
520
+ return Discard(type, [
521
+ "~kind",
522
+ "type",
523
+ "item"
524
+ ]);
525
+ }
526
+ //#endregion
527
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/_immutable.mjs
528
+ /** Adds Immutable to the given type. */
529
+ function ImmutableAdd(type) {
530
+ return Update(type, { "~immutable": true }, {});
531
+ }
532
+ /** Applies an Immutable modifier to the given type. */
533
+ function Immutable(type) {
534
+ return ImmutableAdd(type);
535
+ }
536
+ /** Returns true if the given value is a TImmutable */
537
+ function IsImmutable(value) {
538
+ return IsSchema(value) && HasPropertyKey(value, "~immutable");
539
+ }
540
+ //#endregion
541
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/_optional.mjs
542
+ /** Removes Optional from the given type. */
543
+ function OptionalRemove(type) {
544
+ return Discard(type, ["~optional"]);
545
+ }
546
+ /** Adds Optional to the given type. */
547
+ function OptionalAdd(type) {
548
+ return Update(type, { "~optional": true }, {});
549
+ }
550
+ /** Applies an Optional modifier to the given type. */
551
+ function Optional(type) {
552
+ return OptionalAdd(type);
553
+ }
554
+ /** Returns true if the given value is TOptional */
555
+ function IsOptional(value) {
556
+ return IsSchema(value) && HasPropertyKey(value, "~optional");
557
+ }
558
+ //#endregion
559
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/_readonly.mjs
560
+ /** Removes a Readonly property modifier from the given type. */
561
+ function ReadonlyRemove(type) {
562
+ return Discard(type, ["~readonly"]);
563
+ }
564
+ /** Adds a Readonly property modifier to the given type. */
565
+ function ReadonlyAdd(type) {
566
+ return Update(type, { "~readonly": true }, {});
567
+ }
568
+ /** Applies an Readonly property modifier to the given type. */
569
+ function Readonly(type) {
570
+ return ReadonlyAdd(type);
571
+ }
572
+ /** Returns true if the given value is a TReadonly */
573
+ function IsReadonly(value) {
574
+ return IsSchema(value) && HasPropertyKey(value, "~readonly");
575
+ }
576
+ //#endregion
577
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/base.mjs
578
+ function BaseProperty(value) {
579
+ return {
580
+ enumerable: Get().enumerableKind,
581
+ writable: false,
582
+ configurable: false,
583
+ value
584
+ };
585
+ }
586
+ /**
587
+ * @deprecated Use Type.Refine() + Type.Unsafe() instead.
588
+ *
589
+ *
590
+ * **Reason:** It is noted that JavaScript class instances do not behave like
591
+ * plain objects during structural clone or when the TB compositor needs to
592
+ * assign dynamic modifier properties (such as '~optional').
593
+ *
594
+ * Because the TypeBox compositor needs to transform schematics via object clone /
595
+ * property spread, these operations can result in class instance types losing
596
+ * methods on the prototype (via clone), which can lead to unexpected structures being
597
+ * returned. This has led to special-case (non-clone) handling for Base which needs
598
+ * to be removed as it has proven orthogonal to the TypeBox 1.x design.
599
+ *
600
+ * The Base type was introduced in 1.x to try integrate / embed Standard Schema into JSON
601
+ * Schema; however, support for integrated Standard Schema embedding will not be continued
602
+ * in TypeBox. This type will be removed in the next minor revision of TypeBox.
603
+ *
604
+ * ```typescript
605
+ * // (Deprecated)
606
+ * class DateType extends Type.Base<Date> { Check(value) { return value instanceof Date } }
607
+ *
608
+ * // (Future)
609
+ * const DateType = Type.Refine(Type.Unsafe<Date>({}), value => value instanceof Date)
610
+ * ```
611
+ */
612
+ var Base = class {
613
+ constructor() {
614
+ globalThis.Object.defineProperty(this, "~kind", BaseProperty("Base"));
615
+ globalThis.Object.defineProperty(this, "~guard", BaseProperty({
616
+ check: (value) => this.Check(value),
617
+ errors: (value) => this.Errors(value)
618
+ }));
619
+ }
620
+ /** Checks a value or returns false if invalid */
621
+ Check(_value) {
622
+ return true;
623
+ }
624
+ /** Returns errors for a value. Return an empty array if valid. */
625
+ Errors(_value) {
626
+ return [];
627
+ }
628
+ /** Converts a value into this type */
629
+ Convert(value) {
630
+ return value;
631
+ }
632
+ /** Cleans a value according to this type */
633
+ Clean(value) {
634
+ return value;
635
+ }
636
+ /** Returns a default value for this type */
637
+ Default(value) {
638
+ return value;
639
+ }
640
+ /** Creates a new instance of this type */
641
+ Create() {
642
+ throw new Error("Create not implemented");
643
+ }
644
+ /** Clones this type */
645
+ Clone() {
646
+ throw Error("Clone not implemented");
647
+ }
648
+ };
649
+ /** Returns true if the given value is a Base type. */
650
+ function IsBase(value) {
651
+ return IsKind(value, "Base");
652
+ }
653
+ //#endregion
654
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/array.mjs
655
+ /** Creates an Array type. */
656
+ function Array$1(items, options) {
657
+ return Create({ "~kind": "Array" }, {
658
+ type: "array",
659
+ items
660
+ }, options);
661
+ }
662
+ /** Returns true if the given value is a TArray. */
663
+ function IsArray(value) {
664
+ return IsKind(value, "Array");
665
+ }
666
+ /** Extracts options from a TArray. */
667
+ function ArrayOptions(type) {
668
+ return Discard(type, [
669
+ "~kind",
670
+ "type",
671
+ "items"
672
+ ]);
673
+ }
674
+ //#endregion
675
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/async-iterator.mjs
676
+ /** Creates a AsyncIterator type. */
677
+ function AsyncIterator(iteratorItems, options) {
678
+ return Create({ "~kind": "AsyncIterator" }, {
679
+ type: "asyncIterator",
680
+ iteratorItems
681
+ }, options);
682
+ }
683
+ /** Returns true if the given value is a TAsyncIterator */
684
+ function IsAsyncIterator(value) {
685
+ return IsKind(value, "AsyncIterator");
686
+ }
687
+ /** Extracts options from a TAsyncIterator. */
688
+ function AsyncIteratorOptions(type) {
689
+ return Discard(type, [
690
+ "~kind",
691
+ "type",
692
+ "iteratorItems"
693
+ ]);
694
+ }
695
+ //#endregion
696
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/constructor.mjs
697
+ /** Creates a Constructor type. */
698
+ function Constructor(parameters, instanceType, options = {}) {
699
+ return Create({ "~kind": "Constructor" }, {
700
+ type: "constructor",
701
+ parameters,
702
+ instanceType
703
+ }, options);
704
+ }
705
+ /** Returns true if the given value is a TConstructor. */
706
+ function IsConstructor(value) {
707
+ return IsKind(value, "Constructor");
708
+ }
709
+ /** Extracts options from a TConstructor. */
710
+ function ConstructorOptions(type) {
711
+ return Discard(type, [
712
+ "~kind",
713
+ "type",
714
+ "parameters",
715
+ "instanceType"
716
+ ]);
717
+ }
718
+ //#endregion
719
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/function.mjs
720
+ /** Creates a Function type. */
721
+ function _Function_(parameters, returnType, options = {}) {
722
+ return Create({ ["~kind"]: "Function" }, {
723
+ type: "function",
724
+ parameters,
725
+ returnType
726
+ }, options);
727
+ }
728
+ /** Returns true if the given value is TFunction. */
729
+ function IsFunction(value) {
730
+ return IsKind(value, "Function");
731
+ }
732
+ /** Extracts options from a TFunction. */
733
+ function FunctionOptions(type) {
734
+ return Discard(type, [
735
+ "~kind",
736
+ "type",
737
+ "parameters",
738
+ "returnType"
739
+ ]);
740
+ }
741
+ //#endregion
742
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/ref.mjs
743
+ /** Creates a Ref type. */
744
+ function Ref(ref, options) {
745
+ return Create({ ["~kind"]: "Ref" }, { $ref: ref }, options);
746
+ }
747
+ /** Returns true if the given value is TRef. */
748
+ function IsRef(value) {
749
+ return IsKind(value, "Ref");
750
+ }
751
+ //#endregion
752
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/generic.mjs
753
+ /** Creates a Generic type. */
754
+ function Generic(parameters, expression) {
755
+ return Create({ "~kind": "Generic" }, {
756
+ type: "generic",
757
+ parameters,
758
+ expression
759
+ });
760
+ }
761
+ /** Returns true if the given value is a TGeneric. */
762
+ function IsGeneric(value) {
763
+ return IsKind(value, "Generic");
764
+ }
765
+ //#endregion
766
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/any.mjs
767
+ /** Creates a Any type. */
768
+ function Any(options) {
769
+ return Create({ ["~kind"]: "Any" }, {}, options);
770
+ }
771
+ /** Returns true if the given value is a TAny. */
772
+ function IsAny(value) {
773
+ return IsKind(value, "Any");
774
+ }
775
+ //#endregion
776
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/never.mjs
777
+ const NeverPattern = "(?!)";
778
+ /** Creates a Never type. */
779
+ function Never(options) {
780
+ return Create({ "~kind": "Never" }, { not: {} }, options);
781
+ }
782
+ /** Returns true if the given value is TNever. */
783
+ function IsNever(value) {
784
+ return IsKind(value, "Never");
785
+ }
786
+ //#endregion
787
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/properties.mjs
788
+ /** Creates a RequiredArray derived from the given TProperties value. */
789
+ function RequiredArray(properties) {
790
+ return Keys(properties).filter((key) => !IsOptional(properties[key]));
791
+ }
792
+ /** Extracts a tuple of keys from a TProperties value. */
793
+ function PropertyKeys(properties) {
794
+ return Keys(properties);
795
+ }
796
+ /** Extracts a tuple of property values from a TProperties value. */
797
+ function PropertyValues(properties) {
798
+ return Values(properties);
799
+ }
800
+ //#endregion
801
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/object.mjs
802
+ /** Creates an Object type. */
803
+ function _Object_(properties, options = {}) {
804
+ const requiredKeys = RequiredArray(properties);
805
+ return Create({ "~kind": "Object" }, {
806
+ type: "object",
807
+ ...requiredKeys.length > 0 ? { required: requiredKeys } : {},
808
+ properties
809
+ }, options);
810
+ }
811
+ /** Returns true if the given value is TObject. */
812
+ function IsObject(value) {
813
+ return IsKind(value, "Object");
814
+ }
815
+ /** Extracts options from a TObject. */
816
+ function ObjectOptions(type) {
817
+ return Discard(type, [
818
+ "~kind",
819
+ "type",
820
+ "properties",
821
+ "required"
822
+ ]);
823
+ }
824
+ //#endregion
825
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/union.mjs
826
+ /** Creates a Union type. */
827
+ function Union(anyOf, options = {}) {
828
+ return Create({ "~kind": "Union" }, { anyOf }, options);
829
+ }
830
+ /** Returns true if the given value is TUnion. */
831
+ function IsUnion(value) {
832
+ return IsKind(value, "Union");
833
+ }
834
+ /** Extracts options from a TUnion. */
835
+ function UnionOptions(type) {
836
+ return Discard(type, ["~kind", "anyOf"]);
837
+ }
838
+ //#endregion
839
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/unknown.mjs
840
+ /** Creates an Unknown type. */
841
+ function Unknown(options) {
842
+ return Create({ ["~kind"]: "Unknown" }, {}, options);
843
+ }
844
+ /** Returns true if the given value is TUnknown. */
845
+ function IsUnknown(value) {
846
+ return IsKind(value, "Unknown");
847
+ }
848
+ //#endregion
849
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/cyclic.mjs
850
+ /** Creates a Cyclic type. */
851
+ function Cyclic($defs, $ref, options) {
852
+ const defs = Keys($defs).reduce((result, key) => {
853
+ return {
854
+ ...result,
855
+ [key]: Update($defs[key], {}, { $id: key })
856
+ };
857
+ }, {});
858
+ return Create({ ["~kind"]: "Cyclic" }, {
859
+ $defs: defs,
860
+ $ref
861
+ }, options);
862
+ }
863
+ /** Returns true if the given value is a TCyclic. */
864
+ function IsCyclic(value) {
865
+ return IsKind(value, "Cyclic");
866
+ }
867
+ //#endregion
868
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/infer.mjs
869
+ /** Returns true if the given value is TInfer. */
870
+ function IsInfer(value) {
871
+ return IsKind(value, "Infer");
872
+ }
873
+ //#endregion
874
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/enum/typescript-enum-to-enum-values.mjs
875
+ function IsTypeScriptEnumLike(value) {
876
+ return IsObjectNotArray(value);
877
+ }
878
+ function TypeScriptEnumToEnumValues(type) {
879
+ return Keys(type).filter((key) => isNaN(key)).reduce((result, key) => [...result, type[key]], []);
880
+ }
881
+ //#endregion
882
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/enum.mjs
883
+ /** Creates an Enum type. */
884
+ function Enum(value, options) {
885
+ return Create({ "~kind": "Enum" }, { enum: IsTypeScriptEnumLike(value) ? TypeScriptEnumToEnumValues(value) : value }, options);
886
+ }
887
+ /** Returns true if the given value is a TEnum. */
888
+ function IsEnum(value) {
889
+ return IsKind(value, "Enum");
890
+ }
891
+ //#endregion
892
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/intersect.mjs
893
+ /** Creates a Intersect type. */
894
+ function Intersect(types, options = {}) {
895
+ return Create({ "~kind": "Intersect" }, { allOf: types }, options);
896
+ }
897
+ /** Returns true if the given value is TIntersect. */
898
+ function IsIntersect(value) {
899
+ return IsKind(value, "Intersect");
900
+ }
901
+ /** Extracts options from a TIntersect. */
902
+ function IntersectOptions(type) {
903
+ return Discard(type, ["~kind", "allOf"]);
904
+ }
905
+ //#endregion
906
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/unreachable/unreachable.mjs
907
+ /** Used for unreachable logic */
908
+ function Unreachable() {
909
+ throw new Error("Unreachable");
910
+ }
911
+ //#endregion
912
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/system/hashing/hash.mjs
913
+ var hash_exports = /* @__PURE__ */ __exportAll({
914
+ Hash: () => Hash,
915
+ HashCode: () => HashCode
916
+ });
917
+ function InstanceKeys(value) {
918
+ const propertyKeys = /* @__PURE__ */ new Set();
919
+ let current = value;
920
+ while (current && current !== Object.prototype) {
921
+ for (const key of Reflect.ownKeys(current)) if (key !== "constructor" && typeof key !== "symbol") propertyKeys.add(key);
922
+ current = Object.getPrototypeOf(current);
923
+ }
924
+ return [...propertyKeys];
925
+ }
926
+ function IsIEEE754(value) {
927
+ return typeof value === "number";
928
+ }
929
+ var ByteMarker;
930
+ (function(ByteMarker) {
931
+ ByteMarker[ByteMarker["Array"] = 0] = "Array";
932
+ ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
933
+ ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
934
+ ByteMarker[ByteMarker["Date"] = 3] = "Date";
935
+ ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
936
+ ByteMarker[ByteMarker["Function"] = 5] = "Function";
937
+ ByteMarker[ByteMarker["Null"] = 6] = "Null";
938
+ ByteMarker[ByteMarker["Number"] = 7] = "Number";
939
+ ByteMarker[ByteMarker["Object"] = 8] = "Object";
940
+ ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
941
+ ByteMarker[ByteMarker["String"] = 10] = "String";
942
+ ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
943
+ ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
944
+ ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
945
+ })(ByteMarker || (ByteMarker = {}));
946
+ let Accumulator = BigInt("14695981039346656037");
947
+ const [Prime, Size] = [BigInt("1099511628211"), BigInt("18446744073709551616")];
948
+ const Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
949
+ const F64 = new Float64Array(1);
950
+ const F64In = new DataView(F64.buffer);
951
+ const F64Out = new Uint8Array(F64.buffer);
952
+ function FNV1A64_OP(byte) {
953
+ Accumulator = Accumulator ^ Bytes[byte];
954
+ Accumulator = Accumulator * Prime % Size;
955
+ }
956
+ function FromArray$3(value) {
957
+ FNV1A64_OP(ByteMarker.Array);
958
+ for (const item of value) FromValue(item);
959
+ }
960
+ function FromBigInt(value) {
961
+ FNV1A64_OP(ByteMarker.BigInt);
962
+ F64In.setBigInt64(0, value);
963
+ for (const byte of F64Out) FNV1A64_OP(byte);
964
+ }
965
+ function FromBoolean(value) {
966
+ FNV1A64_OP(ByteMarker.Boolean);
967
+ FNV1A64_OP(value ? 1 : 0);
968
+ }
969
+ function FromConstructor(value) {
970
+ FNV1A64_OP(ByteMarker.Constructor);
971
+ FromValue(value.toString());
972
+ }
973
+ function FromDate(value) {
974
+ FNV1A64_OP(ByteMarker.Date);
975
+ FromValue(value.getTime());
976
+ }
977
+ function FromFunction(value) {
978
+ FNV1A64_OP(ByteMarker.Function);
979
+ FromValue(value.toString());
980
+ }
981
+ function FromNull(_value) {
982
+ FNV1A64_OP(ByteMarker.Null);
983
+ }
984
+ function FromNumber(value) {
985
+ FNV1A64_OP(ByteMarker.Number);
986
+ F64In.setFloat64(0, value, true);
987
+ for (const byte of F64Out) FNV1A64_OP(byte);
988
+ }
989
+ function FromObject$6(value) {
990
+ FNV1A64_OP(ByteMarker.Object);
991
+ for (const key of InstanceKeys(value).sort()) {
992
+ FromValue(key);
993
+ FromValue(value[key]);
994
+ }
995
+ }
996
+ function FromRegExp(value) {
997
+ FNV1A64_OP(ByteMarker.RegExp);
998
+ FromString(value.toString());
999
+ }
1000
+ const encoder = new TextEncoder();
1001
+ function FromString(value) {
1002
+ FNV1A64_OP(ByteMarker.String);
1003
+ for (const byte of encoder.encode(value)) FNV1A64_OP(byte);
1004
+ }
1005
+ function FromSymbol(value) {
1006
+ FNV1A64_OP(ByteMarker.Symbol);
1007
+ FromValue(value.toString());
1008
+ }
1009
+ function FromTypeArray(value) {
1010
+ FNV1A64_OP(ByteMarker.TypeArray);
1011
+ const buffer = new Uint8Array(value.buffer);
1012
+ for (let i = 0; i < buffer.length; i++) FNV1A64_OP(buffer[i]);
1013
+ }
1014
+ function FromUndefined(_value) {
1015
+ return FNV1A64_OP(ByteMarker.Undefined);
1016
+ }
1017
+ function FromValue(value) {
1018
+ return IsTypeArray(value) ? FromTypeArray(value) : IsDate(value) ? FromDate(value) : IsRegExp(value) ? FromRegExp(value) : IsBoolean$1(value) ? FromBoolean(value.valueOf()) : IsString$1(value) ? FromString(value.valueOf()) : IsNumber$1(value) ? FromNumber(value.valueOf()) : IsIEEE754(value) ? FromNumber(value) : IsArray$1(value) ? FromArray$3(value) : IsBoolean$2(value) ? FromBoolean(value) : IsBigInt$1(value) ? FromBigInt(value) : IsConstructor$1(value) ? FromConstructor(value) : IsNull$1(value) ? FromNull(value) : IsObject$1(value) ? FromObject$6(value) : IsString$2(value) ? FromString(value) : IsSymbol$1(value) ? FromSymbol(value) : IsUndefined$1(value) ? FromUndefined(value) : IsFunction$1(value) ? FromFunction(value) : Unreachable();
1019
+ }
1020
+ /** Generates a FNV1A-64 non cryptographic hash of the given value */
1021
+ function HashCode(value) {
1022
+ Accumulator = BigInt("14695981039346656037");
1023
+ FromValue(value);
1024
+ return Accumulator;
1025
+ }
1026
+ /** Generates a FNV1A-64 non cryptographic hash of the given value */
1027
+ function Hash(value) {
1028
+ return HashCode(value).toString(16).padStart(16, "0");
1029
+ }
1030
+ //#endregion
1031
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/_codec.mjs
1032
+ function IsCodec(value) {
1033
+ return IsSchema(value) && HasPropertyKey(value, "~codec") && IsObject$1(value["~codec"]) && HasPropertyKey(value["~codec"], "encode") && HasPropertyKey(value["~codec"], "decode");
1034
+ }
1035
+ //#endregion
1036
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/bigint.mjs
1037
+ const BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
1038
+ /** Creates a BigInt type. */
1039
+ function BigInt$1(options) {
1040
+ return Create({ "~kind": "BigInt" }, { type: "bigint" }, options);
1041
+ }
1042
+ /** Returns true if the given value is a TBigInt. */
1043
+ function IsBigInt(value) {
1044
+ return IsKind(value, "BigInt");
1045
+ }
1046
+ //#endregion
1047
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/boolean.mjs
1048
+ /** Creates a Boolean type. */
1049
+ function Boolean$1(options) {
1050
+ return Create({ "~kind": "Boolean" }, { type: "boolean" }, options);
1051
+ }
1052
+ /** Returns true if the given value is a TBoolean. */
1053
+ function IsBoolean(value) {
1054
+ return IsKind(value, "Boolean");
1055
+ }
1056
+ //#endregion
1057
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/integer.mjs
1058
+ const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
1059
+ /** Creates a Integer type. */
1060
+ function Integer(options) {
1061
+ return Create({ "~kind": "Integer" }, { type: "integer" }, options);
1062
+ }
1063
+ /** Returns true if the given value is TInteger. */
1064
+ function IsInteger(value) {
1065
+ return IsKind(value, "Integer");
1066
+ }
1067
+ //#endregion
1068
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/iterator.mjs
1069
+ /** Creates a Iterator type. */
1070
+ function Iterator(iteratorItems, options) {
1071
+ return Create({ "~kind": "Iterator" }, {
1072
+ type: "iterator",
1073
+ iteratorItems
1074
+ }, options);
1075
+ }
1076
+ /** Returns true if the given value is TIterator. */
1077
+ function IsIterator(value) {
1078
+ return IsKind(value, "Iterator");
1079
+ }
1080
+ /** Extracts options from a TIterator. */
1081
+ function IteratorOptions(type) {
1082
+ return Discard(type, [
1083
+ "~kind",
1084
+ "type",
1085
+ "iteratorItems"
1086
+ ]);
1087
+ }
1088
+ //#endregion
1089
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/literal.mjs
1090
+ var InvalidLiteralValue = class extends Error {
1091
+ constructor(value) {
1092
+ super(`Invalid Literal value`);
1093
+ Object.defineProperty(this, "cause", {
1094
+ value: { value },
1095
+ writable: false,
1096
+ configurable: false,
1097
+ enumerable: false
1098
+ });
1099
+ }
1100
+ };
1101
+ function LiteralTypeName(value) {
1102
+ return IsBigInt$1(value) ? "bigint" : IsBoolean$2(value) ? "boolean" : IsNumber$2(value) ? "number" : IsString$2(value) ? "string" : (() => {
1103
+ throw new InvalidLiteralValue(value);
1104
+ })();
1105
+ }
1106
+ /** Creates a Literal type. */
1107
+ function Literal(value, options) {
1108
+ return Create({ "~kind": "Literal" }, {
1109
+ type: LiteralTypeName(value),
1110
+ const: value
1111
+ }, options);
1112
+ }
1113
+ /** Returns true if the given value is a TLiteralValue. */
1114
+ function IsLiteralValue(value) {
1115
+ return IsBigInt$1(value) || IsBoolean$2(value) || IsNumber$2(value) || IsString$2(value);
1116
+ }
1117
+ /** Returns true if the given value is TLiteral<bigint>. */
1118
+ function IsLiteralBigInt(value) {
1119
+ return IsLiteral(value) && IsBigInt$1(value.const);
1120
+ }
1121
+ /** Returns true if the given value is TLiteral<boolean>. */
1122
+ function IsLiteralBoolean(value) {
1123
+ return IsLiteral(value) && IsBoolean$2(value.const);
1124
+ }
1125
+ /** Returns true if the given value is TLiteral<number>. */
1126
+ function IsLiteralNumber(value) {
1127
+ return IsLiteral(value) && IsNumber$2(value.const);
1128
+ }
1129
+ /** Returns true if the given value is TLiteral<string>. */
1130
+ function IsLiteralString(value) {
1131
+ return IsLiteral(value) && IsString$2(value.const);
1132
+ }
1133
+ /** Returns true if the given value is TLiteral. */
1134
+ function IsLiteral(value) {
1135
+ return IsKind(value, "Literal");
1136
+ }
1137
+ //#endregion
1138
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/null.mjs
1139
+ /** Creates a Null type. */
1140
+ function Null(options) {
1141
+ return Create({ "~kind": "Null" }, { type: "null" }, options);
1142
+ }
1143
+ /** Returns true if the given value is TNull. */
1144
+ function IsNull(value) {
1145
+ return IsKind(value, "Null");
1146
+ }
1147
+ //#endregion
1148
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/number.mjs
1149
+ const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";
1150
+ /** Creates a Number type. */
1151
+ function Number$1(options) {
1152
+ return Create({ "~kind": "Number" }, { type: "number" }, options);
1153
+ }
1154
+ /** Returns true if the given value is a TNumber. */
1155
+ function IsNumber(value) {
1156
+ return IsKind(value, "Number");
1157
+ }
1158
+ //#endregion
1159
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/symbol.mjs
1160
+ /** Creates a Symbol type. */
1161
+ function Symbol$1(options) {
1162
+ return Create({ "~kind": "Symbol" }, { type: "symbol" }, options);
1163
+ }
1164
+ /** Returns true if the given value is TSymbol. */
1165
+ function IsSymbol(value) {
1166
+ return IsKind(value, "Symbol");
1167
+ }
1168
+ //#endregion
1169
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/string.mjs
1170
+ /** Creates a String type. */
1171
+ function String$1(options) {
1172
+ return Create({ "~kind": "String" }, { type: "string" }, options);
1173
+ }
1174
+ /** Returns true if the given value is TString. */
1175
+ function IsString(value) {
1176
+ return IsKind(value, "String");
1177
+ }
1178
+ //#endregion
1179
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/patterns/pattern.mjs
1180
+ /** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
1181
+ function ParsePatternIntoTypes(pattern) {
1182
+ const parsed = Pattern(pattern);
1183
+ return IsEqual(parsed.length, 2) ? parsed[0] : [];
1184
+ }
1185
+ //#endregion
1186
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/template-literal/is-finite.mjs
1187
+ function FromLiteral$3(_value) {
1188
+ return true;
1189
+ }
1190
+ function FromTypesReduce(types) {
1191
+ const [left, ...right] = types;
1192
+ return IsSchema(left) ? FromType$16(left) ? FromTypesReduce(right) : false : true;
1193
+ }
1194
+ function FromTypes$3(types) {
1195
+ return IsEqual(types.length, 0) ? false : FromTypesReduce(types);
1196
+ }
1197
+ function FromType$16(type) {
1198
+ return IsUnion(type) ? FromTypes$3(type.anyOf) : IsLiteral(type) ? FromLiteral$3(type.const) : false;
1199
+ }
1200
+ /** Returns true if the given TemplateLiteral types yields a finite variant set */
1201
+ function IsTemplateLiteralFinite(types) {
1202
+ return FromTypes$3(types);
1203
+ }
1204
+ //#endregion
1205
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/template-literal/create.mjs
1206
+ function TemplateLiteralCreate(pattern) {
1207
+ return Create({ ["~kind"]: "TemplateLiteral" }, {
1208
+ type: "string",
1209
+ pattern
1210
+ }, {});
1211
+ }
1212
+ //#endregion
1213
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/template-literal/decode.mjs
1214
+ function FromLiteralPush(variants, value, result = []) {
1215
+ const [left, ...right] = variants;
1216
+ return IsString$2(left) ? FromLiteralPush(right, value, [...result, `${left}${value}`]) : result;
1217
+ }
1218
+ function FromLiteral$2(variants, value) {
1219
+ return IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value);
1220
+ }
1221
+ function FromUnion$7(variants, types, result = []) {
1222
+ const [left, ...right] = types;
1223
+ return IsSchema(left) ? FromUnion$7(variants, right, [...result, ...FromType$15(variants, left)]) : result;
1224
+ }
1225
+ function FromType$15(variants, type) {
1226
+ return IsUnion(type) ? FromUnion$7(variants, type.anyOf) : IsLiteral(type) ? FromLiteral$2(variants, type.const) : Unreachable();
1227
+ }
1228
+ function DecodeFromSpan(variants, types) {
1229
+ const [left, ...right] = types;
1230
+ return IsSchema(left) ? DecodeFromSpan(FromType$15(variants, left), right) : variants;
1231
+ }
1232
+ function VariantsToLiterals(variants) {
1233
+ return variants.map((variant) => Literal(variant));
1234
+ }
1235
+ function DecodeTypesAsUnion(types) {
1236
+ return Union(VariantsToLiterals(DecodeFromSpan([], types)));
1237
+ }
1238
+ function DecodeTypes(types) {
1239
+ return IsEqual(types.length, 0) ? Unreachable() : IsEqual(types.length, 1) && IsLiteral(types[0]) ? types[0] : DecodeTypesAsUnion(types);
1240
+ }
1241
+ /**
1242
+ * (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
1243
+ * TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
1244
+ * TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
1245
+ * decoding algorithm is needed. (for review)
1246
+ */
1247
+ function TemplateLiteralDecodeUnsafe(pattern) {
1248
+ const types = ParsePatternIntoTypes(pattern);
1249
+ return IsEqual(types.length, 0) ? String$1() : IsTemplateLiteralFinite(types) ? DecodeTypes(types) : TemplateLiteralCreate(pattern);
1250
+ }
1251
+ /** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
1252
+ function TemplateLiteralDecode(pattern) {
1253
+ const decoded = TemplateLiteralDecodeUnsafe(pattern);
1254
+ return IsTemplateLiteral(decoded) ? String$1() : decoded;
1255
+ }
1256
+ //#endregion
1257
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/record-create.mjs
1258
+ function CreateRecord(key, value) {
1259
+ const type = "object";
1260
+ const patternProperties = { [key]: value };
1261
+ return Create({ ["~kind"]: "Record" }, {
1262
+ type,
1263
+ patternProperties
1264
+ });
1265
+ }
1266
+ //#endregion
1267
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-any.mjs
1268
+ function FromAnyKey(value) {
1269
+ return CreateRecord(StringKey, value);
1270
+ }
1271
+ //#endregion
1272
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-boolean.mjs
1273
+ function FromBooleanKey(value) {
1274
+ return _Object_({
1275
+ true: value,
1276
+ false: value
1277
+ });
1278
+ }
1279
+ //#endregion
1280
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/enum/enum-to-union.mjs
1281
+ function FromEnumValue(value) {
1282
+ return IsString$2(value) || IsNumber$2(value) ? Literal(value) : IsNull$1(value) ? Null() : Never();
1283
+ }
1284
+ function EnumValuesToVariants(values) {
1285
+ return values.map((value) => FromEnumValue(value));
1286
+ }
1287
+ function EnumValuesToUnion(values) {
1288
+ return Union(EnumValuesToVariants(values));
1289
+ }
1290
+ function EnumToUnion(type) {
1291
+ return EnumValuesToUnion(type.enum);
1292
+ }
1293
+ //#endregion
1294
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-enum.mjs
1295
+ function FromEnumKey(values, value) {
1296
+ return FromKey(EnumValuesToUnion(values), value);
1297
+ }
1298
+ //#endregion
1299
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-integer.mjs
1300
+ function FromIntegerKey(_key, value) {
1301
+ return CreateRecord(IntegerKey, value);
1302
+ }
1303
+ //#endregion
1304
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/tuple.mjs
1305
+ /** Creates a Tuple type. */
1306
+ function Tuple(types, options = {}) {
1307
+ const [items, minItems, additionalItems] = [
1308
+ types,
1309
+ types.length,
1310
+ false
1311
+ ];
1312
+ return Create({ ["~kind"]: "Tuple" }, {
1313
+ type: "array",
1314
+ additionalItems,
1315
+ items,
1316
+ minItems
1317
+ }, options);
1318
+ }
1319
+ /** Returns true if the given value is TTuple. */
1320
+ function IsTuple(value) {
1321
+ return IsKind(value, "Tuple");
1322
+ }
1323
+ /** Extracts options from a TTuple. */
1324
+ function TupleOptions(type) {
1325
+ return Discard(type, [
1326
+ "~kind",
1327
+ "type",
1328
+ "items",
1329
+ "minItems",
1330
+ "additionalItems"
1331
+ ]);
1332
+ }
1333
+ //#endregion
1334
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/tuple/to-object.mjs
1335
+ function TupleElementsToProperties(types) {
1336
+ return types.reduceRight((result, right, index) => {
1337
+ return {
1338
+ [index]: right,
1339
+ ...result
1340
+ };
1341
+ }, {});
1342
+ }
1343
+ function TupleToObject(type) {
1344
+ return _Object_(TupleElementsToProperties(type.items));
1345
+ }
1346
+ //#endregion
1347
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/composite.mjs
1348
+ function IsReadonlyProperty(left, right) {
1349
+ return IsReadonly(left) ? IsReadonly(right) ? true : false : false;
1350
+ }
1351
+ function IsOptionalProperty(left, right) {
1352
+ return IsOptional(left) ? IsOptional(right) ? true : false : false;
1353
+ }
1354
+ function CompositeProperty(left, right) {
1355
+ const isReadonly = IsReadonlyProperty(left, right);
1356
+ const isOptional = IsOptionalProperty(left, right);
1357
+ const property = ReadonlyRemove(OptionalRemove(EvaluateIntersect([left, right])));
1358
+ return isReadonly && isOptional ? ReadonlyAdd(OptionalAdd(property)) : isReadonly && !isOptional ? ReadonlyAdd(property) : !isReadonly && isOptional ? OptionalAdd(property) : property;
1359
+ }
1360
+ function CompositePropertyKey(left, right, key) {
1361
+ return key in left ? key in right ? CompositeProperty(left[key], right[key]) : left[key] : key in right ? right[key] : Never();
1362
+ }
1363
+ function CompositeProperties(left, right) {
1364
+ return [...new Set([...Keys(right), ...Keys(left)])].reduce((result, key) => {
1365
+ return {
1366
+ ...result,
1367
+ [key]: CompositePropertyKey(left, right, key)
1368
+ };
1369
+ }, {});
1370
+ }
1371
+ function GetProperties(type) {
1372
+ return IsObject(type) ? type.properties : IsTuple(type) ? TupleElementsToProperties(type.items) : Unreachable();
1373
+ }
1374
+ function Composite(left, right) {
1375
+ return _Object_(CompositeProperties(GetProperties(left), GetProperties(right)));
1376
+ }
1377
+ //#endregion
1378
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
1379
+ function Narrow(left, right) {
1380
+ const result = Compare(left, right);
1381
+ return IsEqual(result, "left-inside") ? left : IsEqual(result, "right-inside") ? right : IsEqual(result, "equal") ? right : Never();
1382
+ }
1383
+ //#endregion
1384
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
1385
+ function IsObjectLike(type) {
1386
+ return IsObject(type) || IsTuple(type);
1387
+ }
1388
+ function IsUnionOperand(left, right) {
1389
+ const isUnionLeft = IsUnion(left);
1390
+ const isUnionRight = IsUnion(right);
1391
+ return isUnionLeft || isUnionRight;
1392
+ }
1393
+ function DistributeOperation(left, right) {
1394
+ const evaluatedLeft = EvaluateType(left);
1395
+ const evaluatedRight = EvaluateType(right);
1396
+ const isUnionOperand = IsUnionOperand(evaluatedLeft, evaluatedRight);
1397
+ const isObjectLeft = IsObjectLike(evaluatedLeft);
1398
+ const IsObjectRight = IsObjectLike(evaluatedRight);
1399
+ return isUnionOperand ? EvaluateIntersect([evaluatedLeft, evaluatedRight]) : isObjectLeft && IsObjectRight ? Composite(evaluatedLeft, evaluatedRight) : isObjectLeft && !IsObjectRight ? evaluatedLeft : !isObjectLeft && IsObjectRight ? evaluatedRight : Narrow(evaluatedLeft, evaluatedRight);
1400
+ }
1401
+ function DistributeType(type, types, result = []) {
1402
+ const [left, ...right] = types;
1403
+ return !IsUndefined$1(left) ? DistributeType(type, right, [...result, DistributeOperation(type, left)]) : result.length === 0 ? [type] : result;
1404
+ }
1405
+ function DistributeUnion(types, distribution, result = []) {
1406
+ const [left, ...right] = types;
1407
+ return IsSchema(left) ? DistributeUnion(right, distribution, [...result, ...Distribute$1([left], distribution)]) : result;
1408
+ }
1409
+ function Distribute$1(types, result = []) {
1410
+ const [left, ...right] = types;
1411
+ return IsSchema(left) ? IsUnion(left) ? Distribute$1(right, DistributeUnion(left.anyOf, result)) : Distribute$1(right, DistributeType(left, result)) : result;
1412
+ }
1413
+ //#endregion
1414
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
1415
+ function EvaluateIntersect(types) {
1416
+ return Broaden(Distribute$1(types));
1417
+ }
1418
+ function EvaluateUnion(types) {
1419
+ return Broaden(types);
1420
+ }
1421
+ function EvaluateType(type) {
1422
+ return IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
1423
+ }
1424
+ function EvaluateUnionFast(types) {
1425
+ return IsEqual(types.length, 1) ? types[0] : IsEqual(types.length, 0) ? Never() : Union(types);
1426
+ }
1427
+ //#endregion
1428
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-intersect.mjs
1429
+ function FromIntersectKey(types, value) {
1430
+ return FromKey(EvaluateIntersect(types), value);
1431
+ }
1432
+ //#endregion
1433
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-literal.mjs
1434
+ function FromLiteralKey(key, value) {
1435
+ return IsString$2(key) || IsNumber$2(key) ? _Object_({ [key]: value }) : IsEqual(key, false) ? _Object_({ false: value }) : IsEqual(key, true) ? _Object_({ true: value }) : _Object_({});
1436
+ }
1437
+ //#endregion
1438
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-number.mjs
1439
+ function FromNumberKey(_key, value) {
1440
+ return CreateRecord(NumberKey, value);
1441
+ }
1442
+ //#endregion
1443
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-string.mjs
1444
+ function FromStringKey(key, value) {
1445
+ return HasPropertyKey(key, "pattern") && (IsString$2(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
1446
+ }
1447
+ //#endregion
1448
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-template-literal.mjs
1449
+ function FromTemplateKey(pattern, value) {
1450
+ return IsTemplateLiteralFinite(ParsePatternIntoTypes(pattern)) ? FromKey(TemplateLiteralDecode(pattern), value) : CreateRecord(pattern, value);
1451
+ }
1452
+ //#endregion
1453
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
1454
+ function FlattenType(type) {
1455
+ return IsUnion(type) ? Flatten(type.anyOf) : [type];
1456
+ }
1457
+ function Flatten(types) {
1458
+ return types.reduce((result, type) => {
1459
+ return [...result, ...FlattenType(type)];
1460
+ }, []);
1461
+ }
1462
+ //#endregion
1463
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key-union.mjs
1464
+ function StringOrNumberCheck(types) {
1465
+ return types.some((type) => IsString(type) || IsNumber(type) || IsInteger(type));
1466
+ }
1467
+ function TryBuildRecord(types, value) {
1468
+ return IsEqual(StringOrNumberCheck(types), true) ? CreateRecord(StringKey, value) : void 0;
1469
+ }
1470
+ function CreateProperties(types, value) {
1471
+ return types.reduce((result, left) => {
1472
+ return IsLiteral(left) && (IsString$2(left.const) || IsNumber$2(left.const)) ? {
1473
+ ...result,
1474
+ [left.const]: value
1475
+ } : result;
1476
+ }, {});
1477
+ }
1478
+ function CreateObject(types, value) {
1479
+ return _Object_(CreateProperties(types, value));
1480
+ }
1481
+ function FromUnionKey(types, value) {
1482
+ const flattened = Flatten(types);
1483
+ const record = TryBuildRecord(flattened, value);
1484
+ return IsSchema(record) ? record : CreateObject(flattened, value);
1485
+ }
1486
+ //#endregion
1487
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/from-key.mjs
1488
+ function FromKey(key, value) {
1489
+ return IsAny(key) ? FromAnyKey(value) : IsBoolean(key) ? FromBooleanKey(value) : IsEnum(key) ? FromEnumKey(key.enum, value) : IsInteger(key) ? FromIntegerKey(key, value) : IsIntersect(key) ? FromIntersectKey(key.allOf, value) : IsLiteral(key) ? FromLiteralKey(key.const, value) : IsNumber(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_({});
1490
+ }
1491
+ //#endregion
1492
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/record/instantiate.mjs
1493
+ function RecordAction(key, value, options) {
1494
+ return CanInstantiate([key]) ? Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
1495
+ }
1496
+ function RecordInstantiate(context, state, key, value, options) {
1497
+ return RecordAction(InstantiateType(context, state, key), InstantiateType(context, state, value), options);
1498
+ }
1499
+ //#endregion
1500
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/record.mjs
1501
+ const IntegerKey = `^${IntegerPattern}$`;
1502
+ const NumberKey = `^${NumberPattern}$`;
1503
+ const StringKey = `^.*$`;
1504
+ /** Represents a deferred Record action. */
1505
+ function RecordDeferred(key, value, options = {}) {
1506
+ return Deferred("Record", [key, value], options);
1507
+ }
1508
+ /** Creates a Record type. */
1509
+ function Record(key, value, options = {}) {
1510
+ return RecordAction(key, value, options);
1511
+ }
1512
+ /** Creates a Record type from regular expression pattern. */
1513
+ function RecordFromPattern(key, value) {
1514
+ return CreateRecord(key, value);
1515
+ }
1516
+ /** Returns the raw string pattern used for the Record key */
1517
+ function RecordPattern(type) {
1518
+ return Keys(type.patternProperties)[0];
1519
+ }
1520
+ /** Returns the Record key as a TypeBox type */
1521
+ function RecordKey(type) {
1522
+ const pattern = RecordPattern(type);
1523
+ return IsEqual(pattern, StringKey) ? String$1() : IsEqual(pattern, IntegerKey) ? Integer() : IsEqual(pattern, NumberKey) ? Number$1() : TemplateLiteralDecodeUnsafe(pattern);
1524
+ }
1525
+ function RecordValue(type) {
1526
+ return type.patternProperties[RecordPattern(type)];
1527
+ }
1528
+ function IsRecord(value) {
1529
+ return IsKind(value, "Record");
1530
+ }
1531
+ //#endregion
1532
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/rest.mjs
1533
+ /** Creates a Rest instruction type. */
1534
+ function Rest(type) {
1535
+ return Create({ "~kind": "Rest" }, {
1536
+ type: "rest",
1537
+ items: type
1538
+ }, {});
1539
+ }
1540
+ /** Returns true if the given value is TRest. */
1541
+ function IsRest(value) {
1542
+ return IsKind(value, "Rest");
1543
+ }
1544
+ //#endregion
1545
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/undefined.mjs
1546
+ /** Creates a Undefined type. */
1547
+ function Undefined(options) {
1548
+ return Create({ "~kind": "Undefined" }, { type: "undefined" }, options);
1549
+ }
1550
+ /** Returns true if the given value is TUndefined. */
1551
+ function IsUndefined(value) {
1552
+ return IsKind(value, "Undefined");
1553
+ }
1554
+ //#endregion
1555
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/unsafe.mjs
1556
+ /** Creates a Unsafe type. */
1557
+ function Unsafe(schema) {
1558
+ return Create({ ["~kind"]: "Unsafe" }, {}, schema);
1559
+ }
1560
+ //#endregion
1561
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/void.mjs
1562
+ /** Returns true if the given value is TVoid. */
1563
+ function IsVoid(value) {
1564
+ return IsKind(value, "Void");
1565
+ }
1566
+ //#endregion
1567
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/mapping.mjs
1568
+ function PatternBigIntMapping(input) {
1569
+ return BigInt$1();
1570
+ }
1571
+ function PatternStringMapping(input) {
1572
+ return String$1();
1573
+ }
1574
+ function PatternNumberMapping(input) {
1575
+ return Number$1();
1576
+ }
1577
+ function PatternIntegerMapping(input) {
1578
+ return Integer();
1579
+ }
1580
+ function PatternNeverMapping(input) {
1581
+ return Never();
1582
+ }
1583
+ function PatternTextMapping(input) {
1584
+ return Literal(input);
1585
+ }
1586
+ function PatternBaseMapping(input) {
1587
+ return input;
1588
+ }
1589
+ function PatternGroupMapping(input) {
1590
+ return Union(input[1]);
1591
+ }
1592
+ function PatternUnionMapping(input) {
1593
+ return input.length === 3 ? [...input[0], ...input[2]] : input.length === 1 ? [...input[0]] : [];
1594
+ }
1595
+ function PatternTermMapping(input) {
1596
+ return [input[0], ...input[1]];
1597
+ }
1598
+ function PatternBodyMapping(input) {
1599
+ return input;
1600
+ }
1601
+ function PatternMapping(input) {
1602
+ return input[1];
1603
+ }
1604
+ //#endregion
1605
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/internal/match.mjs
1606
+ /** Checks the value is a Tuple-2 [string, string] result */
1607
+ function IsMatch(value) {
1608
+ return IsEqual(value.length, 2);
1609
+ }
1610
+ /** Matches on a result and dispatches either left or right arm */
1611
+ function Match$1(input, ok, fail) {
1612
+ return IsMatch(input) ? ok(input[0], input[1]) : fail();
1613
+ }
1614
+ //#endregion
1615
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/internal/take.mjs
1616
+ function TakeVariant(variant, input) {
1617
+ return IsEqual(input.indexOf(variant), 0) ? [variant, input.slice(variant.length)] : [];
1618
+ }
1619
+ /** Takes one of the given variants or fail */
1620
+ function Take(variants, input) {
1621
+ for (let i = 0; i < variants.length; i++) {
1622
+ const result = TakeVariant(variants[i], input);
1623
+ if (IsMatch(result)) return result;
1624
+ }
1625
+ return [];
1626
+ }
1627
+ //#endregion
1628
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/internal/char.mjs
1629
+ function Range(start, end) {
1630
+ return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
1631
+ }
1632
+ const Alpha = [...Range(97, 122), ...Range(65, 90)];
1633
+ const Digit = ["0", ...Range(49, 57)];
1634
+ //#endregion
1635
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/internal/trim.mjs
1636
+ const LineComment = "//";
1637
+ const OpenComment = "/*";
1638
+ const CloseComment = "*/";
1639
+ function DiscardMultilineComment(input) {
1640
+ const index = input.indexOf(CloseComment);
1641
+ return IsEqual(index, -1) ? "" : input.slice(index + 2);
1642
+ }
1643
+ function DiscardLineComment(input) {
1644
+ const index = input.indexOf("\n");
1645
+ return IsEqual(index, -1) ? "" : input.slice(index);
1646
+ }
1647
+ function TrimStartUntilNewline(input) {
1648
+ return input.replace(/^[ \t\r\f\v]+/, "");
1649
+ }
1650
+ function TrimWhitespace(input) {
1651
+ const trimmed = TrimStartUntilNewline(input);
1652
+ return trimmed.startsWith(OpenComment) ? TrimWhitespace(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? TrimWhitespace(DiscardLineComment(trimmed.slice(2))) : trimmed;
1653
+ }
1654
+ function Trim(input) {
1655
+ const trimmed = input.trimStart();
1656
+ return trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) : trimmed;
1657
+ }
1658
+ [...Digit];
1659
+ //#endregion
1660
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/const.mjs
1661
+ function TakeConst(const_, input) {
1662
+ return Take([const_], input);
1663
+ }
1664
+ /** Matches if next is the given Const value */
1665
+ function Const(const_, input) {
1666
+ return IsEqual(const_, "") ? ["", input] : const_.startsWith("\n") ? TakeConst(const_, TrimWhitespace(input)) : const_.startsWith(" ") ? TakeConst(const_, input) : TakeConst(const_, Trim(input));
1667
+ }
1668
+ [...[
1669
+ ...Alpha,
1670
+ "_",
1671
+ "$"
1672
+ ], ...Digit];
1673
+ [...Digit];
1674
+ //#endregion
1675
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/until.mjs
1676
+ function TakeOne(input) {
1677
+ return IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
1678
+ }
1679
+ function IsInputMatchSentinal(end, input) {
1680
+ const [left, ...right] = end;
1681
+ return IsString$2(left) ? input.startsWith(left) ? true : IsInputMatchSentinal(right, input) : false;
1682
+ }
1683
+ /** Match Input until but not including End. No match if End not found. */
1684
+ function Until(end, input, result = "") {
1685
+ return Match$1(TakeOne(input), (One, Rest) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest, `${result}${One}`), () => []);
1686
+ }
1687
+ //#endregion
1688
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/token/until_1.mjs
1689
+ /** Match Input until but not including End. No match if End not found or match is zero-length. */
1690
+ function Until_1(end, input) {
1691
+ return Match$1(Until(end, input), (Until, UntilRest) => IsEqual(Until, "") ? [] : [Until, UntilRest], () => []);
1692
+ }
1693
+ //#endregion
1694
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/script/parser.mjs
1695
+ const If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
1696
+ const PatternBigInt = (input) => If(Const("-?(?:0|[1-9][0-9]*)n", input), ([_0, input]) => [PatternBigIntMapping(_0), input]);
1697
+ const PatternString = (input) => If(Const(".*", input), ([_0, input]) => [PatternStringMapping(_0), input]);
1698
+ const PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?", input), ([_0, input]) => [PatternNumberMapping(_0), input]);
1699
+ const PatternInteger = (input) => If(Const("-?(?:0|[1-9][0-9]*)", input), ([_0, input]) => [PatternIntegerMapping(_0), input]);
1700
+ const PatternNever = (input) => If(Const("(?!)", input), ([_0, input]) => [PatternNeverMapping(_0), input]);
1701
+ const PatternText = (input) => If(Until_1([
1702
+ "-?(?:0|[1-9][0-9]*)n",
1703
+ ".*",
1704
+ "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",
1705
+ "-?(?:0|[1-9][0-9]*)",
1706
+ "(?!)",
1707
+ "(",
1708
+ ")",
1709
+ "$",
1710
+ "|"
1711
+ ], input), ([_0, input]) => [PatternTextMapping(_0), input]);
1712
+ const PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input]) => [_0, input], () => If(PatternString(input), ([_0, input]) => [_0, input], () => If(PatternNumber(input), ([_0, input]) => [_0, input], () => If(PatternInteger(input), ([_0, input]) => [_0, input], () => If(PatternNever(input), ([_0, input]) => [_0, input], () => If(PatternGroup(input), ([_0, input]) => [_0, input], () => If(PatternText(input), ([_0, input]) => [_0, input], () => []))))))), ([_0, input]) => [PatternBaseMapping(_0), input]);
1713
+ const PatternGroup = (input) => If(If(Const("(", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => [[
1714
+ _0,
1715
+ _1,
1716
+ _2
1717
+ ], input]))), ([_0, input]) => [PatternGroupMapping(_0), input]);
1718
+ const PatternUnion = (input) => If(If(If(PatternTerm(input), ([_0, input]) => If(Const("|", input), ([_1, input]) => If(PatternUnion(input), ([_2, input]) => [[
1719
+ _0,
1720
+ _1,
1721
+ _2
1722
+ ], input]))), ([_0, input]) => [_0, input], () => If(If(PatternTerm(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [PatternUnionMapping(_0), input]);
1723
+ const PatternTerm = (input) => If(If(PatternBase(input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [PatternTermMapping(_0), input]);
1724
+ const PatternBody = (input) => If(If(PatternUnion(input), ([_0, input]) => [_0, input], () => If(PatternTerm(input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [PatternBodyMapping(_0), input]);
1725
+ const Pattern = (input) => If(If(Const("^", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const("$", input), ([_2, input]) => [[
1726
+ _0,
1727
+ _1,
1728
+ _2
1729
+ ], input]))), ([_0, input]) => [PatternMapping(_0), input]);
1730
+ //#endregion
1731
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/template-literal/encode.mjs
1732
+ function JoinString(input) {
1733
+ return input.join("|");
1734
+ }
1735
+ function UnwrapTemplateLiteralPattern(pattern) {
1736
+ return pattern.slice(1, pattern.length - 1);
1737
+ }
1738
+ function EncodeLiteral(value, right, pattern) {
1739
+ return EncodeTypes(right, `${pattern}${value}`);
1740
+ }
1741
+ function EncodeBigInt(right, pattern) {
1742
+ return EncodeTypes(right, `${pattern}${BigIntPattern}`);
1743
+ }
1744
+ function EncodeInteger(right, pattern) {
1745
+ return EncodeTypes(right, `${pattern}${IntegerPattern}`);
1746
+ }
1747
+ function EncodeNumber(right, pattern) {
1748
+ return EncodeTypes(right, `${pattern}${NumberPattern}`);
1749
+ }
1750
+ function EncodeBoolean(right, pattern) {
1751
+ return EncodeType(Union([Literal("false"), Literal("true")]), right, pattern);
1752
+ }
1753
+ function EncodeString(right, pattern) {
1754
+ return EncodeTypes(right, `${pattern}.*`);
1755
+ }
1756
+ function EncodeTemplateLiteral(templatePattern, right, pattern) {
1757
+ return EncodeTypes(right, `${pattern}${UnwrapTemplateLiteralPattern(templatePattern)}`);
1758
+ }
1759
+ function EncodeTemplateLiteralDeferred(types, right, pattern) {
1760
+ return EncodeType(TemplateLiteralAction(types, {}), right, pattern);
1761
+ }
1762
+ function EncodeEnum(types, right, pattern) {
1763
+ return EncodeUnion(EnumValuesToVariants(types), right, pattern);
1764
+ }
1765
+ function EncodeUnion(types, right, pattern, result = []) {
1766
+ const [head, ...tail] = types;
1767
+ return IsSchema(head) ? EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]) : EncodeTypes(right, `${pattern}(${JoinString(result)})`);
1768
+ }
1769
+ function EncodeType(type, right, pattern) {
1770
+ return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt(type) ? EncodeBigInt(right, pattern) : IsBoolean(type) ? EncodeBoolean(right, pattern) : IsNumber(type) ? EncodeNumber(right, pattern) : IsString(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
1771
+ }
1772
+ function EncodeTypes(types, pattern) {
1773
+ const [left, ...right] = types;
1774
+ return IsSchema(left) ? EncodeType(left, right, pattern) : pattern;
1775
+ }
1776
+ function EncodePattern(types) {
1777
+ return `^${EncodeTypes(types, "")}$`;
1778
+ }
1779
+ /** Encodes a TemplateLiteral type sequence into a TemplateLiteral */
1780
+ function TemplateLiteralEncode(types) {
1781
+ return TemplateLiteralCreate(EncodePattern(types));
1782
+ }
1783
+ //#endregion
1784
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/template-literal/instantiate.mjs
1785
+ function TemplateLiteralAction(types, options) {
1786
+ return CanInstantiate(types) ? Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
1787
+ }
1788
+ function TemplateLiteralInstantiate(context, state, types, options) {
1789
+ return TemplateLiteralAction(InstantiateTypes(context, state, types), options);
1790
+ }
1791
+ //#endregion
1792
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/template-literal.mjs
1793
+ /** Creates a deferred TemplateLiteral action. */
1794
+ function TemplateLiteralDeferred(types, options = {}) {
1795
+ return Deferred("TemplateLiteral", [types], options);
1796
+ }
1797
+ /** Returns true if this value is a deferred Interface action. */
1798
+ function IsTemplateLiteralDeferred(value) {
1799
+ return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "TemplateLiteral");
1800
+ }
1801
+ /** Returns true if the given value is TTemplateLiteral. */
1802
+ function IsTemplateLiteral(value) {
1803
+ return IsKind(value, "TemplateLiteral");
1804
+ }
1805
+ //#endregion
1806
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/result.mjs
1807
+ function ExtendsUnion$1(inferred) {
1808
+ return Create({ ["~kind"]: "ExtendsUnion" }, { inferred });
1809
+ }
1810
+ function IsExtendsUnion(value) {
1811
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsUnion") && IsObject$1(value.inferred);
1812
+ }
1813
+ function ExtendsTrue(inferred) {
1814
+ return Create({ ["~kind"]: "ExtendsTrue" }, { inferred });
1815
+ }
1816
+ function IsExtendsTrue(value) {
1817
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsTrue") && IsObject$1(value.inferred);
1818
+ }
1819
+ function ExtendsFalse() {
1820
+ return Create({ ["~kind"]: "ExtendsFalse" }, {});
1821
+ }
1822
+ function IsExtendsFalse(value) {
1823
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], "ExtendsFalse");
1824
+ }
1825
+ function IsExtendsTrueLike(value) {
1826
+ return IsExtendsUnion(value) || IsExtendsTrue(value);
1827
+ }
1828
+ function Match(result, true_, false_) {
1829
+ return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
1830
+ }
1831
+ function TakeLeft(array, true_, false_) {
1832
+ return IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1));
1833
+ }
1834
+ //#endregion
1835
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/extends-right.mjs
1836
+ function ExtendsRightInfer(inferred, name, left, right) {
1837
+ return Match(ExtendsLeft(inferred, left, right), (checkInferred) => ExtendsTrue(Assign(Assign(inferred, checkInferred), { [name]: left })), () => ExtendsFalse());
1838
+ }
1839
+ function ExtendsRightAny(inferred, _left) {
1840
+ return ExtendsTrue(inferred);
1841
+ }
1842
+ function ExtendsRightEnum(inferred, left, right) {
1843
+ return ExtendsLeft(inferred, left, EnumValuesToUnion(right));
1844
+ }
1845
+ function ExtendsRightIntersect(inferred, left, right) {
1846
+ return TakeLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsRightIntersect(inferred, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
1847
+ }
1848
+ function ExtendsRightTemplateLiteral(inferred, left, right) {
1849
+ return ExtendsLeft(inferred, left, TemplateLiteralDecode(right));
1850
+ }
1851
+ function ExtendsRightUnion(inferred, left, right) {
1852
+ return TakeLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
1853
+ }
1854
+ function ExtendsRight(inferred, left, right) {
1855
+ 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();
1856
+ }
1857
+ //#endregion
1858
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/any.mjs
1859
+ function ExtendsAny(inferred, left, right) {
1860
+ return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion$1(inferred);
1861
+ }
1862
+ //#endregion
1863
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/array.mjs
1864
+ function ExtendsImmutable(left, right) {
1865
+ const isImmutableLeft = IsImmutable(left);
1866
+ const isImmutableRight = IsImmutable(right);
1867
+ return isImmutableLeft && isImmutableRight ? true : !isImmutableLeft && isImmutableRight ? true : isImmutableLeft && !isImmutableRight ? false : true;
1868
+ }
1869
+ function ExtendsArray(inferred, arrayLeft, left, right) {
1870
+ return IsArray(right) ? ExtendsImmutable(arrayLeft, right) ? ExtendsLeft(inferred, left, right.items) : ExtendsFalse() : ExtendsRight(inferred, arrayLeft, right);
1871
+ }
1872
+ //#endregion
1873
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/async-iterator.mjs
1874
+ function ExtendsAsyncIterator(inferred, left, right) {
1875
+ return IsAsyncIterator(right) ? ExtendsLeft(inferred, left, right.iteratorItems) : ExtendsRight(inferred, AsyncIterator(left), right);
1876
+ }
1877
+ //#endregion
1878
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/bigint.mjs
1879
+ function ExtendsBigInt(inferred, left, right) {
1880
+ return IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1881
+ }
1882
+ //#endregion
1883
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/boolean.mjs
1884
+ function ExtendsBoolean(inferred, left, right) {
1885
+ return IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1886
+ }
1887
+ //#endregion
1888
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/parameters.mjs
1889
+ function ParameterCompare(inferred, left, leftRest, right, rightRest) {
1890
+ const checkLeft = IsInfer(right) ? left : right;
1891
+ const checkRight = IsInfer(right) ? right : left;
1892
+ const isLeftOptional = IsOptional(left);
1893
+ const isRightOptional = IsOptional(right);
1894
+ return !isLeftOptional && isRightOptional ? ExtendsFalse() : Match(ExtendsLeft(inferred, checkLeft, checkRight), (inferred) => ExtendsParameters(inferred, leftRest, rightRest), () => ExtendsFalse());
1895
+ }
1896
+ function ParameterRight(inferred, left, leftRest, rightRest) {
1897
+ return TakeLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) ? ExtendsTrue(inferred) : ExtendsFalse());
1898
+ }
1899
+ function ParametersLeft(inferred, left, rightRest) {
1900
+ return TakeLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => ExtendsTrue(inferred));
1901
+ }
1902
+ function ExtendsParameters(inferred, left, right) {
1903
+ return ParametersLeft(inferred, left, right);
1904
+ }
1905
+ //#endregion
1906
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/return-type.mjs
1907
+ function ExtendsReturnType(inferred, left, right) {
1908
+ return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsLeft(inferred, left, right);
1909
+ }
1910
+ //#endregion
1911
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/constructor.mjs
1912
+ function ExtendsConstructor(inferred, parameters, returnType, right) {
1913
+ return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsConstructor(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["instanceType"]), () => ExtendsFalse()) : ExtendsFalse();
1914
+ }
1915
+ //#endregion
1916
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/enum.mjs
1917
+ function ExtendsEnum(inferred, left, right) {
1918
+ return ExtendsLeft(inferred, EnumToUnion(left), right);
1919
+ }
1920
+ //#endregion
1921
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/function.mjs
1922
+ function ExtendsFunction(inferred, parameters, returnType, right) {
1923
+ return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsFunction(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["returnType"]), () => ExtendsFalse()) : ExtendsFalse();
1924
+ }
1925
+ //#endregion
1926
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/integer.mjs
1927
+ function ExtendsInteger(inferred, left, right) {
1928
+ return IsInteger(right) ? ExtendsTrue(inferred) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1929
+ }
1930
+ //#endregion
1931
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/intersect.mjs
1932
+ function ExtendsIntersect(inferred, left, right) {
1933
+ return ExtendsLeft(inferred, EvaluateIntersect(left), right);
1934
+ }
1935
+ //#endregion
1936
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/iterator.mjs
1937
+ function ExtendsIterator(inferred, left, right) {
1938
+ return IsIterator(right) ? ExtendsLeft(inferred, left, right.iteratorItems) : ExtendsRight(inferred, Iterator(left), right);
1939
+ }
1940
+ //#endregion
1941
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/literal.mjs
1942
+ function ExtendsLiteralValue(inferred, left, right) {
1943
+ return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
1944
+ }
1945
+ function ExtendsLiteralBigInt(inferred, left, right) {
1946
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1947
+ }
1948
+ function ExtendsLiteralBoolean(inferred, left, right) {
1949
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1950
+ }
1951
+ function ExtendsLiteralNumber(inferred, left, right) {
1952
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1953
+ }
1954
+ function ExtendsLiteralString(inferred, left, right) {
1955
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1956
+ }
1957
+ function ExtendsLiteral(inferred, left, right) {
1958
+ return IsBigInt$1(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) : IsBoolean$2(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) : IsNumber$2(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) : IsString$2(left.const) ? ExtendsLiteralString(inferred, left.const, right) : Unreachable();
1959
+ }
1960
+ //#endregion
1961
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/never.mjs
1962
+ function ExtendsNever(inferred, left, right) {
1963
+ return IsInfer(right) ? ExtendsRight(inferred, left, right) : ExtendsTrue(inferred);
1964
+ }
1965
+ //#endregion
1966
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/null.mjs
1967
+ function ExtendsNull(inferred, left, right) {
1968
+ return IsNull(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1969
+ }
1970
+ //#endregion
1971
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/number.mjs
1972
+ function ExtendsNumber(inferred, left, right) {
1973
+ return IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1974
+ }
1975
+ //#endregion
1976
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/object.mjs
1977
+ function ExtendsPropertyOptional(inferred, left, right) {
1978
+ return IsOptional(left) ? IsOptional(right) ? ExtendsTrue(inferred) : ExtendsFalse() : ExtendsTrue(inferred);
1979
+ }
1980
+ function ExtendsProperty(inferred, left, right) {
1981
+ return IsInfer(right) && IsNever(right.extends) ? ExtendsFalse() : Match(ExtendsLeft(inferred, left, right), (inferred) => ExtendsPropertyOptional(inferred, left, right), () => ExtendsFalse());
1982
+ }
1983
+ function ExtractInferredProperties(keys, properties) {
1984
+ return keys.reduce((result, key) => {
1985
+ return key in properties ? IsExtendsTrueLike(properties[key]) ? {
1986
+ ...result,
1987
+ ...properties[key].inferred
1988
+ } : Unreachable() : Unreachable();
1989
+ }, {});
1990
+ }
1991
+ function ExtendsPropertiesComparer(inferred, left, right) {
1992
+ const properties = {};
1993
+ for (const rightKey of Keys(right)) properties[rightKey] = rightKey in left ? ExtendsProperty({}, left[rightKey], right[rightKey]) : IsOptional(right[rightKey]) ? IsInfer(right[rightKey]) ? ExtendsTrue(Assign(inferred, { [right[rightKey].name]: right[rightKey].extends })) : ExtendsTrue(inferred) : ExtendsFalse();
1994
+ const checked = Values(properties).every((result) => IsExtendsTrueLike(result));
1995
+ const extracted = checked ? ExtractInferredProperties(Keys(properties), properties) : {};
1996
+ return checked ? ExtendsTrue(extracted) : ExtendsFalse();
1997
+ }
1998
+ function ExtendsProperties(inferred, left, right) {
1999
+ const compared = ExtendsPropertiesComparer(inferred, left, right);
2000
+ return IsExtendsTrueLike(compared) ? ExtendsTrue(Assign(inferred, compared.inferred)) : ExtendsFalse();
2001
+ }
2002
+ function ExtendsObjectToObject(inferred, left, right) {
2003
+ return ExtendsProperties(inferred, left, right);
2004
+ }
2005
+ function ExtendsObject(inferred, left, right) {
2006
+ return IsObject(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_(left), right);
2007
+ }
2008
+ //#endregion
2009
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/promise.mjs
2010
+ function ExtendsPromise(inferred, left, right) {
2011
+ return IsPromise(right) ? ExtendsLeft(inferred, left, right.item) : ExtendsRight(inferred, _Promise_(left), right);
2012
+ }
2013
+ //#endregion
2014
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/string.mjs
2015
+ function ExtendsString(inferred, left, right) {
2016
+ return IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2017
+ }
2018
+ //#endregion
2019
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/symbol.mjs
2020
+ function ExtendsSymbol(inferred, left, right) {
2021
+ return IsSymbol(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2022
+ }
2023
+ //#endregion
2024
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/template-literal.mjs
2025
+ function ExtendsTemplateLiteral(inferred, left, right) {
2026
+ return ExtendsLeft(inferred, TemplateLiteralDecode(left), right);
2027
+ }
2028
+ //#endregion
2029
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/inference.mjs
2030
+ function Inferrable(name, type) {
2031
+ return Create({ "~kind": "Inferrable" }, {
2032
+ name,
2033
+ type
2034
+ }, {});
2035
+ }
2036
+ function IsInferable(value) {
2037
+ return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "name") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "Inferrable") && IsString$2(value.name) && IsObject$1(value.type);
2038
+ }
2039
+ function TryRestInferable(type) {
2040
+ return IsRest(type) ? IsInfer(type.items) ? IsArray(type.items.extends) ? Inferrable(type.items.name, type.items.extends.items) : IsUnknown(type.items.extends) ? Inferrable(type.items.name, type.items.extends) : void 0 : Unreachable() : void 0;
2041
+ }
2042
+ function TryInferable(type) {
2043
+ return IsInfer(type) ? Inferrable(type.name, type.extends) : void 0;
2044
+ }
2045
+ function TryInferResults(rest, right, result = []) {
2046
+ return TakeLeft(rest, (head, tail) => Match(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => void 0), () => result);
2047
+ }
2048
+ function InferTupleResult(inferred, name, left, right) {
2049
+ const results = TryInferResults(left, right);
2050
+ return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Tuple(results) })) : ExtendsFalse();
2051
+ }
2052
+ function InferUnionResult(inferred, name, left, right) {
2053
+ const results = TryInferResults(left, right);
2054
+ return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Union(results) })) : ExtendsFalse();
2055
+ }
2056
+ //#endregion
2057
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/tuple.mjs
2058
+ function Reverse(types) {
2059
+ return [...types].reverse();
2060
+ }
2061
+ function ApplyReverse(types, reversed) {
2062
+ return reversed ? Reverse(types) : types;
2063
+ }
2064
+ function Reversed(types) {
2065
+ const first = types.length > 0 ? types[0] : void 0;
2066
+ return IsSchema(IsSchema(first) ? TryRestInferable(first) : void 0);
2067
+ }
2068
+ function ElementsCompare(inferred, reversed, left, leftRest, right, rightRest) {
2069
+ return Match(ExtendsLeft(inferred, left, right), (checkInferred) => Elements(checkInferred, reversed, leftRest, rightRest), () => ExtendsFalse());
2070
+ }
2071
+ function ElementsLeft(inferred, reversed, leftRest, right, rightRest) {
2072
+ const inferable = TryRestInferable(right);
2073
+ return IsInferable(inferable) ? InferTupleResult(inferred, inferable["name"], ApplyReverse(leftRest, reversed), inferable["type"]) : TakeLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => ExtendsFalse());
2074
+ }
2075
+ function ElementsRight(inferred, reversed, leftRest, rightRest) {
2076
+ return TakeLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => IsEqual(leftRest.length, 0) ? ExtendsTrue(inferred) : ExtendsFalse());
2077
+ }
2078
+ function Elements(inferred, reversed, leftRest, rightRest) {
2079
+ return ElementsRight(inferred, reversed, leftRest, rightRest);
2080
+ }
2081
+ function ExtendsTupleToTuple(inferred, left, right) {
2082
+ const instantiatedRight = InstantiateElements(inferred, { callstack: [] }, right);
2083
+ const reversed = Reversed(instantiatedRight);
2084
+ return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
2085
+ }
2086
+ function ExtendsTupleToArray(inferred, left, right) {
2087
+ const inferrable = TryInferable(right);
2088
+ return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : TakeLeft(left, (head, tail) => Match(ExtendsLeft(inferred, head, right), (inferred) => ExtendsTupleToArray(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
2089
+ }
2090
+ function ExtendsTuple(inferred, left, right) {
2091
+ const instantiatedLeft = InstantiateElements(inferred, { callstack: [] }, left);
2092
+ return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
2093
+ }
2094
+ //#endregion
2095
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/undefined.mjs
2096
+ function ExtendsUndefined(inferred, left, right) {
2097
+ return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2098
+ }
2099
+ //#endregion
2100
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/union.mjs
2101
+ function ExtendsUnionSome(inferred, type, unionTypes) {
2102
+ return TakeLeft(unionTypes, (head, tail) => Match(ExtendsLeft(inferred, type, head), (inferred) => ExtendsTrue(inferred), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
2103
+ }
2104
+ function ExtendsUnionLeft(inferred, left, right) {
2105
+ return TakeLeft(left, (head, tail) => Match(ExtendsUnionSome(inferred, head, right), (inferred) => ExtendsUnionLeft(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
2106
+ }
2107
+ function ExtendsUnion(inferred, left, right) {
2108
+ const inferrable = TryInferable(right);
2109
+ return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable.name, left, inferrable.type) : IsUnion(right) ? ExtendsUnionLeft(inferred, left, right.anyOf) : ExtendsUnionLeft(inferred, left, [right]);
2110
+ }
2111
+ //#endregion
2112
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/unknown.mjs
2113
+ function ExtendsUnknown(inferred, left, right) {
2114
+ return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
2115
+ }
2116
+ //#endregion
2117
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/void.mjs
2118
+ function ExtendsVoid(inferred, left, right) {
2119
+ return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2120
+ }
2121
+ //#endregion
2122
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/extends-left.mjs
2123
+ function ExtendsLeft(inferred, left, right) {
2124
+ return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray(left) ? ExtendsArray(inferred, left, left.items, right) : IsAsyncIterator(left) ? ExtendsAsyncIterator(inferred, left.iteratorItems, right) : IsBigInt(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsEnum(left) ? ExtendsEnum(inferred, left, right) : IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsIterator(left) ? ExtendsIterator(inferred, left.iteratorItems, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull(left) ? ExtendsNull(inferred, left, right) : IsNumber(left) ? ExtendsNumber(inferred, left, right) : IsObject(left) ? ExtendsObject(inferred, left.properties, right) : IsPromise(left) ? ExtendsPromise(inferred, left.item, right) : IsString(left) ? ExtendsString(inferred, left, right) : IsSymbol(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
2125
+ }
2126
+ //#endregion
2127
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/interface/instantiate.mjs
2128
+ function InterfaceOperation(heritage, properties) {
2129
+ return EvaluateIntersect([...heritage, _Object_(properties)]);
2130
+ }
2131
+ function InterfaceAction(heritage, properties, options) {
2132
+ return CanInstantiate(heritage) ? Update(InterfaceOperation(heritage, properties), {}, options) : InterfaceDeferred(heritage, properties, options);
2133
+ }
2134
+ function InterfaceInstantiate(context, state, heritage, properties, options) {
2135
+ return InterfaceAction(InstantiateTypes(context, state, heritage), InstantiateProperties(context, state, properties), options);
2136
+ }
2137
+ //#endregion
2138
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/interface.mjs
2139
+ /** Creates a deferred Interface action. */
2140
+ function InterfaceDeferred(heritage, properties, options = {}) {
2141
+ return Deferred("Interface", [heritage, properties], options);
2142
+ }
2143
+ /** Returns true if this value is a deferred Interface action. */
2144
+ function IsInterfaceDeferred(value) {
2145
+ return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "Interface");
2146
+ }
2147
+ //#endregion
2148
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/cyclic/check.mjs
2149
+ function FromRef$3(stack, context, ref) {
2150
+ return stack.includes(ref) ? true : FromType$14([...stack, ref], context, context[ref]);
2151
+ }
2152
+ function FromProperties$2(stack, context, properties) {
2153
+ return FromTypes$2(stack, context, PropertyValues(properties));
2154
+ }
2155
+ function FromTypes$2(stack, context, types) {
2156
+ const [left, ...right] = types;
2157
+ return IsSchema(left) ? FromType$14(stack, context, left) ? true : FromTypes$2(stack, context, right) : false;
2158
+ }
2159
+ function FromType$14(stack, context, type) {
2160
+ return IsRef(type) ? FromRef$3(stack, context, type.$ref) : IsArray(type) ? FromType$14(stack, context, type.items) : IsAsyncIterator(type) ? FromType$14(stack, context, type.iteratorItems) : IsConstructor(type) ? FromTypes$2(stack, context, [...type.parameters, type.instanceType]) : IsFunction(type) ? FromTypes$2(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties$2(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes$2(stack, context, type.allOf) : IsIterator(type) ? FromType$14(stack, context, type.iteratorItems) : IsObject(type) ? FromProperties$2(stack, context, type.properties) : IsPromise(type) ? FromType$14(stack, context, type.item) : IsUnion(type) ? FromTypes$2(stack, context, type.anyOf) : IsTuple(type) ? FromTypes$2(stack, context, type.items) : IsRecord(type) ? FromType$14(stack, context, RecordValue(type)) : false;
2161
+ }
2162
+ /** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */
2163
+ function CyclicCheck(stack, context, type) {
2164
+ return FromType$14(stack, context, type);
2165
+ }
2166
+ //#endregion
2167
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
2168
+ function ResolveCandidateKeys(context, keys) {
2169
+ return keys.reduce((result, left) => {
2170
+ return left in context ? CyclicCheck([left], context, context[left]) ? [...result, left] : result : Unreachable();
2171
+ }, []);
2172
+ }
2173
+ /** Returns keys for context types that need to be transformed to TCyclic. */
2174
+ function CyclicCandidates(context) {
2175
+ return ResolveCandidateKeys(context, PropertyKeys(context));
2176
+ }
2177
+ //#endregion
2178
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
2179
+ function FromRef$2(context, ref, result) {
2180
+ return result.includes(ref) ? result : ref in context ? FromType$13(context, context[ref], [...result, ref]) : Unreachable();
2181
+ }
2182
+ function FromProperties$1(context, properties, result) {
2183
+ return FromTypes$1(context, PropertyValues(properties), result);
2184
+ }
2185
+ function FromTypes$1(context, types, result) {
2186
+ return types.reduce((result, left) => {
2187
+ return FromType$13(context, left, result);
2188
+ }, result);
2189
+ }
2190
+ function FromType$13(context, type, result) {
2191
+ return IsRef(type) ? FromRef$2(context, type.$ref, result) : IsArray(type) ? FromType$13(context, type.items, result) : IsAsyncIterator(type) ? FromType$13(context, type.iteratorItems, result) : IsConstructor(type) ? FromTypes$1(context, [...type.parameters, type.instanceType], result) : IsFunction(type) ? FromTypes$1(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties$1(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes$1(context, type.allOf, result) : IsIterator(type) ? FromType$13(context, type.iteratorItems, result) : IsObject(type) ? FromProperties$1(context, type.properties, result) : IsPromise(type) ? FromType$13(context, type.item, result) : IsUnion(type) ? FromTypes$1(context, type.anyOf, result) : IsTuple(type) ? FromTypes$1(context, type.items, result) : IsRecord(type) ? FromType$13(context, RecordValue(type), result) : result;
2192
+ }
2193
+ /** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */
2194
+ function CyclicDependencies(context, key, type) {
2195
+ return FromType$13(context, type, [key]);
2196
+ }
2197
+ //#endregion
2198
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/cyclic/extends.mjs
2199
+ function FromRef$1(_ref) {
2200
+ return Any();
2201
+ }
2202
+ function FromProperties(properties) {
2203
+ return Keys(properties).reduce((result, key) => {
2204
+ return {
2205
+ ...result,
2206
+ [key]: FromType$12(properties[key])
2207
+ };
2208
+ }, {});
2209
+ }
2210
+ function FromTypes(types) {
2211
+ return types.reduce((result, left) => {
2212
+ return [...result, FromType$12(left)];
2213
+ }, []);
2214
+ }
2215
+ function FromType$12(type) {
2216
+ return IsRef(type) ? FromRef$1(type.$ref) : IsArray(type) ? Array$1(FromType$12(type.items), ArrayOptions(type)) : IsAsyncIterator(type) ? AsyncIterator(FromType$12(type.iteratorItems)) : IsConstructor(type) ? Constructor(FromTypes(type.parameters), FromType$12(type.instanceType)) : IsFunction(type) ? _Function_(FromTypes(type.parameters), FromType$12(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes(type.allOf)) : IsIterator(type) ? Iterator(FromType$12(type.iteratorItems)) : IsObject(type) ? _Object_(FromProperties(type.properties)) : IsPromise(type) ? _Promise_(FromType$12(type.item)) : IsRecord(type) ? Record(RecordKey(type), FromType$12(RecordValue(type))) : IsUnion(type) ? Union(FromTypes(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes(type.items)) : type;
2217
+ }
2218
+ function CyclicAnyFromParameters(defs, ref) {
2219
+ return ref in defs ? FromType$12(defs[ref]) : Unknown();
2220
+ }
2221
+ /** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/
2222
+ function CyclicExtends(type) {
2223
+ return CyclicAnyFromParameters(type.$defs, type.$ref);
2224
+ }
2225
+ //#endregion
2226
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
2227
+ function CyclicInterface(context, heritage, properties) {
2228
+ const instantiatedHeritage = InstantiateTypes(context, { callstack: [] }, heritage);
2229
+ const instantiatedProperties = InstantiateProperties({}, { callstack: [] }, properties);
2230
+ return EvaluateIntersect([...instantiatedHeritage, _Object_(instantiatedProperties)]);
2231
+ }
2232
+ function CyclicDefinitions(context, dependencies) {
2233
+ return Keys(context).filter((key) => dependencies.includes(key)).reduce((result, key) => {
2234
+ const type = context[key];
2235
+ const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;
2236
+ return {
2237
+ ...result,
2238
+ [key]: instantiatedType
2239
+ };
2240
+ }, {});
2241
+ }
2242
+ function InstantiateCyclic(context, ref, type) {
2243
+ return Cyclic(CyclicDefinitions(context, CyclicDependencies(context, ref, type)), ref);
2244
+ }
2245
+ //#endregion
2246
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/cyclic/target.mjs
2247
+ function Resolve(defs, ref) {
2248
+ return ref in defs ? IsRef(defs[ref]) ? Resolve(defs, defs[ref].$ref) : defs[ref] : Never();
2249
+ }
2250
+ /** Returns the target Type from the Defs or Never if target is non-resolvable */
2251
+ function CyclicTarget(defs, ref) {
2252
+ return Resolve(defs, ref);
2253
+ }
2254
+ //#endregion
2255
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/extends/extends.mjs
2256
+ function Normal(type) {
2257
+ return IsCyclic(type) ? CyclicExtends(type) : type;
2258
+ }
2259
+ /** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
2260
+ function Extends(inferred, left, right) {
2261
+ return ExtendsLeft(inferred, Normal(left), Normal(right));
2262
+ }
2263
+ //#endregion
2264
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/compare.mjs
2265
+ const ResultEqual = "equal";
2266
+ const ResultDisjoint = "disjoint";
2267
+ const ResultLeftInside = "left-inside";
2268
+ const ResultRightInside = "right-inside";
2269
+ /** Compares left and right types and determines their set relationship. */
2270
+ function Compare(left, right) {
2271
+ const extendsCheck = [IsUnknown(left) ? ExtendsFalse() : Extends({}, left, right), IsUnknown(left) ? ExtendsTrue({}) : Extends({}, right, left)];
2272
+ return IsExtendsTrueLike(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? ResultEqual : IsExtendsTrueLike(extendsCheck[0]) && IsExtendsFalse(extendsCheck[1]) ? ResultLeftInside : IsExtendsFalse(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? ResultRightInside : ResultDisjoint;
2273
+ }
2274
+ //#endregion
2275
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
2276
+ function BroadFilter(type, types) {
2277
+ return types.filter((left) => {
2278
+ return Compare(type, left) === "right-inside" ? false : true;
2279
+ });
2280
+ }
2281
+ function IsBroadestType(type, types) {
2282
+ return IsEqual(types.some((left) => {
2283
+ const result = Compare(type, left);
2284
+ return IsEqual(result, "left-inside") || IsEqual(result, "equal");
2285
+ }), false);
2286
+ }
2287
+ function BroadenType(type, types) {
2288
+ const evaluated = EvaluateType(type);
2289
+ return IsAny(evaluated) ? [evaluated] : IsBroadestType(evaluated, types) ? [...BroadFilter(evaluated, types), evaluated] : types;
2290
+ }
2291
+ function BroadenTypes(types) {
2292
+ return types.reduce((result, left) => {
2293
+ return IsObject(left) ? [...result, left] : IsNever(left) ? result : BroadenType(left, result);
2294
+ }, []);
2295
+ }
2296
+ /** Broadens a set of types and returns either the most broad type, or union or disjoint types. */
2297
+ function Broaden(types) {
2298
+ const flattened = Flatten(BroadenTypes(types));
2299
+ return flattened.length === 0 ? Never() : flattened.length === 1 ? flattened[0] : Union(flattened);
2300
+ }
2301
+ //#endregion
2302
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
2303
+ function EvaluateAction(type, options) {
2304
+ return Update(EvaluateType(type), {}, options);
2305
+ }
2306
+ function EvaluateInstantiate(context, state, type, options) {
2307
+ return EvaluateAction(InstantiateType(context, state, type), options);
2308
+ }
2309
+ //#endregion
2310
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/call/distribute-arguments.mjs
2311
+ function CollectDistributionNames(expression, result = []) {
2312
+ return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result)) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? IsDeferred(expression.parameters[1]) && IsEqual(expression.parameters[1].action, "KeyOf") && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]["$ref"]] : result : result;
2313
+ }
2314
+ function BuildDistributionArray(parameters, names) {
2315
+ return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
2316
+ }
2317
+ function ZipDistributionArray(arguments_, distributionArray, result = []) {
2318
+ const [argumentLeft, ...argumentRight] = arguments_;
2319
+ const [booleanLeft, ...booleanRight] = distributionArray;
2320
+ return IsGreaterThan(arguments_.length, 0) ? IsGreaterThan(distributionArray.length, 0) ? ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]) : result : result;
2321
+ }
2322
+ function Expand(type) {
2323
+ return IsUnion(type) ? [...type.anyOf] : [type];
2324
+ }
2325
+ function Append(current, type) {
2326
+ return current.reduce((result, left) => [...result, [...left, type]], []);
2327
+ }
2328
+ function Cross(current, variants) {
2329
+ return variants.reduce((result, left) => {
2330
+ return [...result, ...Append(current, left)];
2331
+ }, []);
2332
+ }
2333
+ function Distribute(zipped) {
2334
+ return zipped.reduce((result, left) => {
2335
+ return IsEqual(left[0], true) ? Cross(result, Expand(left[1])) : Cross(result, [left[1]]);
2336
+ }, [[]]);
2337
+ }
2338
+ function DistributeArguments(parameters, arguments_, expression) {
2339
+ const zippedArguments = ZipDistributionArray(arguments_, BuildDistributionArray(parameters, CollectDistributionNames(expression)));
2340
+ return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? Distribute(zippedArguments) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? Distribute(zippedArguments) : [arguments_];
2341
+ }
2342
+ //#endregion
2343
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/call/resolve-target.mjs
2344
+ function FromNotResolvable() {
2345
+ return ["(not-resolvable)", Never()];
2346
+ }
2347
+ function FromNotGeneric() {
2348
+ return ["(not-generic)", Never()];
2349
+ }
2350
+ function FromGeneric(name, parameters, expression) {
2351
+ return [name, Generic(parameters, expression)];
2352
+ }
2353
+ function FromRef(context, ref, arguments_) {
2354
+ return ref in context ? FromType$11(context, ref, context[ref], arguments_) : FromNotResolvable();
2355
+ }
2356
+ function FromType$11(context, name, target, arguments_) {
2357
+ return IsGeneric(target) ? FromGeneric(name, target.parameters, target.expression) : IsRef(target) ? FromRef(context, target.$ref, arguments_) : FromNotGeneric();
2358
+ }
2359
+ /** Resolves a named generic target from the context, or returns TNever if it cannot be resolved or is not generic. */
2360
+ function ResolveTarget(context, target, arguments_) {
2361
+ return FromType$11(context, "(anonymous)", target, arguments_);
2362
+ }
2363
+ //#endregion
2364
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/call/resolve-arguments.mjs
2365
+ function AssertArgumentExtends(name, type, extends_) {
2366
+ if (IsInfer(type) || IsCall(type) || IsExtendsTrueLike(Extends({}, type, extends_))) return;
2367
+ const cause = {
2368
+ parameter: name,
2369
+ expect: extends_,
2370
+ actual: type
2371
+ };
2372
+ throw new Error(`Argument for parameter ${name} does not satisfy constraint`, { cause });
2373
+ }
2374
+ function BindArgument(context, state, name, extends_, type) {
2375
+ const instantiatedArgument = InstantiateType(context, state, type);
2376
+ AssertArgumentExtends(name, instantiatedArgument, extends_);
2377
+ return Assign(context, { [name]: instantiatedArgument });
2378
+ }
2379
+ function BindArguments(context, state, parameterLeft, parameterRight, arguments_) {
2380
+ const instantiatedExtends = InstantiateType(context, state, parameterLeft.extends);
2381
+ const instantiatedEquals = InstantiateType(context, state, parameterLeft.equals);
2382
+ const [left, ...right] = arguments_;
2383
+ return IsSchema(left) ? BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, left), state, parameterRight, right) : BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, instantiatedEquals), state, parameterRight, []);
2384
+ }
2385
+ function BindParameters(context, state, parameters, arguments_) {
2386
+ const [left, ...right] = parameters;
2387
+ return IsSchema(left) ? BindArguments(context, state, left, right, arguments_) : context;
2388
+ }
2389
+ function ResolveArgumentsContext(context, state, parameters, arguments_) {
2390
+ return BindParameters(context, state, parameters, arguments_);
2391
+ }
2392
+ //#endregion
2393
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/call/instantiate.mjs
2394
+ function Peek(state) {
2395
+ return IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
2396
+ }
2397
+ function IsTailCall(state, name) {
2398
+ return IsEqual(Peek(state), name);
2399
+ }
2400
+ function CallDispatch(context, state, target, parameters, expression, arguments_) {
2401
+ return InstantiateType(context, state, InstantiateType(ResolveArgumentsContext(context, state, parameters, arguments_), { callstack: [...state.callstack, target.$ref] }, expression));
2402
+ }
2403
+ function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
2404
+ return distributedArguments.reduce((result, arguments_) => [...result, CallDispatch(context, state, target, parameters, expression, arguments_)], []);
2405
+ }
2406
+ function CallImmediate(context, state, target, parameters, expression, arguments_) {
2407
+ const returnTypes = CallDistributed(context, state, target, parameters, expression, DistributeArguments(parameters, arguments_, expression));
2408
+ return IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);
2409
+ }
2410
+ function CallInstantiate(context, state, target, arguments_) {
2411
+ const instantiatedArguments = InstantiateTypes(context, state, arguments_);
2412
+ const resolved = ResolveTarget(context, target, arguments_);
2413
+ const name = resolved[0];
2414
+ const type = resolved[1];
2415
+ return IsGeneric(type) ? IsTailCall(state, name) ? CallConstruct(Ref(name), instantiatedArguments) : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments) : CallConstruct(target, instantiatedArguments);
2416
+ }
2417
+ //#endregion
2418
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/types/call.mjs
2419
+ function CallConstruct(target, arguments_) {
2420
+ return Create({ ["~kind"]: "Call" }, {
2421
+ target,
2422
+ arguments: arguments_
2423
+ }, {});
2424
+ }
2425
+ /** Returns true if the given type is a TCall. */
2426
+ function IsCall(value) {
2427
+ return IsKind(value, "Call");
2428
+ }
2429
+ //#endregion
2430
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
2431
+ function ApplyMapping(mapping, value) {
2432
+ return mapping(value);
2433
+ }
2434
+ //#endregion
2435
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/intrinsics/from-literal.mjs
2436
+ function FromLiteral$1(mapping, value) {
2437
+ return IsString$2(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
2438
+ }
2439
+ //#endregion
2440
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/intrinsics/from-template-literal.mjs
2441
+ function FromTemplateLiteral$2(mapping, pattern) {
2442
+ return FromType$10(mapping, TemplateLiteralDecode(pattern));
2443
+ }
2444
+ //#endregion
2445
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/intrinsics/from-union.mjs
2446
+ function FromUnion$6(mapping, types) {
2447
+ return Union(types.map((type) => FromType$10(mapping, type)));
2448
+ }
2449
+ //#endregion
2450
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/intrinsics/from-type.mjs
2451
+ function FromType$10(mapping, type) {
2452
+ return IsLiteral(type) ? FromLiteral$1(mapping, type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$2(mapping, type.pattern) : IsUnion(type) ? FromUnion$6(mapping, type.anyOf) : type;
2453
+ }
2454
+ //#endregion
2455
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/capitalize.mjs
2456
+ /** Creates a deferred Capitalize action. */
2457
+ function CapitalizeDeferred(type, options = {}) {
2458
+ return Deferred("Capitalize", [type], options);
2459
+ }
2460
+ //#endregion
2461
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/lowercase.mjs
2462
+ /** Creates a deferred Lowercase action. */
2463
+ function LowercaseDeferred(type, options = {}) {
2464
+ return Deferred("Lowercase", [type], options);
2465
+ }
2466
+ //#endregion
2467
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/uncapitalize.mjs
2468
+ /** Creates a deferred Uncapitalize action. */
2469
+ function UncapitalizeDeferred(type, options = {}) {
2470
+ return Deferred("Uncapitalize", [type], options);
2471
+ }
2472
+ //#endregion
2473
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/uppercase.mjs
2474
+ /** Creates a deferred Uppercase action. */
2475
+ function UppercaseDeferred(type, options = {}) {
2476
+ return Deferred("Uppercase", [type], options);
2477
+ }
2478
+ //#endregion
2479
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
2480
+ const CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);
2481
+ const LowercaseMapping = (input) => input.toLowerCase();
2482
+ const UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);
2483
+ const UppercaseMapping = (input) => input.toUpperCase();
2484
+ function CapitalizeAction(type, options) {
2485
+ return CanInstantiate([type]) ? Update(FromType$10(CapitalizeMapping, type), {}, options) : CapitalizeDeferred(type, options);
2486
+ }
2487
+ function LowercaseAction(type, options) {
2488
+ return CanInstantiate([type]) ? Update(FromType$10(LowercaseMapping, type), {}, options) : LowercaseDeferred(type, options);
2489
+ }
2490
+ function UncapitalizeAction(type, options) {
2491
+ return CanInstantiate([type]) ? Update(FromType$10(UncapitalizeMapping, type), {}, options) : UncapitalizeDeferred(type, options);
2492
+ }
2493
+ function UppercaseAction(type, options) {
2494
+ return CanInstantiate([type]) ? Update(FromType$10(UppercaseMapping, type), {}, options) : UppercaseDeferred(type, options);
2495
+ }
2496
+ function CapitalizeInstantiate(context, state, type, options) {
2497
+ return CapitalizeAction(InstantiateType(context, state, type), options);
2498
+ }
2499
+ function LowercaseInstantiate(context, state, type, options) {
2500
+ return LowercaseAction(InstantiateType(context, state, type), options);
2501
+ }
2502
+ function UncapitalizeInstantiate(context, state, type, options) {
2503
+ return UncapitalizeAction(InstantiateType(context, state, type), options);
2504
+ }
2505
+ function UppercaseInstantiate(context, state, type, options) {
2506
+ return UppercaseAction(InstantiateType(context, state, type), options);
2507
+ }
2508
+ //#endregion
2509
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/conditional.mjs
2510
+ /** Creates a deferred Conditional action. */
2511
+ function ConditionalDeferred(left, right, true_, false_, options = {}) {
2512
+ return Deferred("Conditional", [
2513
+ left,
2514
+ right,
2515
+ true_,
2516
+ false_
2517
+ ], options);
2518
+ }
2519
+ //#endregion
2520
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
2521
+ function ConditionalOperation(context, state, left, right, true_, false_) {
2522
+ const extendsResult = Extends(context, left, right);
2523
+ return IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) : IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) : InstantiateType(context, state, false_);
2524
+ }
2525
+ function ConditionalAction(context, state, left, right, true_, false_, options) {
2526
+ return CanInstantiate([left, right]) ? Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options) : ConditionalDeferred(left, right, true_, false_, options);
2527
+ }
2528
+ function ConditionalInstantiate(context, state, left, right, true_, false_, options) {
2529
+ return ConditionalAction(context, state, InstantiateType(context, state, left), InstantiateType(context, state, right), true_, false_, options);
2530
+ }
2531
+ //#endregion
2532
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/constructor-parameters.mjs
2533
+ /** Creates a deferred ConstructorParameters action. */
2534
+ function ConstructorParametersDeferred(type, options = {}) {
2535
+ return Deferred("ConstructorParameters", [type], options);
2536
+ }
2537
+ //#endregion
2538
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/constructor-parameters/instantiate.mjs
2539
+ function ConstructorParametersOperation(type) {
2540
+ return Tuple(InstantiateElements({}, { callstack: [] }, IsConstructor(type) ? type["parameters"] : []));
2541
+ }
2542
+ function ConstructorParametersAction(type, options) {
2543
+ return CanInstantiate([type]) ? Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
2544
+ }
2545
+ function ConstructorParametersInstantiate(context, state, type, options) {
2546
+ return ConstructorParametersAction(InstantiateType(context, state, type), options);
2547
+ }
2548
+ //#endregion
2549
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/exclude.mjs
2550
+ /** Creates a deferred Exclude action. */
2551
+ function ExcludeDeferred(left, right, options = {}) {
2552
+ return Deferred("Exclude", [left, right], options);
2553
+ }
2554
+ //#endregion
2555
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/exclude/operation.mjs
2556
+ function ExcludeUnionLeft(types, right) {
2557
+ return types.reduce((result, head) => {
2558
+ return [...result, ...ExcludeTypeLeft(head, right)];
2559
+ }, []);
2560
+ }
2561
+ function ExcludeTypeLeft(left, right) {
2562
+ return IsExtendsTrueLike(Extends({}, left, right)) ? [] : [left];
2563
+ }
2564
+ function ExcludeOperation(left, right) {
2565
+ return EvaluateUnion(IsEnum(left) ? ExcludeUnionLeft(EnumValuesToVariants(left.enum), right) : IsUnion(left) ? ExcludeUnionLeft(Flatten(left.anyOf), right) : ExcludeTypeLeft(left, right));
2566
+ }
2567
+ //#endregion
2568
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
2569
+ function ExcludeAction(left, right, options) {
2570
+ return CanInstantiate([left, right]) ? Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
2571
+ }
2572
+ function ExcludeInstantiate(context, state, left, right, options) {
2573
+ return ExcludeAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
2574
+ }
2575
+ //#endregion
2576
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/extract.mjs
2577
+ /** Creates a deferred Extract action. */
2578
+ function ExtractDeferred(left, right, options = {}) {
2579
+ return Deferred("Extract", [left, right], options);
2580
+ }
2581
+ //#endregion
2582
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/extract/operation.mjs
2583
+ function ExtractUnionLeft(types, right) {
2584
+ return types.reduce((result, head) => {
2585
+ return [...result, ...ExtractTypeLeft(head, right)];
2586
+ }, []);
2587
+ }
2588
+ function ExtractTypeLeft(left, right) {
2589
+ return IsExtendsTrueLike(Extends({}, left, right)) ? [left] : [];
2590
+ }
2591
+ function ExtractOperation(left, right) {
2592
+ return EvaluateUnion(IsEnum(left) ? ExtractUnionLeft(EnumValuesToVariants(left.enum), right) : IsUnion(left) ? ExtractUnionLeft(Flatten(left.anyOf), right) : ExtractTypeLeft(left, right));
2593
+ }
2594
+ //#endregion
2595
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/extract/instantiate.mjs
2596
+ function ExtractAction(left, right, options) {
2597
+ return CanInstantiate([left, right]) ? Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
2598
+ }
2599
+ function ExtractInstantiate(context, state, left, right, options) {
2600
+ return ExtractAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
2601
+ }
2602
+ //#endregion
2603
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/indexed.mjs
2604
+ /** Creates a deferred Index action. */
2605
+ function IndexDeferred(type, indexer, options = {}) {
2606
+ return Deferred("Index", [type, indexer], options);
2607
+ }
2608
+ //#endregion
2609
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/from-cyclic.mjs
2610
+ function FromCyclic$4(defs, ref) {
2611
+ return FromType$9(CyclicTarget(defs, ref));
2612
+ }
2613
+ //#endregion
2614
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/from-intersect.mjs
2615
+ function CollapseIntersectProperties(left, right) {
2616
+ const leftKeys = Keys(left).filter((key) => !HasPropertyKey(right, key));
2617
+ const rightKeys = Keys(right).filter((key) => !HasPropertyKey(left, key));
2618
+ const sharedKeys = Keys(left).filter((key) => HasPropertyKey(right, key));
2619
+ const leftProperties = leftKeys.reduce((result, key) => ({
2620
+ ...result,
2621
+ [key]: left[key]
2622
+ }), {});
2623
+ const rightProperties = rightKeys.reduce((result, key) => ({
2624
+ ...result,
2625
+ [key]: right[key]
2626
+ }), {});
2627
+ const sharedProperties = sharedKeys.reduce((result, key) => ({
2628
+ ...result,
2629
+ [key]: EvaluateIntersect([left[key], right[key]])
2630
+ }), {});
2631
+ return Assign(Assign(leftProperties, rightProperties), sharedProperties);
2632
+ }
2633
+ function FromIntersect$4(types) {
2634
+ return types.reduce((result, left) => {
2635
+ return CollapseIntersectProperties(result, FromType$9(left));
2636
+ }, {});
2637
+ }
2638
+ //#endregion
2639
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/from-object.mjs
2640
+ function FromObject$5(properties) {
2641
+ return properties;
2642
+ }
2643
+ //#endregion
2644
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/from-tuple.mjs
2645
+ function FromTuple$3(types) {
2646
+ return FromType$9(TupleToObject(Tuple(types)));
2647
+ }
2648
+ //#endregion
2649
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/from-union.mjs
2650
+ function CollapseUnionProperties(left, right) {
2651
+ return Keys(left).filter((key) => key in right).reduce((result, key) => {
2652
+ return {
2653
+ ...result,
2654
+ [key]: EvaluateUnion([left[key], right[key]])
2655
+ };
2656
+ }, {});
2657
+ }
2658
+ function ReduceVariants(types, result) {
2659
+ const [left, ...right] = types;
2660
+ return IsSchema(left) ? ReduceVariants(right, CollapseUnionProperties(result, FromType$9(left))) : result;
2661
+ }
2662
+ function FromUnion$5(types) {
2663
+ const [left, ...right] = types;
2664
+ return IsSchema(left) ? ReduceVariants(right, FromType$9(left)) : Unreachable();
2665
+ }
2666
+ //#endregion
2667
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/from-type.mjs
2668
+ function FromType$9(type) {
2669
+ return IsCyclic(type) ? FromCyclic$4(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect$4(type.allOf) : IsUnion(type) ? FromUnion$5(type.anyOf) : IsTuple(type) ? FromTuple$3(type.items) : IsObject(type) ? FromObject$5(type.properties) : {};
2670
+ }
2671
+ //#endregion
2672
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/object/collapse.mjs
2673
+ /**
2674
+ * Collapses a type into a TObject schema. This is a lossy fast path used to
2675
+ * normalize arbitrary TSchema types into a TObject structure. This function is
2676
+ * primarily used in indexing operations where a normalized object structure
2677
+ * is required. If the type cannot be collapsed, an empty object schema is returned.
2678
+ */
2679
+ function CollapseToObject(type) {
2680
+ return _Object_(FromType$9(type));
2681
+ }
2682
+ //#endregion
2683
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/helpers/keys.mjs
2684
+ const integerKeyPattern = /* @__PURE__ */ new RegExp("^(?:0|[1-9][0-9]*)$");
2685
+ function ConvertToIntegerKey(value) {
2686
+ const normal = `${value}`;
2687
+ return integerKeyPattern.test(normal) ? parseInt(normal) : value;
2688
+ }
2689
+ //#endregion
2690
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexed/from-array.mjs
2691
+ function NormalizeLiteral(value) {
2692
+ return Literal(ConvertToIntegerKey(value));
2693
+ }
2694
+ function NormalizeIndexerTypes(types) {
2695
+ return types.map((type) => NormalizeIndexer(type));
2696
+ }
2697
+ function NormalizeIndexer(type) {
2698
+ return IsIntersect(type) ? Intersect(NormalizeIndexerTypes(type.allOf)) : IsUnion(type) ? Union(NormalizeIndexerTypes(type.anyOf)) : IsLiteral(type) ? NormalizeLiteral(type.const) : type;
2699
+ }
2700
+ function FromArray$2(type, indexer) {
2701
+ return IsExtendsTrueLike(Extends({}, NormalizeIndexer(indexer), Number$1())) ? type : IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Number$1() : Never();
2702
+ }
2703
+ //#endregion
2704
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-cyclic.mjs
2705
+ function FromCyclic$3(defs, ref) {
2706
+ return FromType$8(CyclicTarget(defs, ref));
2707
+ }
2708
+ //#endregion
2709
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-union.mjs
2710
+ function FromUnion$4(types) {
2711
+ return types.reduce((result, left) => {
2712
+ return [...result, ...FromType$8(left)];
2713
+ }, []);
2714
+ }
2715
+ //#endregion
2716
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-enum.mjs
2717
+ function FromEnum(values) {
2718
+ return FromUnion$4(EnumValuesToVariants(values));
2719
+ }
2720
+ //#endregion
2721
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-intersect.mjs
2722
+ function FromIntersect$3(types) {
2723
+ return FromType$8(EvaluateIntersect(types));
2724
+ }
2725
+ //#endregion
2726
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-literal.mjs
2727
+ function FromLiteral(value) {
2728
+ return [`${value}`];
2729
+ }
2730
+ //#endregion
2731
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-template-literal.mjs
2732
+ function FromTemplateLiteral$1(pattern) {
2733
+ return FromType$8(TemplateLiteralDecode(pattern));
2734
+ }
2735
+ //#endregion
2736
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/from-type.mjs
2737
+ function FromType$8(type) {
2738
+ return IsCyclic(type) ? FromCyclic$3(type.$defs, type.$ref) : IsEnum(type) ? FromEnum(type.enum) : IsIntersect(type) ? FromIntersect$3(type.allOf) : IsLiteral(type) ? FromLiteral(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$1(type.pattern) : IsUnion(type) ? FromUnion$4(type.anyOf) : [];
2739
+ }
2740
+ //#endregion
2741
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/to-indexable-keys.mjs
2742
+ /**
2743
+ * Transforms a type meant as an Indexer into string[] array which is used by Indexable types
2744
+ * like Index, Pick and Omit to select from property keys. This function should only be used
2745
+ * for Object key selection, and not for Array / Tuple key selection as Array-Like structures
2746
+ * require TNumber indexing support.
2747
+ */
2748
+ function ToIndexableKeys(type) {
2749
+ return FromType$8(type);
2750
+ }
2751
+ //#endregion
2752
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexed/from-object.mjs
2753
+ function SelectProperty(properties, indexer) {
2754
+ return indexer in properties ? [properties[indexer]] : [];
2755
+ }
2756
+ function SelectProperties(properties, indexer) {
2757
+ return indexer.reduce((result, left) => {
2758
+ return [...result, ...SelectProperty(properties, left)];
2759
+ }, []);
2760
+ }
2761
+ function FromObject$4(properties, indexer) {
2762
+ return EvaluateUnion(SelectProperties(properties, ToIndexableKeys(indexer)));
2763
+ }
2764
+ //#endregion
2765
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexed/array-indexer.mjs
2766
+ function ConvertLiteral(value) {
2767
+ return Literal(ConvertToIntegerKey(value));
2768
+ }
2769
+ function ArrayIndexerTypes(types) {
2770
+ return types.map((type) => FormatArrayIndexer(type));
2771
+ }
2772
+ /** Formats embedded integer-like strings on an Indexer to be number values inline with TS indexing | coercion behaviors. */
2773
+ function FormatArrayIndexer(type) {
2774
+ return IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) : IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) : IsLiteral(type) ? ConvertLiteral(type.const) : type;
2775
+ }
2776
+ //#endregion
2777
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexed/from-tuple.mjs
2778
+ function IndexElementsWithIndexer(types, indexer) {
2779
+ return types.reduceRight((result, right, index) => {
2780
+ return IsExtendsTrueLike(Extends({}, Literal(index), indexer)) ? [right, ...result] : result;
2781
+ }, []);
2782
+ }
2783
+ function FromTupleWithIndexer(types, indexer) {
2784
+ return EvaluateUnionFast(IndexElementsWithIndexer(types, FormatArrayIndexer(indexer)));
2785
+ }
2786
+ function FromTupleWithoutIndexer(types) {
2787
+ return EvaluateUnionFast(types);
2788
+ }
2789
+ function FromTuple$2(types, indexer) {
2790
+ return IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber(indexer) || IsInteger(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
2791
+ }
2792
+ //#endregion
2793
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexed/from-type.mjs
2794
+ function FromType$7(type, indexer) {
2795
+ return IsArray(type) ? FromArray$2(type.items, indexer) : IsObject(type) ? FromObject$4(type.properties, indexer) : IsTuple(type) ? FromTuple$2(type.items, indexer) : Never();
2796
+ }
2797
+ //#endregion
2798
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
2799
+ function NormalizeType$1(type) {
2800
+ return IsCyclic(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
2801
+ }
2802
+ function IndexAction(type, indexer, options) {
2803
+ return CanInstantiate([type, indexer]) ? Update(FromType$7(NormalizeType$1(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
2804
+ }
2805
+ function IndexInstantiate(context, state, type, indexer, options) {
2806
+ return IndexAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
2807
+ }
2808
+ //#endregion
2809
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/instance-type.mjs
2810
+ /** Creates a deferred InstanceType action. */
2811
+ function InstanceTypeDeferred(type, options = {}) {
2812
+ return Deferred("InstanceType", [type], options);
2813
+ }
2814
+ //#endregion
2815
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/instance-type/instantiate.mjs
2816
+ function InstanceTypeOperation(type) {
2817
+ return IsConstructor(type) ? type["instanceType"] : Never();
2818
+ }
2819
+ function InstanceTypeAction(type, options) {
2820
+ return CanInstantiate([type]) ? Update(InstanceTypeOperation(type), {}, options) : InstanceTypeDeferred(type, options);
2821
+ }
2822
+ function InstanceTypeInstantiate(context, state, type, options = {}) {
2823
+ return InstanceTypeAction(InstantiateType(context, state, type), options);
2824
+ }
2825
+ //#endregion
2826
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/keyof.mjs
2827
+ /** Creates a deferred KeyOf action. */
2828
+ function KeyOfDeferred(type, options = {}) {
2829
+ return Deferred("KeyOf", [type], options);
2830
+ }
2831
+ //#endregion
2832
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/from-any.mjs
2833
+ function FromAny() {
2834
+ return Union([
2835
+ Number$1(),
2836
+ String$1(),
2837
+ Symbol$1()
2838
+ ]);
2839
+ }
2840
+ //#endregion
2841
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/from-array.mjs
2842
+ function FromArray$1(_type) {
2843
+ return Number$1();
2844
+ }
2845
+ //#endregion
2846
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/from-object.mjs
2847
+ function FromPropertyKeys(keys) {
2848
+ return keys.reduce((result, left) => {
2849
+ return IsLiteralValue(left) ? [...result, Literal(ConvertToIntegerKey(left))] : Unreachable();
2850
+ }, []);
2851
+ }
2852
+ function FromObject$3(properties) {
2853
+ return EvaluateUnionFast(FromPropertyKeys(Keys(properties)));
2854
+ }
2855
+ //#endregion
2856
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/from-record.mjs
2857
+ function FromRecord(type) {
2858
+ return RecordKey(type);
2859
+ }
2860
+ //#endregion
2861
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/from-tuple.mjs
2862
+ function FromTuple$1(types) {
2863
+ return EvaluateUnionFast(types.map((_, index) => Literal(index)));
2864
+ }
2865
+ //#endregion
2866
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/from-type.mjs
2867
+ function FromType$6(type) {
2868
+ return IsAny(type) ? FromAny() : IsArray(type) ? FromArray$1(type.items) : IsObject(type) ? FromObject$3(type.properties) : IsRecord(type) ? FromRecord(type) : IsTuple(type) ? FromTuple$1(type.items) : Never();
2869
+ }
2870
+ //#endregion
2871
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
2872
+ function NormalizeType(type) {
2873
+ return IsCyclic(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
2874
+ }
2875
+ function KeyOfAction(type, options) {
2876
+ return CanInstantiate([type]) ? Update(FromType$6(NormalizeType(type)), {}, options) : KeyOfDeferred(type, options);
2877
+ }
2878
+ function KeyOfInstantiate(context, state, type, options) {
2879
+ return KeyOfAction(InstantiateType(context, state, type), options);
2880
+ }
2881
+ //#endregion
2882
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/mapped.mjs
2883
+ /** Creates a deferred Mapped action. */
2884
+ function MappedDeferred(identifier, type, as, property, options = {}) {
2885
+ return Deferred("Mapped", [
2886
+ identifier,
2887
+ type,
2888
+ as,
2889
+ property
2890
+ ], options);
2891
+ }
2892
+ //#endregion
2893
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/mapped/mapped-variants.mjs
2894
+ function FromTemplateLiteral(pattern) {
2895
+ return FromType$5(TemplateLiteralDecode(pattern));
2896
+ }
2897
+ function FromUnion$3(types) {
2898
+ return types.reduce((result, left) => {
2899
+ return [...result, ...FromType$5(left)];
2900
+ }, []);
2901
+ }
2902
+ function FromType$5(type) {
2903
+ return IsEnum(type) ? FromUnion$3(EnumValuesToVariants(type.enum)) : IsLiteralString(type) || IsLiteralNumber(type) ? [type] : IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) : IsUnion(type) ? FromUnion$3(type.anyOf) : [type];
2904
+ }
2905
+ function MappedVariants(type) {
2906
+ return FromType$5(type);
2907
+ }
2908
+ //#endregion
2909
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/mapped/mapped-operation.mjs
2910
+ function CanonicalAs(instantiatedAs) {
2911
+ return IsTemplateLiteral(instantiatedAs) ? TemplateLiteralDecode(instantiatedAs.pattern) : instantiatedAs;
2912
+ }
2913
+ function MappedVariant(context, state, identifier, variant, as, property) {
2914
+ const variantContext = Assign(context, { [identifier["name"]]: variant });
2915
+ const canonicalAs = CanonicalAs(InstantiateType(variantContext, state, as));
2916
+ const instantiatedProperty = InstantiateType(variantContext, state, property);
2917
+ return IsLiteralNumber(canonicalAs) || IsLiteralString(canonicalAs) ? { [canonicalAs.const]: instantiatedProperty } : {};
2918
+ }
2919
+ function MappedProperties(context, state, identifier, variants, as, property) {
2920
+ return variants.reduce((result, left) => {
2921
+ return [...result, MappedVariant(context, state, identifier, left, as, property)];
2922
+ }, []);
2923
+ }
2924
+ function MappedObjects(properties) {
2925
+ return properties.reduce((result, left) => {
2926
+ return [...result, _Object_(left)];
2927
+ }, []);
2928
+ }
2929
+ function MappedOperation(context, state, identifier, type, as, property) {
2930
+ return EvaluateIntersect(MappedObjects(MappedProperties(context, state, identifier, MappedVariants(type), as, property)));
2931
+ }
2932
+ //#endregion
2933
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
2934
+ function MappedAction(context, state, identifier, type, as, property, options) {
2935
+ return CanInstantiate([type]) ? Update(MappedOperation(context, state, identifier, type, as, property), {}, options) : MappedDeferred(identifier, type, as, property, options);
2936
+ }
2937
+ function MappedInstantiate(context, state, identifier, type, as, property, options) {
2938
+ return MappedAction(context, state, identifier, InstantiateType(context, state, type), as, property, options);
2939
+ }
2940
+ //#endregion
2941
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/module/instantiate.mjs
2942
+ function InstantiateCyclics(context, cyclicKeys) {
2943
+ return Keys(context).filter((key) => cyclicKeys.includes(key)).reduce((result, key) => {
2944
+ return {
2945
+ ...result,
2946
+ [key]: InstantiateCyclic(context, key, context[key])
2947
+ };
2948
+ }, {});
2949
+ }
2950
+ function InstantiateNonCyclics(context, cyclicKeys) {
2951
+ return Keys(context).filter((key) => !cyclicKeys.includes(key)).reduce((result, key) => {
2952
+ return {
2953
+ ...result,
2954
+ [key]: InstantiateType(context, { callstack: [] }, context[key])
2955
+ };
2956
+ }, {});
2957
+ }
2958
+ function InstantiateModule(context, options) {
2959
+ const cyclicCandidates = CyclicCandidates(context);
2960
+ const instantiatedCyclics = InstantiateCyclics(context, cyclicCandidates);
2961
+ const instantiatedNonCyclics = InstantiateNonCyclics(context, cyclicCandidates);
2962
+ return Update({
2963
+ ...instantiatedCyclics,
2964
+ ...instantiatedNonCyclics
2965
+ }, {}, options);
2966
+ }
2967
+ function ModuleInstantiate(context, _state, properties, options) {
2968
+ return InstantiateModule(Assign(context, properties), options);
2969
+ }
2970
+ //#endregion
2971
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/non-nullable.mjs
2972
+ /** Creates a deferred NonNullable action. */
2973
+ function NonNullableDeferred(type, options = {}) {
2974
+ return Deferred("NonNullable", [type], options);
2975
+ }
2976
+ //#endregion
2977
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/non-nullable/instantiate.mjs
2978
+ function NonNullableOperation(type) {
2979
+ return ExcludeAction(type, Union([Null(), Undefined()]), {});
2980
+ }
2981
+ function NonNullableAction(type, options) {
2982
+ return CanInstantiate([type]) ? Update(NonNullableOperation(type), {}, options) : NonNullableDeferred(type, options);
2983
+ }
2984
+ function NonNullableInstantiate(context, state, type, options) {
2985
+ return NonNullableAction(InstantiateType(context, state, type), options);
2986
+ }
2987
+ //#endregion
2988
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/omit.mjs
2989
+ /** Creates a deferred Omit action. */
2990
+ function OmitDeferred(type, indexer, options = {}) {
2991
+ return Deferred("Omit", [type, indexer], options);
2992
+ }
2993
+ //#endregion
2994
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/indexable/to-indexable.mjs
2995
+ /** Transforms a type into a TProperties used for indexing operations */
2996
+ function ToIndexable(type) {
2997
+ const collapsed = CollapseToObject(type);
2998
+ return IsObject(collapsed) ? collapsed.properties : Unreachable();
2999
+ }
3000
+ //#endregion
3001
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/omit/from-type.mjs
3002
+ function FromKeys$1(properties, keys) {
3003
+ return Keys(properties).reduce((result, key) => {
3004
+ return keys.includes(key) ? result : {
3005
+ ...result,
3006
+ [key]: properties[key]
3007
+ };
3008
+ }, {});
3009
+ }
3010
+ function FromType$4(type, indexer) {
3011
+ return _Object_(FromKeys$1(ToIndexable(type), ToIndexableKeys(indexer)));
3012
+ }
3013
+ //#endregion
3014
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/omit/instantiate.mjs
3015
+ function OmitAction(type, indexer, options) {
3016
+ return CanInstantiate([type, indexer]) ? Update(FromType$4(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
3017
+ }
3018
+ function OmitInstantiate(context, state, type, indexer, options) {
3019
+ return OmitAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
3020
+ }
3021
+ //#endregion
3022
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/options.mjs
3023
+ /** Creates a deferred Options action. */
3024
+ function OptionsDeferred(type, options) {
3025
+ return Deferred("Options", [type, options], {});
3026
+ }
3027
+ /** Applies an immediate Options action to the given type. */
3028
+ function Options(type, options) {
3029
+ return OptionsAction(type, options);
3030
+ }
3031
+ //#endregion
3032
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/options/instantiate.mjs
3033
+ function OptionsAction(type, options) {
3034
+ return CanInstantiate([type]) ? Update(type, {}, options) : OptionsDeferred(type, options);
3035
+ }
3036
+ function OptionsInstantiate(context, state, type, options) {
3037
+ return OptionsAction(InstantiateType(context, state, type), options);
3038
+ }
3039
+ //#endregion
3040
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/parameters.mjs
3041
+ /** Creates a deferred Parameters action. */
3042
+ function ParametersDeferred(type, options = {}) {
3043
+ return Deferred("Parameters", [type], options);
3044
+ }
3045
+ //#endregion
3046
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
3047
+ function ParametersOperation(type) {
3048
+ return Tuple(InstantiateElements({}, { callstack: [] }, IsFunction(type) ? type["parameters"] : []));
3049
+ }
3050
+ function ParametersAction(type, options) {
3051
+ return CanInstantiate([type]) ? Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
3052
+ }
3053
+ function ParametersInstantiate(context, state, type, options) {
3054
+ return ParametersAction(InstantiateType(context, state, type), options);
3055
+ }
3056
+ //#endregion
3057
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/partial.mjs
3058
+ /** Creates a deferred Partial action. */
3059
+ function PartialDeferred(type, options = {}) {
3060
+ return Deferred("Partial", [type], options);
3061
+ }
3062
+ /** Applies a Partial action to the given type. */
3063
+ function Partial(type, options = {}) {
3064
+ return PartialAction(type, options);
3065
+ }
3066
+ //#endregion
3067
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/partial/from-cyclic.mjs
3068
+ function FromCyclic$2(defs, ref) {
3069
+ const partial = FromType$3(CyclicTarget(defs, ref));
3070
+ return Cyclic(Assign(defs, { [ref]: partial }), ref);
3071
+ }
3072
+ //#endregion
3073
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/partial/from-intersect.mjs
3074
+ function FromIntersect$2(types) {
3075
+ return EvaluateIntersect(types.map((type) => FromType$3(type)));
3076
+ }
3077
+ //#endregion
3078
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/partial/from-union.mjs
3079
+ function FromUnion$2(types) {
3080
+ return Union(types.map((type) => FromType$3(type)));
3081
+ }
3082
+ //#endregion
3083
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/partial/from-object.mjs
3084
+ function FromObject$2(properties) {
3085
+ return _Object_(Keys(properties).reduce((result, left) => {
3086
+ return {
3087
+ ...result,
3088
+ [left]: Optional(properties[left])
3089
+ };
3090
+ }, {}));
3091
+ }
3092
+ //#endregion
3093
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/partial/from-type.mjs
3094
+ function FromType$3(type) {
3095
+ return IsCyclic(type) ? FromCyclic$2(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect$2(type.allOf) : IsUnion(type) ? FromUnion$2(type.anyOf) : IsObject(type) ? FromObject$2(type.properties) : _Object_({});
3096
+ }
3097
+ //#endregion
3098
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/partial/instantiate.mjs
3099
+ function PartialAction(type, options) {
3100
+ return CanInstantiate([type]) ? Update(FromType$3(type), {}, options) : PartialDeferred(type, options);
3101
+ }
3102
+ function PartialInstantiate(context, state, type, options) {
3103
+ return PartialAction(InstantiateType(context, state, type), options);
3104
+ }
3105
+ //#endregion
3106
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/pick.mjs
3107
+ /** Creates a deferred Pick action. */
3108
+ function PickDeferred(type, indexer, options = {}) {
3109
+ return Deferred("Pick", [type, indexer], options);
3110
+ }
3111
+ //#endregion
3112
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/pick/from-type.mjs
3113
+ function FromKeys(properties, keys) {
3114
+ return Keys(properties).reduce((result, key) => {
3115
+ return keys.includes(key) ? Assign(result, { [key]: properties[key] }) : result;
3116
+ }, {});
3117
+ }
3118
+ function FromType$2(type, indexer) {
3119
+ return _Object_(FromKeys(ToIndexable(type), ToIndexableKeys(indexer)));
3120
+ }
3121
+ //#endregion
3122
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/pick/instantiate.mjs
3123
+ function PickAction(type, indexer, options) {
3124
+ return CanInstantiate([type, indexer]) ? Update(FromType$2(type, indexer), {}, options) : PickDeferred(type, indexer, options);
3125
+ }
3126
+ function PickInstantiate(context, state, type, indexer, options) {
3127
+ return PickAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
3128
+ }
3129
+ //#endregion
3130
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/readonly-object.mjs
3131
+ /** Creates a deferred ReadonlyType action. */
3132
+ function ReadonlyObjectDeferred(type, options = {}) {
3133
+ return Deferred("ReadonlyObject", [type], options);
3134
+ }
3135
+ //#endregion
3136
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-array.mjs
3137
+ function FromArray(type) {
3138
+ return Immutable(Array$1(type));
3139
+ }
3140
+ //#endregion
3141
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-cyclic.mjs
3142
+ function FromCyclic$1(defs, ref) {
3143
+ const partial = FromType$1(CyclicTarget(defs, ref));
3144
+ return Cyclic(Assign(defs, { [ref]: partial }), ref);
3145
+ }
3146
+ //#endregion
3147
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-intersect.mjs
3148
+ function FromIntersect$1(types) {
3149
+ return EvaluateIntersect(types.map((type) => FromType$1(type)));
3150
+ }
3151
+ //#endregion
3152
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-object.mjs
3153
+ function FromObject$1(properties) {
3154
+ return _Object_(Keys(properties).reduce((result, left) => {
3155
+ return {
3156
+ ...result,
3157
+ [left]: Readonly(properties[left])
3158
+ };
3159
+ }, {}));
3160
+ }
3161
+ //#endregion
3162
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-tuple.mjs
3163
+ function FromTuple(types) {
3164
+ return Immutable(Tuple(types));
3165
+ }
3166
+ //#endregion
3167
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-union.mjs
3168
+ function FromUnion$1(types) {
3169
+ return Union(types.map((type) => FromType$1(type)));
3170
+ }
3171
+ //#endregion
3172
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/from-type.mjs
3173
+ function FromType$1(type) {
3174
+ return IsArray(type) ? FromArray(type.items) : IsCyclic(type) ? FromCyclic$1(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect$1(type.allOf) : IsObject(type) ? FromObject$1(type.properties) : IsTuple(type) ? FromTuple(type.items) : IsUnion(type) ? FromUnion$1(type.anyOf) : type;
3175
+ }
3176
+ //#endregion
3177
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/readonly-object/instantiate.mjs
3178
+ function ReadonlyObjectAction(type, options) {
3179
+ return CanInstantiate([type]) ? Update(FromType$1(type), {}, options) : ReadonlyObjectDeferred(type);
3180
+ }
3181
+ function ReadonlyObjectInstantiate(context, state, type, options) {
3182
+ return ReadonlyObjectAction(InstantiateType(context, state, type), options);
3183
+ }
3184
+ //#endregion
3185
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/ref/instantiate.mjs
3186
+ function RefInstantiate(context, state, type, ref) {
3187
+ return ref in context ? CyclicCheck([ref], context, context[ref]) ? type : InstantiateType(context, state, context[ref]) : type;
3188
+ }
3189
+ //#endregion
3190
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/required/from-cyclic.mjs
3191
+ function FromCyclic(defs, ref) {
3192
+ const partial = FromType(CyclicTarget(defs, ref));
3193
+ return Cyclic(Assign(defs, { [ref]: partial }), ref);
3194
+ }
3195
+ //#endregion
3196
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/required/from-intersect.mjs
3197
+ function FromIntersect(types) {
3198
+ return EvaluateIntersect(types.map((type) => FromType(type)));
3199
+ }
3200
+ //#endregion
3201
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/required/from-union.mjs
3202
+ function FromUnion(types) {
3203
+ return Union(types.map((type) => FromType(type)));
3204
+ }
3205
+ //#endregion
3206
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/required/from-object.mjs
3207
+ function FromObject(properties) {
3208
+ return _Object_(Keys(properties).reduce((result, left) => {
3209
+ return {
3210
+ ...result,
3211
+ [left]: OptionalRemove(properties[left])
3212
+ };
3213
+ }, {}));
3214
+ }
3215
+ //#endregion
3216
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/required/from-type.mjs
3217
+ function FromType(type) {
3218
+ return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsObject(type) ? FromObject(type.properties) : _Object_({});
3219
+ }
3220
+ //#endregion
3221
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/required.mjs
3222
+ /** Creates a deferred Required action. */
3223
+ function RequiredDeferred(type, options = {}) {
3224
+ return Deferred("Required", [type], options);
3225
+ }
3226
+ //#endregion
3227
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/required/instantiate.mjs
3228
+ function RequiredAction(type, options) {
3229
+ return CanInstantiate([type]) ? Update(FromType(type), {}, options) : RequiredDeferred(type, options);
3230
+ }
3231
+ function RequiredInstantiate(context, state, type, options) {
3232
+ return RequiredAction(InstantiateType(context, state, type), options);
3233
+ }
3234
+ //#endregion
3235
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/return-type.mjs
3236
+ /** Creates a deferred ReturnType action. */
3237
+ function ReturnTypeDeferred(type, options = {}) {
3238
+ return Deferred("ReturnType", [type], options);
3239
+ }
3240
+ //#endregion
3241
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/return-type/instantiate.mjs
3242
+ function ReturnTypeOperation(type) {
3243
+ return IsFunction(type) ? type["returnType"] : Never();
3244
+ }
3245
+ function ReturnTypeAction(type, options) {
3246
+ return CanInstantiate([type]) ? Update(ReturnTypeOperation(type), {}, options) : ReturnTypeDeferred(type, options);
3247
+ }
3248
+ function ReturnTypeInstantiate(context, state, type, options = {}) {
3249
+ return ReturnTypeAction(InstantiateType(context, state, type), options);
3250
+ }
3251
+ //#endregion
3252
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/rest/spread.mjs
3253
+ function SpreadElement(type) {
3254
+ return IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
3255
+ }
3256
+ function RestSpread(types) {
3257
+ return types.reduce((result, left) => {
3258
+ return [...result, ...SpreadElement(left)];
3259
+ }, []);
3260
+ }
3261
+ //#endregion
3262
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/instantiate.mjs
3263
+ function CanInstantiate(types) {
3264
+ const [left, ...right] = types;
3265
+ return IsSchema(left) ? IsRef(left) ? false : CanInstantiate(right) : true;
3266
+ }
3267
+ function ModifierActions(type, readonly, optional) {
3268
+ 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") : [
3269
+ type,
3270
+ readonly,
3271
+ optional
3272
+ ];
3273
+ }
3274
+ function ApplyReadonly(action, type) {
3275
+ return IsEqual(action, "remove") ? ReadonlyRemove(type) : IsEqual(action, "add") ? ReadonlyAdd(type) : type;
3276
+ }
3277
+ function ApplyOptional(action, type) {
3278
+ return IsEqual(action, "remove") ? OptionalRemove(type) : IsEqual(action, "add") ? OptionalAdd(type) : type;
3279
+ }
3280
+ function InstantiateProperties(context, state, properties) {
3281
+ return Keys(properties).reduce((result, key) => {
3282
+ return {
3283
+ ...result,
3284
+ [key]: InstantiateType(context, state, properties[key])
3285
+ };
3286
+ }, {});
3287
+ }
3288
+ function InstantiateElements(context, state, types) {
3289
+ return RestSpread(InstantiateTypes(context, state, types));
3290
+ }
3291
+ function InstantiateTypes(context, state, types) {
3292
+ return types.map((type) => InstantiateType(context, state, type));
3293
+ }
3294
+ function InstantiateDeferred(context, state, action, parameters, options) {
3295
+ return IsEqual(action, "Awaited") ? AwaitedInstantiate(context, state, parameters[0], options) : IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Options") ? OptionsInstantiate(context, state, parameters[0], parameters[1]) : IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : Deferred(action, parameters, options);
3296
+ }
3297
+ function InstantiateType(context, state, input) {
3298
+ const immutable = IsImmutable(input);
3299
+ const modifiers = ModifierActions(input, IsReadonly(input) ? "add" : "none", IsOptional(input) ? "add" : "none");
3300
+ const type = IsBase(modifiers[0]) ? modifiers[0].Clone() : modifiers[0];
3301
+ const instantiated = IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray(type) ? Array$1(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsAsyncIterator(type) ? AsyncIterator(InstantiateType(context, state, type.iteratorItems), AsyncIteratorOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : IsFunction(type) ? _Function_(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsIterator(type) ? Iterator(InstantiateType(context, state, type.iteratorItems), IteratorOptions(type)) : IsObject(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;
3302
+ const withImmutable = immutable ? Immutable(instantiated) : instantiated;
3303
+ return ApplyReadonly(modifiers[1], ApplyOptional(modifiers[2], withImmutable));
3304
+ }
3305
+ /** Instantiates computed schematics using the given context and type. */
3306
+ function Instantiate(context, type) {
3307
+ return InstantiateType(context, { callstack: [] }, type);
3308
+ }
3309
+ //#endregion
3310
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/engine/awaited/instantiate.mjs
3311
+ function AwaitedOperation(type) {
3312
+ return IsPromise(type) ? AwaitedOperation(type.item) : type;
3313
+ }
3314
+ function AwaitedAction(type, options) {
3315
+ return CanInstantiate([type]) ? Update(AwaitedOperation(type), {}, options) : AwaitedDeferred(type, options);
3316
+ }
3317
+ function AwaitedInstantiate(context, state, type, options) {
3318
+ return AwaitedAction(InstantiateType(context, state, type), options);
3319
+ }
3320
+ //#endregion
3321
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/awaited.mjs
3322
+ /** Creates a deferred Awaited action. */
3323
+ function AwaitedDeferred(type, options = {}) {
3324
+ return Deferred("Awaited", [type], options);
3325
+ }
3326
+ //#endregion
3327
+ //#region node_modules/.pnpm/typebox@1.1.28/node_modules/typebox/build/type/action/evaluate.mjs
3328
+ /** Applies an Evaluate action to a type. */
3329
+ function Evaluate(type, options = {}) {
3330
+ return EvaluateAction(type, options);
3331
+ }
3332
+ //#endregion
3333
+ export { IsFunction as $, IsIterator as A, IsInteger$1 as At, IsIntersect as B, IsObjectNotArray as Bt, Null as C, IsClassInstance as Ct, IsLiteralNumber as D, IsFunction$1 as Dt, IsLiteralBoolean as E, IsEqual as Et, IsBigInt as F, IsMinLength as Ft, IsUnion as G, Keys as Gt, IsEnum as H, IsSymbol$1 as Ht, IsCodec as I, IsMultipleOf as It, _Object_ as J, Union as K, guard_exports as Kt, Hash as L, IsNull$1 as Lt, IsInteger as M, IsLessEqualThan as Mt, Boolean$1 as N, IsLessThan as Nt, IsLiteralString as O, IsGreaterEqualThan as Ot, IsBoolean as P, IsMaxLength as Pt, Ref as Q, hash_exports as R, IsNumber$2 as Rt, IsNull as S, IsBoolean$2 as St, IsLiteralBigInt as T, IsDeepEqual as Tt, IsCyclic as U, IsUndefined$1 as Ut, Enum as V, IsString$2 as Vt, Unknown as W, IsValueLike as Wt, Any as X, IsNever as Y, IsRef as Z, IsString as _, EveryAll as _t, Compare as a, IsBase as at, IsNumber as b, IsAsyncIterator$1 as bt, Unsafe as c, IsPromise as ct, Record as d, IsMap as dt, IsConstructor as et, RecordPattern as f, IsSet as ft, TemplateLiteralDecode as g, Every as gt, EnumToUnion as h, EntriesRegExp as ht, Options as i, Base as it, Integer as j, IsIterator$1 as jt, Literal as k, IsGreaterThan as kt, IsUndefined as l, IsSchema as lt, IsTuple as m, Entries as mt, Instantiate as n, Array$1 as nt, IsTemplateLiteral as o, IsOptional as ot, RecordValue as p, IsTypeArray as pt, IsObject as q, Partial as r, IsArray as rt, IsVoid as s, Optional as st, Evaluate as t, IsAsyncIterator as tt, IsRecord as u, Get as ut, String$1 as v, HasPropertyKey as vt, IsLiteral as w, IsConstructor$1 as wt, Number$1 as x, IsBigInt$1 as xt, IsSymbol as y, IsArray$1 as yt, Unreachable as z, IsObject$1 as zt };