@eslint-react/core 1.43.1-next.0 → 1.43.2-beta.2

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 (3) hide show
  1. package/dist/index.js +1228 -328
  2. package/dist/index.mjs +1228 -328
  3. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -35,343 +35,1235 @@ var JSX3__namespace = /*#__PURE__*/_interopNamespace(JSX3);
35
35
  var VAR__namespace = /*#__PURE__*/_interopNamespace(VAR);
36
36
  var birecord__default = /*#__PURE__*/_interopDefault(birecord);
37
37
 
38
- // src/component/component-collector.ts
38
+ var __defProp = Object.defineProperty;
39
+ var __export = (target, all) => {
40
+ for (var name in all)
41
+ __defProp(target, name, { get: all[name], enumerable: true });
42
+ };
39
43
 
40
- // ../../node_modules/.pnpm/valibot@1.0.0_typescript@5.8.3/node_modules/valibot/dist/index.js
41
- var store;
44
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/core.js
42
45
  // @__NO_SIDE_EFFECTS__
43
- function getGlobalConfig(config2) {
46
+ function $constructor(name, initializer) {
47
+ class _6 {
48
+ constructor(def) {
49
+ var _a;
50
+ const th = this;
51
+ _6.init(th, def);
52
+ (_a = th._zod).deferred ?? (_a.deferred = []);
53
+ for (const fn of th._zod.deferred) {
54
+ fn();
55
+ }
56
+ }
57
+ static init(inst, def) {
58
+ var _a;
59
+ inst._zod ?? (inst._zod = {});
60
+ (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
61
+ inst._zod.traits.add(name);
62
+ initializer(inst, def);
63
+ for (const k in _6.prototype) {
64
+ Object.defineProperty(inst, k, { value: _6.prototype[k].bind(inst) });
65
+ }
66
+ inst._zod.constr = _6;
67
+ inst._zod.def = def;
68
+ }
69
+ static [Symbol.hasInstance](inst) {
70
+ return inst?._zod?.traits?.has(name);
71
+ }
72
+ }
73
+ Object.defineProperty(_6, "name", { value: name });
74
+ return _6;
75
+ }
76
+ var $ZodAsyncError = class extends Error {
77
+ constructor() {
78
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
79
+ }
80
+ };
81
+ var globalConfig = {};
82
+ function config(config2) {
83
+ return globalConfig;
84
+ }
85
+
86
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/util.js
87
+ var util_exports = {};
88
+ __export(util_exports, {
89
+ BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
90
+ NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
91
+ aborted: () => aborted,
92
+ allowsEval: () => allowsEval,
93
+ assert: () => assert,
94
+ assertEqual: () => assertEqual,
95
+ assertIs: () => assertIs,
96
+ assertNever: () => assertNever,
97
+ assertNotEqual: () => assertNotEqual,
98
+ assignProp: () => assignProp,
99
+ cached: () => cached,
100
+ cleanInterfaceKey: () => cleanInterfaceKey,
101
+ cleanInterfaceShape: () => cleanInterfaceShape,
102
+ cleanRegex: () => cleanRegex,
103
+ clone: () => clone,
104
+ createTransparentProxy: () => createTransparentProxy,
105
+ defineLazy: () => defineLazy,
106
+ esc: () => esc,
107
+ escapeRegex: () => escapeRegex,
108
+ extend: () => extend,
109
+ extendObjectLike: () => extendObjectLike,
110
+ finalizeIssue: () => finalizeIssue,
111
+ floatSafeRemainder: () => floatSafeRemainder,
112
+ getElementAtPath: () => getElementAtPath,
113
+ getLengthableOrigin: () => getLengthableOrigin,
114
+ getParsedType: () => getParsedType,
115
+ getSizableOrigin: () => getSizableOrigin,
116
+ getValidEnumValues: () => getValidEnumValues,
117
+ isObject: () => isObject,
118
+ isPlainObject: () => isPlainObject,
119
+ issue: () => issue,
120
+ joinValues: () => joinValues,
121
+ jsonStringifyReplacer: () => jsonStringifyReplacer,
122
+ mergeObjectLike: () => mergeObjectLike,
123
+ normalizeObjectLikeDef: () => normalizeObjectLikeDef,
124
+ normalizeParams: () => normalizeParams,
125
+ nullish: () => nullish,
126
+ numKeys: () => numKeys,
127
+ omit: () => omit,
128
+ optionalInterfaceKeys: () => optionalInterfaceKeys,
129
+ optionalObjectKeys: () => optionalObjectKeys,
130
+ partialObjectLike: () => partialObjectLike,
131
+ pick: () => pick,
132
+ prefixIssues: () => prefixIssues,
133
+ primitiveTypes: () => primitiveTypes,
134
+ promiseAllObject: () => promiseAllObject,
135
+ propertyKeyTypes: () => propertyKeyTypes,
136
+ randomString: () => randomString,
137
+ requiredObjectLike: () => requiredObjectLike,
138
+ splitChecksAndParams: () => splitChecksAndParams,
139
+ stringifyPrimitive: () => stringifyPrimitive,
140
+ unwrapMessage: () => unwrapMessage
141
+ });
142
+ function assertEqual(val) {
143
+ return val;
144
+ }
145
+ function assertNotEqual(val) {
146
+ return val;
147
+ }
148
+ function assertIs(_arg) {
149
+ }
150
+ function assertNever(_x) {
151
+ throw new Error();
152
+ }
153
+ function assert(_6) {
154
+ }
155
+ function getValidEnumValues(obj) {
156
+ const validKeys = Object.keys(obj).filter((k) => typeof obj[obj[k]] !== "number");
157
+ const filtered = {};
158
+ for (const k of validKeys) {
159
+ filtered[k] = obj[k];
160
+ }
161
+ return Object.values(filtered);
162
+ }
163
+ function joinValues(array2, separator = "|") {
164
+ return array2.map((val) => stringifyPrimitive(val)).join(separator);
165
+ }
166
+ function jsonStringifyReplacer(_6, value) {
167
+ if (typeof value === "bigint")
168
+ return value.toString();
169
+ return value;
170
+ }
171
+ function cached(getter) {
44
172
  return {
45
- lang: config2?.lang ?? store?.lang,
46
- message: config2?.message,
47
- abortEarly: config2?.abortEarly ?? store?.abortEarly,
48
- abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
173
+ get value() {
174
+ {
175
+ const value = getter();
176
+ Object.defineProperty(this, "value", { value });
177
+ return value;
178
+ }
179
+ }
49
180
  };
50
181
  }
51
- var store2;
52
- // @__NO_SIDE_EFFECTS__
53
- function getGlobalMessage(lang) {
54
- return store2?.get(lang);
182
+ function nullish(input) {
183
+ return input === null || input === void 0;
184
+ }
185
+ function cleanRegex(source) {
186
+ const start = source.startsWith("^") ? 1 : 0;
187
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
188
+ return source.slice(start, end);
189
+ }
190
+ function floatSafeRemainder(val, step) {
191
+ const valDecCount = (val.toString().split(".")[1] || "").length;
192
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
193
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
194
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
195
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
196
+ return valInt % stepInt / 10 ** decCount;
197
+ }
198
+ function defineLazy(object2, key, getter) {
199
+ Object.defineProperty(object2, key, {
200
+ get() {
201
+ {
202
+ const value = getter();
203
+ object2[key] = value;
204
+ return value;
205
+ }
206
+ },
207
+ set(v) {
208
+ Object.defineProperty(object2, key, {
209
+ value: v
210
+ // configurable: true,
211
+ });
212
+ },
213
+ configurable: true
214
+ });
55
215
  }
56
- var store3;
57
- // @__NO_SIDE_EFFECTS__
58
- function getSchemaMessage(lang) {
59
- return store3?.get(lang);
216
+ function assignProp(target, prop, value) {
217
+ Object.defineProperty(target, prop, {
218
+ value,
219
+ writable: true,
220
+ enumerable: true,
221
+ configurable: true
222
+ });
60
223
  }
61
- var store4;
62
- // @__NO_SIDE_EFFECTS__
63
- function getSpecificMessage(reference, lang) {
64
- return store4?.get(reference)?.get(lang);
224
+ function getElementAtPath(obj, path) {
225
+ if (!path)
226
+ return obj;
227
+ return path.reduce((acc, key) => acc?.[key], obj);
228
+ }
229
+ function promiseAllObject(promisesObj) {
230
+ const keys = Object.keys(promisesObj);
231
+ const promises = keys.map((key) => promisesObj[key]);
232
+ return Promise.all(promises).then((results) => {
233
+ const resolvedObj = {};
234
+ for (let i = 0; i < keys.length; i++) {
235
+ resolvedObj[keys[i]] = results[i];
236
+ }
237
+ return resolvedObj;
238
+ });
65
239
  }
66
- // @__NO_SIDE_EFFECTS__
67
- function _stringify(input) {
68
- const type = typeof input;
69
- if (type === "string") {
70
- return `"${input}"`;
71
- }
72
- if (type === "number" || type === "bigint" || type === "boolean") {
73
- return `${input}`;
74
- }
75
- if (type === "object" || type === "function") {
76
- return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
77
- }
78
- return type;
79
- }
80
- function _addIssue(context, label, dataset, config2, other) {
81
- const input = other && "input" in other ? other.input : dataset.value;
82
- const expected = other?.expected ?? context.expects ?? null;
83
- const received = other?.received ?? /* @__PURE__ */ _stringify(input);
84
- const issue = {
85
- kind: context.kind,
86
- type: context.type,
87
- input,
88
- expected,
89
- received,
90
- message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
91
- requirement: context.requirement,
92
- path: other?.path,
93
- issues: other?.issues,
94
- lang: config2.lang,
95
- abortEarly: config2.abortEarly,
96
- abortPipeEarly: config2.abortPipeEarly
97
- };
98
- const isSchema = context.kind === "schema";
99
- const message = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
100
- if (message !== void 0) {
101
- issue.message = typeof message === "function" ? (
102
- // @ts-expect-error
103
- message(issue)
104
- ) : message;
105
- }
106
- if (isSchema) {
107
- dataset.typed = false;
108
- }
109
- if (dataset.issues) {
110
- dataset.issues.push(issue);
111
- } else {
112
- dataset.issues = [issue];
240
+ function randomString(length = 10) {
241
+ const chars = "abcdefghijklmnopqrstuvwxyz";
242
+ let str = "";
243
+ for (let i = 0; i < length; i++) {
244
+ str += chars[Math.floor(Math.random() * chars.length)];
113
245
  }
246
+ return str;
114
247
  }
115
- // @__NO_SIDE_EFFECTS__
116
- function _getStandardProps(context) {
248
+ function esc(str) {
249
+ return JSON.stringify(str);
250
+ }
251
+ function isObject(data) {
252
+ return typeof data === "object" && data !== null;
253
+ }
254
+ var allowsEval = cached(() => {
255
+ try {
256
+ new Function("");
257
+ return true;
258
+ } catch (_6) {
259
+ return false;
260
+ }
261
+ });
262
+ function isPlainObject(data) {
263
+ return typeof data === "object" && data !== null && Object.getPrototypeOf(data) === Object.prototype;
264
+ }
265
+ function numKeys(data) {
266
+ let keyCount = 0;
267
+ for (const key in data) {
268
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
269
+ keyCount++;
270
+ }
271
+ }
272
+ return keyCount;
273
+ }
274
+ var getParsedType = (data) => {
275
+ const t = typeof data;
276
+ switch (t) {
277
+ case "undefined":
278
+ return "undefined";
279
+ case "string":
280
+ return "string";
281
+ case "number":
282
+ return Number.isNaN(data) ? "nan" : "number";
283
+ case "boolean":
284
+ return "boolean";
285
+ case "function":
286
+ return "function";
287
+ case "bigint":
288
+ return "bigint";
289
+ case "symbol":
290
+ return "symbol";
291
+ case "object":
292
+ if (Array.isArray(data)) {
293
+ return "array";
294
+ }
295
+ if (data === null) {
296
+ return "null";
297
+ }
298
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
299
+ return "promise";
300
+ }
301
+ if (typeof Map !== "undefined" && data instanceof Map) {
302
+ return "map";
303
+ }
304
+ if (typeof Set !== "undefined" && data instanceof Set) {
305
+ return "set";
306
+ }
307
+ if (typeof Date !== "undefined" && data instanceof Date) {
308
+ return "date";
309
+ }
310
+ if (typeof File !== "undefined" && data instanceof File) {
311
+ return "file";
312
+ }
313
+ return "object";
314
+ default:
315
+ throw new Error(`Unknown data type: ${t}`);
316
+ }
317
+ };
318
+ var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
319
+ var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
320
+ function escapeRegex(str) {
321
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
322
+ }
323
+ function clone(inst, def) {
324
+ return new inst._zod.constr(def);
325
+ }
326
+ function splitChecksAndParams(_paramsOrChecks, _checks) {
327
+ const params = Array.isArray(_paramsOrChecks) ? {} : _paramsOrChecks ?? {};
328
+ const checks = Array.isArray(_paramsOrChecks) ? _paramsOrChecks : _checks ?? [];
117
329
  return {
118
- version: 1,
119
- vendor: "valibot",
120
- validate(value2) {
121
- return context["~run"]({ value: value2 }, /* @__PURE__ */ getGlobalConfig());
330
+ checks,
331
+ params
332
+ };
333
+ }
334
+ function normalizeParams(_params) {
335
+ const params = _params;
336
+ if (!params)
337
+ return {};
338
+ if (typeof params === "string")
339
+ return { error: () => params };
340
+ if (params?.message !== void 0) {
341
+ if (params?.error !== void 0)
342
+ throw new Error("Cannot specify both `message` and `error` params");
343
+ params.error = params.message;
344
+ }
345
+ delete params.message;
346
+ if (typeof params.error === "string")
347
+ return { ...params, error: () => params.error };
348
+ return params;
349
+ }
350
+ function createTransparentProxy(getter) {
351
+ let target;
352
+ return new Proxy({}, {
353
+ get(_6, prop, receiver) {
354
+ target ?? (target = getter());
355
+ return Reflect.get(target, prop, receiver);
356
+ },
357
+ set(_6, prop, value, receiver) {
358
+ target ?? (target = getter());
359
+ return Reflect.set(target, prop, value, receiver);
360
+ },
361
+ has(_6, prop) {
362
+ target ?? (target = getter());
363
+ return Reflect.has(target, prop);
364
+ },
365
+ deleteProperty(_6, prop) {
366
+ target ?? (target = getter());
367
+ return Reflect.deleteProperty(target, prop);
368
+ },
369
+ ownKeys(_6) {
370
+ target ?? (target = getter());
371
+ return Reflect.ownKeys(target);
372
+ },
373
+ getOwnPropertyDescriptor(_6, prop) {
374
+ target ?? (target = getter());
375
+ return Reflect.getOwnPropertyDescriptor(target, prop);
376
+ },
377
+ defineProperty(_6, prop, descriptor) {
378
+ target ?? (target = getter());
379
+ return Reflect.defineProperty(target, prop, descriptor);
380
+ }
381
+ // apply(target, thisArg, args) {
382
+ // return Reflect.apply(target, thisArg, args);
383
+ // },
384
+ // construct(target, args, newTarget) {
385
+ // return Reflect.construct(target, args, newTarget);
386
+ // },
387
+ });
388
+ }
389
+ function stringifyPrimitive(value) {
390
+ if (typeof value === "bigint")
391
+ return value.toString() + "n";
392
+ if (typeof value === "string")
393
+ return `"${value}"`;
394
+ return `${value}`;
395
+ }
396
+ function optionalObjectKeys(shape) {
397
+ return Object.keys(shape).filter((k) => {
398
+ return shape[k]._zod.qout === "true";
399
+ });
400
+ }
401
+ function optionalInterfaceKeys(shape) {
402
+ return Object.keys(shape).filter((k) => {
403
+ return k.endsWith("?");
404
+ }).map((k) => k.replace(/\?$/, ""));
405
+ }
406
+ function cleanInterfaceKey(key) {
407
+ return key.replace(/^\?/, "").replace(/\?$/, "");
408
+ }
409
+ function cleanInterfaceShape(_shape) {
410
+ const keyMap = {};
411
+ const shape = {};
412
+ const optional2 = [];
413
+ const defaulted = [];
414
+ for (const [key, value] of Object.entries(_shape)) {
415
+ if (key.endsWith("?"))
416
+ optional2.push(key.slice(0, -1));
417
+ if (key.startsWith("?"))
418
+ defaulted.push(key.slice(1));
419
+ const cleanKey = cleanInterfaceKey(key);
420
+ shape[cleanKey] = value;
421
+ keyMap[cleanKey] = key;
422
+ }
423
+ return { shape, keyMap, optional: optional2, defaulted };
424
+ }
425
+ var NUMBER_FORMAT_RANGES = {
426
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
427
+ int32: [-2147483648, 2147483647],
428
+ uint32: [0, 4294967295],
429
+ float32: [-34028234663852886e22, 34028234663852886e22],
430
+ float64: [-17976931348623157e292, 17976931348623157e292]
431
+ };
432
+ var BIGINT_FORMAT_RANGES = {
433
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
434
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
435
+ };
436
+ function pick(schema, mask) {
437
+ const newShape = {};
438
+ const newOptional = [];
439
+ const currShape = schema._zod.def.shape;
440
+ const currOptional = new Set(schema._zod.def.optional);
441
+ for (const key in mask) {
442
+ if (!(key in currShape)) {
443
+ throw new Error(`Unrecognized key: "${key}"`);
444
+ }
445
+ if (!mask[key])
446
+ continue;
447
+ newShape[key] = currShape[key];
448
+ if (currOptional.has(key)) {
449
+ newOptional.push(key);
450
+ }
451
+ }
452
+ return clone(schema, {
453
+ ...schema._zod.def,
454
+ shape: newShape,
455
+ optional: newOptional,
456
+ checks: []
457
+ });
458
+ }
459
+ function omit(schema, mask) {
460
+ const newShape = { ...schema._zod.def.shape };
461
+ const newOptional = new Set(schema._zod.def.optional);
462
+ for (const key in mask) {
463
+ if (!(key in schema._zod.def.shape)) {
464
+ throw new Error(`Unrecognized key: "${key}"`);
122
465
  }
466
+ if (!mask[key])
467
+ continue;
468
+ delete newShape[key];
469
+ newOptional.delete(key);
470
+ }
471
+ return clone(schema, {
472
+ ...schema._zod.def,
473
+ shape: newShape,
474
+ optional: [...newOptional],
475
+ checks: []
476
+ });
477
+ }
478
+ function extend(schema, shape) {
479
+ const def = {
480
+ ...schema._zod.def,
481
+ get shape() {
482
+ const _shape = { ...schema._zod.def.shape, ...shape };
483
+ assignProp(this, "shape", _shape);
484
+ return _shape;
485
+ },
486
+ checks: []
487
+ // delete existing checks
123
488
  };
489
+ defineLazy(def, "shape", () => ({ ...schema._zod.def.shape, ...shape }));
490
+ return clone(schema, def);
491
+ }
492
+ function mergeObjectLike(a, b) {
493
+ const bKeys = new Set(Object.keys(b._zod.def.shape));
494
+ const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
495
+ return clone(a, {
496
+ ...a._zod.def,
497
+ get shape() {
498
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
499
+ assignProp(this, "shape", _shape);
500
+ return _shape;
501
+ },
502
+ optional: optional2,
503
+ catchall: b._zod.def.catchall,
504
+ checks: []
505
+ // delete existing checks
506
+ });
124
507
  }
125
- var ValiError = class extends Error {
126
- /**
127
- * Creates a Valibot error with useful information.
128
- *
129
- * @param issues The error issues.
130
- */
508
+ function extendObjectLike(a, b) {
509
+ const bKeys = new Set(Object.keys(b._zod.def.shape));
510
+ const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
511
+ return clone(a, {
512
+ ...a._zod.def,
513
+ get shape() {
514
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
515
+ assignProp(this, "shape", _shape);
516
+ return _shape;
517
+ },
518
+ optional: optional2,
519
+ checks: []
520
+ // delete existent checks
521
+ });
522
+ }
523
+ function partialObjectLike(Class, schema, mask) {
524
+ const shape = { ...schema._zod.def.shape };
525
+ const optional2 = new Set(schema._zod.def.optional);
526
+ if (mask) {
527
+ for (const key in mask) {
528
+ if (!(key in shape)) {
529
+ throw new Error(`Unrecognized key: "${key}"`);
530
+ }
531
+ if (!mask[key])
532
+ continue;
533
+ shape[key] = new Class({
534
+ type: "optional",
535
+ innerType: schema._zod.def.shape[key]
536
+ });
537
+ optional2.add(key);
538
+ }
539
+ } else {
540
+ for (const key in schema._zod.def.shape) {
541
+ shape[key] = new Class({
542
+ type: "optional",
543
+ innerType: schema._zod.def.shape[key]
544
+ });
545
+ optional2.add(key);
546
+ }
547
+ }
548
+ return clone(schema, {
549
+ ...schema._zod.def,
550
+ shape,
551
+ optional: [...optional2],
552
+ checks: []
553
+ });
554
+ }
555
+ function requiredObjectLike(Class, schema, mask) {
556
+ const shape = { ...schema._zod.def.shape };
557
+ if (mask) {
558
+ for (const key in mask) {
559
+ if (!(key in shape)) {
560
+ throw new Error(`Unrecognized key: "${key}"`);
561
+ }
562
+ if (!mask[key])
563
+ continue;
564
+ shape[key] = new Class({
565
+ type: "nonoptional",
566
+ innerType: schema._zod.def.shape[key]
567
+ });
568
+ }
569
+ } else {
570
+ for (const key in schema._zod.def.shape) {
571
+ shape[key] = new Class({
572
+ type: "nonoptional",
573
+ innerType: schema._zod.def.shape[key]
574
+ });
575
+ }
576
+ }
577
+ return clone(schema, {
578
+ ...schema._zod.def,
579
+ shape,
580
+ optional: [],
581
+ checks: []
582
+ });
583
+ }
584
+ function normalizeObjectLikeDef(def) {
585
+ if (def.type === "interface") {
586
+ const keys = Object.keys(def.shape);
587
+ const keySet = new Set(Object.keys(def.shape));
588
+ return {
589
+ shape: { ...def.shape },
590
+ // resolve getters
591
+ keys,
592
+ keySet,
593
+ numKeys: keys.length,
594
+ optionalKeys: new Set(def.optional)
595
+ };
596
+ }
597
+ if (def.type === "object") {
598
+ const keys = Object.keys(def.shape);
599
+ const keySet = new Set(Object.keys(def.shape));
600
+ return {
601
+ shape: { ...def.shape },
602
+ // resolve getters
603
+ keys,
604
+ keySet,
605
+ numKeys: keys.length,
606
+ optionalKeys: new Set(def.optional)
607
+ };
608
+ }
609
+ throw new Error("Invalid object-like type");
610
+ }
611
+ function aborted(x, startIndex = 0) {
612
+ for (let i = startIndex; i < x.issues.length; i++) {
613
+ if (x.issues[i].continue !== true)
614
+ return true;
615
+ }
616
+ return false;
617
+ }
618
+ function prefixIssues(path, issues) {
619
+ return issues.map((iss) => {
620
+ var _a;
621
+ (_a = iss).path ?? (_a.path = []);
622
+ iss.path.unshift(path);
623
+ return iss;
624
+ });
625
+ }
626
+ function unwrapMessage(message) {
627
+ return typeof message === "string" ? message : message?.message;
628
+ }
629
+ function finalizeIssue(iss, ctx, config2) {
630
+ const full = { ...iss, path: iss.path ?? [] };
631
+ if (!iss.message) {
632
+ const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
633
+ full.message = message;
634
+ }
635
+ delete full.inst;
636
+ delete full.continue;
637
+ if (!ctx?.reportInput) {
638
+ delete full.input;
639
+ }
640
+ return full;
641
+ }
642
+ function getSizableOrigin(input) {
643
+ if (input instanceof Set)
644
+ return "set";
645
+ if (input instanceof Map)
646
+ return "map";
647
+ if (input instanceof File)
648
+ return "file";
649
+ return "unknown";
650
+ }
651
+ function getLengthableOrigin(input) {
652
+ if (Array.isArray(input))
653
+ return "array";
654
+ if (typeof input === "string")
655
+ return "string";
656
+ return "unknown";
657
+ }
658
+ function issue(...args) {
659
+ const [iss, input, inst] = args;
660
+ if (typeof iss === "string") {
661
+ return {
662
+ message: iss,
663
+ code: "custom",
664
+ input,
665
+ inst
666
+ };
667
+ }
668
+ return { ...iss };
669
+ }
670
+
671
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/errors.js
672
+ var ZOD_ERROR = Symbol.for("{{zod.error}}");
673
+ var $ZodError = class {
674
+ get message() {
675
+ return JSON.stringify(this.issues, jsonStringifyReplacer, 2);
676
+ }
131
677
  constructor(issues) {
132
- super(issues[0].message);
133
- this.name = "ValiError";
678
+ Object.defineProperty(this, "_tag", { value: ZOD_ERROR, enumerable: false });
679
+ Object.defineProperty(this, "name", { value: "$ZodError", enumerable: false });
134
680
  this.issues = issues;
135
681
  }
682
+ // @ts-ignore
683
+ static [Symbol.hasInstance](inst) {
684
+ return inst?._tag === ZOD_ERROR;
685
+ }
136
686
  };
137
- // @__NO_SIDE_EFFECTS__
138
- function getFallback(schema, dataset, config2) {
139
- return typeof schema.fallback === "function" ? (
140
- // @ts-expect-error
141
- schema.fallback(dataset, config2)
142
- ) : (
143
- // @ts-expect-error
144
- schema.fallback
145
- );
687
+
688
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/parse.js
689
+ function _parse(schema, value, _ctx) {
690
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
691
+ const result = schema._zod.run({ value, issues: [] }, ctx);
692
+ if (result instanceof Promise) {
693
+ throw new $ZodAsyncError();
694
+ }
695
+ if (result.issues.length) {
696
+ throw new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
697
+ }
698
+ return result.value;
146
699
  }
147
- // @__NO_SIDE_EFFECTS__
148
- function getDefault(schema, dataset, config2) {
149
- return typeof schema.default === "function" ? (
150
- // @ts-expect-error
151
- schema.default(dataset, config2)
152
- ) : (
153
- // @ts-expect-error
154
- schema.default
155
- );
700
+ function _safeParse(schema, value, _ctx) {
701
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
702
+ const result = schema._zod.run({ value, issues: [] }, ctx);
703
+ if (result instanceof Promise) {
704
+ throw new $ZodAsyncError();
705
+ }
706
+ return result.issues.length ? {
707
+ success: false,
708
+ error: new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
709
+ } : { success: true, data: result.value };
710
+ }
711
+ async function _parseAsync(schema, value, _ctx) {
712
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
713
+ let result = schema._zod.run({ value, issues: [] }, ctx);
714
+ if (result instanceof Promise)
715
+ result = await result;
716
+ if (result.issues.length) {
717
+ throw new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
718
+ }
719
+ return result.value;
720
+ }
721
+ async function _safeParseAsync(schema, value, _ctx) {
722
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
723
+ let result = schema._zod.run({ value, issues: [] }, ctx);
724
+ if (result instanceof Promise)
725
+ result = await result;
726
+ if (result.issues.length) {
727
+ return {
728
+ success: false,
729
+ error: new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
730
+ };
731
+ }
732
+ return { success: true, data: result.value };
156
733
  }
157
- // @__NO_SIDE_EFFECTS__
158
- function array(item, message) {
159
- return {
160
- kind: "schema",
161
- type: "array",
162
- reference: array,
163
- expects: "Array",
164
- async: false,
165
- item,
166
- message,
167
- get "~standard"() {
168
- return /* @__PURE__ */ _getStandardProps(this);
169
- },
170
- "~run"(dataset, config2) {
171
- const input = dataset.value;
172
- if (Array.isArray(input)) {
173
- dataset.typed = true;
174
- dataset.value = [];
175
- for (let key = 0; key < input.length; key++) {
176
- const value2 = input[key];
177
- const itemDataset = this.item["~run"]({ value: value2 }, config2);
178
- if (itemDataset.issues) {
179
- const pathItem = {
180
- type: "array",
181
- origin: "value",
182
- input,
183
- key,
184
- value: value2
185
- };
186
- for (const issue of itemDataset.issues) {
187
- if (issue.path) {
188
- issue.path.unshift(pathItem);
189
- } else {
190
- issue.path = [pathItem];
191
- }
192
- dataset.issues?.push(issue);
193
- }
194
- if (!dataset.issues) {
195
- dataset.issues = itemDataset.issues;
196
- }
197
- if (config2.abortEarly) {
198
- dataset.typed = false;
199
- break;
200
- }
201
- }
202
- if (!itemDataset.typed) {
203
- dataset.typed = false;
734
+ var string = (params) => {
735
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
736
+ return new RegExp(`^${regex}$`);
737
+ };
738
+ var boolean = /true|false/i;
739
+
740
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/doc.js
741
+ var Doc = class {
742
+ constructor(args) {
743
+ this.content = [];
744
+ this.indent = 0;
745
+ this.args = args;
746
+ }
747
+ indented(fn) {
748
+ this.indent += 1;
749
+ fn(this);
750
+ this.indent -= 1;
751
+ }
752
+ write(arg) {
753
+ if (typeof arg === "function") {
754
+ arg(this, { execution: "sync" });
755
+ arg(this, { execution: "async" });
756
+ return;
757
+ }
758
+ const content = arg;
759
+ const lines = content.split("\n").filter((x) => x);
760
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
761
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
762
+ for (const line of dedented) {
763
+ this.content.push(line);
764
+ }
765
+ }
766
+ compile() {
767
+ const lines = [...this.content.map((x) => ` ${x}`)];
768
+ return new Function(...this.args, lines.join("\n"));
769
+ }
770
+ };
771
+
772
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/versions.js
773
+ var version = {
774
+ major: 0,
775
+ minor: 3,
776
+ patch: 3
777
+ };
778
+
779
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/schemas.js
780
+ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
781
+ var _a;
782
+ inst ?? (inst = {});
783
+ inst._zod.id = def.type + "_" + randomString(10);
784
+ inst._zod.def = def;
785
+ inst._zod.computed = inst._zod.computed || {};
786
+ inst._zod.version = version;
787
+ const checks = [...inst._zod.def.checks ?? []];
788
+ def.type;
789
+ if (inst._zod.traits.has("$ZodCheck")) {
790
+ checks.unshift(inst);
791
+ }
792
+ for (const ch of checks) {
793
+ ch._zod.onattach?.(inst);
794
+ }
795
+ if (checks.length === 0) {
796
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
797
+ inst._zod.deferred?.push(() => {
798
+ inst._zod.run = inst._zod.parse;
799
+ });
800
+ } else {
801
+ const runChecks = (payload, checks2, ctx) => {
802
+ let isAborted = aborted(payload);
803
+ let asyncResult;
804
+ for (const ch of checks2) {
805
+ if (ch._zod.when) {
806
+ const shouldRun = ch._zod.when(payload);
807
+ if (!shouldRun)
808
+ continue;
809
+ } else {
810
+ if (isAborted) {
811
+ continue;
204
812
  }
205
- dataset.value.push(itemDataset.value);
206
813
  }
814
+ const currLen = payload.issues.length;
815
+ const _6 = ch._zod.check(payload);
816
+ if (_6 instanceof Promise && ctx?.async === false) {
817
+ throw new $ZodAsyncError();
818
+ }
819
+ if (asyncResult || _6 instanceof Promise) {
820
+ asyncResult = asyncResult ?? Promise.resolve();
821
+ asyncResult.then(async () => {
822
+ await _6;
823
+ const nextLen = payload.issues.length;
824
+ if (nextLen === currLen)
825
+ return;
826
+ if (!isAborted)
827
+ isAborted = aborted(payload, currLen);
828
+ });
829
+ } else {
830
+ const nextLen = payload.issues.length;
831
+ if (nextLen === currLen)
832
+ continue;
833
+ if (!isAborted)
834
+ isAborted = aborted(payload, currLen);
835
+ }
836
+ }
837
+ if (asyncResult) {
838
+ return asyncResult.then(() => {
839
+ return payload;
840
+ });
841
+ }
842
+ return payload;
843
+ };
844
+ inst._zod.run = (payload, ctx) => {
845
+ const result = inst._zod.parse(payload, ctx);
846
+ if (result instanceof Promise) {
847
+ if (ctx.async === false)
848
+ throw new $ZodAsyncError();
849
+ return result.then((result2) => runChecks(result2, checks, ctx));
850
+ }
851
+ return runChecks(result, checks, ctx);
852
+ };
853
+ }
854
+ inst["~standard"] = {
855
+ validate: (value) => {
856
+ const result = inst._zod.run({ value, issues: [] }, {});
857
+ if (result instanceof Promise) {
858
+ return result.then(({ issues, value: value2 }) => {
859
+ if (issues.length === 0)
860
+ return { value: value2 };
861
+ return { issues };
862
+ });
863
+ }
864
+ if (result.issues.length === 0)
865
+ return { value: result.value };
866
+ return { issues: result.issues };
867
+ },
868
+ vendor: "zod",
869
+ version: 1
870
+ };
871
+ });
872
+ var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
873
+ $ZodType.init(inst, def);
874
+ inst._zod.pattern = inst?._zod.computed?.pattern ?? string(inst._zod.computed);
875
+ inst._zod.parse = (payload, _6) => {
876
+ if (def.coerce)
877
+ try {
878
+ payload.value = String(payload.value);
879
+ } catch (_7) {
880
+ }
881
+ if (typeof payload.value === "string")
882
+ return payload;
883
+ payload.issues.push({
884
+ expected: "string",
885
+ code: "invalid_type",
886
+ input: payload.value,
887
+ inst
888
+ });
889
+ return payload;
890
+ };
891
+ });
892
+ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
893
+ $ZodType.init(inst, def);
894
+ inst._zod.pattern = boolean;
895
+ inst._zod.parse = (payload, _ctx) => {
896
+ if (def.coerce)
897
+ try {
898
+ payload.value = Boolean(payload.value);
899
+ } catch (_6) {
900
+ }
901
+ const input = payload.value;
902
+ if (typeof input === "boolean")
903
+ return payload;
904
+ payload.issues.push({
905
+ expected: "boolean",
906
+ code: "invalid_type",
907
+ input,
908
+ inst
909
+ });
910
+ return payload;
911
+ };
912
+ });
913
+ function handleArrayResult(result, final, index) {
914
+ if (result.issues.length) {
915
+ final.issues.push(...prefixIssues(index, result.issues));
916
+ }
917
+ final.value[index] = result.value;
918
+ }
919
+ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
920
+ $ZodType.init(inst, def);
921
+ inst._zod.parse = (payload, ctx) => {
922
+ const input = payload.value;
923
+ if (!Array.isArray(input)) {
924
+ payload.issues.push({
925
+ expected: "array",
926
+ code: "invalid_type",
927
+ input,
928
+ inst
929
+ });
930
+ return payload;
931
+ }
932
+ payload.value = Array(input.length);
933
+ const proms = [];
934
+ for (let i = 0; i < input.length; i++) {
935
+ const item = input[i];
936
+ const result = def.element._zod.run({
937
+ value: item,
938
+ issues: []
939
+ }, ctx);
940
+ if (result instanceof Promise) {
941
+ proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
207
942
  } else {
208
- _addIssue(this, "type", dataset, config2);
943
+ handleArrayResult(result, payload, i);
209
944
  }
210
- return dataset;
211
945
  }
946
+ if (proms.length) {
947
+ return Promise.all(proms).then(() => payload);
948
+ }
949
+ return payload;
212
950
  };
951
+ });
952
+ function handleObjectResult(result, final, key) {
953
+ if (result.issues.length) {
954
+ final.issues.push(...prefixIssues(key, result.issues));
955
+ } else {
956
+ final.value[key] = result.value;
957
+ }
213
958
  }
214
- // @__NO_SIDE_EFFECTS__
215
- function boolean(message) {
216
- return {
217
- kind: "schema",
218
- type: "boolean",
219
- reference: boolean,
220
- expects: "boolean",
221
- async: false,
222
- message,
223
- get "~standard"() {
224
- return /* @__PURE__ */ _getStandardProps(this);
225
- },
226
- "~run"(dataset, config2) {
227
- if (typeof dataset.value === "boolean") {
228
- dataset.typed = true;
229
- } else {
230
- _addIssue(this, "type", dataset, config2);
959
+ function handleOptionalObjectResult(result, final, key, input) {
960
+ if (result.issues.length) {
961
+ if (input[key] === void 0) {
962
+ if (key in input) {
963
+ final.value[key] = void 0;
231
964
  }
232
- return dataset;
965
+ } else {
966
+ final.issues.push(...prefixIssues(key, result.issues));
233
967
  }
234
- };
968
+ } else if (result.value === void 0) {
969
+ if (key in input)
970
+ final.value[key] = void 0;
971
+ } else {
972
+ final.value[key] = result.value;
973
+ }
235
974
  }
236
- // @__NO_SIDE_EFFECTS__
237
- function object(entries, message) {
238
- return {
239
- kind: "schema",
240
- type: "object",
241
- reference: object,
242
- expects: "Object",
243
- async: false,
244
- entries,
245
- message,
246
- get "~standard"() {
247
- return /* @__PURE__ */ _getStandardProps(this);
248
- },
249
- "~run"(dataset, config2) {
250
- const input = dataset.value;
251
- if (input && typeof input === "object") {
252
- dataset.typed = true;
253
- dataset.value = {};
254
- for (const key in this.entries) {
255
- const valueSchema = this.entries[key];
256
- if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && // @ts-expect-error
257
- valueSchema.default !== void 0) {
258
- const value2 = key in input ? (
259
- // @ts-expect-error
260
- input[key]
261
- ) : /* @__PURE__ */ getDefault(valueSchema);
262
- const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
263
- if (valueDataset.issues) {
264
- const pathItem = {
265
- type: "object",
266
- origin: "value",
267
- input,
268
- key,
269
- value: value2
270
- };
271
- for (const issue of valueDataset.issues) {
272
- if (issue.path) {
273
- issue.path.unshift(pathItem);
274
- } else {
275
- issue.path = [pathItem];
276
- }
277
- dataset.issues?.push(issue);
278
- }
279
- if (!dataset.issues) {
280
- dataset.issues = valueDataset.issues;
281
- }
282
- if (config2.abortEarly) {
283
- dataset.typed = false;
284
- break;
285
- }
286
- }
287
- if (!valueDataset.typed) {
288
- dataset.typed = false;
289
- }
290
- dataset.value[key] = valueDataset.value;
291
- } else if (valueSchema.fallback !== void 0) {
292
- dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
293
- } else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
294
- _addIssue(this, "key", dataset, config2, {
295
- input: void 0,
296
- expected: `"${key}"`,
297
- path: [
298
- {
299
- type: "object",
300
- origin: "key",
301
- input,
302
- key,
303
- // @ts-expect-error
304
- value: input[key]
305
- }
306
- ]
307
- });
308
- if (config2.abortEarly) {
309
- break;
975
+ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def) => {
976
+ $ZodType.init(inst, def);
977
+ defineLazy(inst._zod, "shape", () => def.shape);
978
+ const _normalized = cached(() => {
979
+ const keys = Object.keys(def.shape);
980
+ return {
981
+ shape: def.shape,
982
+ keys,
983
+ keySet: new Set(keys),
984
+ numKeys: keys.length,
985
+ optionalKeys: new Set(def.optional)
986
+ };
987
+ });
988
+ defineLazy(inst._zod, "disc", () => {
989
+ const shape = def.shape;
990
+ const discMap = /* @__PURE__ */ new Map();
991
+ let hasDisc = false;
992
+ for (const key in shape) {
993
+ const field = shape[key]._zod;
994
+ if (field.values || field.disc) {
995
+ hasDisc = true;
996
+ const o = {
997
+ values: new Set(field.values ?? []),
998
+ maps: field.disc ? [field.disc] : []
999
+ };
1000
+ discMap.set(key, o);
1001
+ }
1002
+ }
1003
+ if (!hasDisc)
1004
+ return void 0;
1005
+ return discMap;
1006
+ });
1007
+ const generateFastpass = (shape) => {
1008
+ const doc = new Doc(["shape", "payload", "ctx"]);
1009
+ const { keys, optionalKeys } = _normalized.value;
1010
+ const parseStr = (key) => {
1011
+ const k = esc(key);
1012
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1013
+ };
1014
+ doc.write(`const input = payload.value;`);
1015
+ const ids = {};
1016
+ for (const key of keys) {
1017
+ ids[key] = randomString(15);
1018
+ }
1019
+ for (const key of keys) {
1020
+ if (optionalKeys.has(key))
1021
+ continue;
1022
+ const id = ids[key];
1023
+ doc.write(`const ${id} = ${parseStr(key)};`);
1024
+ doc.write(`
1025
+ if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1026
+ ...iss,
1027
+ path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
1028
+ })));`);
1029
+ }
1030
+ doc.write(`payload.value = {`);
1031
+ doc.indented(() => {
1032
+ for (const key of keys) {
1033
+ if (optionalKeys.has(key))
1034
+ continue;
1035
+ const id = ids[key];
1036
+ doc.write(` ${esc(key)}: ${id}.value,`);
1037
+ }
1038
+ });
1039
+ doc.write(`}`);
1040
+ for (const key of keys) {
1041
+ if (!optionalKeys.has(key))
1042
+ continue;
1043
+ const id = ids[key];
1044
+ doc.write(`const ${id} = ${parseStr(key)};`);
1045
+ const k = esc(key);
1046
+ doc.write(`
1047
+ if (${id}.issues.length) {
1048
+ if (input[${k}] === undefined) {
1049
+ if (${k} in input) {
1050
+ payload.value[${k}] = undefined;
310
1051
  }
1052
+ } else {
1053
+ payload.issues = payload.issues.concat(
1054
+ ${id}.issues.map((iss) => ({
1055
+ ...iss,
1056
+ path: iss.path ? [${k}, ...iss.path] : [${k}],
1057
+ }))
1058
+ );
1059
+ }
1060
+ } else if (${id}.value === undefined) {
1061
+ if (${k} in input) payload.value[${k}] = undefined;
1062
+ } else {
1063
+ payload.value[${k}] = ${id}.value;
1064
+ }
1065
+ `);
1066
+ }
1067
+ doc.write(`return payload;`);
1068
+ const fn = doc.compile();
1069
+ return (payload, ctx) => fn(shape, payload, ctx);
1070
+ };
1071
+ let fastpass;
1072
+ const fastEnabled = allowsEval.value;
1073
+ const isObject2 = isObject;
1074
+ const { catchall } = def;
1075
+ let value;
1076
+ inst._zod.parse = (payload, ctx) => {
1077
+ value ?? (value = _normalized.value);
1078
+ const input = payload.value;
1079
+ if (!isObject2(input)) {
1080
+ payload.issues.push({
1081
+ expected: "object",
1082
+ code: "invalid_type",
1083
+ input,
1084
+ inst
1085
+ });
1086
+ return payload;
1087
+ }
1088
+ const proms = [];
1089
+ if (fastEnabled && ctx?.async === false && ctx.noPrecompilation !== true) {
1090
+ if (!fastpass)
1091
+ fastpass = generateFastpass(def.shape);
1092
+ payload = fastpass(payload, ctx);
1093
+ } else {
1094
+ payload.value = {};
1095
+ const { keys, shape, optionalKeys } = value;
1096
+ for (const key of keys) {
1097
+ const valueSchema = shape[key];
1098
+ const r = valueSchema._zod.run({ value: input[key], issues: [] }, ctx);
1099
+ const isOptional = optionalKeys.has(key);
1100
+ if (r instanceof Promise) {
1101
+ proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
1102
+ } else {
1103
+ if (isOptional) {
1104
+ handleOptionalObjectResult(r, payload, key, input);
1105
+ } else {
1106
+ handleObjectResult(r, payload, key);
311
1107
  }
312
1108
  }
1109
+ }
1110
+ }
1111
+ if (!catchall) {
1112
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
1113
+ }
1114
+ const unrecognized = [];
1115
+ const keySet = value.keySet;
1116
+ const _catchall = catchall._zod;
1117
+ const t = _catchall.def.type;
1118
+ for (const key of Object.keys(input)) {
1119
+ if (keySet.has(key))
1120
+ continue;
1121
+ if (t === "never") {
1122
+ unrecognized.push(key);
1123
+ continue;
1124
+ }
1125
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1126
+ if (r instanceof Promise) {
1127
+ proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
313
1128
  } else {
314
- _addIssue(this, "type", dataset, config2);
1129
+ handleObjectResult(r, payload, key);
315
1130
  }
316
- return dataset;
317
1131
  }
1132
+ if (unrecognized.length) {
1133
+ payload.issues.push({
1134
+ code: "unrecognized_keys",
1135
+ keys: unrecognized,
1136
+ input,
1137
+ inst
1138
+ });
1139
+ }
1140
+ if (!proms.length)
1141
+ return payload;
1142
+ return Promise.all(proms).then(() => {
1143
+ return payload;
1144
+ });
318
1145
  };
319
- }
320
- // @__NO_SIDE_EFFECTS__
321
- function optional(wrapped, default_) {
322
- return {
323
- kind: "schema",
324
- type: "optional",
325
- reference: optional,
326
- expects: `(${wrapped.expects} | undefined)`,
327
- async: false,
328
- wrapped,
329
- default: default_,
330
- get "~standard"() {
331
- return /* @__PURE__ */ _getStandardProps(this);
332
- },
333
- "~run"(dataset, config2) {
334
- if (dataset.value === void 0) {
335
- if (this.default !== void 0) {
336
- dataset.value = /* @__PURE__ */ getDefault(this, dataset, config2);
337
- }
338
- if (dataset.value === void 0) {
339
- dataset.typed = true;
340
- return dataset;
341
- }
342
- }
343
- return this.wrapped["~run"](dataset, config2);
1146
+ });
1147
+ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1148
+ $ZodObjectLike.init(inst, def);
1149
+ });
1150
+ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
1151
+ $ZodType.init(inst, def);
1152
+ inst._zod.qout = "true";
1153
+ if (def.innerType._zod.values)
1154
+ inst._zod.values = /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]);
1155
+ const pattern = def.innerType._zod.pattern;
1156
+ if (pattern)
1157
+ inst._zod.pattern = new RegExp(`^(${cleanRegex(pattern.source)})?$`);
1158
+ inst._zod.parse = (payload, ctx) => {
1159
+ if (payload.value === void 0) {
1160
+ return payload;
344
1161
  }
1162
+ return def.innerType._zod.run(payload, ctx);
345
1163
  };
346
- }
347
- // @__NO_SIDE_EFFECTS__
348
- function string(message) {
349
- return {
350
- kind: "schema",
1164
+ });
1165
+
1166
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/api.js
1167
+ function _string(Class, params) {
1168
+ return new Class({
351
1169
  type: "string",
352
- reference: string,
353
- expects: "string",
354
- async: false,
355
- message,
356
- get "~standard"() {
357
- return /* @__PURE__ */ _getStandardProps(this);
1170
+ ...normalizeParams(params)
1171
+ });
1172
+ }
1173
+ function _boolean(Class, params) {
1174
+ return new Class({
1175
+ type: "boolean",
1176
+ ...normalizeParams(params)
1177
+ });
1178
+ }
1179
+
1180
+ // ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.20250411T005215_60e10b0f348e07070e4d24639ea7d4ee/node_modules/@zod/mini/dist/esm/parse.js
1181
+ var parse2 = /* @__PURE__ */ _parse.bind({ Error: $ZodError });
1182
+ var safeParse = /* @__PURE__ */ _safeParse.bind({ Error: $ZodError });
1183
+ var parseAsync2 = /* @__PURE__ */ _parseAsync.bind({ Error: $ZodError });
1184
+ var safeParseAsync = /* @__PURE__ */ _safeParseAsync.bind({
1185
+ Error: $ZodError
1186
+ });
1187
+
1188
+ // ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.20250411T005215_60e10b0f348e07070e4d24639ea7d4ee/node_modules/@zod/mini/dist/esm/schemas.js
1189
+ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
1190
+ if (!inst._zod)
1191
+ throw new Error("Uninitialized schema in mixin ZodMiniType.");
1192
+ $ZodType.init(inst, def);
1193
+ inst.def = def;
1194
+ inst.parse = (data, params) => parse2(inst, data, params);
1195
+ inst.safeParse = (data, params) => safeParse(inst, data, params);
1196
+ inst.parseAsync = async (data, params) => parseAsync2(inst, data, params);
1197
+ inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
1198
+ inst.check = (...checks) => {
1199
+ return inst.clone({
1200
+ ...def,
1201
+ checks: [
1202
+ ...def.checks ?? [],
1203
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" } } } : ch)
1204
+ ]
1205
+ });
1206
+ };
1207
+ inst.clone = (_def) => clone(inst, _def ?? def);
1208
+ inst.brand = () => inst;
1209
+ inst.register = (reg, meta) => {
1210
+ reg.add(inst, meta);
1211
+ return inst;
1212
+ };
1213
+ });
1214
+ var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
1215
+ $ZodString.init(inst, def);
1216
+ ZodMiniType.init(inst, def);
1217
+ });
1218
+ function string2(params) {
1219
+ return _string(ZodMiniString, params);
1220
+ }
1221
+ var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
1222
+ $ZodBoolean.init(inst, def);
1223
+ ZodMiniType.init(inst, def);
1224
+ });
1225
+ function boolean2(params) {
1226
+ return _boolean(ZodMiniBoolean, params);
1227
+ }
1228
+ var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
1229
+ $ZodArray.init(inst, def);
1230
+ ZodMiniType.init(inst, def);
1231
+ });
1232
+ function array(element, params) {
1233
+ return new ZodMiniArray({
1234
+ type: "array",
1235
+ element,
1236
+ // get element() {
1237
+ // return element;
1238
+ // },
1239
+ ...util_exports.normalizeParams(params)
1240
+ });
1241
+ }
1242
+ var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
1243
+ $ZodObject.init(inst, def);
1244
+ ZodMiniType.init(inst, def);
1245
+ });
1246
+ function object(shape, params) {
1247
+ const def = {
1248
+ type: "object",
1249
+ shape: shape ?? {},
1250
+ get optional() {
1251
+ return util_exports.optionalObjectKeys(shape ?? {});
358
1252
  },
359
- "~run"(dataset, config2) {
360
- if (typeof dataset.value === "string") {
361
- dataset.typed = true;
362
- } else {
363
- _addIssue(this, "type", dataset, config2);
364
- }
365
- return dataset;
366
- }
1253
+ ...util_exports.normalizeParams(params)
367
1254
  };
1255
+ return new ZodMiniObject(def);
368
1256
  }
369
- function parse(schema, input, config2) {
370
- const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config2));
371
- if (dataset.issues) {
372
- throw new ValiError(dataset.issues);
373
- }
374
- return dataset.value;
1257
+ var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
1258
+ $ZodOptional.init(inst, def);
1259
+ ZodMiniType.init(inst, def);
1260
+ });
1261
+ function optional(innerType, params) {
1262
+ return new ZodMiniOptional({
1263
+ type: "optional",
1264
+ innerType,
1265
+ ...util_exports.normalizeParams(params)
1266
+ });
375
1267
  }
376
1268
 
377
1269
  // ../shared/src/schemas.ts
@@ -381,26 +1273,26 @@ var CustomComponentPropSchema = object({
381
1273
  * @example
382
1274
  * "to"
383
1275
  */
384
- name: string(),
1276
+ name: string2(),
385
1277
  /**
386
1278
  * The name of the prop in the host component.
387
1279
  * @example
388
1280
  * "href"
389
1281
  */
390
- as: optional(string()),
1282
+ as: optional(string2()),
391
1283
  /**
392
1284
  * Whether the prop is controlled or not in the user-defined component.
393
1285
  * @internal
394
1286
  * @example
395
1287
  * `true`
396
1288
  */
397
- controlled: optional(boolean()),
1289
+ controlled: optional(boolean2()),
398
1290
  /**
399
1291
  * The default value of the prop in the user-defined component.
400
1292
  * @example
401
1293
  * `"/"`
402
1294
  */
403
- defaultValue: optional(string())
1295
+ defaultValue: optional(string2())
404
1296
  });
405
1297
  var CustomComponentSchema = object({
406
1298
  /**
@@ -408,13 +1300,13 @@ var CustomComponentSchema = object({
408
1300
  * @example
409
1301
  * "Link"
410
1302
  */
411
- name: string(),
1303
+ name: string2(),
412
1304
  /**
413
1305
  * The name of the host component that the user-defined component represents.
414
1306
  * @example
415
1307
  * "a"
416
1308
  */
417
- as: optional(string()),
1309
+ as: optional(string2()),
418
1310
  /**
419
1311
  * Attributes mapping between the user-defined component and the host component.
420
1312
  * @example
@@ -427,28 +1319,28 @@ var CustomComponentSchema = object({
427
1319
  * @example
428
1320
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
429
1321
  */
430
- selector: optional(string())
1322
+ selector: optional(string2())
431
1323
  });
432
1324
  var CustomHooksSchema = object({
433
- use: optional(array(string())),
434
- useActionState: optional(array(string())),
435
- useCallback: optional(array(string())),
436
- useContext: optional(array(string())),
437
- useDebugValue: optional(array(string())),
438
- useDeferredValue: optional(array(string())),
439
- useEffect: optional(array(string())),
440
- useFormStatus: optional(array(string())),
441
- useId: optional(array(string())),
442
- useImperativeHandle: optional(array(string())),
443
- useInsertionEffect: optional(array(string())),
444
- useLayoutEffect: optional(array(string())),
445
- useMemo: optional(array(string())),
446
- useOptimistic: optional(array(string())),
447
- useReducer: optional(array(string())),
448
- useRef: optional(array(string())),
449
- useState: optional(array(string())),
450
- useSyncExternalStore: optional(array(string())),
451
- useTransition: optional(array(string()))
1325
+ use: optional(array(string2())),
1326
+ useActionState: optional(array(string2())),
1327
+ useCallback: optional(array(string2())),
1328
+ useContext: optional(array(string2())),
1329
+ useDebugValue: optional(array(string2())),
1330
+ useDeferredValue: optional(array(string2())),
1331
+ useEffect: optional(array(string2())),
1332
+ useFormStatus: optional(array(string2())),
1333
+ useId: optional(array(string2())),
1334
+ useImperativeHandle: optional(array(string2())),
1335
+ useInsertionEffect: optional(array(string2())),
1336
+ useLayoutEffect: optional(array(string2())),
1337
+ useMemo: optional(array(string2())),
1338
+ useOptimistic: optional(array(string2())),
1339
+ useReducer: optional(array(string2())),
1340
+ useRef: optional(array(string2())),
1341
+ useState: optional(array(string2())),
1342
+ useSyncExternalStore: optional(array(string2())),
1343
+ useTransition: optional(array(string2()))
452
1344
  });
453
1345
  var ESLintReactSettingsSchema = object({
454
1346
  /**
@@ -457,43 +1349,43 @@ var ESLintReactSettingsSchema = object({
457
1349
  * @default `"react"`
458
1350
  * @example `"@pika/react"`
459
1351
  */
460
- importSource: optional(string()),
1352
+ importSource: optional(string2()),
461
1353
  /**
462
1354
  * The identifier that's used for JSX Element creation.
463
1355
  * @default `"createElement"`
464
1356
  * @deprecated
465
1357
  */
466
- jsxPragma: optional(string()),
1358
+ jsxPragma: optional(string2()),
467
1359
  /**
468
1360
  * The identifier that's used for JSX fragment elements.
469
1361
  * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
470
1362
  * @default `"Fragment"`
471
1363
  * @deprecated
472
1364
  */
473
- jsxPragmaFrag: optional(string()),
1365
+ jsxPragmaFrag: optional(string2()),
474
1366
  /**
475
1367
  * The name of the prop that is used for polymorphic components.
476
1368
  * @description This is used to determine the type of the component.
477
1369
  * @example `"as"`
478
1370
  */
479
- polymorphicPropName: optional(string()),
1371
+ polymorphicPropName: optional(string2()),
480
1372
  /**
481
1373
  * @internal
482
1374
  */
483
- strict: optional(boolean(), false),
1375
+ strict: optional(boolean2()),
484
1376
  /**
485
1377
  * Check both the shape and the import to determine if an API is from React.
486
1378
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
487
1379
  * @default `true`
488
1380
  */
489
- skipImportCheck: optional(boolean(), true),
1381
+ skipImportCheck: optional(boolean2()),
490
1382
  /**
491
1383
  * React version to use, "detect" means auto detect React version from the project's dependencies.
492
1384
  * If `importSource` is specified, an equivalent version of React should be provided here.
493
1385
  * @example `"18.3.1"`
494
1386
  * @default `"detect"`
495
1387
  */
496
- version: optional(string()),
1388
+ version: optional(string2()),
497
1389
  /**
498
1390
  * A object to define additional hooks that are equivalent to the built-in React Hooks.
499
1391
  * @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
@@ -507,8 +1399,16 @@ var ESLintReactSettingsSchema = object({
507
1399
  */
508
1400
  additionalComponents: optional(array(CustomComponentSchema))
509
1401
  });
1402
+ optional(
1403
+ object({
1404
+ "react-x": optional(ESLintReactSettingsSchema),
1405
+ /** @deprecated Use `react-x` instead */
1406
+ reactOptions: optional(ESLintReactSettingsSchema)
1407
+ }),
1408
+ {}
1409
+ );
510
1410
  var DEFAULT_ESLINT_REACT_SETTINGS = {
511
- ...parse(ESLintReactSettingsSchema, {}),
1411
+ ...parse2(ESLintReactSettingsSchema, {}),
512
1412
  importSource: "react"};
513
1413
  function getInstanceId(node, prev) {
514
1414
  switch (true) {